| Modifier and Type | Class and Description |
|---|---|
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 |
| Modifier and Type | Field and Description |
|---|---|
protected JcrRepository |
repository |
ACTION_ADD_NODE, ACTION_READ, ACTION_REMOVE, ACTION_SET_PROPERTY| Modifier | Constructor and Description |
|---|---|
protected |
JcrSession(JcrRepository repository,
String workspaceName,
ExecutionContext context,
Map<String,Object> sessionAttributes,
boolean readOnly) |
protected |
JcrSession(JcrSession original,
boolean readOnly) |
| Modifier and Type | Method and Description |
|---|---|
protected long |
aclAdded(long count) |
protected long |
aclChangesCount() |
protected long |
aclRemoved(long count) |
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. |
String |
decode(String localName)
Evaluate a local name and replace any characters that were previously
encoded. |
String |
encode(String localName)
Evaluate a local name and replace any characters that are not allowed within the local names of nodes and properties.
|
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) |
protected org.modeshape.jcr.AbstractJcrNode |
getNode(String absPath,
boolean accessControlScope) |
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 |
isReadOnly() |
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) |
protected void |
releaseCachedNode(org.modeshape.jcr.AbstractJcrNode node) |
void |
removeItem(String absPath) |
void |
removeLockToken(String lockToken) |
void |
save() |
boolean |
sequence(String sequencerName,
Property inputProperty,
Node outputNode)
Sequence the specified property using the named sequencer, and place the generated output at the specified location using
this session.
|
void |
setNamespacePrefix(String newPrefix,
String existingUri) |
String |
toString() |
protected final JcrRepository repository
protected JcrSession(JcrRepository repository, String workspaceName, ExecutionContext context, Map<String,Object> sessionAttributes, boolean readOnly)
protected JcrSession(JcrSession original, boolean readOnly)
public final boolean isReadOnly()
protected final String readableLocation(CachedNode node)
protected final long aclChangesCount()
protected final long aclAdded(long count)
protected final long aclRemoved(long count)
protected void releaseCachedNode(org.modeshape.jcr.AbstractJcrNode node)
public JcrRepository getRepository()
getRepository 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 Sessionpublic org.modeshape.jcr.JcrRootNode getRootNode()
throws RepositoryException
getRootNode in interface SessionRepositoryExceptionpublic Session impersonate(Credentials credentials) throws LoginException, RepositoryException
impersonate in interface SessionLoginExceptionRepositoryException@Deprecated public org.modeshape.jcr.AbstractJcrNode getNodeByUUID(String uuid) throws ItemNotFoundException, RepositoryException
getNodeByUUID in interface SessionItemNotFoundExceptionRepositoryExceptionpublic org.modeshape.jcr.AbstractJcrNode getNodeByIdentifier(String id) throws ItemNotFoundException, RepositoryException
getNodeByIdentifier in interface SessionItemNotFoundExceptionRepositoryExceptionpublic 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 identifierItemNotFoundException - if a node cannot be found in the non-system content of the repositoryRepositoryException - if there is another problemgetNodeByIdentifier(String)public org.modeshape.jcr.AbstractJcrNode getNode(String absPath) throws PathNotFoundException, RepositoryException
getNode in interface SessionPathNotFoundExceptionRepositoryExceptionprotected org.modeshape.jcr.AbstractJcrNode getNode(String absPath, boolean accessControlScope) throws PathNotFoundException, RepositoryException
public org.modeshape.jcr.AbstractJcrItem getItem(String absPath) throws PathNotFoundException, RepositoryException
getItem in interface SessionPathNotFoundExceptionRepositoryExceptionpublic Property getProperty(String absPath) throws PathNotFoundException, RepositoryException
getProperty in interface SessionPathNotFoundExceptionRepositoryExceptionpublic boolean itemExists(String absPath) throws RepositoryException
itemExists in interface SessionRepositoryExceptionpublic void removeItem(String absPath) throws VersionException, LockException, ConstraintViolationException, AccessDeniedException, RepositoryException
removeItem in interface SessionVersionExceptionLockExceptionConstraintViolationExceptionAccessDeniedExceptionRepositoryExceptionpublic boolean nodeExists(String absPath) throws RepositoryException
nodeExists in interface SessionRepositoryExceptionprotected boolean nodeExists(NodeKey key)
key - the key of the node; may not be nullpublic boolean propertyExists(String absPath) throws RepositoryException
propertyExists in interface SessionRepositoryExceptionpublic void move(String srcAbsPath, String destAbsPath) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, RepositoryException
move in interface SessionItemExistsExceptionPathNotFoundExceptionVersionExceptionConstraintViolationExceptionLockExceptionRepositoryExceptionpublic void save()
throws AccessDeniedException,
ItemExistsException,
ReferentialIntegrityException,
ConstraintViolationException,
InvalidItemStateException,
VersionException,
LockException,
NoSuchNodeTypeException,
RepositoryException
public void refresh(boolean keepChanges)
throws RepositoryException
refresh in interface SessionRepositoryExceptionpublic boolean hasPendingChanges()
throws RepositoryException
hasPendingChanges in interface SessionRepositoryExceptionpublic JcrValueFactory getValueFactory() throws RepositoryException
getValueFactory in interface SessionRepositoryExceptionpublic void checkPermission(String path, String actions)
checkPermission in interface Sessionpublic boolean hasPermission(String absPath, String actions) throws RepositoryException
hasPermission in interface SessionRepositoryExceptionpublic 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 methodIllegalArgumentExceptionRepositoryExceptionpublic ContentHandler getImportContentHandler(String parentAbsPath, int uuidBehavior) throws PathNotFoundException, ConstraintViolationException, VersionException, LockException, RepositoryException
getImportContentHandler in interface SessionPathNotFoundExceptionConstraintViolationExceptionVersionExceptionLockExceptionRepositoryExceptionprotected 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 SessionIOExceptionPathNotFoundExceptionItemExistsExceptionConstraintViolationExceptionVersionExceptionInvalidSerializedDataExceptionLockExceptionRepositoryExceptionpublic void exportSystemView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse) throws PathNotFoundException, SAXException, RepositoryException
exportSystemView in interface SessionPathNotFoundExceptionSAXExceptionRepositoryExceptionpublic void exportSystemView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse) throws IOException, PathNotFoundException, RepositoryException
exportSystemView in interface SessionIOExceptionPathNotFoundExceptionRepositoryExceptionpublic void exportDocumentView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse) throws PathNotFoundException, SAXException, RepositoryException
exportDocumentView in interface SessionPathNotFoundExceptionSAXExceptionRepositoryExceptionpublic void exportDocumentView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse) throws IOException, PathNotFoundException, RepositoryException
exportDocumentView in interface SessionIOExceptionPathNotFoundExceptionRepositoryExceptionpublic String getNamespacePrefix(String uri) throws RepositoryException
getNamespacePrefix in interface SessionRepositoryExceptionpublic String[] getNamespacePrefixes() throws RepositoryException
getNamespacePrefixes in interface SessionRepositoryExceptionpublic String getNamespaceURI(String prefix) throws RepositoryException
getNamespaceURI in interface SessionRepositoryExceptionpublic void setNamespacePrefix(String newPrefix, String existingUri) throws NamespaceException, RepositoryException
setNamespacePrefix in interface SessionNamespaceExceptionRepositoryExceptionpublic void addLockToken(String lockToken)
addLockToken in interface Sessionpublic String[] getLockTokens()
getLockTokens in interface Sessionpublic void removeLockToken(String lockToken)
removeLockToken in interface Sessionpublic AccessControlManager getAccessControlManager()
getAccessControlManager in interface Sessionpublic RetentionManager getRetentionManager() throws UnsupportedRepositoryOperationException, RepositoryException
getRetentionManager in interface SessionUnsupportedRepositoryOperationExceptionRepositoryExceptionpublic 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 nullpublic 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 nullpublic 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 nullNode.getIdentifier()protected final boolean isForeignKey(NodeKey key)
key - the node key; may be nullprotected final String nodeIdentifier(NodeKey key)
key - the node key; may be nullNode.getIdentifier()public boolean sequence(String sequencerName, Property inputProperty, Node outputNode) throws RepositoryException
SessionIt is suggested that this method be used on inputs that the sequencer is not configured to process automatically, otherwise ModeShape will also sequence the same property. If your application is to only manually sequence, simply configure each sequencer without a path expression or with a path expression that will never apply to the manually-sequenced nodes.
sequencerName - the name of the configured sequencer that should be executedinputProperty - the property that was changed and that should be used as the input; never nulloutputNode - the node that represents the output for the derived information; never null, and will either be
new if the output is being placed outside of the selected node, or will not be new when the
output is to be placed on the selected input nodesequencerName is null or does not match a configured sequencerRepositoryException - if there was a problem with the sequencerpublic String decode(String localName)
Sessionencoded.localName - the local name to be decoded; can be null or emptynull if the input was nullSession.encode(String)public String encode(String localName)
SessionlocalName - the local name to be encoded; can be null or emptynull if the input was nullSession.move(String, String),
Node.addNode(String),
Node.addNode(String, String)Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.