org.alfresco.repo.domain.contentdata
Interface ContentDataDAO

All Known Implementing Classes:
AbstractContentDataDAOImpl, ContentDataDAOImpl

public interface ContentDataDAO

DAO services for alf_content_data table

Since:
3.2

Nested Class Summary
static interface ContentDataDAO.ContentUrlHandler
          Interface for callbacks during content URL enumeration
 
Method Summary
 org.alfresco.util.Pair createContentData(org.alfresco.service.cmr.repository.ContentData contentData)
          Create a new ContentData instance.
 org.alfresco.util.Pair createContentUrlOrphaned(java.lang.String contentUrl, java.util.Date orphanTime)
          Creates an immediately-orphaned content URL, if possible
 void deleteContentData(java.lang.Long id)
          Delete an instance of content.
 void deleteContentDataForNode(java.lang.Long nodeId, java.util.Set qnameIds)
          Deletes all alf_content_data rows that are referenced by the given node
 int deleteContentUrls(java.util.List ids)
          Delete a batch of content URL entities.
 org.alfresco.util.Pair getContentData(java.lang.Long id)
           
 void getContentUrlsOrphaned(ContentDataDAO.ContentUrlHandler contentUrlHandler, java.lang.Long maxOrphanTimeExclusive, int maxResults)
          Enumerate all available content URLs that were orphaned on or before the given time
 void updateContentData(java.lang.Long id, org.alfresco.service.cmr.repository.ContentData contentData)
          Update a content data instance
 

Method Detail

createContentData

org.alfresco.util.Pair createContentData(org.alfresco.service.cmr.repository.ContentData contentData)
Create a new ContentData instance.

Parameters:
contentData - the ContentData details
Returns:
the ContentData pair (id, ContentData) (never null)

updateContentData

void updateContentData(java.lang.Long id,
                       org.alfresco.service.cmr.repository.ContentData contentData)
Update a content data instance

Parameters:
id - the unique ID of the entity
contentData - the new data

createContentUrlOrphaned

org.alfresco.util.Pair createContentUrlOrphaned(java.lang.String contentUrl,
                                                java.util.Date orphanTime)
Creates an immediately-orphaned content URL, if possible

Parameters:
contentUrl - the URL to create if it doesn't exist
Returns:
Returns the ID-URL pair
Throws:
org.springframework.dao.DataIntegrityViolationException - if the URL already exists

getContentData

org.alfresco.util.Pair getContentData(java.lang.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

deleteContentData

void deleteContentData(java.lang.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(java.lang.Long nodeId,
                              java.util.Set 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,
                            java.lang.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)

deleteContentUrls

int deleteContentUrls(java.util.List ids)
Delete a batch of content URL entities.



Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.