public final class DefaultBatchSession extends Object implements BatchSession
BatchSession interface. This is quite a massive class due to the complexity of
the JCR Session, Node, and Property interfacesACTION_ADD_NODE, ACTION_READ, ACTION_REMOVE, ACTION_SET_PROPERTY| Constructor and Description |
|---|
DefaultBatchSession(Session session) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(BatchSessionListener listener)
Add a
BatchSessionListener to the session, to receive notifications when the session auto-saves |
void |
addLockToken(String s) |
void |
checkPermission(String s,
String s2) |
void |
commit()
Immediately re-enables session saves and autoSaves, and then saves any uncommitted changes.
|
boolean |
disableAutoSave()
Disables autoSave even when the batchSize is exceeded.
|
boolean |
disableSessionSave()
Ignore calls to session saves.
|
boolean |
enableAutoSave()
Re-enables autoSave for future changes after a call to
BatchSession.disableAutoSave(). |
boolean |
enableSessionSave()
Re-enable calls to session saves after a call to
BatchSession.disableSessionSave() |
void |
exportDocumentView(String s,
ContentHandler contentHandler,
boolean b,
boolean b2) |
void |
exportDocumentView(String s,
OutputStream outputStream,
boolean b,
boolean b2) |
void |
exportSystemView(String s,
ContentHandler contentHandler,
boolean b,
boolean b2) |
void |
exportSystemView(String s,
OutputStream outputStream,
boolean b,
boolean b2) |
AccessControlManager |
getAccessControlManager() |
Object |
getAttribute(String name) |
String[] |
getAttributeNames() |
int |
getBatchSize() |
Set<String> |
getCommittedPaths() |
ContentHandler |
getImportContentHandler(String s,
int i) |
Item |
getItem(String path) |
String[] |
getLockTokens() |
String |
getNamespacePrefix(String s) |
String[] |
getNamespacePrefixes() |
String |
getNamespaceURI(String s) |
Node |
getNode(String path) |
Node |
getNodeByIdentifier(String identifier) |
Node |
getNodeByUUID(String uuid) |
Property |
getProperty(String path) |
Repository |
getRepository() |
RetentionManager |
getRetentionManager() |
Node |
getRootNode() |
Session |
getSession() |
int |
getTotalSaves() |
Set<String> |
getUncommittedPaths() |
String |
getUserID() |
ValueFactory |
getValueFactory() |
Workspace |
getWorkspace() |
boolean |
hasCapability(String s,
Object o,
Object[] objects) |
boolean |
hasPendingChanges() |
boolean |
hasPermission(String s,
String s2) |
Session |
impersonate(Credentials credentials) |
void |
importXML(String s,
InputStream inputStream,
int i) |
boolean |
isAutoSaveEnabled() |
boolean |
isLive() |
boolean |
isSessionSaveEnabled() |
boolean |
itemExists(String path) |
void |
logout() |
void |
move(String fromPath,
String toPath) |
boolean |
nodeExists(String path) |
boolean |
propertyExists(String path) |
void |
purge(String path)
Recursively removes the subgraph of Nodes and related
Version Nodes,
descending from path, by traversing depth-first to the leaves and removing each node
on the way up. |
void |
refresh(boolean preserveChanges) |
void |
removeItem(String path) |
void |
removeListener(BatchSessionListener listener)
Removes a
BatchSessionListener from the session. |
void |
removeLockToken(String s) |
void |
save() |
void |
setBatchSize(int batchSize)
The batch size determines when the BatchSession will auto-save.
|
void |
setNamespacePrefix(String s,
String s2) |
public DefaultBatchSession(Session session)
public boolean disableSessionSave()
BatchSessionBatchSession.enableSessionSave() to re-enable
Session.save()disableSessionSave in interface BatchSessionpublic boolean enableSessionSave()
BatchSessionBatchSession.disableSessionSave()enableSessionSave in interface BatchSessionpublic boolean disableAutoSave()
BatchSessionBatchSession.enableAutoSave()
to re-enable autoSaves.disableAutoSave in interface BatchSessionpublic boolean enableAutoSave()
BatchSessionBatchSession.disableAutoSave().enableAutoSave in interface BatchSessionpublic boolean isSessionSaveEnabled()
isSessionSaveEnabled in interface BatchSessionSession.save() will actually do anythingpublic boolean isAutoSaveEnabled()
isAutoSaveEnabled in interface BatchSessionpublic void commit()
throws RepositoryException
BatchSessioncommit in interface BatchSessionRepositoryExceptionpublic void save()
throws RepositoryException
save in interface SessionRepositoryExceptionpublic void refresh(boolean preserveChanges)
throws RepositoryException
refresh in interface SessionRepositoryExceptionpublic Session getSession()
getSession in interface BatchSessionpublic void purge(String path) throws RepositoryException
BatchSessionVersion Nodes,
descending from path, by traversing depth-first to the leaves and removing each node
on the way up. Versions are marked for removal, but are only removed after a session save because
version modifications are workspace-write operations, not session-write operations.purge in interface BatchSessionpath - the node at the top of the subgraphRepositoryException - if anything goes wrongpublic void addListener(BatchSessionListener listener)
BatchSessionBatchSessionListener to the session, to receive notifications when the session auto-savesaddListener in interface BatchSessionlistener - the listener to be addedpublic void removeListener(BatchSessionListener listener)
BatchSessionBatchSessionListener from the session.removeListener in interface BatchSessionlistener - the listener to be removed.public int getBatchSize()
getBatchSize in interface BatchSessionpublic void setBatchSize(int batchSize)
BatchSessionsetBatchSize in interface BatchSessionpublic int getTotalSaves()
getTotalSaves in interface BatchSessionpublic Set<String> getCommittedPaths()
getCommittedPaths in interface BatchSessionpublic Set<String> getUncommittedPaths()
getUncommittedPaths in interface BatchSessionpublic void move(String fromPath, String toPath) throws RepositoryException
move in interface SessionRepositoryExceptionpublic void removeItem(String path) throws RepositoryException
removeItem in interface SessionRepositoryExceptionpublic ContentHandler getImportContentHandler(String s, int i) throws RepositoryException
getImportContentHandler in interface SessionRepositoryExceptionpublic void importXML(String s, InputStream inputStream, int i) throws IOException, RepositoryException
importXML in interface SessionIOExceptionRepositoryExceptionpublic void setNamespacePrefix(String s, String s2) throws RepositoryException
setNamespacePrefix in interface SessionRepositoryExceptionpublic Node getRootNode() throws RepositoryException
getRootNode in interface SessionRepositoryExceptionpublic Node getNodeByUUID(String uuid) throws RepositoryException
getNodeByUUID in interface SessionRepositoryExceptionpublic Node getNodeByIdentifier(String identifier) throws RepositoryException
getNodeByIdentifier in interface SessionRepositoryExceptionpublic Item getItem(String path) throws RepositoryException
getItem in interface SessionRepositoryExceptionpublic Node getNode(String path) throws RepositoryException
getNode in interface SessionRepositoryExceptionpublic Property getProperty(String path) throws RepositoryException
getProperty in interface SessionRepositoryExceptionpublic Repository getRepository()
getRepository in interface Sessionpublic String[] getAttributeNames()
getAttributeNames in interface Sessionpublic Object getAttribute(String name)
getAttribute in interface Sessionpublic Workspace getWorkspace()
getWorkspace in interface Sessionpublic Session impersonate(Credentials credentials) throws RepositoryException
impersonate in interface SessionRepositoryExceptionpublic boolean itemExists(String path) throws RepositoryException
itemExists in interface SessionRepositoryExceptionpublic boolean nodeExists(String path) throws RepositoryException
nodeExists in interface SessionRepositoryExceptionpublic boolean propertyExists(String path) throws RepositoryException
propertyExists in interface SessionRepositoryExceptionpublic boolean hasPendingChanges()
throws RepositoryException
hasPendingChanges in interface SessionRepositoryExceptionpublic ValueFactory getValueFactory() throws RepositoryException
getValueFactory in interface SessionRepositoryExceptionpublic boolean hasPermission(String s, String s2) throws RepositoryException
hasPermission in interface SessionRepositoryExceptionpublic void checkPermission(String s, String s2) throws AccessControlException, RepositoryException
checkPermission in interface SessionAccessControlExceptionRepositoryExceptionpublic boolean hasCapability(String s, Object o, Object[] objects) throws RepositoryException
hasCapability in interface SessionRepositoryExceptionpublic void exportSystemView(String s, ContentHandler contentHandler, boolean b, boolean b2) throws SAXException, RepositoryException
exportSystemView in interface SessionSAXExceptionRepositoryExceptionpublic void exportSystemView(String s, OutputStream outputStream, boolean b, boolean b2) throws IOException, RepositoryException
exportSystemView in interface SessionIOExceptionRepositoryExceptionpublic void exportDocumentView(String s, ContentHandler contentHandler, boolean b, boolean b2) throws SAXException, RepositoryException
exportDocumentView in interface SessionSAXExceptionRepositoryExceptionpublic void exportDocumentView(String s, OutputStream outputStream, boolean b, boolean b2) throws IOException, RepositoryException
exportDocumentView in interface SessionIOExceptionRepositoryExceptionpublic String[] getNamespacePrefixes() throws RepositoryException
getNamespacePrefixes in interface SessionRepositoryExceptionpublic String getNamespaceURI(String s) throws RepositoryException
getNamespaceURI in interface SessionRepositoryExceptionpublic String getNamespacePrefix(String s) throws RepositoryException
getNamespacePrefix in interface SessionRepositoryExceptionpublic void addLockToken(String s)
addLockToken in interface Sessionpublic void removeLockToken(String s)
removeLockToken in interface Sessionpublic String[] getLockTokens()
getLockTokens in interface Sessionpublic AccessControlManager getAccessControlManager() throws RepositoryException
getAccessControlManager in interface SessionRepositoryExceptionpublic RetentionManager getRetentionManager() throws RepositoryException
getRetentionManager in interface SessionRepositoryExceptionCopyright © 2013. All Rights Reserved.