|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Session
A session is a connection to a CMIS repository with a specific user.
Not all operations might be supported the connected repository. Either
OpenCMIS or the repository will throw an exception if an unsupported
operation is called. The capabilities of the repository can be discovered by
evaluating the repository info (see getRepositoryInfo()
).
Almost all methods might throw exceptions derived from
CmisBaseException
which is a runtime exception!
(Please refer to the CMIS specification for details about the domain model, terms, concepts, base types, properties, ids and query names, query language, etc.)
Method Summary | |
---|---|
Acl |
applyAcl(ObjectId objectId,
java.util.List<Ace> addAces,
java.util.List<Ace> removeAces,
AclPropagation aclPropagation)
Applies an ACL to an object. |
void |
applyPolicy(ObjectId objectId,
ObjectId... policyIds)
Applies a set of policies to an object. |
void |
clear()
Clears all cached data. |
ObjectId |
createDocument(java.util.Map<java.lang.String,?> properties,
ObjectId folderId,
ContentStream contentStream,
VersioningState versioningState)
Creates a new document. |
ObjectId |
createDocument(java.util.Map<java.lang.String,?> properties,
ObjectId folderId,
ContentStream contentStream,
VersioningState versioningState,
java.util.List<Policy> policies,
java.util.List<Ace> addAces,
java.util.List<Ace> removeAces)
Creates a new document. |
ObjectId |
createDocumentFromSource(ObjectId source,
java.util.Map<java.lang.String,?> properties,
ObjectId folderId,
VersioningState versioningState)
Creates a new document from a source document. |
ObjectId |
createDocumentFromSource(ObjectId source,
java.util.Map<java.lang.String,?> properties,
ObjectId folderId,
VersioningState versioningState,
java.util.List<Policy> policies,
java.util.List<Ace> addAces,
java.util.List<Ace> removeAces)
Creates a new document from a source document. |
ObjectId |
createFolder(java.util.Map<java.lang.String,?> properties,
ObjectId folderId)
Creates a new folder. |
ObjectId |
createFolder(java.util.Map<java.lang.String,?> properties,
ObjectId folderId,
java.util.List<Policy> policies,
java.util.List<Ace> addAces,
java.util.List<Ace> removeAces)
Creates a new folder. |
ObjectId |
createObjectId(java.lang.String id)
Creates an object id from a String. |
OperationContext |
createOperationContext()
Creates a new operation context object. |
OperationContext |
createOperationContext(java.util.Set<java.lang.String> filter,
boolean includeAcls,
boolean includeAllowableActions,
boolean includePolicies,
IncludeRelationships includeRelationships,
java.util.Set<java.lang.String> renditionFilter,
boolean includePathSegments,
java.lang.String orderBy,
boolean cacheEnabled,
int maxItemsPerPage)
Creates a new operation context object with the given properties. |
ObjectId |
createPolicy(java.util.Map<java.lang.String,?> properties,
ObjectId folderId)
Creates a new policy. |
ObjectId |
createPolicy(java.util.Map<java.lang.String,?> properties,
ObjectId folderId,
java.util.List<Policy> policies,
java.util.List<Ace> addAces,
java.util.List<Ace> removeAces)
Creates a new policy. |
QueryStatement |
createQueryStatement(java.lang.String statement)
Creates a query statement. |
ObjectId |
createRelationship(java.util.Map<java.lang.String,?> properties)
Creates a new relationship. |
ObjectId |
createRelationship(java.util.Map<java.lang.String,?> properties,
java.util.List<Policy> policies,
java.util.List<Ace> addAces,
java.util.List<Ace> removeAces)
Creates a new relationship. |
Acl |
getAcl(ObjectId objectId,
boolean onlyBasicPermissions)
Fetches the ACL of an object from the repository. |
CmisBinding |
getBinding()
Returns the underlying binding object. |
ItemIterable<Document> |
getCheckedOutDocs()
Returns all checked out documents. |
ItemIterable<Document> |
getCheckedOutDocs(OperationContext context)
Returns all checked out documents with the given OperationContext
. |
ChangeEvents |
getContentChanges(java.lang.String changeLogToken,
boolean includeProperties,
long maxNumItems)
Returns the content changes. |
ChangeEvents |
getContentChanges(java.lang.String changeLogToken,
boolean includeProperties,
long maxNumItems,
OperationContext context)
Returns the content changes. |
OperationContext |
getDefaultContext()
Returns the current default operation parameters for filtering, paging and caching. |
java.util.Locale |
getLocale()
Get the current locale to be used for this session. |
CmisObject |
getObject(ObjectId objectId)
Returns a CMIS object from the session cache. |
CmisObject |
getObject(ObjectId objectId,
OperationContext context)
Returns a CMIS object from the session cache. |
CmisObject |
getObject(java.lang.String objectId)
Returns a CMIS object from the session cache. |
CmisObject |
getObject(java.lang.String objectId,
OperationContext context)
Returns a CMIS object from the session cache. |
CmisObject |
getObjectByPath(java.lang.String path)
Returns a CMIS object from the session cache. |
CmisObject |
getObjectByPath(java.lang.String path,
OperationContext context)
Returns a CMIS object from the session cache. |
ObjectFactory |
getObjectFactory()
Gets a factory object that provides methods to create the objects used by this API. |
ItemIterable<Relationship> |
getRelationships(ObjectId objectId,
boolean includeSubRelationshipTypes,
RelationshipDirection relationshipDirection,
ObjectType type,
OperationContext context)
Fetches the relationships from or to an object from the repository. |
RepositoryInfo |
getRepositoryInfo()
Returns the repository info of the repository associated with this session. |
Folder |
getRootFolder()
Gets the root folder of the repository. |
Folder |
getRootFolder(OperationContext context)
Gets the root folder of the repository with the given OperationContext . |
ItemIterable<ObjectType> |
getTypeChildren(java.lang.String typeId,
boolean includePropertyDefinitions)
Returns the type children of the given type id. |
ObjectType |
getTypeDefinition(java.lang.String typeId)
Returns the type definition of the given type id. |
java.util.List<Tree<ObjectType>> |
getTypeDescendants(java.lang.String typeId,
int depth,
boolean includePropertyDefinitions)
Returns the type descendants of the given type id. |
ItemIterable<QueryResult> |
query(java.lang.String statement,
boolean searchAllVersions)
Sends a query to the repository. |
ItemIterable<QueryResult> |
query(java.lang.String statement,
boolean searchAllVersions,
OperationContext context)
Sends a query to the repository using the given OperationContext . |
void |
removeObjectFromCache(ObjectId objectId)
Removes the given object from the cache. |
void |
removeObjectFromCache(java.lang.String objectId)
Removes the given object from the cache. |
void |
removePolicy(ObjectId objectId,
ObjectId... policyIds)
Removes a set of policies from an object. |
void |
setDefaultContext(OperationContext context)
Sets the current session parameters for filtering, paging and caching. |
Method Detail |
---|
void clear()
CmisBinding getBinding()
OperationContext getDefaultContext()
Please note: The returned object is not thread-safe and should
only be modified right after the session has been created and before the
session object has been used. In order to change the default context in
thread-safe manner, create a new OperationContext
object and use
setDefaultContext(OperationContext)
to apply it.
void setDefaultContext(OperationContext context)
context
- the OperationContext
to be used for the session;
if null
, a default context is usedOperationContext createOperationContext()
OperationContext createOperationContext(java.util.Set<java.lang.String> filter, boolean includeAcls, boolean includeAllowableActions, boolean includePolicies, IncludeRelationships includeRelationships, java.util.Set<java.lang.String> renditionFilter, boolean includePathSegments, java.lang.String orderBy, boolean cacheEnabled, int maxItemsPerPage)
OperationContext
ObjectId createObjectId(java.lang.String id)
java.util.Locale getLocale()
RepositoryInfo getRepositoryInfo()
ObjectFactory getObjectFactory()
ObjectType getTypeDefinition(java.lang.String typeId)
ItemIterable<ObjectType> getTypeChildren(java.lang.String typeId, boolean includePropertyDefinitions)
java.util.List<Tree<ObjectType>> getTypeDescendants(java.lang.String typeId, int depth, boolean includePropertyDefinitions)
Folder getRootFolder()
Folder getRootFolder(OperationContext context)
OperationContext
.
ItemIterable<Document> getCheckedOutDocs()
Folder.getCheckedOutDocs()
ItemIterable<Document> getCheckedOutDocs(OperationContext context)
OperationContext
.
Folder.getCheckedOutDocs(OperationContext)
CmisObject getObject(ObjectId objectId)
OperationContext
, it
will load the object from the repository and puts it into the cache.
objectId
- the object idgetObject(String)
CmisObject getObject(ObjectId objectId, OperationContext context)
OperationContext
has caching turned off, it
will load the object from the repository and puts it into the cache.
objectId
- the object idcontext
- the OperationContext
to usegetObject(String, OperationContext)
CmisObject getObject(java.lang.String objectId)
OperationContext
, it
will load the object from the repository and puts it into the cache.
objectId
- the object idgetObject(ObjectId)
CmisObject getObject(java.lang.String objectId, OperationContext context)
OperationContext
has caching turned off, it
will load the object from the repository and puts it into the cache.
objectId
- the object idcontext
- the OperationContext
to usegetObject(ObjectId, OperationContext)
CmisObject getObjectByPath(java.lang.String path)
OperationContext
, it
will load the object from the repository and puts it into the cache.
path
- the object pathCmisObject getObjectByPath(java.lang.String path, OperationContext context)
OperationContext
has caching turned off, it
will load the object from the repository and puts it into the cache.
path
- the object pathcontext
- the OperationContext
to usevoid removeObjectFromCache(ObjectId objectId)
objectId
- object idvoid removeObjectFromCache(java.lang.String objectId)
objectId
- object idItemIterable<QueryResult> query(java.lang.String statement, boolean searchAllVersions)
statement
- the query statement (CMIS query language)searchAllVersions
- specifies if the latest and non-latest versions of document
objects should be includedItemIterable<QueryResult> query(java.lang.String statement, boolean searchAllVersions, OperationContext context)
OperationContext
.
(See CMIS spec "2.1.10 Query".)
statement
- the query statement (CMIS query language)searchAllVersions
- specifies if the latest and non-latest versions of document
objects should be includedcontext
- the OperationContextQueryStatement createQueryStatement(java.lang.String statement)
statement
- the query statement with placeholders ('?').QueryStatement
ChangeEvents getContentChanges(java.lang.String changeLogToken, boolean includeProperties, long maxNumItems)
changeLogToken
- the change log token to start from or null
includeProperties
- indicates if changed properties should be included in the
resultmaxNumItems
- maximum numbers of eventsChangeEvents getContentChanges(java.lang.String changeLogToken, boolean includeProperties, long maxNumItems, OperationContext context)
changeLogToken
- the change log token to start from or null
includeProperties
- indicates if changed properties should be included in the
resultmaxNumItems
- maximum numbers of eventscontext
- the OperationContextObjectId createDocument(java.util.Map<java.lang.String,?> properties, ObjectId folderId, ContentStream contentStream, VersioningState versioningState, java.util.List<Policy> policies, java.util.List<Ace> addAces, java.util.List<Ace> removeAces)
Folder.createDocument(Map, ContentStream, VersioningState, List,
List, List, OperationContext)
ObjectId createDocument(java.util.Map<java.lang.String,?> properties, ObjectId folderId, ContentStream contentStream, VersioningState versioningState)
Folder.createDocument(Map, ContentStream, VersioningState, List,
List, List, OperationContext)
ObjectId createDocumentFromSource(ObjectId source, java.util.Map<java.lang.String,?> properties, ObjectId folderId, VersioningState versioningState, java.util.List<Policy> policies, java.util.List<Ace> addAces, java.util.List<Ace> removeAces)
Folder.createDocumentFromSource(ObjectId, Map, VersioningState,
List, List, List, OperationContext)
ObjectId createDocumentFromSource(ObjectId source, java.util.Map<java.lang.String,?> properties, ObjectId folderId, VersioningState versioningState)
Folder.createDocumentFromSource(ObjectId, Map, VersioningState,
List, List, List, OperationContext)
ObjectId createFolder(java.util.Map<java.lang.String,?> properties, ObjectId folderId, java.util.List<Policy> policies, java.util.List<Ace> addAces, java.util.List<Ace> removeAces)
Folder.createFolder(Map, List, List, List, OperationContext)
ObjectId createFolder(java.util.Map<java.lang.String,?> properties, ObjectId folderId)
Folder.createFolder(Map, List, List, List, OperationContext)
ObjectId createPolicy(java.util.Map<java.lang.String,?> properties, ObjectId folderId, java.util.List<Policy> policies, java.util.List<Ace> addAces, java.util.List<Ace> removeAces)
Folder.createPolicy(Map, List, List, List, OperationContext)
ObjectId createPolicy(java.util.Map<java.lang.String,?> properties, ObjectId folderId)
Folder.createPolicy(Map, List, List, List, OperationContext)
ObjectId createRelationship(java.util.Map<java.lang.String,?> properties, java.util.List<Policy> policies, java.util.List<Ace> addAces, java.util.List<Ace> removeAces)
ObjectId createRelationship(java.util.Map<java.lang.String,?> properties)
ItemIterable<Relationship> getRelationships(ObjectId objectId, boolean includeSubRelationshipTypes, RelationshipDirection relationshipDirection, ObjectType type, OperationContext context)
Acl getAcl(ObjectId objectId, boolean onlyBasicPermissions)
Acl applyAcl(ObjectId objectId, java.util.List<Ace> addAces, java.util.List<Ace> removeAces, AclPropagation aclPropagation)
void applyPolicy(ObjectId objectId, ObjectId... policyIds)
void removePolicy(ObjectId objectId, ObjectId... policyIds)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |