|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ObjectContentManager
The object content manager encapsulates a JCR session. This is the main component used to manage objects into the JCR repository.
Method Summary | |
---|---|
void |
addVersionLabel(String path,
String versionName,
String versionLabel)
Add a new label to a particular version |
void |
checkin(String path)
Checkin an object |
void |
checkin(String path,
String[] versionLabels)
Checkin an object and apply some labels to this new version Within a particular object path, a given label may appear a maximum of once |
void |
checkout(String path)
Checkout - Create a new version This is only possible if the object is based on mix:versionable node type |
void |
copy(String srcPath,
String destPath)
Copy an object |
String[] |
getAllVersionLabels(String path)
Get all version labels assigned to all versions |
VersionIterator |
getAllVersions(String path)
Get all object versions |
Version |
getBaseVersion(String path)
Get the lastest object version |
Object |
getObject(Class objectClass,
String path)
Get an object from the JCR repository |
Object |
getObject(Class objectClass,
String path,
String versionNumber)
Get an object from the JCR repository |
Object |
getObject(Query query)
Retrieve an object matching to a query |
Object |
getObject(String path)
Get an object from the JCR repository |
Object |
getObject(String path,
String versionNumber)
Get an object from the JCR repository |
Object |
getObjectByUuid(String uuid)
Get an object from the JCR repository |
Iterator |
getObjectIterator(Query query)
Retrieve some objects matching to a query. |
Iterator |
getObjectIterator(String query,
String language)
Retrieve an objects matching a query specified in a specific query language. |
Collection |
getObjects(Class objectClass,
String path)
Returns a list of objects of that particular class which are associated to a specific path. |
Collection |
getObjects(Query query)
Retrieve some objects matching to a query |
Collection |
getObjects(String query,
String language)
Return a list of object matching to a JCR query |
QueryManager |
getQueryManager()
|
Version |
getRootVersion(String path)
Get the first object version |
Session |
getSession()
This method returns the JCR session. |
Version |
getVersion(String path,
String versionName)
Get a particular version |
String[] |
getVersionLabels(String path,
String versionName)
Get all version labels assigned to a particular object version |
void |
insert(Object object)
Insert an object into the JCR repository |
boolean |
isLocked(String absPath)
Is that path locked? |
boolean |
isPersistent(Class clazz)
Can this object content manager insert, update, delete, ... that type? |
Lock |
lock(String path,
boolean isDeep,
boolean isSessionScoped)
Lock object saved on . |
void |
logout()
Close the session |
void |
move(String srcPath,
String destPath)
Move an object |
boolean |
objectExists(String path)
Check if an object exists |
void |
refresh(boolean keepChanges)
Refresh the underlying jcr session (see the jcr spec) |
void |
remove(Object object)
Remove an object from a JCR repository |
void |
remove(Query query)
Remove all objects matching to a query |
void |
remove(String path)
Remove an object from a JCR repository |
void |
retrieveAllMappedAttributes(Object object)
Retrieve all mapped attributes for the given persistent object. |
void |
retrieveMappedAttribute(Object object,
String attributeName)
Retrieve the specified attribute for the given persistent object. this attribute is either a bean or a collection. |
void |
save()
Save all modifications made by the object content manager |
void |
unlock(String path,
String lockToken)
Unlock object stored on . |
void |
update(Object object)
Update an object |
Method Detail |
---|
boolean objectExists(String path) throws ObjectContentManagerException
path
- the object path
ObjectContentManagerException
- when it is not possible to check if the item existboolean isPersistent(Class clazz)
clazz
- class for question
true
if the class is persistencevoid insert(Object object) throws ObjectContentManagerException
object
- the object to add
ObjectContentManagerException
- when it is not possible to insert the objectvoid update(Object object) throws ObjectContentManagerException
object
- the object to update
ObjectContentManagerException
- when it is not possible to update the objectObject getObject(String path) throws ObjectContentManagerException
path
- the object path
ObjectContentManagerException
- when it is not possible to retrieve the objectObject getObjectByUuid(String uuid) throws ObjectContentManagerException
the
- object uuid
ObjectContentManagerException
- when it is not possible to retrieve the objectObject getObject(String path, String versionNumber) throws ObjectContentManagerException
path
- the object pathversionNumber
- The desired object version number
ObjectContentManagerException
- when it is not possible to retrieve the objectObject getObject(Class objectClass, String path) throws ObjectContentManagerException
objectClass
- the object classpath
- the object path
ObjectContentManagerException
- when it is not possible to retrieve the objectObject getObject(Class objectClass, String path, String versionNumber) throws ObjectContentManagerException
objectClass
- the object classpath
- the object pathversionNumber
- The desired object version number
ObjectContentManagerException
- when it is not possible to retrieve the objectvoid retrieveMappedAttribute(Object object, String attributeName)
object
- The persistent objectattributeName
- The name of the attribute to retrievevoid retrieveAllMappedAttributes(Object object)
object
- The persistent objectvoid remove(String path) throws ObjectContentManagerException
path
- the object path
ObjectContentManagerException
- when it is not possible to remove the objectvoid remove(Object object) throws ObjectContentManagerException
object
- the object to remove
ObjectContentManagerException
- when it is not possible to remove the objectvoid remove(Query query) throws ObjectContentManagerException
query
- The query used to find the objects to remove
ObjectContentManagerException
- when it is not possible to remove all objectsObject getObject(Query query) throws ObjectContentManagerException
query
- The Query object used to seach the object
ObjectContentManagerException
- when it is not possible to retrieve the objectCollection getObjects(Query query) throws ObjectContentManagerException
query
- The query used to seach the objects
ObjectContentManagerException
- when it is not possible to retrieve the objectsCollection getObjects(Class objectClass, String path) throws ObjectContentManagerException
objectClass
- path
- Node path.
ObjectContentManagerException
Collection getObjects(String query, String language)
query
- the JCR querylanguage
- the JCR Language ("XPATH" or "SQL").
Iterator getObjectIterator(Query query) throws ObjectContentManagerException
query
- The query used to seach the objects
ObjectContentManagerException
- when it is not possible to retrieve the objectsIterator getObjectIterator(String query, String language)
Query
using the session's QueryManager
with the given query
exception and language parameters.
If the query statement
is syntactically invalid, given the
language specified, an InvalidQueryException
is thrown.
The language
must be a string from among those returned by
javax.jcr.QueryManager.getSupportedQueryLanguages()
; if
it is not, then an InvalidQueryException
is thrown.
query
- The query to execute to find the objects.language
- The language in which the query is written
InvalidQueryException
- If the query is not a valid JCR Query according to the
specified language
ObjectContentManagerException
- If an error occurrs querying for the objects.QueryManager.createQuery(String, String)
,
QueryManager.getSupportedQueryLanguages()
void checkout(String path) throws VersionException
path
- The object path
VersionException
- when it is not possible to create a new versionvoid checkin(String path) throws VersionException
path
- the object path
VersionException
- when it is not possible to checkinvoid checkin(String path, String[] versionLabels) throws VersionException
path
- The object pathversionLabels
- the version labels to apply to the new version
VersionException
- when it is possible to checkinString[] getVersionLabels(String path, String versionName) throws VersionException
path
- the object pathversionName
- the object version name (1.0, ...)
VersionException
- when it is not to get all version labelsString[] getAllVersionLabels(String path) throws VersionException
path
- the object path
VersionException
- when it is not to get all version labelsvoid addVersionLabel(String path, String versionName, String versionLabel) throws VersionException
path
- the object pathversionName
- the object versio name (1.0, 1.1, ...)versionLabel
- The new label to apply
VersionException
- when it is not possible to add a new version label to this
versionVersionIterator getAllVersions(String path) throws VersionException
path
- the object path
VersionException
- when it is not possible to retrieve all versionsVersion getRootVersion(String path) throws VersionException
path
- the object path
VersionException
- when it is not possible to get the root versionVersion getBaseVersion(String path) throws VersionException
path
- the object path
VersionException
- when it is not possible to get the last versionVersion getVersion(String path, String versionName) throws VersionException
path
- the object pathversionName
- the version name
VersionException
- when it is not possible to retrieve this particular versionvoid save() throws ObjectContentManagerException
ObjectContentManagerException
- when it is not possible to save all pending operation into
the JCR repovoid logout() throws ObjectContentManagerException
ObjectContentManagerException
- when it is not possible to logoutLock lock(String path, boolean isDeep, boolean isSessionScoped) throws LockedException
path
- path to saved object.isDeep
- is lock deep? See JCR spec: 8.4.3 Shallow and Deep LocksisSessionScoped
- is lock session scoped? See JCR spec: Session-scoped and
Open-scoped Locks
LockedException
- if path is locked (cannot lock same path again)void unlock(String path, String lockToken) throws IllegalUnlockException
path
- path to stored objectlockToken
- see JCR spec: 8.4.6 Lock Token; can be null
IllegalUnlockException
- throws if the current operation does not own the current lockboolean isLocked(String absPath)
absPath
-
true
if path lockedQueryManager getQueryManager()
void refresh(boolean keepChanges)
keepChanges
- void move(String srcPath, String destPath) throws ObjectContentManagerException
srcPath
- path of the object to movedestPath
- destination path
ObjectContentManagerException
void copy(String srcPath, String destPath) throws ObjectContentManagerException
srcPath
- path of the object to copydestPath
- destination path
ObjectContentManagerException
Session getSession()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |