|
ModeShape Distribution 3.2.0.Final | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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. |
protected class |
JcrSession.SystemSessionCache
|
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)
|
static NodeKey |
createNodeKeyFromIdentifier(String identifier,
NodeKey rootKey)
Determine if the supplied string represents just the node's identifier or whether it is a
string representation of a NodeKey. |
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. |
org.modeshape.jcr.AbstractJcrNode |
getNonSystemNodeByIdentifier(String id)
A variant of the standard getNodeByIdentifier(String) method that does not find nodes within the system
area. |
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
RepositoryException
protected final String readableLocation(CachedNode node)
protected final String readable(Path path)
public JcrRepository getRepository()
getRepository
in interface Session
public String getUserID()
getUserID
in interface Session
public boolean isAnonymous()
public String[] getAttributeNames()
getAttributeNames
in interface Session
public Object getAttribute(String name)
getAttribute
in interface Session
public org.modeshape.jcr.JcrWorkspace getWorkspace()
getWorkspace
in interface Session
public org.modeshape.jcr.JcrRootNode getRootNode() throws RepositoryException
getRootNode
in interface Session
RepositoryException
public Session impersonate(Credentials credentials) throws LoginException, RepositoryException
impersonate
in interface Session
LoginException
RepositoryException
@Deprecated public org.modeshape.jcr.AbstractJcrNode getNodeByUUID(String uuid) throws ItemNotFoundException, RepositoryException
getNodeByUUID
in interface Session
ItemNotFoundException
RepositoryException
public org.modeshape.jcr.AbstractJcrNode getNodeByIdentifier(String id) throws ItemNotFoundException, RepositoryException
getNodeByIdentifier
in interface Session
ItemNotFoundException
RepositoryException
public org.modeshape.jcr.AbstractJcrNode getNonSystemNodeByIdentifier(String id) throws ItemNotFoundException, RepositoryException
getNodeByIdentifier(String)
method that does not find nodes within the system
area. This is often needed by the JcrVersionManager
functionality.
id
- the string identifier
ItemNotFoundException
- if a node cannot be found in the non-system content of the repository
RepositoryException
- if there is another problemgetNodeByIdentifier(String)
public org.modeshape.jcr.AbstractJcrNode getNode(String absPath) throws PathNotFoundException, RepositoryException
getNode
in interface Session
PathNotFoundException
RepositoryException
public org.modeshape.jcr.AbstractJcrItem getItem(String absPath) throws PathNotFoundException, RepositoryException
getItem
in interface Session
PathNotFoundException
RepositoryException
public Property getProperty(String absPath) throws PathNotFoundException, RepositoryException
getProperty
in interface Session
PathNotFoundException
RepositoryException
public boolean itemExists(String absPath) throws RepositoryException
itemExists
in interface Session
RepositoryException
public void removeItem(String absPath) throws VersionException, LockException, ConstraintViolationException, AccessDeniedException, RepositoryException
removeItem
in interface Session
VersionException
LockException
ConstraintViolationException
AccessDeniedException
RepositoryException
public boolean nodeExists(String absPath) throws RepositoryException
nodeExists
in interface Session
RepositoryException
protected boolean nodeExists(NodeKey key)
key
- the key of the node; may not be null
public boolean propertyExists(String absPath) throws RepositoryException
propertyExists
in interface Session
RepositoryException
public void move(String srcAbsPath, String destAbsPath) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, RepositoryException
move
in interface Session
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
RepositoryException
public void save() throws AccessDeniedException, ItemExistsException, ReferentialIntegrityException, ConstraintViolationException, InvalidItemStateException, VersionException, LockException, NoSuchNodeTypeException, RepositoryException
save
in interface Session
AccessDeniedException
ItemExistsException
ReferentialIntegrityException
ConstraintViolationException
InvalidItemStateException
VersionException
LockException
NoSuchNodeTypeException
RepositoryException
public void refresh(boolean keepChanges) throws RepositoryException
refresh
in interface Session
RepositoryException
public boolean hasPendingChanges() throws RepositoryException
hasPendingChanges
in interface Session
RepositoryException
public JcrValueFactory getValueFactory() throws UnsupportedRepositoryOperationException, RepositoryException
getValueFactory
in interface Session
UnsupportedRepositoryOperationException
RepositoryException
public void checkPermission(String path, String actions)
checkPermission
in interface Session
public boolean hasPermission(String absPath, String actions) throws RepositoryException
hasPermission
in interface Session
RepositoryException
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 Session
methodName
- 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 Session
PathNotFoundException
ConstraintViolationException
VersionException
LockException
RepositoryException
protected 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 Session
IOException
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 Session
PathNotFoundException
SAXException
RepositoryException
public void exportSystemView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse) throws IOException, PathNotFoundException, RepositoryException
exportSystemView
in interface Session
IOException
PathNotFoundException
RepositoryException
public void exportDocumentView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse) throws PathNotFoundException, SAXException, RepositoryException
exportDocumentView
in interface Session
PathNotFoundException
SAXException
RepositoryException
public void exportDocumentView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse) throws IOException, PathNotFoundException, RepositoryException
exportDocumentView
in interface Session
IOException
PathNotFoundException
RepositoryException
public String getNamespacePrefix(String uri) throws RepositoryException
getNamespacePrefix
in interface Session
RepositoryException
public String[] getNamespacePrefixes() throws RepositoryException
getNamespacePrefixes
in interface Session
RepositoryException
public String getNamespaceURI(String prefix) throws RepositoryException
getNamespaceURI
in interface Session
RepositoryException
public void setNamespacePrefix(String newPrefix, String existingUri) throws NamespaceException, RepositoryException
setNamespacePrefix
in interface Session
NamespaceException
RepositoryException
public void logout()
logout
in interface Session
public boolean isLive()
isLive
in interface Session
public void addLockToken(String lockToken)
addLockToken
in interface Session
public String[] getLockTokens()
getLockTokens
in interface Session
public void removeLockToken(String lockToken)
removeLockToken
in interface Session
public AccessControlManager getAccessControlManager() throws UnsupportedRepositoryOperationException, RepositoryException
getAccessControlManager
in interface Session
UnsupportedRepositoryOperationException
RepositoryException
public RetentionManager getRetentionManager() throws UnsupportedRepositoryOperationException, RepositoryException
getRetentionManager
in interface Session
UnsupportedRepositoryOperationException
RepositoryException
public static NodeKey createNodeKeyFromIdentifier(String identifier, NodeKey rootKey)
node's identifier
or whether it is a
string representation of a NodeKey. If it is just the node's identifier, then the NodeKey is created by using the same
source key
and workspace key
from the supplied root node.
identifier
- the identifier string; may not be nullrootKey
- the node of the root in the workspace; may not be null
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.2.0.Final | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |