Class StorageImpl

  • All Implemented Interfaces:
    org.xcmis.spi.Storage, org.xcmis.spi.TypeManager

    public class StorageImpl
    extends Object
    implements org.xcmis.spi.Storage
    Version:
    $Id: StorageImpl.java 804 2010-04-16 16:48:59Z alexey.zavizionov@gmail.com $
    Author:
    Andrey Parfonov
    • Constructor Detail

      • StorageImpl

        public StorageImpl​(StorageConfiguration configuration,
                           org.xcmis.search.SearchService searchService,
                           org.xcmis.spi.PermissionService permissionService,
                           Map<String,​TypeMapping> nodeTypeMapping)
    • Method Detail

      • calculateAllowableActions

        public org.xcmis.spi.model.AllowableActions calculateAllowableActions​(org.xcmis.spi.ObjectData object)
        Specified by:
        calculateAllowableActions in interface org.xcmis.spi.Storage
      • copyDocument

        public org.xcmis.spi.DocumentData copyDocument​(org.xcmis.spi.DocumentData source,
                                                       org.xcmis.spi.FolderData parent,
                                                       Map<String,​org.xcmis.spi.model.Property<?>> properties,
                                                       List<org.xcmis.spi.model.AccessControlEntry> acl,
                                                       Collection<org.xcmis.spi.PolicyData> policies,
                                                       org.xcmis.spi.model.VersioningState versioningState)
                                                throws org.xcmis.spi.ConstraintException,
                                                       org.xcmis.spi.NameConstraintViolationException,
                                                       org.xcmis.spi.StorageException
        Specified by:
        copyDocument in interface org.xcmis.spi.Storage
        Throws:
        org.xcmis.spi.ConstraintException
        org.xcmis.spi.NameConstraintViolationException
        org.xcmis.spi.StorageException
      • createDocument

        public org.xcmis.spi.DocumentData createDocument​(org.xcmis.spi.FolderData parent,
                                                         org.xcmis.spi.model.TypeDefinition typeDefinition,
                                                         Map<String,​org.xcmis.spi.model.Property<?>> properties,
                                                         org.xcmis.spi.ContentStream content,
                                                         List<org.xcmis.spi.model.AccessControlEntry> acl,
                                                         Collection<org.xcmis.spi.PolicyData> policies,
                                                         org.xcmis.spi.model.VersioningState versioningState)
                                                  throws org.xcmis.spi.ConstraintException,
                                                         org.xcmis.spi.NameConstraintViolationException,
                                                         IOException,
                                                         org.xcmis.spi.StorageException
        Specified by:
        createDocument in interface org.xcmis.spi.Storage
        Throws:
        org.xcmis.spi.ConstraintException
        org.xcmis.spi.NameConstraintViolationException
        IOException
        org.xcmis.spi.StorageException
      • createFolder

        public org.xcmis.spi.FolderData createFolder​(org.xcmis.spi.FolderData parent,
                                                     org.xcmis.spi.model.TypeDefinition typeDefinition,
                                                     Map<String,​org.xcmis.spi.model.Property<?>> properties,
                                                     List<org.xcmis.spi.model.AccessControlEntry> acl,
                                                     Collection<org.xcmis.spi.PolicyData> policies)
                                              throws org.xcmis.spi.ConstraintException,
                                                     org.xcmis.spi.NameConstraintViolationException,
                                                     org.xcmis.spi.StorageException
        Specified by:
        createFolder in interface org.xcmis.spi.Storage
        Throws:
        org.xcmis.spi.ConstraintException
        org.xcmis.spi.NameConstraintViolationException
        org.xcmis.spi.StorageException
      • createPolicy

        public org.xcmis.spi.PolicyData createPolicy​(org.xcmis.spi.FolderData parent,
                                                     org.xcmis.spi.model.TypeDefinition typeDefinition,
                                                     Map<String,​org.xcmis.spi.model.Property<?>> properties,
                                                     List<org.xcmis.spi.model.AccessControlEntry> acl,
                                                     Collection<org.xcmis.spi.PolicyData> policies)
                                              throws org.xcmis.spi.ConstraintException,
                                                     org.xcmis.spi.NameConstraintViolationException,
                                                     org.xcmis.spi.StorageException
        Specified by:
        createPolicy in interface org.xcmis.spi.Storage
        Throws:
        org.xcmis.spi.ConstraintException
        org.xcmis.spi.NameConstraintViolationException
        org.xcmis.spi.StorageException
      • createRelationship

        public org.xcmis.spi.RelationshipData createRelationship​(org.xcmis.spi.ObjectData source,
                                                                 org.xcmis.spi.ObjectData target,
                                                                 org.xcmis.spi.model.TypeDefinition typeDefinition,
                                                                 Map<String,​org.xcmis.spi.model.Property<?>> properties,
                                                                 List<org.xcmis.spi.model.AccessControlEntry> acl,
                                                                 Collection<org.xcmis.spi.PolicyData> policies)
                                                          throws org.xcmis.spi.NameConstraintViolationException,
                                                                 org.xcmis.spi.StorageException
        Specified by:
        createRelationship in interface org.xcmis.spi.Storage
        Throws:
        org.xcmis.spi.NameConstraintViolationException
        org.xcmis.spi.StorageException
      • deleteObject

        public void deleteObject​(org.xcmis.spi.ObjectData object,
                                 boolean deleteAllVersions)
                          throws org.xcmis.spi.UpdateConflictException,
                                 org.xcmis.spi.VersioningException,
                                 org.xcmis.spi.StorageException
        Specified by:
        deleteObject in interface org.xcmis.spi.Storage
        Throws:
        org.xcmis.spi.UpdateConflictException
        org.xcmis.spi.VersioningException
        org.xcmis.spi.StorageException
      • deleteTree

        public Collection<String> deleteTree​(org.xcmis.spi.FolderData folder,
                                             boolean deleteAllVersions,
                                             org.xcmis.spi.model.UnfileObject unfileObject,
                                             boolean continueOnFailure)
                                      throws org.xcmis.spi.UpdateConflictException
        Specified by:
        deleteTree in interface org.xcmis.spi.Storage
        Throws:
        org.xcmis.spi.UpdateConflictException
      • getAllVersions

        public Collection<org.xcmis.spi.DocumentData> getAllVersions​(String versionSeriesId)
                                                              throws org.xcmis.spi.ObjectNotFoundException
        Specified by:
        getAllVersions in interface org.xcmis.spi.Storage
        Throws:
        org.xcmis.spi.ObjectNotFoundException
      • getChangeLog

        public org.xcmis.spi.ItemsIterator<org.xcmis.spi.model.ChangeEvent> getChangeLog​(String changeLogToken)
                                                                                  throws org.xcmis.spi.ConstraintException
        Specified by:
        getChangeLog in interface org.xcmis.spi.Storage
        Throws:
        org.xcmis.spi.ConstraintException
      • getCheckedOutDocuments

        public org.xcmis.spi.ItemsIterator<org.xcmis.spi.DocumentData> getCheckedOutDocuments​(org.xcmis.spi.FolderData folder,
                                                                                              String orderBy)
        Specified by:
        getCheckedOutDocuments in interface org.xcmis.spi.Storage
      • getId

        public String getId()
        Specified by:
        getId in interface org.xcmis.spi.Storage
      • getObjectById

        public org.xcmis.spi.ObjectData getObjectById​(String objectId)
                                               throws org.xcmis.spi.ObjectNotFoundException
        Specified by:
        getObjectById in interface org.xcmis.spi.Storage
        Throws:
        org.xcmis.spi.ObjectNotFoundException
      • getObjectByPath

        public org.xcmis.spi.ObjectData getObjectByPath​(String path)
                                                 throws org.xcmis.spi.ObjectNotFoundException
        Specified by:
        getObjectByPath in interface org.xcmis.spi.Storage
        Throws:
        org.xcmis.spi.ObjectNotFoundException
      • getRenditions

        public org.xcmis.spi.ItemsIterator<org.xcmis.spi.model.Rendition> getRenditions​(org.xcmis.spi.ObjectData object)
        Specified by:
        getRenditions in interface org.xcmis.spi.Storage
      • getRepositoryInfo

        public org.xcmis.spi.model.RepositoryInfo getRepositoryInfo()
        Specified by:
        getRepositoryInfo in interface org.xcmis.spi.Storage
      • getUnfiledObjectsId

        public Iterator<String> getUnfiledObjectsId()
                                             throws org.xcmis.spi.StorageException
        Specified by:
        getUnfiledObjectsId in interface org.xcmis.spi.Storage
        Throws:
        org.xcmis.spi.StorageException
      • moveObject

        public org.xcmis.spi.ObjectData moveObject​(org.xcmis.spi.ObjectData object,
                                                   org.xcmis.spi.FolderData target,
                                                   org.xcmis.spi.FolderData source)
                                            throws org.xcmis.spi.UpdateConflictException,
                                                   org.xcmis.spi.VersioningException,
                                                   org.xcmis.spi.NameConstraintViolationException,
                                                   org.xcmis.spi.StorageException
        Specified by:
        moveObject in interface org.xcmis.spi.Storage
        Throws:
        org.xcmis.spi.UpdateConflictException
        org.xcmis.spi.VersioningException
        org.xcmis.spi.NameConstraintViolationException
        org.xcmis.spi.StorageException
      • query

        public org.xcmis.spi.ItemsIterator<org.xcmis.spi.query.Result> query​(org.xcmis.spi.query.Query query)
                                                                      throws org.xcmis.spi.InvalidArgumentException
        Specified by:
        query in interface org.xcmis.spi.Storage
        Throws:
        org.xcmis.spi.InvalidArgumentException
      • unfileObject

        public void unfileObject​(org.xcmis.spi.ObjectData object)
        Specified by:
        unfileObject in interface org.xcmis.spi.Storage
      • getSearchService

        public org.xcmis.search.SearchService getSearchService()
        Returns:
        the searchService
      • setSearchService

        public void setSearchService​(org.xcmis.search.SearchService searchService)
        Parameters:
        searchService - the searchService to set
      • getStorageConfiguration

        public StorageConfiguration getStorageConfiguration()
        Returns:
        the storageConfiguration
      • addType

        public String addType​(org.xcmis.spi.model.TypeDefinition type)
                       throws org.xcmis.spi.ConstraintException,
                              org.xcmis.spi.StorageException
        Specified by:
        addType in interface org.xcmis.spi.TypeManager
        Throws:
        org.xcmis.spi.ConstraintException
        org.xcmis.spi.StorageException
      • getTypeChildren

        public org.xcmis.spi.ItemsIterator<org.xcmis.spi.model.TypeDefinition> getTypeChildren​(String typeId,
                                                                                               boolean includePropertyDefinitions)
                                                                                        throws org.xcmis.spi.TypeNotFoundException
        Specified by:
        getTypeChildren in interface org.xcmis.spi.TypeManager
        Throws:
        org.xcmis.spi.TypeNotFoundException
      • getTypeDefinition

        public org.xcmis.spi.model.TypeDefinition getTypeDefinition​(String typeId,
                                                                    boolean includePropertyDefinition)
                                                             throws org.xcmis.spi.TypeNotFoundException
        Specified by:
        getTypeDefinition in interface org.xcmis.spi.TypeManager
        Throws:
        org.xcmis.spi.TypeNotFoundException
      • removeType

        public void removeType​(String typeId)
                        throws org.xcmis.spi.ConstraintException,
                               org.xcmis.spi.TypeNotFoundException,
                               org.xcmis.spi.StorageException
        Specified by:
        removeType in interface org.xcmis.spi.TypeManager
        Throws:
        org.xcmis.spi.ConstraintException
        org.xcmis.spi.TypeNotFoundException
        org.xcmis.spi.StorageException
      • getSubTypes

        public Collection<org.xcmis.spi.model.TypeDefinition> getSubTypes​(String typeId,
                                                                          boolean includePropertyDefinitions)
                                                                   throws org.xcmis.spi.TypeNotFoundException
        Get all sub-types of type typeId.
        Parameters:
        typeId - type Id
        includePropertyDefinitions - if true property definition should be included
        Returns:
        set of type definitions which are sub-type of specified type. If type has not any sub-types that empty collection will be returned.
        Throws:
        org.xcmis.spi.TypeNotFoundException - if type typeId does not exist
      • getTypeDefinition

        public org.xcmis.spi.model.TypeDefinition getTypeDefinition​(javax.jcr.nodetype.NodeType nodeType,
                                                                    boolean includePropertyDefinition)
        Get CMIS type definition which is front-end of JCR node type.
        Parameters:
        nodeType - JCR node type
        includePropertyDefinition - if true property definition should be included
        Returns:
        CMIS type definition
      • createDocumentEntry

        public org.exoplatform.ecms.xcmis.sp.JcrNodeEntry createDocumentEntry​(org.exoplatform.ecms.xcmis.sp.JcrNodeEntry parent,
                                                                              String name,
                                                                              org.xcmis.spi.model.TypeDefinition typeDefinition,
                                                                              org.xcmis.spi.model.VersioningState versioningState)
                                                                       throws org.xcmis.spi.NameConstraintViolationException,
                                                                              org.xcmis.spi.StorageException
        Throws:
        org.xcmis.spi.NameConstraintViolationException
        org.xcmis.spi.StorageException
      • createFolderEntry

        public org.exoplatform.ecms.xcmis.sp.JcrNodeEntry createFolderEntry​(org.exoplatform.ecms.xcmis.sp.JcrNodeEntry parent,
                                                                            String name,
                                                                            org.xcmis.spi.model.TypeDefinition typeDefinition)
                                                                     throws org.xcmis.spi.NameConstraintViolationException,
                                                                            org.xcmis.spi.StorageException
        Throws:
        org.xcmis.spi.NameConstraintViolationException
        org.xcmis.spi.StorageException
      • createPolicyEntry

        public org.exoplatform.ecms.xcmis.sp.JcrNodeEntry createPolicyEntry​(String name,
                                                                            org.xcmis.spi.model.TypeDefinition typeDefinition)
                                                                     throws org.xcmis.spi.NameConstraintViolationException,
                                                                            org.xcmis.spi.StorageException
        Throws:
        org.xcmis.spi.NameConstraintViolationException
        org.xcmis.spi.StorageException
      • createRelationshipEntry

        public org.exoplatform.ecms.xcmis.sp.JcrNodeEntry createRelationshipEntry​(String name,
                                                                                  org.xcmis.spi.model.TypeDefinition typeDefinition,
                                                                                  org.exoplatform.ecms.xcmis.sp.JcrNodeEntry source,
                                                                                  org.exoplatform.ecms.xcmis.sp.JcrNodeEntry target)
                                                                           throws org.xcmis.spi.NameConstraintViolationException,
                                                                                  org.xcmis.spi.StorageException
        Throws:
        org.xcmis.spi.NameConstraintViolationException
        org.xcmis.spi.StorageException
      • getEntry

        public org.exoplatform.ecms.xcmis.sp.JcrNodeEntry getEntry​(String id)
                                                            throws org.xcmis.spi.ObjectNotFoundException
        Throws:
        org.xcmis.spi.ObjectNotFoundException
      • fromNode

        public org.exoplatform.ecms.xcmis.sp.JcrNodeEntry fromNode​(javax.jcr.Node node)
                                                            throws org.xcmis.spi.ObjectNotFoundException
        Throws:
        org.xcmis.spi.ObjectNotFoundException
      • getJcrRootPath

        public String getJcrRootPath()
      • isSupportedNodeType

        public boolean isSupportedNodeType​(String nodeTypeName)
      • getNodeTypeMapping

        public Map<String,​TypeMapping> getNodeTypeMapping()
        Returns:
        the nodeTypeMapping
      • getSession

        public javax.jcr.Session getSession()
                                     throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException