public abstract class AbstractContentDataDAOImpl extends Object implements ContentDataDAO
This provides basic services such as caching, but defers to the underlying implementation for CRUD operations.
The DAO deals in ContentData
instances. The cache is primarily present to decode
IDs into ContentData
instances.
Modifier and Type | Class and Description |
---|---|
class |
AbstractContentDataDAOImpl.ContentUrlDeleteTransactionListener
Transactional listener that deletes unreferenced content_url entities.
|
ContentDataDAO.ContentUrlHandler
Modifier and Type | Field and Description |
---|---|
protected ControlDAO |
controlDAO |
protected EncodingDAO |
encodingDAO |
protected LocaleDAO |
localeDAO |
protected MimetypeDAO |
mimetypeDAO |
Constructor and Description |
---|
AbstractContentDataDAOImpl()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
cacheContentDataForNodes(Set<Long> nodeIds) |
org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.ContentData> |
createContentData(org.alfresco.service.cmr.repository.ContentData contentData)
Create a new ContentData instance.
|
protected ContentDataEntity |
createContentDataEntity(org.alfresco.service.cmr.repository.ContentData contentData)
Translates the
ContentData into persistable values using the helper DAOs |
protected abstract ContentDataEntity |
createContentDataEntity(Long contentUrlId,
Long mimetypeId,
Long encodingId,
Long localeId)
Create the row for the alf_content_data
|
protected abstract ContentUrlEntity |
createContentUrlEntity(String contentUrl,
long size,
ContentUrlKeyEntity contentUrlKey) |
void |
deleteContentData(Long id)
Delete an instance of content.
|
protected abstract int |
deleteContentDataEntity(Long id)
Delete the entity with the given ID
|
protected abstract int |
deleteContentUrlEntity(long id) |
org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.ContentData> |
getContentData(Long id) |
protected abstract List<ContentDataEntity> |
getContentDataEntitiesForNodes(Set<Long> nodeIds) |
protected abstract ContentDataEntity |
getContentDataEntity(Long id) |
ContentUrlEntity |
getContentUrl(Long contentUrlId)
Get a content url entity by contentUrlId
|
ContentUrlEntity |
getContentUrl(String contentUrl)
Get a content url entity by contentUrl
|
protected abstract ContentUrlEntity |
getContentUrlEntity(Long id) |
protected abstract ContentUrlEntity |
getContentUrlEntity(String contentUrl) |
protected abstract ContentUrlEntity |
getContentUrlEntityUnreferenced(String contentUrl) |
ContentUrlEntity |
getOrCreateContentUrl(String contentUrl)
Get a content URL or create one if it does not exist
|
ContentUrlEntity |
getOrCreateContentUrl(String contentUrl,
long size)
Get a content URL or create one if it does not exist
|
protected void |
registerDereferencedContentUrl(String contentUrl)
A content_url entity was dereferenced.
|
void |
setContentDataCache(org.alfresco.repo.cache.SimpleCache<Long,org.alfresco.service.cmr.repository.ContentData> contentDataCache) |
void |
setContentStoreCleaner(EagerContentStoreCleaner contentStoreCleaner)
Set this property to enable eager cleanup of orphaned content.
|
void |
setContentUrlCache(org.alfresco.repo.cache.SimpleCache<Long,ContentUrlEntity> contentUrlCache) |
void |
setControlDAO(ControlDAO controlDAO) |
void |
setEncodingDAO(EncodingDAO encodingDAO) |
void |
setLocaleDAO(LocaleDAO localeDAO) |
void |
setMimetypeDAO(MimetypeDAO mimetypeDAO) |
void |
updateContentData(Long id,
org.alfresco.service.cmr.repository.ContentData contentData)
Update a content data instance
|
protected abstract int |
updateContentDataEntity(ContentDataEntity entity)
Update an existing alf_content_data entity
|
protected int |
updateContentDataEntity(ContentDataEntity contentDataEntity,
org.alfresco.service.cmr.repository.ContentData contentData)
Translates the
ContentData into persistable values using the helper DAOs |
protected abstract int |
updateContentUrlEntity(ContentUrlEntity existing,
ContentUrlEntity entity) |
boolean |
updateContentUrlKey(long contentUrlId,
ContentUrlKeyEntity contentUrlKey)
Updates the content key for the given content url
|
boolean |
updateContentUrlKey(String contentUrl,
ContentUrlKeyEntity contentUrlKey)
Updates the content key for the given content url
|
protected abstract int |
updateContentUrlOrphanTime(Long id,
Long orphanTime,
Long oldOrphanTime)
Update a content URL with the given orphan time
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
countSymmetricKeysForMasterKeyAlias, countSymmetricKeysForMasterKeys, createContentUrlOrphaned, deleteContentDataForNode, deleteContentUrls, getContentUrlsKeepOrphaned, getContentUrlsOrphaned, getSymmetricKeysByMasterKeyAlias
protected ControlDAO controlDAO
protected MimetypeDAO mimetypeDAO
protected EncodingDAO encodingDAO
protected LocaleDAO localeDAO
public AbstractContentDataDAOImpl()
public void setControlDAO(ControlDAO controlDAO)
public void setMimetypeDAO(MimetypeDAO mimetypeDAO)
public void setEncodingDAO(EncodingDAO encodingDAO)
public void setLocaleDAO(LocaleDAO localeDAO)
public void setContentStoreCleaner(EagerContentStoreCleaner contentStoreCleaner)
contentStoreCleaner
- an eager cleaner (may be null)public void setContentDataCache(org.alfresco.repo.cache.SimpleCache<Long,org.alfresco.service.cmr.repository.ContentData> contentDataCache)
contentDataCache
- the cache of IDs to ContentData and vice versapublic void setContentUrlCache(org.alfresco.repo.cache.SimpleCache<Long,ContentUrlEntity> contentUrlCache)
protected void registerDereferencedContentUrl(String contentUrl)
public org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.ContentData> createContentData(org.alfresco.service.cmr.repository.ContentData contentData)
ContentDataDAO
createContentData
in interface ContentDataDAO
contentData
- the ContentData detailspublic org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.ContentData> getContentData(Long id)
getContentData
in interface ContentDataDAO
id
- the unique ID of the entitypublic ContentUrlEntity getContentUrl(String contentUrl)
ContentDataDAO
getContentUrl
in interface ContentDataDAO
public ContentUrlEntity getContentUrl(Long contentUrlId)
ContentDataDAO
getContentUrl
in interface ContentDataDAO
public void cacheContentDataForNodes(Set<Long> nodeIds)
cacheContentDataForNodes
in interface ContentDataDAO
nodeIds
- the nodeIdspublic void updateContentData(Long id, org.alfresco.service.cmr.repository.ContentData contentData)
ContentDataDAO
updateContentData
in interface ContentDataDAO
id
- the unique ID of the entitycontentData
- the new datapublic void deleteContentData(Long id)
ContentDataDAO
deleteContentData
in interface ContentDataDAO
id
- the unique ID of the entityprotected ContentDataEntity createContentDataEntity(org.alfresco.service.cmr.repository.ContentData contentData)
ContentData
into persistable values using the helper DAOsprotected int updateContentDataEntity(ContentDataEntity contentDataEntity, org.alfresco.service.cmr.repository.ContentData contentData)
ContentData
into persistable values using the helper DAOspublic boolean updateContentUrlKey(String contentUrl, ContentUrlKeyEntity contentUrlKey)
ContentDataDAO
updateContentUrlKey
in interface ContentDataDAO
public boolean updateContentUrlKey(long contentUrlId, ContentUrlKeyEntity contentUrlKey)
ContentDataDAO
updateContentUrlKey
in interface ContentDataDAO
public ContentUrlEntity getOrCreateContentUrl(String contentUrl)
ContentDataDAO
getOrCreateContentUrl
in interface ContentDataDAO
public ContentUrlEntity getOrCreateContentUrl(String contentUrl, long size)
ContentDataDAO
getOrCreateContentUrl
in interface ContentDataDAO
protected abstract ContentUrlEntity createContentUrlEntity(String contentUrl, long size, ContentUrlKeyEntity contentUrlKey)
contentUrl
- the content URL to create or search forprotected abstract ContentUrlEntity getContentUrlEntity(Long id)
id
- the ID of the content url entityprotected abstract ContentUrlEntity getContentUrlEntity(String contentUrl)
protected abstract ContentUrlEntity getContentUrlEntityUnreferenced(String contentUrl)
contentUrl
- the URL of the content url entityprotected abstract int updateContentUrlOrphanTime(Long id, Long orphanTime, Long oldOrphanTime)
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)protected abstract ContentDataEntity createContentDataEntity(Long contentUrlId, Long mimetypeId, Long encodingId, Long localeId)
protected abstract ContentDataEntity getContentDataEntity(Long id)
id
- the entity IDprotected abstract List<ContentDataEntity> getContentDataEntitiesForNodes(Set<Long> nodeIds)
nodeIds
- the node IDprotected abstract int updateContentDataEntity(ContentDataEntity entity)
entity
- the existing entity that will be updatedprotected abstract int deleteContentDataEntity(Long id)
protected abstract int deleteContentUrlEntity(long id)
protected abstract int updateContentUrlEntity(ContentUrlEntity existing, ContentUrlEntity entity)
Copyright © 2005–2017 Alfresco Software. All rights reserved.