org.xcmis.sp.jcr.exo
Class StorageImpl

java.lang.Object
  extended by org.xcmis.sp.jcr.exo.StorageImpl
All Implemented Interfaces:
Storage, TypeManager
Direct Known Subclasses:
QueryableStorage

public class StorageImpl
extends Object
implements Storage

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

Field Summary
protected  javax.jcr.Session session
           
static String XCMIS_POLICIES
           
static String XCMIS_PROPERTY_TYPE
           
static Pattern XCMIS_PROPERTY_TYPE_PATTERN
           
static String XCMIS_RELATIONSHIPS
           
static String XCMIS_SYSTEM_PATH
           
static String XCMIS_UNFILED
           
static String XCMIS_WORKING_COPIES
           
 
Constructor Summary
StorageImpl(javax.jcr.Session session, IndexListener indexListener, StorageConfiguration configuration, RenditionManager renditionManager, PermissionService permissionService)
           
StorageImpl(javax.jcr.Session session, StorageConfiguration configuration, PermissionService permissionService)
           
StorageImpl(javax.jcr.Session session, StorageConfiguration configuration, RenditionManager renditionManager, 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)
          
protected  String createJcrDate(Calendar c)
          Create String representation of date in format required by JCR.
 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)
          
 Collection<DocumentData> getAllVersions(String versionSeriesId)
          
 ItemsIterator<ChangeEvent> getChangeLog(String changeLogToken)
          
 ItemsIterator<DocumentData> getCheckedOutDocuments(FolderData folder, String orderBy)
          
 String getId()
          
 IndexListener getIndexListener()
           
protected  javax.jcr.nodetype.NodeType getNodeType(String name)
           
 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 setIndexListener(IndexListener indexListener)
           
 void unfileObject(ObjectData object)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XCMIS_SYSTEM_PATH

public static final String XCMIS_SYSTEM_PATH
See Also:
Constant Field Values

XCMIS_UNFILED

public static final String XCMIS_UNFILED
See Also:
Constant Field Values

XCMIS_WORKING_COPIES

public static final String XCMIS_WORKING_COPIES
See Also:
Constant Field Values

XCMIS_RELATIONSHIPS

public static final String XCMIS_RELATIONSHIPS
See Also:
Constant Field Values

XCMIS_POLICIES

public static final String XCMIS_POLICIES
See Also:
Constant Field Values

XCMIS_PROPERTY_TYPE

public static final String XCMIS_PROPERTY_TYPE
See Also:
Constant Field Values

XCMIS_PROPERTY_TYPE_PATTERN

public static final Pattern XCMIS_PROPERTY_TYPE_PATTERN

session

protected final javax.jcr.Session session
Constructor Detail

StorageImpl

public StorageImpl(javax.jcr.Session session,
                   IndexListener indexListener,
                   StorageConfiguration configuration,
                   RenditionManager renditionManager,
                   PermissionService permissionService)

StorageImpl

public StorageImpl(javax.jcr.Session session,
                   StorageConfiguration configuration,
                   PermissionService permissionService)

StorageImpl

public StorageImpl(javax.jcr.Session session,
                   StorageConfiguration configuration,
                   RenditionManager renditionManager,
                   PermissionService permissionService)
Method Detail

addType

public String addType(TypeDefinition type)
               throws ConstraintException,
                      StorageException

Specified by:
addType in interface TypeManager
Throws:
ConstraintException
StorageException

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 UpdateConflictException,
                         VersioningException,
                         StorageException

Specified by:
deleteObject in interface Storage
Throws:
UpdateConflictException
VersioningException
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

getIndexListener

public IndexListener getIndexListener()
Returns:
the indexListener

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

getTypeChildren

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

Specified by:
getTypeChildren in interface TypeManager
Throws:
TypeNotFoundException

getTypeDefinition

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

Specified by:
getTypeDefinition in interface TypeManager
Throws:
TypeNotFoundException
CmisRuntimeException

getUnfiledObjectsId

public Iterator<String> getUnfiledObjectsId()
                                     throws StorageException

Specified by:
getUnfiledObjectsId in interface Storage
Throws:
StorageException

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

removeType

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

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

setIndexListener

public void setIndexListener(IndexListener indexListener)
Parameters:
indexListener - the indexListener to set

unfileObject

public void unfileObject(ObjectData object)

Specified by:
unfileObject in interface Storage

createJcrDate

protected String createJcrDate(Calendar c)
Create String representation of date in format required by JCR.

Parameters:
c - Calendar
Returns:
formated string date

getNodeType

protected javax.jcr.nodetype.NodeType getNodeType(String name)
                                           throws javax.jcr.nodetype.NoSuchNodeTypeException,
                                                  javax.jcr.RepositoryException
Throws:
javax.jcr.nodetype.NoSuchNodeTypeException
javax.jcr.RepositoryException


Copyright © 2010 eXo Platform SAS. All Rights Reserved.