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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.alfresco.repo.domain.contentdata.AbstractContentDataDAOImpl
AbstractContentDataDAOImpl.ContentUrlDeleteTransactionListener
-
Nested classes/interfaces inherited from interface org.alfresco.repo.domain.contentdata.ContentDataDAO
ContentDataDAO.ContentUrlHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected org.mybatis.spring.SqlSessionTemplatetemplate-
Fields inherited from class org.alfresco.repo.domain.contentdata.AbstractContentDataDAOImpl
controlDAO, encodingDAO, localeDAO, mimetypeDAO
-
-
Constructor Summary
Constructors Constructor Description ContentDataDAOImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountSymmetricKeysForMasterKeyAlias(java.lang.String masterKeyAlias)Count symmetric keys entities for symmetric keys that have been encrypted using the given master keyjava.util.Map<java.lang.String,java.lang.Integer>countSymmetricKeysForMasterKeys()Count symmetric keys entities for symmetric keys for all master keysprotected ContentDataEntitycreateContentDataEntity(java.lang.Long contentUrlId, java.lang.Long mimetypeId, java.lang.Long encodingId, java.lang.Long localeId)Create the row for the alf_content_dataprotected ContentUrlEntitycreateContentUrlEntity(java.lang.String contentUrl, long size, ContentUrlKeyEntity contentUrlKeyEntity)org.alfresco.util.Pair<java.lang.Long,java.lang.String>createContentUrlOrphaned(java.lang.String contentUrl, java.util.Date orphanTime)Creates an immediately-orphaned content URL, if possibleprotected intdeleteContentDataEntity(java.lang.Long id)Delete the entity with the given IDvoiddeleteContentDataForNode(java.lang.Long nodeId, java.util.Set<java.lang.Long> qnameIds)Deletes all alf_content_data rows that are referenced by the given nodeprotected intdeleteContentUrlEntity(long id)intdeleteContentUrls(java.util.List<java.lang.Long> ids)Delete a batch of content URL entities.protected java.util.List<ContentDataEntity>getContentDataEntitiesForNodes(java.util.Set<java.lang.Long> nodeIds)protected ContentDataEntitygetContentDataEntity(java.lang.Long id)protected ContentUrlEntitygetContentUrlEntity(java.lang.Long id)ContentUrlEntitygetContentUrlEntity(java.lang.String contentUrl)protected ContentUrlEntitygetContentUrlEntityUnreferenced(java.lang.String contentUrl)voidgetContentUrlsKeepOrphaned(ContentDataDAO.ContentUrlHandler contentUrlHandler, int maxResults)Enumerate all available content URLs that were orphaned and cleanup for these urls failedvoidgetContentUrlsOrphaned(ContentDataDAO.ContentUrlHandler contentUrlHandler, java.lang.Long maxOrphanTimeExclusive, int maxResults)Enumerate all available content URLs that were orphaned on or before the given timejava.util.List<ContentUrlKeyEntity>getSymmetricKeysByMasterKeyAlias(java.lang.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.voidsetSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate)protected intupdateContentDataEntity(ContentDataEntity entity)Update an existing alf_content_data entityprotected intupdateContentUrlEntity(ContentUrlEntity existing, ContentUrlEntity entity)intupdateContentUrlOrphanTime(java.lang.Long id, java.lang.Long orphanTime, java.lang.Long oldOrphanTime)Update a content URL with the given orphan time-
Methods inherited from class org.alfresco.repo.domain.contentdata.AbstractContentDataDAOImpl
cacheContentDataForNodes, createContentData, createContentDataEntity, deleteContentData, getContentData, getContentUrl, getContentUrl, getOrCreateContentUrl, getOrCreateContentUrl, registerDereferencedContentUrl, setContentDataCache, setContentStoreCleaner, setContentUrlCache, setControlDAO, setEncodingDAO, setLocaleDAO, setMimetypeDAO, updateContentData, updateContentDataEntity, updateContentUrlKey, updateContentUrlKey
-
-
-
-
Method Detail
-
setSqlSessionTemplate
public final void setSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate)
-
createContentUrlOrphaned
public org.alfresco.util.Pair<java.lang.Long,java.lang.String> createContentUrlOrphaned(java.lang.String contentUrl, java.util.Date orphanTime)Description copied from interface:ContentDataDAOCreates an immediately-orphaned content URL, if possible- Parameters:
contentUrl- the URL to create if it doesn't existorphanTime- the recorded orphan time or null to apply the current time- Returns:
- Returns the ID-URL pair
-
createContentUrlEntity
protected ContentUrlEntity createContentUrlEntity(java.lang.String contentUrl, long size, ContentUrlKeyEntity contentUrlKeyEntity)
- Specified by:
createContentUrlEntityin classAbstractContentDataDAOImpl- Parameters:
contentUrl- the content URL to create or search for
-
getContentUrlEntity
protected ContentUrlEntity getContentUrlEntity(java.lang.Long id)
- Specified by:
getContentUrlEntityin classAbstractContentDataDAOImpl- Parameters:
id- the ID of the content url entity- Returns:
- Return the entity or null if it doesn't exist
-
getContentUrlEntity
public ContentUrlEntity getContentUrlEntity(java.lang.String contentUrl)
- Specified by:
getContentUrlEntityin classAbstractContentDataDAOImpl
-
getContentUrlsOrphaned
public void getContentUrlsOrphaned(ContentDataDAO.ContentUrlHandler contentUrlHandler, java.lang.Long maxOrphanTimeExclusive, int maxResults)
Description copied from interface:ContentDataDAOEnumerate all available content URLs that were orphaned on or before the given time- Parameters:
contentUrlHandler- the callback object to process the rowsmaxOrphanTimeExclusive- 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:ContentDataDAOEnumerate all available content URLs that were orphaned and cleanup for these urls failed- Parameters:
contentUrlHandler- the callback object to process the rowsmaxResults- the maximum number of results (1 or greater)
-
updateContentUrlOrphanTime
public int updateContentUrlOrphanTime(java.lang.Long id, java.lang.Long orphanTime, java.lang.Long oldOrphanTime)Description copied from class:AbstractContentDataDAOImplUpdate a content URL with the given orphan time- Specified by:
updateContentUrlOrphanTimein classAbstractContentDataDAOImpl- Parameters:
id- the unique ID of the entityorphanTime- the time (ms since epoch) that the entity was orphanedoldOrphanTime- the orphan time we expect to update for optimistic locking (may be null)- Returns:
- Returns the number of rows updated
-
deleteContentUrls
public int deleteContentUrls(java.util.List<java.lang.Long> ids)
Delete a batch of content URL entities.
-
getContentUrlEntityUnreferenced
protected ContentUrlEntity getContentUrlEntityUnreferenced(java.lang.String contentUrl)
- Specified by:
getContentUrlEntityUnreferencedin classAbstractContentDataDAOImpl- 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(java.lang.Long contentUrlId, java.lang.Long mimetypeId, java.lang.Long encodingId, java.lang.Long localeId)
Description copied from class:AbstractContentDataDAOImplCreate the row for the alf_content_data- Specified by:
createContentDataEntityin classAbstractContentDataDAOImpl
-
getContentDataEntity
protected ContentDataEntity getContentDataEntity(java.lang.Long id)
- Specified by:
getContentDataEntityin classAbstractContentDataDAOImpl- Parameters:
id- the entity ID- Returns:
- Returns the entity or null if it doesn't exist
-
getContentDataEntitiesForNodes
protected java.util.List<ContentDataEntity> getContentDataEntitiesForNodes(java.util.Set<java.lang.Long> nodeIds)
- Specified by:
getContentDataEntitiesForNodesin classAbstractContentDataDAOImpl- 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:AbstractContentDataDAOImplUpdate an existing alf_content_data entity- Specified by:
updateContentDataEntityin classAbstractContentDataDAOImpl- Parameters:
entity- the existing entity that will be updated- Returns:
- Returns the number of rows updated (should be 1)
-
deleteContentDataEntity
protected int deleteContentDataEntity(java.lang.Long id)
Description copied from class:AbstractContentDataDAOImplDelete the entity with the given ID- Specified by:
deleteContentDataEntityin classAbstractContentDataDAOImpl- Returns:
- Returns the number of rows deleted
-
deleteContentDataForNode
public void deleteContentDataForNode(java.lang.Long nodeId, java.util.Set<java.lang.Long> qnameIds)Description copied from interface:ContentDataDAODeletes all alf_content_data rows that are referenced by the given node- Parameters:
nodeId- the node IDqnameIds- the content properties to target
-
updateContentUrlEntity
protected int updateContentUrlEntity(ContentUrlEntity existing, ContentUrlEntity entity)
- Specified by:
updateContentUrlEntityin classAbstractContentDataDAOImpl
-
deleteContentUrlEntity
protected int deleteContentUrlEntity(long id)
- Specified by:
deleteContentUrlEntityin classAbstractContentDataDAOImpl
-
getSymmetricKeysByMasterKeyAlias
public java.util.List<ContentUrlKeyEntity> getSymmetricKeysByMasterKeyAlias(java.lang.String masterKeyAlias, long fromId, int maxResults)
Description copied from interface:ContentDataDAOGet 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 aliasfromId- idmaxResults- max results- Returns:
-
countSymmetricKeysForMasterKeys
public java.util.Map<java.lang.String,java.lang.Integer> countSymmetricKeysForMasterKeys()
Description copied from interface:ContentDataDAOCount symmetric keys entities for symmetric keys for all master keys- Returns:
-
countSymmetricKeysForMasterKeyAlias
public int countSymmetricKeysForMasterKeyAlias(java.lang.String masterKeyAlias)
Description copied from interface:ContentDataDAOCount symmetric keys entities for symmetric keys that have been encrypted using the given master key- Returns:
-
-