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()
BatchSession
BatchSession.enableSessionSave()
to re-enable
Session.save()disableSessionSave
in interface BatchSession
public boolean enableSessionSave()
BatchSession
BatchSession.disableSessionSave()
enableSessionSave
in interface BatchSession
public boolean disableAutoSave()
BatchSession
BatchSession.enableAutoSave()
to re-enable autoSaves.disableAutoSave
in interface BatchSession
public boolean enableAutoSave()
BatchSession
BatchSession.disableAutoSave()
.enableAutoSave
in interface BatchSession
public boolean isSessionSaveEnabled()
isSessionSaveEnabled
in interface BatchSession
Session.save()
will actually do anythingpublic boolean isAutoSaveEnabled()
isAutoSaveEnabled
in interface BatchSession
public void commit() throws RepositoryException
BatchSession
commit
in interface BatchSession
RepositoryException
public void save() throws RepositoryException
save
in interface Session
RepositoryException
public void refresh(boolean preserveChanges) throws RepositoryException
refresh
in interface Session
RepositoryException
public Session getSession()
getSession
in interface BatchSession
public void purge(String path) throws RepositoryException
BatchSession
Version
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 BatchSession
path
- the node at the top of the subgraphRepositoryException
- if anything goes wrongpublic void addListener(BatchSessionListener listener)
BatchSession
BatchSessionListener
to the session, to receive notifications when the session auto-savesaddListener
in interface BatchSession
listener
- the listener to be addedpublic void removeListener(BatchSessionListener listener)
BatchSession
BatchSessionListener
from the session.removeListener
in interface BatchSession
listener
- the listener to be removed.public int getBatchSize()
getBatchSize
in interface BatchSession
public void setBatchSize(int batchSize)
BatchSession
setBatchSize
in interface BatchSession
public int getTotalSaves()
getTotalSaves
in interface BatchSession
public Set<String> getCommittedPaths()
getCommittedPaths
in interface BatchSession
public Set<String> getUncommittedPaths()
getUncommittedPaths
in interface BatchSession
public void move(String fromPath, String toPath) throws RepositoryException
move
in interface Session
RepositoryException
public void removeItem(String path) throws RepositoryException
removeItem
in interface Session
RepositoryException
public ContentHandler getImportContentHandler(String s, int i) throws RepositoryException
getImportContentHandler
in interface Session
RepositoryException
public void importXML(String s, InputStream inputStream, int i) throws IOException, RepositoryException
importXML
in interface Session
IOException
RepositoryException
public void setNamespacePrefix(String s, String s2) throws RepositoryException
setNamespacePrefix
in interface Session
RepositoryException
public Node getRootNode() throws RepositoryException
getRootNode
in interface Session
RepositoryException
public Node getNodeByUUID(String uuid) throws RepositoryException
getNodeByUUID
in interface Session
RepositoryException
public Node getNodeByIdentifier(String identifier) throws RepositoryException
getNodeByIdentifier
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 Repository getRepository()
getRepository
in interface Session
public String[] getAttributeNames()
getAttributeNames
in interface Session
public Object getAttribute(String name)
getAttribute
in interface Session
public Workspace getWorkspace()
getWorkspace
in interface Session
public Session impersonate(Credentials credentials) throws RepositoryException
impersonate
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 boolean hasPendingChanges() throws RepositoryException
hasPendingChanges
in interface Session
RepositoryException
public ValueFactory getValueFactory() throws RepositoryException
getValueFactory
in interface Session
RepositoryException
public boolean hasPermission(String s, String s2) throws RepositoryException
hasPermission
in interface Session
RepositoryException
public void checkPermission(String s, String s2) throws AccessControlException, RepositoryException
checkPermission
in interface Session
AccessControlException
RepositoryException
public boolean hasCapability(String s, Object o, Object[] objects) throws RepositoryException
hasCapability
in interface Session
RepositoryException
public void exportSystemView(String s, ContentHandler contentHandler, boolean b, boolean b2) throws SAXException, RepositoryException
exportSystemView
in interface Session
SAXException
RepositoryException
public void exportSystemView(String s, OutputStream outputStream, boolean b, boolean b2) throws IOException, RepositoryException
exportSystemView
in interface Session
IOException
RepositoryException
public void exportDocumentView(String s, ContentHandler contentHandler, boolean b, boolean b2) throws SAXException, RepositoryException
exportDocumentView
in interface Session
SAXException
RepositoryException
public void exportDocumentView(String s, OutputStream outputStream, boolean b, boolean b2) throws IOException, RepositoryException
exportDocumentView
in interface Session
IOException
RepositoryException
public String[] getNamespacePrefixes() throws RepositoryException
getNamespacePrefixes
in interface Session
RepositoryException
public String getNamespaceURI(String s) throws RepositoryException
getNamespaceURI
in interface Session
RepositoryException
public String getNamespacePrefix(String s) throws RepositoryException
getNamespacePrefix
in interface Session
RepositoryException
public void addLockToken(String s)
addLockToken
in interface Session
public void removeLockToken(String s)
removeLockToken
in interface Session
public String[] getLockTokens()
getLockTokens
in interface Session
public AccessControlManager getAccessControlManager() throws RepositoryException
getAccessControlManager
in interface Session
RepositoryException
public RetentionManager getRetentionManager() throws RepositoryException
getRetentionManager
in interface Session
RepositoryException
Copyright © 2013. All Rights Reserved.