org.xcmis.sp.inmemory
Class StorageImpl

java.lang.Object
  extended by org.xcmis.sp.inmemory.StorageImpl
All Implemented Interfaces:
Storage, TypeManager

public class StorageImpl
extends Object
implements Storage

In-memory implementation of xCMIS storage. This is storage is limited in number of items and total amount of content. Storage is not designed for high concurrency load. In some cases data in storage can be in inconsistency state.

Version:
$Id: StorageImpl.java 804 2010-04-16 16:48:59Z alexey.zavizionov@gmail.com $
Author:
Andrey Parfonov

Field Summary
protected  RenditionManager renditionManager
          The rendition manager.
 
Constructor Summary
StorageImpl(StorageConfiguration configuration)
           
StorageImpl(StorageConfiguration configuration, RenditionManager manager, PermissionService permissionService)
           
 
Method Summary
 String addType(TypeDefinition type)
          
 AllowableActions calculateAllowableActions(ObjectData object)
          
 DocumentData copyDocument(DocumentData source, FolderData parent, Map<String,Property<?>> properties, List<AccessControlEntry> acl, Collection<PolicyData> policies, VersioningState versioningState)
          
 DocumentData createDocument(FolderData parent, TypeDefinition typeDefinition, Map<String,Property<?>> properties, ContentStream content, List<AccessControlEntry> acl, Collection<PolicyData> policies, VersioningState versioningState)
          
 FolderData createFolder(FolderData parent, TypeDefinition typeDefinition, Map<String,Property<?>> properties, List<AccessControlEntry> acl, Collection<PolicyData> policies)
          
 PolicyData createPolicy(FolderData parent, TypeDefinition typeDefinition, Map<String,Property<?>> properties, List<AccessControlEntry> acl, Collection<PolicyData> policies)
          
 RelationshipData createRelationship(ObjectData source, ObjectData target, TypeDefinition typeDefinition, Map<String,Property<?>> properties, List<AccessControlEntry> acl, Collection<PolicyData> policies)
          
 void deleteObject(ObjectData object, boolean deleteAllVersions)
          
 Collection<String> deleteTree(FolderData folder, boolean deleteAllVersions, UnfileObject unfileObject, boolean continueOnFailure)
          
static String generateId()
           
 Collection<DocumentData> getAllVersions(String versionSeriesId)
          
 ItemsIterator<ChangeEvent> getChangeLog(String changeLogToken)
          
 ItemsIterator<DocumentData> getCheckedOutDocuments(FolderData folder, String orderBy)
          
protected  String getCurrentUser()
           
 String getId()
          
 ObjectData getObjectById(String objectId)
          
 ObjectData getObjectByPath(String path)
          
 ItemsIterator<Rendition> getRenditions(ObjectData object)
          
 RepositoryInfo getRepositoryInfo()
          
 ItemsIterator<TypeDefinition> getTypeChildren(String typeId, boolean includePropertyDefinitions)
          
 TypeDefinition getTypeDefinition(String typeId, boolean includePropertyDefinition)
          
 Iterator<String> getUnfiledObjectsId()
          
 ObjectData moveObject(ObjectData object, FolderData target, FolderData source)
          
 ItemsIterator<Result> query(Query query)
          
 void removeType(String typeId)
          
 void unfileObject(ObjectData object)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

renditionManager

protected RenditionManager renditionManager
The rendition manager.

Constructor Detail

StorageImpl

public StorageImpl(StorageConfiguration configuration,
                   RenditionManager manager,
                   PermissionService permissionService)

StorageImpl

public StorageImpl(StorageConfiguration configuration)
Method Detail

generateId

public static String generateId()

calculateAllowableActions

public AllowableActions calculateAllowableActions(ObjectData object)

Specified by:
calculateAllowableActions in interface Storage

copyDocument

public DocumentData copyDocument(DocumentData source,
                                 FolderData parent,
                                 Map<String,Property<?>> properties,
                                 List<AccessControlEntry> acl,
                                 Collection<PolicyData> policies,
                                 VersioningState versioningState)
                          throws ConstraintException,
                                 NameConstraintViolationException,
                                 StorageException

Specified by:
copyDocument in interface Storage
Throws:
ConstraintException
NameConstraintViolationException
StorageException

createDocument

public DocumentData createDocument(FolderData parent,
                                   TypeDefinition typeDefinition,
                                   Map<String,Property<?>> properties,
                                   ContentStream content,
                                   List<AccessControlEntry> acl,
                                   Collection<PolicyData> policies,
                                   VersioningState versioningState)
                            throws ConstraintException,
                                   NameConstraintViolationException,
                                   IOException,
                                   StorageException

Specified by:
createDocument in interface Storage
Throws:
ConstraintException
NameConstraintViolationException
IOException
StorageException

createFolder

public FolderData createFolder(FolderData parent,
                               TypeDefinition typeDefinition,
                               Map<String,Property<?>> properties,
                               List<AccessControlEntry> acl,
                               Collection<PolicyData> policies)
                        throws ConstraintException,
                               NameConstraintViolationException,
                               StorageException

Specified by:
createFolder in interface Storage
Throws:
ConstraintException
NameConstraintViolationException
StorageException

createPolicy

public PolicyData createPolicy(FolderData parent,
                               TypeDefinition typeDefinition,
                               Map<String,Property<?>> properties,
                               List<AccessControlEntry> acl,
                               Collection<PolicyData> policies)
                        throws ConstraintException,
                               NameConstraintViolationException,
                               StorageException

Specified by:
createPolicy in interface Storage
Throws:
ConstraintException
NameConstraintViolationException
StorageException

createRelationship

public RelationshipData createRelationship(ObjectData source,
                                           ObjectData target,
                                           TypeDefinition typeDefinition,
                                           Map<String,Property<?>> properties,
                                           List<AccessControlEntry> acl,
                                           Collection<PolicyData> policies)
                                    throws NameConstraintViolationException,
                                           StorageException

Specified by:
createRelationship in interface Storage
Throws:
NameConstraintViolationException
StorageException

deleteObject

public void deleteObject(ObjectData object,
                         boolean deleteAllVersions)
                  throws VersioningException,
                         UpdateConflictException,
                         StorageException

Specified by:
deleteObject in interface Storage
Throws:
VersioningException
UpdateConflictException
StorageException

deleteTree

public Collection<String> deleteTree(FolderData folder,
                                     boolean deleteAllVersions,
                                     UnfileObject unfileObject,
                                     boolean continueOnFailure)
                              throws UpdateConflictException

Specified by:
deleteTree in interface Storage
Throws:
UpdateConflictException

getAllVersions

public Collection<DocumentData> getAllVersions(String versionSeriesId)
                                        throws ObjectNotFoundException

Specified by:
getAllVersions in interface Storage
Throws:
ObjectNotFoundException

getChangeLog

public ItemsIterator<ChangeEvent> getChangeLog(String changeLogToken)
                                        throws ConstraintException

Specified by:
getChangeLog in interface Storage
Throws:
ConstraintException

getCheckedOutDocuments

public ItemsIterator<DocumentData> getCheckedOutDocuments(FolderData folder,
                                                          String orderBy)

Specified by:
getCheckedOutDocuments in interface Storage

getId

public String getId()

Specified by:
getId in interface Storage

getObjectById

public ObjectData getObjectById(String objectId)
                         throws ObjectNotFoundException

Specified by:
getObjectById in interface Storage
Throws:
ObjectNotFoundException

getObjectByPath

public ObjectData getObjectByPath(String path)
                           throws ObjectNotFoundException

Specified by:
getObjectByPath in interface Storage
Throws:
ObjectNotFoundException

getRenditions

public ItemsIterator<Rendition> getRenditions(ObjectData object)

Specified by:
getRenditions in interface Storage

getRepositoryInfo

public RepositoryInfo getRepositoryInfo()

Specified by:
getRepositoryInfo in interface Storage

moveObject

public ObjectData moveObject(ObjectData object,
                             FolderData target,
                             FolderData source)
                      throws UpdateConflictException,
                             VersioningException,
                             NameConstraintViolationException,
                             StorageException

Specified by:
moveObject in interface Storage
Throws:
UpdateConflictException
VersioningException
NameConstraintViolationException
StorageException

query

public ItemsIterator<Result> query(Query query)
                            throws InvalidArgumentException

Specified by:
query in interface Storage
Throws:
InvalidArgumentException

unfileObject

public void unfileObject(ObjectData object)

Specified by:
unfileObject in interface Storage

getUnfiledObjectsId

public Iterator<String> getUnfiledObjectsId()
                                     throws StorageException

Specified by:
getUnfiledObjectsId in interface Storage
Throws:
StorageException

addType

public String addType(TypeDefinition type)
               throws StorageException,
                      CmisRuntimeException

Specified by:
addType in interface TypeManager
Throws:
StorageException
CmisRuntimeException

getTypeChildren

public ItemsIterator<TypeDefinition> getTypeChildren(String typeId,
                                                     boolean includePropertyDefinitions)
                                              throws TypeNotFoundException,
                                                     CmisRuntimeException

Specified by:
getTypeChildren in interface TypeManager
Throws:
TypeNotFoundException
CmisRuntimeException

getTypeDefinition

public TypeDefinition getTypeDefinition(String typeId,
                                        boolean includePropertyDefinition)
                                 throws TypeNotFoundException,
                                        CmisRuntimeException

Specified by:
getTypeDefinition in interface TypeManager
Throws:
TypeNotFoundException
CmisRuntimeException

removeType

public void removeType(String typeId)
                throws TypeNotFoundException,
                       StorageException,
                       ConstraintException

Specified by:
removeType in interface TypeManager
Throws:
TypeNotFoundException
StorageException
ConstraintException

getCurrentUser

protected String getCurrentUser()


Copyright © 2010 eXo Platform SAS. All Rights Reserved.