Interface VirtualStore

  • All Known Implementing Classes:
    VirtualStoreImpl

    public interface VirtualStore
    Interface for public and internal reference operations.

    Handles most virtualized Reference meta-data interactions analogous to actual Alfresco public Repository Services.

    Author:
    Bogdan Horje
    See Also:
    The Public Repository Services
    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      org.alfresco.service.cmr.repository.NodeRef adhere​(Reference reference, int mode)  
      boolean canMaterialize​(Reference reference)  
      boolean canVirtualize​(org.alfresco.service.cmr.repository.NodeRef nodeRef)  
      FilingData createFilingData​(Reference reference, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, org.alfresco.service.namespace.QName nodeTypeQName, java.util.Map<org.alfresco.service.namespace.QName,​java.io.Serializable> properties)  
      java.util.Set<org.alfresco.service.cmr.security.AccessPermission> getAllSetPermissions​(Reference reference)  
      java.util.List<org.alfresco.service.cmr.repository.ChildAssociationRef> getChildAssocs​(Reference parentReference, java.util.Set<org.alfresco.service.namespace.QName> childNodeTypeQNames)
      Retrieve immediate children references of a given reference where the child nodes are in the given inclusive list.
      java.util.List<org.alfresco.service.cmr.repository.ChildAssociationRef> getChildAssocs​(Reference parentReference, org.alfresco.service.namespace.QNamePattern typeQNamePattern, org.alfresco.service.namespace.QNamePattern qnamePattern, int maxResults, boolean preload)
      Gets all child references associations where the pattern of the association qualified name is an exact match.
      java.util.List<org.alfresco.service.cmr.repository.ChildAssociationRef> getChildAssocsByPropertyValue​(Reference parentReference, org.alfresco.service.namespace.QName propertyQName, java.io.Serializable value)
      Retrieve the immediate children of a given node based on the value of a property of those children.
      java.util.Collection<org.alfresco.service.cmr.repository.ChildAssociationRef> getChildAssocsWithoutParentAssocsOfType​(Reference parentReference, org.alfresco.service.namespace.QName assocTypeQName)
      Gets the set of child associations of a certain parent node without parent associations of a certain type to other nodes with the same parent! In effect the 'orphans' with respect to a certain association type.
      Reference getChildByName​(Reference parentReference, org.alfresco.service.namespace.QName assocTypeQName, java.lang.String childName)
      Get the reference of the virtualized artefact with the given name within the virtual context (only) of the parent reference.
      The name is case-insensitive as Alfresco has to support case-insensitive clients as standard.
      org.alfresco.service.cmr.repository.Path getPath​(Reference reference)  
      java.util.Map<org.alfresco.service.namespace.QName,​java.io.Serializable> getProperties​(Reference reference)  
      NodePermissionEntry getSetPermissions​(Reference reference)  
      org.alfresco.service.namespace.QName getType​(Reference reference)  
      org.alfresco.service.cmr.security.AccessStatus hasPermission​(Reference reference, java.lang.String perm)
      Check that the given authentication has a particular permission for the given virtualized artefact.
      org.alfresco.service.cmr.security.AccessStatus hasPermission​(Reference reference, PermissionReference perm)
      Check that the given authentication has a particular permission for the given virtualized artefact.
      boolean isVirtual​(org.alfresco.service.cmr.repository.NodeRef nodeRef)  
      java.util.List<Reference> list​(Reference reference)
      Lists all immediate children of the referred virtualized artefact.
      Note: this could be a long list (and will be trimmed at a pre-configured maximum).
      org.alfresco.query.PagingResults<Reference> list​(Reference ref, boolean actual, boolean virtual, boolean files, boolean folders, java.lang.String pattern, java.util.Set<org.alfresco.service.namespace.QName> ignoreTypeQNames, java.util.Set<org.alfresco.service.namespace.QName> ignoreAspectQNames, java.util.List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,​java.lang.Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest)
      Lists page of immediate children of the referred virtualized artefact with optional filtering (exclusion of certain child file/folder subtypes, actual-virtual filtering) and sorting.
      org.alfresco.query.PagingResults<Reference> list​(Reference ref, boolean actual, boolean virtual, boolean files, boolean folders, java.lang.String pattern, java.util.Set<org.alfresco.service.namespace.QName> searchTypeQNames, java.util.Set<org.alfresco.service.namespace.QName> ignoreTypeQNames, java.util.Set<org.alfresco.service.namespace.QName> ignoreAspectQNames, java.util.List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,​java.lang.Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest)
      Lists page of immediate children of the referred virtualized artefact with optional filtering (exclusion of certain child file/folder subtypes, actual-virtual filtering) and sorting.
      Pattern uses '*' as a wildcard
      org.alfresco.query.PagingResults<Reference> list​(Reference ref, boolean actual, boolean virtual, java.util.Set<org.alfresco.service.namespace.QName> searchTypeQNames, java.util.Set<org.alfresco.service.namespace.QName> ignoreTypeQNames, java.util.Set<org.alfresco.service.namespace.QName> ignoreAspectQNames, java.util.List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,​java.lang.Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest)
      Lists page of immediate children of the referred virtualized artefact with optional filtering (exclusion of certain child file/folder subtypes, actual-virtual filtering) and sorting.
      org.alfresco.service.cmr.repository.NodeRef materialize​(Reference reference)  
      java.util.Collection<org.alfresco.service.cmr.repository.NodeRef> materializeIfPossible​(java.util.Collection<org.alfresco.service.cmr.repository.NodeRef> nodeRefs)  
      org.alfresco.service.cmr.repository.NodeRef materializeIfPossible​(org.alfresco.service.cmr.repository.NodeRef nodeRef)  
      java.util.List<Reference> search​(Reference reference, java.lang.String namePattern, boolean fileSearch, boolean folderSearch, boolean includeSubFolders)
      Deprecated.
      FileFolderService.search(NodeRef, String, boolean, boolean, boolean) alignment : for shallow search use list, listFolders, listFiles, searchSimple.
      Reference virtualize​(org.alfresco.service.cmr.repository.NodeRef nodeRef)  
    • Method Detail

      • materializeIfPossible

        java.util.Collection<org.alfresco.service.cmr.repository.NodeRef> materializeIfPossible​(java.util.Collection<org.alfresco.service.cmr.repository.NodeRef> nodeRefs)
                                                                                         throws VirtualizationException
        Throws:
        VirtualizationException
      • getProperties

        java.util.Map<org.alfresco.service.namespace.QName,​java.io.Serializable> getProperties​(Reference reference)
                                                                                              throws VirtualizationException
        Parameters:
        reference -
        Returns:
        all virtual properties of the referred virtualized artefact keyed by their qualified name
        Throws:
        VirtualizationException
      • getChildByName

        Reference getChildByName​(Reference parentReference,
                                 org.alfresco.service.namespace.QName assocTypeQName,
                                 java.lang.String childName)
                          throws VirtualizationException
        Get the reference of the virtualized artefact with the given name within the virtual context (only) of the parent reference.
        The name is case-insensitive as Alfresco has to support case-insensitive clients as standard.
        Parameters:
        parentReference - parent Reference
        assocTypeQName -
        childName -
        Returns:
        the virtual child reference for the given name in the context of the given parent reference
        Throws:
        VirtualizationException
        See Also:
        NodeService.getChildByName(org.alfresco.service.cmr.repository.NodeRef, QName, String)
      • getChildAssocs

        java.util.List<org.alfresco.service.cmr.repository.ChildAssociationRef> getChildAssocs​(Reference parentReference,
                                                                                               java.util.Set<org.alfresco.service.namespace.QName> childNodeTypeQNames)
        Retrieve immediate children references of a given reference where the child nodes are in the given inclusive list.
        Parameters:
        parentReference - the parent node - usually a container
        childNodeTypeQNames - the types that the children may be. Subtypes are not automatically calculated and the list must therefore be exhaustive.
        Returns:
        Returns a list of ChildAssociationRef instances.
      • getChildAssocs

        java.util.List<org.alfresco.service.cmr.repository.ChildAssociationRef> getChildAssocs​(Reference parentReference,
                                                                                               org.alfresco.service.namespace.QNamePattern typeQNamePattern,
                                                                                               org.alfresco.service.namespace.QNamePattern qnamePattern,
                                                                                               int maxResults,
                                                                                               boolean preload)
                                                                                        throws org.alfresco.service.cmr.repository.InvalidNodeRefException
        Gets all child references associations where the pattern of the association qualified name is an exact match.
        Parameters:
        parentReference - the parent node - usually a container
        typeQNamePattern - the qualified name of the association ( null to ignore)
        qnamePattern - the path qualified name (null to ignore)
        maxResults - the number of results to get
        preload - true if the nodes must be preloaded into the cache
        Returns:
        Returns a list of ChildAssociationRef instances
        Throws:
        org.alfresco.service.cmr.repository.InvalidNodeRefException - if the node could not be found
        See Also:
        QName
      • getChildAssocsByPropertyValue

        java.util.List<org.alfresco.service.cmr.repository.ChildAssociationRef> getChildAssocsByPropertyValue​(Reference parentReference,
                                                                                                              org.alfresco.service.namespace.QName propertyQName,
                                                                                                              java.io.Serializable value)
        Retrieve the immediate children of a given node based on the value of a property of those children.

        If the property to be searched is multi-valued then will match on any one values.

        Please note, the following system maintained properties that cannot be used with this method.

        • cm:name - use getChildByName instead
        • cm:created
        • cm:creator
        • cm:modified
        • cm:modifier
        • sys:node-uuid
        • sys:node-dbid
        • sys:store-identifier
        • sys:store-protocol
        Parameters:
        parentReference - the parent reference - usually a container
        propertyQName - the fully qualified name of the property
        value - the value to search for. Must be a simple type such as String, Number, Date or Boolean, it cannot be a collection, a content property, MLText or a float.
        Returns:
        Returns a list of ChildAssociationRef instances.
      • getChildAssocsWithoutParentAssocsOfType

        java.util.Collection<org.alfresco.service.cmr.repository.ChildAssociationRef> getChildAssocsWithoutParentAssocsOfType​(Reference parentReference,
                                                                                                                              org.alfresco.service.namespace.QName assocTypeQName)
        Gets the set of child associations of a certain parent node without parent associations of a certain type to other nodes with the same parent! In effect the 'orphans' with respect to a certain association type.
        Parameters:
        parent - the parent reference
        assocTypeQName - the association type QName
        Returns:
        a Collection of child associations
      • list

        org.alfresco.query.PagingResults<Reference> list​(Reference ref,
                                                         boolean actual,
                                                         boolean virtual,
                                                         boolean files,
                                                         boolean folders,
                                                         java.lang.String pattern,
                                                         java.util.Set<org.alfresco.service.namespace.QName> searchTypeQNames,
                                                         java.util.Set<org.alfresco.service.namespace.QName> ignoreTypeQNames,
                                                         java.util.Set<org.alfresco.service.namespace.QName> ignoreAspectQNames,
                                                         java.util.List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,​java.lang.Boolean>> sortProps,
                                                         org.alfresco.query.PagingRequest pagingRequest)
                                                  throws VirtualizationException
        Lists page of immediate children of the referred virtualized artefact with optional filtering (exclusion of certain child file/folder subtypes, actual-virtual filtering) and sorting.
        Pattern uses '*' as a wildcard
        Parameters:
        ref -
        actual -
        virtual -
        files -
        folders -
        pattern -
        ignoreQNames -
        searchTypeQNames -
        ignoreAspectQNames -
        sortProps -
        pagingRequest -
        Throws:
        VirtualizationException
      • list

        org.alfresco.query.PagingResults<Reference> list​(Reference ref,
                                                         boolean actual,
                                                         boolean virtual,
                                                         boolean files,
                                                         boolean folders,
                                                         java.lang.String pattern,
                                                         java.util.Set<org.alfresco.service.namespace.QName> ignoreTypeQNames,
                                                         java.util.Set<org.alfresco.service.namespace.QName> ignoreAspectQNames,
                                                         java.util.List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,​java.lang.Boolean>> sortProps,
                                                         org.alfresco.query.PagingRequest pagingRequest)
                                                  throws VirtualizationException
        Lists page of immediate children of the referred virtualized artefact with optional filtering (exclusion of certain child file/folder subtypes, actual-virtual filtering) and sorting.
        Parameters:
        ref -
        actual -
        virtual -
        files -
        folders -
        pattern -
        ignoreQNames -
        sortProps -
        pagingRequest -
        Throws:
        VirtualizationException
      • list

        org.alfresco.query.PagingResults<Reference> list​(Reference ref,
                                                         boolean actual,
                                                         boolean virtual,
                                                         java.util.Set<org.alfresco.service.namespace.QName> searchTypeQNames,
                                                         java.util.Set<org.alfresco.service.namespace.QName> ignoreTypeQNames,
                                                         java.util.Set<org.alfresco.service.namespace.QName> ignoreAspectQNames,
                                                         java.util.List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,​java.lang.Boolean>> sortProps,
                                                         org.alfresco.query.PagingRequest pagingRequest)
                                                  throws VirtualizationException
        Lists page of immediate children of the referred virtualized artefact with optional filtering (exclusion of certain child file/folder subtypes, actual-virtual filtering) and sorting.
        Throws:
        VirtualizationException
      • list

        java.util.List<Reference> list​(Reference reference)
                                throws VirtualizationException
        Lists all immediate children of the referred virtualized artefact.
        Note: this could be a long list (and will be trimmed at a pre-configured maximum). You should consider using a paging request.
        Parameters:
        reference -
        Throws:
        VirtualizationException
      • search

        java.util.List<Reference> search​(Reference reference,
                                         java.lang.String namePattern,
                                         boolean fileSearch,
                                         boolean folderSearch,
                                         boolean includeSubFolders)
                                  throws VirtualizationException
        Deprecated.
        FileFolderService.search(NodeRef, String, boolean, boolean, boolean) alignment : for shallow search use list, listFolders, listFiles, searchSimple. For deep listing use listDeepFolders. Avoid calling this method with any name pattern except for "*".
        Perform a search against the name of the files or folders within a virtualized artefact Reference hierarchy.
        Wildcard characters are * and ?.
        Warning: Please avoid using this method with any "namePattern" other than "*". Although it works, its performance is poor which is why this method is deprecated.
        Parameters:
        reference -
        namePattern -
        fileSearch -
        folderSearch -
        includeSubFolders -
        Throws:
        VirtualizationException
      • createFilingData

        FilingData createFilingData​(Reference reference,
                                    org.alfresco.service.namespace.QName assocTypeQName,
                                    org.alfresco.service.namespace.QName assocQName,
                                    org.alfresco.service.namespace.QName nodeTypeQName,
                                    java.util.Map<org.alfresco.service.namespace.QName,​java.io.Serializable> properties)
                             throws VirtualizationException
        Parameters:
        reference -
        assocTypeQName -
        assocQName -
        nodeTypeQName -
        properties -
        Returns:
        FilingData of the given parent location
        Throws:
        VirtualizationException
      • hasPermission

        org.alfresco.service.cmr.security.AccessStatus hasPermission​(Reference reference,
                                                                     java.lang.String perm)
                                                              throws VirtualizationException
        Check that the given authentication has a particular permission for the given virtualized artefact. (The default behaviour is to inherit permissions)
        Parameters:
        reference -
        perm -
        Returns:
        an AccessStatus
        Throws:
        VirtualizationException
      • hasPermission

        org.alfresco.service.cmr.security.AccessStatus hasPermission​(Reference reference,
                                                                     PermissionReference perm)
                                                              throws VirtualizationException
        Check that the given authentication has a particular permission for the given virtualized artefact. (The default behaviour is to inherit permissions)
        Parameters:
        reference -
        perm -
        Returns:
        an AccessStatus
        Throws:
        VirtualizationException
      • getAllSetPermissions

        java.util.Set<org.alfresco.service.cmr.security.AccessPermission> getAllSetPermissions​(Reference reference)