|
ModeShape Distribution 3.0.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.modeshape.jcr.JcrSession
public class JcrSession
| Nested Class Summary | |
|---|---|
protected class |
JcrSession.JcrPreSave
Define the operations that are to be performed on all the nodes that were created or modified within this session. |
| Field Summary | |
|---|---|
protected JcrRepository |
repository
|
| Fields inherited from interface javax.jcr.Session |
|---|
ACTION_ADD_NODE, ACTION_READ, ACTION_REMOVE, ACTION_SET_PROPERTY |
| Constructor Summary | |
|---|---|
protected |
JcrSession(JcrRepository repository,
String workspaceName,
ExecutionContext context,
Map<String,Object> sessionAttributes,
boolean readOnly)
|
protected |
JcrSession(JcrSession original,
boolean readOnly)
|
| Method Summary | |
|---|---|
void |
addLockToken(String lockToken)
|
void |
checkPermission(String path,
String actions)
|
protected SchematicEntry |
entryForNode(NodeKey nodeKey)
|
void |
exportDocumentView(String absPath,
ContentHandler contentHandler,
boolean skipBinary,
boolean noRecurse)
|
void |
exportDocumentView(String absPath,
OutputStream out,
boolean skipBinary,
boolean noRecurse)
|
void |
exportSystemView(String absPath,
ContentHandler contentHandler,
boolean skipBinary,
boolean noRecurse)
|
void |
exportSystemView(String absPath,
OutputStream out,
boolean skipBinary,
boolean noRecurse)
|
AccessControlManager |
getAccessControlManager()
|
Object |
getAttribute(String name)
|
String[] |
getAttributeNames()
|
ContentHandler |
getImportContentHandler(String parentAbsPath,
int uuidBehavior)
|
org.modeshape.jcr.AbstractJcrItem |
getItem(String absPath)
|
String[] |
getLockTokens()
|
String |
getNamespacePrefix(String uri)
|
String[] |
getNamespacePrefixes()
|
String |
getNamespaceURI(String prefix)
|
org.modeshape.jcr.AbstractJcrNode |
getNode(String absPath)
|
org.modeshape.jcr.AbstractJcrNode |
getNodeByIdentifier(String id)
|
org.modeshape.jcr.AbstractJcrNode |
getNodeByUUID(String uuid)
Deprecated. |
Property |
getProperty(String absPath)
|
JcrRepository |
getRepository()
|
RetentionManager |
getRetentionManager()
|
org.modeshape.jcr.JcrRootNode |
getRootNode()
|
String |
getUserID()
|
JcrValueFactory |
getValueFactory()
|
org.modeshape.jcr.JcrWorkspace |
getWorkspace()
|
boolean |
hasCapability(String methodName,
Object target,
Object[] arguments)
Makes a "best effort" determination of whether the given method can be successfully called on the given target with the given arguments. |
boolean |
hasPendingChanges()
|
boolean |
hasPermission(String absPath,
String actions)
|
Session |
impersonate(Credentials credentials)
|
void |
importXML(String parentAbsPath,
InputStream in,
int uuidBehavior)
|
protected void |
initBaseVersionKeys()
|
protected void |
initOriginalVersionKeys()
|
boolean |
isAnonymous()
|
protected boolean |
isForeignKey(NodeKey key)
Checks if the node given key is foreign by comparing the source key & workspace key against the same keys from this session's root. |
static boolean |
isForeignKey(NodeKey key,
NodeKey rootKey)
Checks if the node given key is foreign by comparing the source key & workspace key against the same keys from this session's root. |
boolean |
isLive()
|
boolean |
itemExists(String absPath)
|
void |
logout()
|
void |
move(String srcAbsPath,
String destAbsPath)
|
protected boolean |
nodeExists(NodeKey key)
Utility method to determine if the node with the specified key still exists within the transient & persisted state. |
boolean |
nodeExists(String absPath)
|
protected String |
nodeIdentifier(NodeKey key)
Returns a string representing a node's identifier, based on whether the node is foreign or not. |
static String |
nodeIdentifier(NodeKey key,
NodeKey rootKey)
Returns a string representing a node's identifier, based on whether the node is foreign or not. |
boolean |
propertyExists(String absPath)
|
protected String |
readable(Path path)
|
protected String |
readableLocation(CachedNode node)
|
void |
refresh(boolean keepChanges)
|
void |
removeItem(String absPath)
|
void |
removeLockToken(String lockToken)
|
void |
save()
|
void |
setNamespacePrefix(String newPrefix,
String existingUri)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final JcrRepository repository
| Constructor Detail |
|---|
protected JcrSession(JcrRepository repository,
String workspaceName,
ExecutionContext context,
Map<String,Object> sessionAttributes,
boolean readOnly)
protected JcrSession(JcrSession original,
boolean readOnly)
| Method Detail |
|---|
protected SchematicEntry entryForNode(NodeKey nodeKey)
throws RepositoryException
RepositoryExceptionprotected final String readableLocation(CachedNode node)
protected final String readable(Path path)
public JcrRepository getRepository()
getRepository in interface Sessionpublic String getUserID()
getUserID in interface Sessionpublic boolean isAnonymous()
public String[] getAttributeNames()
getAttributeNames in interface Sessionpublic Object getAttribute(String name)
getAttribute in interface Sessionpublic org.modeshape.jcr.JcrWorkspace getWorkspace()
getWorkspace in interface Session
public org.modeshape.jcr.JcrRootNode getRootNode()
throws RepositoryException
getRootNode in interface SessionRepositoryException
public Session impersonate(Credentials credentials)
throws LoginException,
RepositoryException
impersonate in interface SessionLoginException
RepositoryException
@Deprecated
public org.modeshape.jcr.AbstractJcrNode getNodeByUUID(String uuid)
throws ItemNotFoundException,
RepositoryException
getNodeByUUID in interface SessionItemNotFoundException
RepositoryException
public org.modeshape.jcr.AbstractJcrNode getNodeByIdentifier(String id)
throws ItemNotFoundException,
RepositoryException
getNodeByIdentifier in interface SessionItemNotFoundException
RepositoryException
public org.modeshape.jcr.AbstractJcrNode getNode(String absPath)
throws PathNotFoundException,
RepositoryException
getNode in interface SessionPathNotFoundException
RepositoryException
public org.modeshape.jcr.AbstractJcrItem getItem(String absPath)
throws PathNotFoundException,
RepositoryException
getItem in interface SessionPathNotFoundException
RepositoryException
public Property getProperty(String absPath)
throws PathNotFoundException,
RepositoryException
getProperty in interface SessionPathNotFoundException
RepositoryException
public boolean itemExists(String absPath)
throws RepositoryException
itemExists in interface SessionRepositoryException
public void removeItem(String absPath)
throws VersionException,
LockException,
ConstraintViolationException,
AccessDeniedException,
RepositoryException
removeItem in interface SessionVersionException
LockException
ConstraintViolationException
AccessDeniedException
RepositoryException
public boolean nodeExists(String absPath)
throws RepositoryException
nodeExists in interface SessionRepositoryExceptionprotected boolean nodeExists(NodeKey key)
key - the key of the node; may not be null
public boolean propertyExists(String absPath)
throws RepositoryException
propertyExists in interface SessionRepositoryException
public void move(String srcAbsPath,
String destAbsPath)
throws ItemExistsException,
PathNotFoundException,
VersionException,
ConstraintViolationException,
LockException,
RepositoryException
move in interface SessionItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
RepositoryException
public void save()
throws AccessDeniedException,
ItemExistsException,
ReferentialIntegrityException,
ConstraintViolationException,
InvalidItemStateException,
VersionException,
LockException,
NoSuchNodeTypeException,
RepositoryException
save in interface SessionAccessDeniedException
ItemExistsException
ReferentialIntegrityException
ConstraintViolationException
InvalidItemStateException
VersionException
LockException
NoSuchNodeTypeException
RepositoryException
public void refresh(boolean keepChanges)
throws RepositoryException
refresh in interface SessionRepositoryException
public boolean hasPendingChanges()
throws RepositoryException
hasPendingChanges in interface SessionRepositoryException
public JcrValueFactory getValueFactory()
throws UnsupportedRepositoryOperationException,
RepositoryException
getValueFactory in interface SessionUnsupportedRepositoryOperationException
RepositoryException
public void checkPermission(String path,
String actions)
checkPermission in interface Session
public boolean hasPermission(String absPath,
String actions)
throws RepositoryException
hasPermission in interface SessionRepositoryException
public boolean hasCapability(String methodName,
Object target,
Object[] arguments)
throws RepositoryException
false indicates that the method would not succeed. A return value of
true indicates that the method might succeed.
hasCapability in interface SessionmethodName - the method to invoke; may not be nulltarget - the object on which to invoke it; may not be nullarguments - the arguments to pass to the method; varies depending on the method
IllegalArgumentException
RepositoryException
public ContentHandler getImportContentHandler(String parentAbsPath,
int uuidBehavior)
throws PathNotFoundException,
ConstraintViolationException,
VersionException,
LockException,
RepositoryException
getImportContentHandler in interface SessionPathNotFoundException
ConstraintViolationException
VersionException
LockException
RepositoryExceptionprotected void initBaseVersionKeys()
protected void initOriginalVersionKeys()
public void importXML(String parentAbsPath,
InputStream in,
int uuidBehavior)
throws IOException,
PathNotFoundException,
ItemExistsException,
ConstraintViolationException,
VersionException,
InvalidSerializedDataException,
LockException,
RepositoryException
importXML in interface SessionIOException
PathNotFoundException
ItemExistsException
ConstraintViolationException
VersionException
InvalidSerializedDataException
LockException
RepositoryException
public void exportSystemView(String absPath,
ContentHandler contentHandler,
boolean skipBinary,
boolean noRecurse)
throws PathNotFoundException,
SAXException,
RepositoryException
exportSystemView in interface SessionPathNotFoundException
SAXException
RepositoryException
public void exportSystemView(String absPath,
OutputStream out,
boolean skipBinary,
boolean noRecurse)
throws IOException,
PathNotFoundException,
RepositoryException
exportSystemView in interface SessionIOException
PathNotFoundException
RepositoryException
public void exportDocumentView(String absPath,
ContentHandler contentHandler,
boolean skipBinary,
boolean noRecurse)
throws PathNotFoundException,
SAXException,
RepositoryException
exportDocumentView in interface SessionPathNotFoundException
SAXException
RepositoryException
public void exportDocumentView(String absPath,
OutputStream out,
boolean skipBinary,
boolean noRecurse)
throws IOException,
PathNotFoundException,
RepositoryException
exportDocumentView in interface SessionIOException
PathNotFoundException
RepositoryException
public String getNamespacePrefix(String uri)
throws RepositoryException
getNamespacePrefix in interface SessionRepositoryException
public String[] getNamespacePrefixes()
throws RepositoryException
getNamespacePrefixes in interface SessionRepositoryException
public String getNamespaceURI(String prefix)
throws RepositoryException
getNamespaceURI in interface SessionRepositoryException
public void setNamespacePrefix(String newPrefix,
String existingUri)
throws NamespaceException,
RepositoryException
setNamespacePrefix in interface SessionNamespaceException
RepositoryExceptionpublic void logout()
logout in interface Sessionpublic boolean isLive()
isLive in interface Sessionpublic void addLockToken(String lockToken)
addLockToken in interface Sessionpublic String[] getLockTokens()
getLockTokens in interface Sessionpublic void removeLockToken(String lockToken)
removeLockToken in interface Session
public AccessControlManager getAccessControlManager()
throws UnsupportedRepositoryOperationException,
RepositoryException
getAccessControlManager in interface SessionUnsupportedRepositoryOperationException
RepositoryException
public RetentionManager getRetentionManager()
throws UnsupportedRepositoryOperationException,
RepositoryException
getRetentionManager in interface SessionUnsupportedRepositoryOperationException
RepositoryException
public static boolean isForeignKey(NodeKey key,
NodeKey rootKey)
key - the node key; may be nullrootKey - the key of the root node in the workspace; may not be null
public static String nodeIdentifier(NodeKey key,
NodeKey rootKey)
key - the node key; may be nullrootKey - the key of the root node in the workspace; may not be null
Node.getIdentifier()protected final boolean isForeignKey(NodeKey key)
key - the node key; may be null
protected final String nodeIdentifier(NodeKey key)
key - the node key; may be null
Node.getIdentifier()public String toString()
toString in class Object
|
ModeShape Distribution 3.0.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||