Class ContentDataDAOImpl
java.lang.Object
org.alfresco.repo.domain.contentdata.AbstractContentDataDAOImpl
org.alfresco.repo.domain.contentdata.ibatis.ContentDataDAOImpl
- All Implemented Interfaces:
ContentDataDAO
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.ContentUrlDeleteTransactionListenerNested classes/interfaces inherited from interface org.alfresco.repo.domain.contentdata.ContentDataDAO
ContentDataDAO.ContentUrlHandler -
Field Summary
FieldsFields inherited from class org.alfresco.repo.domain.contentdata.AbstractContentDataDAOImpl
controlDAO, encodingDAO, localeDAO, mimetypeDAO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcountSymmetricKeysForMasterKeyAlias(String masterKeyAlias) Count symmetric keys entities for symmetric keys that have been encrypted using the given master keyCount symmetric keys entities for symmetric keys for all master keysprotected ContentDataEntitycreateContentDataEntity(Long contentUrlId, Long mimetypeId, Long encodingId, Long localeId) Create the row for the alf_content_dataprotected ContentUrlEntitycreateContentUrlEntity(String contentUrl, long size, ContentUrlKeyEntity contentUrlKeyEntity) createContentUrlOrphaned(String contentUrl, Date orphanTime) Creates an immediately-orphaned content URL, if possibleprotected intDelete the entity with the given IDvoiddeleteContentDataForNode(Long nodeId, Set<Long> qnameIds) Deletes all alf_content_data rows that are referenced by the given nodeprotected intdeleteContentUrlEntity(long id) intdeleteContentUrls(List<Long> ids) Delete a batch of content URL entities.protected List<ContentDataEntity>getContentDataEntitiesForNodes(Set<Long> nodeIds) protected ContentDataEntityprotected ContentUrlEntitygetContentUrlEntity(String contentUrl) protected ContentUrlEntitygetContentUrlEntityUnreferenced(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, Long maxOrphanTimeExclusive, int maxResults) Enumerate all available content URLs that were orphaned on or before the given timegetSymmetricKeysByMasterKeyAlias(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.final voidsetSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate) protected intUpdate an existing alf_content_data entityprotected intupdateContentUrlEntity(ContentUrlEntity existing, ContentUrlEntity entity) intupdateContentUrlOrphanTime(Long id, Long orphanTime, Long oldOrphanTime) Update a content URL with the given orphan timeMethods 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
-
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
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(String contentUrl, long size, ContentUrlKeyEntity contentUrlKeyEntity) - Specified by:
createContentUrlEntityin classAbstractContentDataDAOImpl- Parameters:
contentUrl- the content URL to create or search for
-
getContentUrlEntity
- 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
- Specified by:
getContentUrlEntityin classAbstractContentDataDAOImpl
-
getContentUrlsOrphaned
public void getContentUrlsOrphaned(ContentDataDAO.ContentUrlHandler contentUrlHandler, 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
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
Delete a batch of content URL entities. -
getContentUrlEntityUnreferenced
- 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(Long contentUrlId, Long mimetypeId, Long encodingId, Long localeId) Description copied from class:AbstractContentDataDAOImplCreate the row for the alf_content_data- Specified by:
createContentDataEntityin classAbstractContentDataDAOImpl
-
getContentDataEntity
- Specified by:
getContentDataEntityin classAbstractContentDataDAOImpl- Parameters:
id- the entity ID- Returns:
- Returns the entity or null if it doesn't exist
-
getContentDataEntitiesForNodes
- Specified by:
getContentDataEntitiesForNodesin classAbstractContentDataDAOImpl- Parameters:
nodeIds- the node ID- Returns:
- Returns the associated entities or null if none exist
-
updateContentDataEntity
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
Description copied from class:AbstractContentDataDAOImplDelete the entity with the given ID- Specified by:
deleteContentDataEntityin classAbstractContentDataDAOImpl- Returns:
- Returns the number of rows deleted
-
deleteContentDataForNode
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
- Specified by:
updateContentUrlEntityin classAbstractContentDataDAOImpl
-
deleteContentUrlEntity
protected int deleteContentUrlEntity(long id) - Specified by:
deleteContentUrlEntityin classAbstractContentDataDAOImpl
-
getSymmetricKeysByMasterKeyAlias
public List<ContentUrlKeyEntity> getSymmetricKeysByMasterKeyAlias(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
Description copied from interface:ContentDataDAOCount symmetric keys entities for symmetric keys for all master keys- Returns:
-
countSymmetricKeysForMasterKeyAlias
Description copied from interface:ContentDataDAOCount symmetric keys entities for symmetric keys that have been encrypted using the given master key- Returns:
-