public class ClientSession extends ClientObject implements Session
RemoteSession
interface. This class makes a remote session locally available using
the JCR Session
interface.Session
,
RemoteSession
Modifier and Type | Field and Description |
---|---|
protected RemoteSession |
remote
The adapted remote session.
|
ACTION_ADD_NODE, ACTION_READ, ACTION_REMOVE, ACTION_SET_PROPERTY
Constructor and Description |
---|
ClientSession(Repository repository,
RemoteSession remote,
LocalAdapterFactory factory)
Creates a client adapter for the given remote session.
|
Modifier and Type | Method and Description |
---|---|
void |
addLockToken(String name) |
void |
checkPermission(String path,
String actions) |
void |
exportDocumentView(String path,
ContentHandler handler,
boolean binaryAsLink,
boolean noRecurse)
Exports the XML document view of the specified repository location
to the given XML content handler.
|
void |
exportDocumentView(String path,
OutputStream output,
boolean binaryAsLink,
boolean noRecurse)
Exports the XML document view of the specified repository location
to the given output stream.
|
void |
exportSystemView(String path,
ContentHandler handler,
boolean binaryAsLink,
boolean noRecurse)
Exports the XML system view of the specified repository location
to the given XML content handler.
|
void |
exportSystemView(String path,
OutputStream output,
boolean binaryAsLink,
boolean noRecurse)
Exports the XML system view of the specified repository location
to the given output stream.
|
AccessControlManager |
getAccessControlManager() |
Object |
getAttribute(String name) |
String[] |
getAttributeNames() |
ContentHandler |
getImportContentHandler(String path,
int mode) |
Item |
getItem(String path) |
String[] |
getLockTokens() |
String |
getNamespacePrefix(String uri) |
String[] |
getNamespacePrefixes() |
String |
getNamespaceURI(String prefix) |
Node |
getNode(String path) |
Node |
getNodeByIdentifier(String id) |
Node |
getNodeByUUID(String uuid) |
Property |
getProperty(String path) |
Repository |
getRepository()
Returns the current repository without contacting the remote session.
|
RetentionManager |
getRetentionManager() |
Node |
getRootNode() |
String |
getUserID() |
ValueFactory |
getValueFactory()
Returns the
SerialValueFactory.getInstance() . |
Workspace |
getWorkspace() |
boolean |
hasCapability(String methodName,
Object target,
Object[] arguments) |
boolean |
hasPendingChanges() |
boolean |
hasPermission(String path,
String actions) |
Session |
impersonate(Credentials credentials) |
void |
importXML(String path,
InputStream xml,
int mode) |
boolean |
isLive() |
boolean |
itemExists(String path) |
void |
logout() |
void |
move(String from,
String to) |
boolean |
nodeExists(String path) |
boolean |
propertyExists(String path) |
void |
refresh(boolean keepChanges) |
void |
removeItem(String path) |
void |
removeLockToken(String name) |
void |
save() |
void |
setNamespacePrefix(String prefix,
String uri) |
getFactory, getItem, getNode, getNodeTypeArray
protected final RemoteSession remote
public ClientSession(Repository repository, RemoteSession remote, LocalAdapterFactory factory)
repository
- current repositoryremote
- remote repositoryfactory
- local adapter factorypublic Repository getRepository()
getRepository
in interface Session
public Object getAttribute(String name)
getAttribute
in interface Session
public String[] getAttributeNames()
getAttributeNames
in interface Session
public Workspace getWorkspace()
getWorkspace
in interface Session
public Session impersonate(Credentials credentials) throws RepositoryException
impersonate
in interface Session
RepositoryException
public Node getRootNode() throws RepositoryException
getRootNode
in interface Session
RepositoryException
public Node getNodeByIdentifier(String id) throws RepositoryException
getNodeByIdentifier
in interface Session
RepositoryException
public Node getNodeByUUID(String uuid) throws RepositoryException
getNodeByUUID
in interface Session
RepositoryException
public Item getItem(String path) throws RepositoryException
getItem
in interface Session
RepositoryException
public Node getNode(String path) throws RepositoryException
getNode
in interface Session
RepositoryException
public Property getProperty(String path) throws RepositoryException
getProperty
in interface Session
RepositoryException
public boolean itemExists(String path) throws RepositoryException
itemExists
in interface Session
RepositoryException
public boolean nodeExists(String path) throws RepositoryException
nodeExists
in interface Session
RepositoryException
public boolean propertyExists(String path) throws RepositoryException
propertyExists
in interface Session
RepositoryException
public void removeItem(String path) throws RepositoryException
removeItem
in interface Session
RepositoryException
public void move(String from, String to) throws RepositoryException
move
in interface Session
RepositoryException
public void save() throws RepositoryException
save
in interface Session
RepositoryException
public void refresh(boolean keepChanges) throws RepositoryException
refresh
in interface Session
RepositoryException
public boolean hasPendingChanges() throws RepositoryException
hasPendingChanges
in interface Session
RepositoryException
public ValueFactory getValueFactory()
SerialValueFactory.getInstance()
.
getValueFactory
in interface Session
public void checkPermission(String path, String actions) throws AccessControlException, RepositoryException
checkPermission
in interface Session
AccessControlException
RepositoryException
public boolean hasPermission(String path, String actions) throws RepositoryException
hasPermission
in interface Session
RepositoryException
public void importXML(String path, InputStream xml, int mode) throws IOException, RepositoryException
importXML
in interface Session
IOException
RepositoryException
public ContentHandler getImportContentHandler(String path, int mode) throws RepositoryException
getImportContentHandler
in interface Session
RepositoryException
public void setNamespacePrefix(String prefix, String uri) throws RepositoryException
setNamespacePrefix
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 String getNamespacePrefix(String uri) throws RepositoryException
getNamespacePrefix
in interface Session
RepositoryException
public void addLockToken(String name)
addLockToken
in interface Session
public String[] getLockTokens()
getLockTokens
in interface Session
public void removeLockToken(String name)
removeLockToken
in interface Session
public void exportSystemView(String path, ContentHandler handler, boolean binaryAsLink, boolean noRecurse) throws SAXException, RepositoryException
exportSystemView
in interface Session
SAXException
RepositoryException
public void exportSystemView(String path, OutputStream output, boolean binaryAsLink, boolean noRecurse) throws IOException, RepositoryException
exportSystemView
in interface Session
IOException
RepositoryException
public void exportDocumentView(String path, ContentHandler handler, boolean binaryAsLink, boolean noRecurse) throws SAXException, RepositoryException
exportDocumentView
in interface Session
SAXException
RepositoryException
public void exportDocumentView(String path, OutputStream output, boolean binaryAsLink, boolean noRecurse) throws IOException, RepositoryException
exportDocumentView
in interface Session
IOException
RepositoryException
public AccessControlManager getAccessControlManager() throws UnsupportedRepositoryOperationException, RepositoryException
getAccessControlManager
in interface Session
UnsupportedRepositoryOperationException
RepositoryException
public RetentionManager getRetentionManager() throws RepositoryException
getRetentionManager
in interface Session
RepositoryException
public boolean hasCapability(String methodName, Object target, Object[] arguments) throws RepositoryException
hasCapability
in interface Session
RepositoryException
Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.