Class ContentDataDAOImpl

java.lang.Object
org.alfresco.repo.domain.contentdata.AbstractContentDataDAOImpl
org.alfresco.repo.domain.contentdata.ibatis.ContentDataDAOImpl
All Implemented Interfaces:
ContentDataDAO

public class ContentDataDAOImpl extends AbstractContentDataDAOImpl
iBatis-specific implementation of the ContentData DAO.
Since:
3.2
Author:
Derek Hulley, sglover
  • Field Details

    • template

      protected org.mybatis.spring.SqlSessionTemplate template
  • Constructor Details

    • ContentDataDAOImpl

      public ContentDataDAOImpl()
  • Method Details

    • setSqlSessionTemplate

      public final void setSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate)
    • createContentUrlOrphaned

      public Pair<Long,String> createContentUrlOrphaned(String contentUrl, Date orphanTime)
      Description copied from interface: ContentDataDAO
      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
    • createContentUrlEntity

      protected ContentUrlEntity createContentUrlEntity(String contentUrl, long size, ContentUrlKeyEntity contentUrlKeyEntity)
      Specified by:
      createContentUrlEntity in class AbstractContentDataDAOImpl
      Parameters:
      contentUrl - the content URL to create or search for
    • getContentUrlEntity

      protected ContentUrlEntity getContentUrlEntity(Long id)
      Specified by:
      getContentUrlEntity in class AbstractContentDataDAOImpl
      Parameters:
      id - the ID of the content url entity
      Returns:
      Return the entity or null if it doesn't exist
    • getContentUrlEntity

      public ContentUrlEntity getContentUrlEntity(String contentUrl)
      Specified by:
      getContentUrlEntity in class AbstractContentDataDAOImpl
    • getContentUrlsOrphaned

      public void getContentUrlsOrphaned(ContentDataDAO.ContentUrlHandler contentUrlHandler, Long maxOrphanTimeExclusive, int maxResults)
      Description copied from interface: ContentDataDAO
      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

      public void getContentUrlsKeepOrphaned(ContentDataDAO.ContentUrlHandler contentUrlHandler, int maxResults)
      Description copied from interface: ContentDataDAO
      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)
    • updateContentUrlOrphanTime

      public int updateContentUrlOrphanTime(Long id, Long orphanTime, Long oldOrphanTime)
      Description copied from class: AbstractContentDataDAOImpl
      Update a content URL with the given orphan time
      Specified by:
      updateContentUrlOrphanTime in class AbstractContentDataDAOImpl
      Parameters:
      id - the unique ID of the entity
      orphanTime - the time (ms since epoch) that the entity was orphaned
      oldOrphanTime - the orphan time we expect to update for optimistic locking (may be null)
      Returns:
      Returns the number of rows updated
    • deleteContentUrls

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

      protected ContentUrlEntity getContentUrlEntityUnreferenced(String contentUrl)
      Specified by:
      getContentUrlEntityUnreferenced in class AbstractContentDataDAOImpl
      Parameters:
      contentUrl - the URL of the content url entity
      Returns:
      Return the entity or null if it doesn't exist or is still referenced by a content_data entity
    • createContentDataEntity

      protected ContentDataEntity createContentDataEntity(Long contentUrlId, Long mimetypeId, Long encodingId, Long localeId)
      Description copied from class: AbstractContentDataDAOImpl
      Create the row for the alf_content_data
      Specified by:
      createContentDataEntity in class AbstractContentDataDAOImpl
    • getContentDataEntity

      protected ContentDataEntity getContentDataEntity(Long id)
      Specified by:
      getContentDataEntity in class AbstractContentDataDAOImpl
      Parameters:
      id - the entity ID
      Returns:
      Returns the entity or null if it doesn't exist
    • getContentDataEntitiesForNodes

      protected List<ContentDataEntity> getContentDataEntitiesForNodes(Set<Long> nodeIds)
      Specified by:
      getContentDataEntitiesForNodes in class AbstractContentDataDAOImpl
      Parameters:
      nodeIds - the node ID
      Returns:
      Returns the associated entities or null if none exist
    • updateContentDataEntity

      protected int updateContentDataEntity(ContentDataEntity entity)
      Description copied from class: AbstractContentDataDAOImpl
      Update an existing alf_content_data entity
      Specified by:
      updateContentDataEntity in class AbstractContentDataDAOImpl
      Parameters:
      entity - the existing entity that will be updated
      Returns:
      Returns the number of rows updated (should be 1)
    • deleteContentDataEntity

      protected int deleteContentDataEntity(Long id)
      Description copied from class: AbstractContentDataDAOImpl
      Delete the entity with the given ID
      Specified by:
      deleteContentDataEntity in class AbstractContentDataDAOImpl
      Returns:
      Returns the number of rows deleted
    • deleteContentDataForNode

      public void deleteContentDataForNode(Long nodeId, Set<Long> qnameIds)
      Description copied from interface: ContentDataDAO
      Deletes all alf_content_data rows that are referenced by the given node
      Parameters:
      nodeId - the node ID
      qnameIds - the content properties to target
    • updateContentUrlEntity

      protected int updateContentUrlEntity(ContentUrlEntity existing, ContentUrlEntity entity)
      Specified by:
      updateContentUrlEntity in class AbstractContentDataDAOImpl
    • deleteContentUrlEntity

      protected int deleteContentUrlEntity(long id)
      Specified by:
      deleteContentUrlEntity in class AbstractContentDataDAOImpl
    • getSymmetricKeysByMasterKeyAlias

      public List<ContentUrlKeyEntity> getSymmetricKeysByMasterKeyAlias(String masterKeyAlias, long fromId, int maxResults)
      Description copied from interface: ContentDataDAO
      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:
    • countSymmetricKeysForMasterKeys

      public Map<String,Integer> countSymmetricKeysForMasterKeys()
      Description copied from interface: ContentDataDAO
      Count symmetric keys entities for symmetric keys for all master keys
      Returns:
    • countSymmetricKeysForMasterKeyAlias

      public int countSymmetricKeysForMasterKeyAlias(String masterKeyAlias)
      Description copied from interface: ContentDataDAO
      Count symmetric keys entities for symmetric keys that have been encrypted using the given master key
      Returns: