Interface ContentDataDAO

    • Method Detail

      • createContentData

        org.alfresco.util.Pair<java.lang.Long,​org.alfresco.service.cmr.repository.ContentData> 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<java.lang.Long,​java.lang.String> 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
        orphanTime - the recorded orphan time or null to apply the current time
        Returns:
        Returns the ID-URL pair
        Throws:
        org.springframework.dao.DataIntegrityViolationException - if the URL already exists
      • getContentData

        org.alfresco.util.Pair<java.lang.Long,​org.alfresco.service.cmr.repository.ContentData> 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
      • cacheContentDataForNodes

        void cacheContentDataForNodes​(java.util.Set<java.lang.Long> nodeIds)
        Parameters:
        nodeIds - the nodeIds
        Throws:
        org.alfresco.error.AlfrescoRuntimeException - if an 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<java.lang.Long> 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)
      • getContentUrlsKeepOrphaned

        void getContentUrlsKeepOrphaned​(ContentDataDAO.ContentUrlHandler contentUrlHandler,
                                        int maxResults)
        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)
      • deleteContentUrls

        int deleteContentUrls​(java.util.List<java.lang.Long> ids)
        Delete a batch of content URL entities.
      • getContentUrl

        ContentUrlEntity getContentUrl​(java.lang.String contentUrl)
        Get a content url entity by contentUrl
        Parameters:
        contentUrl -
        Returns:
        null if the url does not exist
        Since:
        5.0
      • getContentUrl

        ContentUrlEntity getContentUrl​(java.lang.Long contentUrlId)
        Get a content url entity by contentUrlId
        Parameters:
        contentUrlId -
        Returns:
        null if the url does not exist
        Since:
        5.0
      • getOrCreateContentUrl

        ContentUrlEntity getOrCreateContentUrl​(java.lang.String contentUrl)
        Get a content URL or create one if it does not exist
        Parameters:
        contentUrlEntity -
        Since:
        5.1
      • getOrCreateContentUrl

        ContentUrlEntity getOrCreateContentUrl​(java.lang.String contentUrl,
                                               long size)
        Get a content URL or create one if it does not exist
        Since:
        5.1
      • updateContentUrlKey

        boolean updateContentUrlKey​(java.lang.String contentUrl,
                                    ContentUrlKeyEntity contentUrlKeyEntity)
        Updates the content key for the given content url
        Parameters:
        contentUrl -
        contentUrlKeyEntity -
        Since:
        5.0
      • updateContentUrlKey

        boolean updateContentUrlKey​(long contentUrlId,
                                    ContentUrlKeyEntity contentUrlKey)
        Updates the content key for the given content url
        Parameters:
        contentUrlId -
        Since:
        5.0
      • getSymmetricKeysByMasterKeyAlias

        java.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.
        Parameters:
        masterKeyAlias - master key alias
        fromId - id
        maxResults - max results
        Returns:
        Since:
        5.0
      • countSymmetricKeysForMasterKeys

        java.util.Map<java.lang.String,​java.lang.Integer> countSymmetricKeysForMasterKeys()
        Count symmetric keys entities for symmetric keys for all master keys
        Returns:
        Since:
        5.0
      • countSymmetricKeysForMasterKeyAlias

        int countSymmetricKeysForMasterKeyAlias​(java.lang.String masterKeyAlias)
        Count symmetric keys entities for symmetric keys that have been encrypted using the given master key
        Parameters:
        masterKeyAlias -
        Returns:
        Since:
        5.0