Interface ContentDataDAO

All Known Implementing Classes:
AbstractContentDataDAOImpl, ContentDataDAOImpl

public interface ContentDataDAO
DAO services for alf_content_data table
Since:
3.2
Author:
Derek Hulley, Steven Glover
  • Method Details

    • createContentData

      Pair<Long,ContentData> createContentData(ContentData contentData)
      Create a new ContentData instance.
      Parameters:
      contentData - the ContentData details
      Returns:
      the ContentData pair (id, ContentData) (never null)
    • updateContentData

      void updateContentData(Long id, ContentData contentData)
      Update a content data instance
      Parameters:
      id - the unique ID of the entity
      contentData - the new data
    • createContentUrlOrphaned

      Pair<Long,String> createContentUrlOrphaned(String contentUrl, Date orphanTime)
      Creates an immediately-orphaned content URL, if possible
      Parameters:
      contentUrl - the URL to create if it doesn't exist
      orphanTime - the recorded orphan time or null to apply the current time
      Returns:
      Returns the ID-URL pair
      Throws:
      org.springframework.dao.DataIntegrityViolationException - if the URL already exists
    • getContentData

      Pair<Long,ContentData> getContentData(Long id)
      Parameters:
      id - the unique ID of the entity
      Returns:
      the ContentData pair (id, ContentData) or null if it doesn't exist
      Throws:
      org.alfresco.error.AlfrescoRuntimeException - if the ID provided is invalid
    • cacheContentDataForNodes

      void cacheContentDataForNodes(Set<Long> nodeIds)
      Parameters:
      nodeIds - the nodeIds
      Throws:
      org.alfresco.error.AlfrescoRuntimeException - if an ID provided is invalid
    • deleteContentData

      void deleteContentData(Long id)
      Delete an instance of content.
      Parameters:
      id - the unique ID of the entity
      Throws:
      org.springframework.dao.ConcurrencyFailureException - if the ID does not exist
    • deleteContentDataForNode

      void deleteContentDataForNode(Long nodeId, Set<Long> qnameIds)
      Deletes all alf_content_data rows that are referenced by the given node
      Parameters:
      nodeId - the node ID
      qnameIds - the content properties to target
    • getContentUrlsOrphaned

      void getContentUrlsOrphaned(ContentDataDAO.ContentUrlHandler contentUrlHandler, Long maxOrphanTimeExclusive, int maxResults)
      Enumerate all available content URLs that were orphaned on or before the given time
      Parameters:
      contentUrlHandler - the callback object to process the rows
      maxOrphanTimeExclusive - the maximum orphan time (exclusive)
      maxResults - the maximum number of results (1 or greater)
    • getContentUrlsKeepOrphaned

      void getContentUrlsKeepOrphaned(ContentDataDAO.ContentUrlHandler contentUrlHandler, int maxResults)
      Enumerate all available content URLs that were orphaned and cleanup for these urls failed
      Parameters:
      contentUrlHandler - the callback object to process the rows
      maxResults - the maximum number of results (1 or greater)
    • deleteContentUrls

      int deleteContentUrls(List<Long> ids)
      Delete a batch of content URL entities.
    • getContentUrl

      ContentUrlEntity getContentUrl(String contentUrl)
      Get a content url entity by contentUrl
      Parameters:
      contentUrl -
      Returns:
      null if the url does not exist
      Since:
      5.0
    • getContentUrl

      ContentUrlEntity getContentUrl(Long contentUrlId)
      Get a content url entity by contentUrlId
      Parameters:
      contentUrlId -
      Returns:
      null if the url does not exist
      Since:
      5.0
    • getOrCreateContentUrl

      ContentUrlEntity getOrCreateContentUrl(String contentUrl)
      Get a content URL or create one if it does not exist
      Parameters:
      contentUrlEntity -
      Since:
      5.1
    • getOrCreateContentUrl

      ContentUrlEntity getOrCreateContentUrl(String contentUrl, long size)
      Get a content URL or create one if it does not exist
      Since:
      5.1
    • updateContentUrlKey

      boolean updateContentUrlKey(String contentUrl, ContentUrlKeyEntity contentUrlKeyEntity)
      Updates the content key for the given content url
      Parameters:
      contentUrl -
      contentUrlKeyEntity -
      Since:
      5.0
    • updateContentUrlKey

      boolean updateContentUrlKey(long contentUrlId, ContentUrlKeyEntity contentUrlKey)
      Updates the content key for the given content url
      Parameters:
      contentUrlId -
      Since:
      5.0
    • getSymmetricKeysByMasterKeyAlias

      List<ContentUrlKeyEntity> getSymmetricKeysByMasterKeyAlias(String masterKeyAlias, long fromId, int maxResults)
      Get symmetric keys entities for symmetric keys that have been encrypted using the given master key, starting from 'fromId' and returning at most 'maxResults' entities.
      Parameters:
      masterKeyAlias - master key alias
      fromId - id
      maxResults - max results
      Returns:
      Since:
      5.0
    • countSymmetricKeysForMasterKeys

      Map<String,Integer> countSymmetricKeysForMasterKeys()
      Count symmetric keys entities for symmetric keys for all master keys
      Returns:
      Since:
      5.0
    • countSymmetricKeysForMasterKeyAlias

      int countSymmetricKeysForMasterKeyAlias(String masterKeyAlias)
      Count symmetric keys entities for symmetric keys that have been encrypted using the given master key
      Parameters:
      masterKeyAlias -
      Returns:
      Since:
      5.0