Package org.apache.jackrabbit.jca
Class JCASessionHandle
- java.lang.Object
-
- org.apache.jackrabbit.jca.JCASessionHandle
-
- All Implemented Interfaces:
Session
,XAResource
public final class JCASessionHandle extends Object implements Session, XAResource
This class implements the JCA implementation of session.
-
-
Field Summary
-
Fields inherited from interface javax.jcr.Session
ACTION_ADD_NODE, ACTION_READ, ACTION_REMOVE, ACTION_SET_PROPERTY
-
Fields inherited from interface javax.transaction.xa.XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
-
-
Constructor Summary
Constructors Constructor Description JCASessionHandle(JCAManagedConnection mc)
Construct a new session.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLockToken(String arg0)
Add lock token.void
checkPermission(String arg0, String arg1)
Check permission.void
commit(Xid xid, boolean onePhase)
void
end(Xid xid, int flags)
void
exportDocumentView(String arg0, OutputStream arg1, boolean arg2, boolean arg3)
Export document view.void
exportDocumentView(String arg0, ContentHandler arg1, boolean arg2, boolean arg3)
Export document view.void
exportSystemView(String arg0, OutputStream arg1, boolean arg2, boolean arg3)
Export system view.void
exportSystemView(String arg0, ContentHandler arg1, boolean arg2, boolean arg3)
Export system view.void
forget(Xid xid)
AccessControlManager
getAccessControlManager()
Object
getAttribute(String name)
Return the attribute.String[]
getAttributeNames()
Return the attribute names.ContentHandler
getImportContentHandler(String arg0, int arg1)
Return the import content handler.Item
getItem(String arg0)
Return the item.String[]
getLockTokens()
Return the lock tokens.JCAManagedConnection
getManagedConnection()
Return the managed connection.String
getNamespacePrefix(String arg0)
Return namespace prefix.String[]
getNamespacePrefixes()
Return namespace prefixes.String
getNamespaceURI(String arg0)
Return namespace URI.Node
getNode(String arg0)
Node
getNodeByIdentifier(String arg0)
Node
getNodeByUUID(String uuid)
Return node by UUID.Property
getProperty(String arg0)
Repository
getRepository()
Return the repository.RetentionManager
getRetentionManager()
Node
getRootNode()
Return the root node.int
getTransactionTimeout()
String
getUserID()
Return the user id.ValueFactory
getValueFactory()
Return the value factory.Workspace
getWorkspace()
Return the workspace.boolean
hasCapability(String arg0, Object arg1, Object[] arg2)
boolean
hasPendingChanges()
Return true if it has pending changes.boolean
hasPermission(String arg0, String arg1)
Session
impersonate(Credentials cred)
Impersonate another user.void
importXML(String arg0, InputStream arg1, int arg2)
Import XML content.boolean
isLive()
Return true if session is live.boolean
isSameRM(XAResource xares)
boolean
itemExists(String arg0)
Return true if item exists.void
logout()
Logout the session.void
move(String arg0, String arg1)
Move the item.boolean
nodeExists(String path)
int
prepare(Xid xid)
boolean
propertyExists(String path)
Xid[]
recover(int flag)
void
refresh(boolean arg0)
Refresh the session.void
removeItem(String path)
void
removeLockToken(String arg0)
Remove lock token.void
rollback(Xid xid)
void
save()
Save the session.void
setManagedConnection(JCAManagedConnection mc)
Set the managed connection.void
setNamespacePrefix(String arg0, String arg1)
Set namespace prefix.boolean
setTransactionTimeout(int seconds)
void
start(Xid xid, int flags)
-
-
-
Constructor Detail
-
JCASessionHandle
public JCASessionHandle(JCAManagedConnection mc)
Construct a new session.
-
-
Method Detail
-
getManagedConnection
public JCAManagedConnection getManagedConnection()
Return the managed connection.
-
setManagedConnection
public void setManagedConnection(JCAManagedConnection mc)
Set the managed connection.
-
getRepository
public Repository getRepository()
Return the repository.- Specified by:
getRepository
in interfaceSession
-
getUserID
public String getUserID()
Return the user id.
-
getAttribute
public Object getAttribute(String name)
Return the attribute.- Specified by:
getAttribute
in interfaceSession
-
getAttributeNames
public String[] getAttributeNames()
Return the attribute names.- Specified by:
getAttributeNames
in interfaceSession
-
getWorkspace
public Workspace getWorkspace()
Return the workspace.- Specified by:
getWorkspace
in interfaceSession
-
impersonate
public Session impersonate(Credentials cred) throws LoginException, RepositoryException
Impersonate another user.- Specified by:
impersonate
in interfaceSession
- Throws:
LoginException
RepositoryException
-
getRootNode
public Node getRootNode() throws RepositoryException
Return the root node.- Specified by:
getRootNode
in interfaceSession
- Throws:
RepositoryException
-
getNodeByUUID
public Node getNodeByUUID(String uuid) throws ItemNotFoundException, RepositoryException
Return node by UUID.- Specified by:
getNodeByUUID
in interfaceSession
- Throws:
ItemNotFoundException
RepositoryException
-
getItem
public Item getItem(String arg0) throws PathNotFoundException, RepositoryException
Return the item.- Specified by:
getItem
in interfaceSession
- Throws:
PathNotFoundException
RepositoryException
-
itemExists
public boolean itemExists(String arg0) throws RepositoryException
Return true if item exists.- Specified by:
itemExists
in interfaceSession
- Throws:
RepositoryException
-
move
public void move(String arg0, String arg1) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, RepositoryException
Move the item.- Specified by:
move
in interfaceSession
- Throws:
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
RepositoryException
-
save
public void save() throws AccessDeniedException, ItemExistsException, ConstraintViolationException, InvalidItemStateException, VersionException, LockException, NoSuchNodeTypeException, RepositoryException
Save the session.- Specified by:
save
in interfaceSession
- Throws:
AccessDeniedException
ItemExistsException
ConstraintViolationException
InvalidItemStateException
VersionException
LockException
NoSuchNodeTypeException
RepositoryException
-
refresh
public void refresh(boolean arg0) throws RepositoryException
Refresh the session.- Specified by:
refresh
in interfaceSession
- Throws:
RepositoryException
-
hasPendingChanges
public boolean hasPendingChanges() throws RepositoryException
Return true if it has pending changes.- Specified by:
hasPendingChanges
in interfaceSession
- Throws:
RepositoryException
-
getValueFactory
public ValueFactory getValueFactory() throws UnsupportedRepositoryOperationException, RepositoryException
Return the value factory.- Specified by:
getValueFactory
in interfaceSession
- Throws:
UnsupportedRepositoryOperationException
RepositoryException
-
checkPermission
public void checkPermission(String arg0, String arg1) throws AccessControlException, RepositoryException
Check permission.- Specified by:
checkPermission
in interfaceSession
- Throws:
AccessControlException
RepositoryException
-
getImportContentHandler
public ContentHandler getImportContentHandler(String arg0, int arg1) throws PathNotFoundException, ConstraintViolationException, VersionException, LockException, RepositoryException
Return the import content handler.- Specified by:
getImportContentHandler
in interfaceSession
- Throws:
PathNotFoundException
ConstraintViolationException
VersionException
LockException
RepositoryException
-
importXML
public void importXML(String arg0, InputStream arg1, int arg2) throws IOException, PathNotFoundException, ItemExistsException, ConstraintViolationException, VersionException, InvalidSerializedDataException, LockException, RepositoryException
Import XML content.- Specified by:
importXML
in interfaceSession
- Throws:
IOException
PathNotFoundException
ItemExistsException
ConstraintViolationException
VersionException
InvalidSerializedDataException
LockException
RepositoryException
-
exportSystemView
public void exportSystemView(String arg0, ContentHandler arg1, boolean arg2, boolean arg3) throws PathNotFoundException, SAXException, RepositoryException
Export system view.- Specified by:
exportSystemView
in interfaceSession
- Throws:
PathNotFoundException
SAXException
RepositoryException
-
exportSystemView
public void exportSystemView(String arg0, OutputStream arg1, boolean arg2, boolean arg3) throws IOException, PathNotFoundException, RepositoryException
Export system view.- Specified by:
exportSystemView
in interfaceSession
- Throws:
IOException
PathNotFoundException
RepositoryException
-
exportDocumentView
public void exportDocumentView(String arg0, ContentHandler arg1, boolean arg2, boolean arg3) throws PathNotFoundException, SAXException, RepositoryException
Export document view.- Specified by:
exportDocumentView
in interfaceSession
- Throws:
PathNotFoundException
SAXException
RepositoryException
-
exportDocumentView
public void exportDocumentView(String arg0, OutputStream arg1, boolean arg2, boolean arg3) throws IOException, PathNotFoundException, RepositoryException
Export document view.- Specified by:
exportDocumentView
in interfaceSession
- Throws:
IOException
PathNotFoundException
RepositoryException
-
setNamespacePrefix
public void setNamespacePrefix(String arg0, String arg1) throws NamespaceException, RepositoryException
Set namespace prefix.- Specified by:
setNamespacePrefix
in interfaceSession
- Throws:
NamespaceException
RepositoryException
-
getNamespacePrefixes
public String[] getNamespacePrefixes() throws RepositoryException
Return namespace prefixes.- Specified by:
getNamespacePrefixes
in interfaceSession
- Throws:
RepositoryException
-
getNamespaceURI
public String getNamespaceURI(String arg0) throws NamespaceException, RepositoryException
Return namespace URI.- Specified by:
getNamespaceURI
in interfaceSession
- Throws:
NamespaceException
RepositoryException
-
getNamespacePrefix
public String getNamespacePrefix(String arg0) throws NamespaceException, RepositoryException
Return namespace prefix.- Specified by:
getNamespacePrefix
in interfaceSession
- Throws:
NamespaceException
RepositoryException
-
isLive
public boolean isLive()
Return true if session is live.
-
addLockToken
public void addLockToken(String arg0)
Add lock token.- Specified by:
addLockToken
in interfaceSession
-
getLockTokens
public String[] getLockTokens()
Return the lock tokens.- Specified by:
getLockTokens
in interfaceSession
-
removeLockToken
public void removeLockToken(String arg0)
Remove lock token.- Specified by:
removeLockToken
in interfaceSession
-
getAccessControlManager
public AccessControlManager getAccessControlManager() throws RepositoryException
- Specified by:
getAccessControlManager
in interfaceSession
- Throws:
RepositoryException
-
getNode
public Node getNode(String arg0) throws RepositoryException
- Specified by:
getNode
in interfaceSession
- Throws:
RepositoryException
-
getNodeByIdentifier
public Node getNodeByIdentifier(String arg0) throws RepositoryException
- Specified by:
getNodeByIdentifier
in interfaceSession
- Throws:
RepositoryException
-
getProperty
public Property getProperty(String arg0) throws RepositoryException
- Specified by:
getProperty
in interfaceSession
- Throws:
RepositoryException
-
getRetentionManager
public RetentionManager getRetentionManager() throws RepositoryException
- Specified by:
getRetentionManager
in interfaceSession
- Throws:
RepositoryException
-
hasCapability
public boolean hasCapability(String arg0, Object arg1, Object[] arg2) throws RepositoryException
- Specified by:
hasCapability
in interfaceSession
- Throws:
RepositoryException
-
hasPermission
public boolean hasPermission(String arg0, String arg1) throws RepositoryException
- Specified by:
hasPermission
in interfaceSession
- Throws:
RepositoryException
-
nodeExists
public boolean nodeExists(String path) throws RepositoryException
- Specified by:
nodeExists
in interfaceSession
- Throws:
RepositoryException
-
propertyExists
public boolean propertyExists(String path) throws RepositoryException
- Specified by:
propertyExists
in interfaceSession
- Throws:
RepositoryException
-
removeItem
public void removeItem(String path) throws RepositoryException
- Specified by:
removeItem
in interfaceSession
- Throws:
RepositoryException
-
start
public void start(Xid xid, int flags) throws XAException
- Specified by:
start
in interfaceXAResource
- Throws:
XAException
-
end
public void end(Xid xid, int flags) throws XAException
- Specified by:
end
in interfaceXAResource
- Throws:
XAException
-
prepare
public int prepare(Xid xid) throws XAException
- Specified by:
prepare
in interfaceXAResource
- Throws:
XAException
-
rollback
public void rollback(Xid xid) throws XAException
- Specified by:
rollback
in interfaceXAResource
- Throws:
XAException
-
commit
public void commit(Xid xid, boolean onePhase) throws XAException
- Specified by:
commit
in interfaceXAResource
- Throws:
XAException
-
forget
public void forget(Xid xid) throws XAException
- Specified by:
forget
in interfaceXAResource
- Throws:
XAException
-
recover
public Xid[] recover(int flag) throws XAException
- Specified by:
recover
in interfaceXAResource
- Throws:
XAException
-
isSameRM
public boolean isSameRM(XAResource xares) throws XAException
- Specified by:
isSameRM
in interfaceXAResource
- Throws:
XAException
-
getTransactionTimeout
public int getTransactionTimeout() throws XAException
- Specified by:
getTransactionTimeout
in interfaceXAResource
- Throws:
XAException
-
setTransactionTimeout
public boolean setTransactionTimeout(int seconds) throws XAException
- Specified by:
setTransactionTimeout
in interfaceXAResource
- Throws:
XAException
-
-