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 voidaddLockToken(String arg0)Add lock token.voidcheckPermission(String arg0, String arg1)Check permission.voidcommit(Xid xid, boolean onePhase)voidend(Xid xid, int flags)voidexportDocumentView(String arg0, OutputStream arg1, boolean arg2, boolean arg3)Export document view.voidexportDocumentView(String arg0, ContentHandler arg1, boolean arg2, boolean arg3)Export document view.voidexportSystemView(String arg0, OutputStream arg1, boolean arg2, boolean arg3)Export system view.voidexportSystemView(String arg0, ContentHandler arg1, boolean arg2, boolean arg3)Export system view.voidforget(Xid xid)AccessControlManagergetAccessControlManager()ObjectgetAttribute(String name)Return the attribute.String[]getAttributeNames()Return the attribute names.ContentHandlergetImportContentHandler(String arg0, int arg1)Return the import content handler.ItemgetItem(String arg0)Return the item.String[]getLockTokens()Return the lock tokens.JCAManagedConnectiongetManagedConnection()Return the managed connection.StringgetNamespacePrefix(String arg0)Return namespace prefix.String[]getNamespacePrefixes()Return namespace prefixes.StringgetNamespaceURI(String arg0)Return namespace URI.NodegetNode(String arg0)NodegetNodeByIdentifier(String arg0)NodegetNodeByUUID(String uuid)Return node by UUID.PropertygetProperty(String arg0)RepositorygetRepository()Return the repository.RetentionManagergetRetentionManager()NodegetRootNode()Return the root node.intgetTransactionTimeout()StringgetUserID()Return the user id.ValueFactorygetValueFactory()Return the value factory.WorkspacegetWorkspace()Return the workspace.booleanhasCapability(String arg0, Object arg1, Object[] arg2)booleanhasPendingChanges()Return true if it has pending changes.booleanhasPermission(String arg0, String arg1)Sessionimpersonate(Credentials cred)Impersonate another user.voidimportXML(String arg0, InputStream arg1, int arg2)Import XML content.booleanisLive()Return true if session is live.booleanisSameRM(XAResource xares)booleanitemExists(String arg0)Return true if item exists.voidlogout()Logout the session.voidmove(String arg0, String arg1)Move the item.booleannodeExists(String path)intprepare(Xid xid)booleanpropertyExists(String path)Xid[]recover(int flag)voidrefresh(boolean arg0)Refresh the session.voidremoveItem(String path)voidremoveLockToken(String arg0)Remove lock token.voidrollback(Xid xid)voidsave()Save the session.voidsetManagedConnection(JCAManagedConnection mc)Set the managed connection.voidsetNamespacePrefix(String arg0, String arg1)Set namespace prefix.booleansetTransactionTimeout(int seconds)voidstart(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:
getRepositoryin interfaceSession
-
getUserID
public String getUserID()
Return the user id.
-
getAttribute
public Object getAttribute(String name)
Return the attribute.- Specified by:
getAttributein interfaceSession
-
getAttributeNames
public String[] getAttributeNames()
Return the attribute names.- Specified by:
getAttributeNamesin interfaceSession
-
getWorkspace
public Workspace getWorkspace()
Return the workspace.- Specified by:
getWorkspacein interfaceSession
-
impersonate
public Session impersonate(Credentials cred) throws LoginException, RepositoryException
Impersonate another user.- Specified by:
impersonatein interfaceSession- Throws:
LoginExceptionRepositoryException
-
getRootNode
public Node getRootNode() throws RepositoryException
Return the root node.- Specified by:
getRootNodein interfaceSession- Throws:
RepositoryException
-
getNodeByUUID
public Node getNodeByUUID(String uuid) throws ItemNotFoundException, RepositoryException
Return node by UUID.- Specified by:
getNodeByUUIDin interfaceSession- Throws:
ItemNotFoundExceptionRepositoryException
-
getItem
public Item getItem(String arg0) throws PathNotFoundException, RepositoryException
Return the item.- Specified by:
getItemin interfaceSession- Throws:
PathNotFoundExceptionRepositoryException
-
itemExists
public boolean itemExists(String arg0) throws RepositoryException
Return true if item exists.- Specified by:
itemExistsin interfaceSession- Throws:
RepositoryException
-
move
public void move(String arg0, String arg1) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, RepositoryException
Move the item.- Specified by:
movein interfaceSession- Throws:
ItemExistsExceptionPathNotFoundExceptionVersionExceptionConstraintViolationExceptionLockExceptionRepositoryException
-
save
public void save() throws AccessDeniedException, ItemExistsException, ConstraintViolationException, InvalidItemStateException, VersionException, LockException, NoSuchNodeTypeException, RepositoryExceptionSave the session.- Specified by:
savein interfaceSession- Throws:
AccessDeniedExceptionItemExistsExceptionConstraintViolationExceptionInvalidItemStateExceptionVersionExceptionLockExceptionNoSuchNodeTypeExceptionRepositoryException
-
refresh
public void refresh(boolean arg0) throws RepositoryExceptionRefresh the session.- Specified by:
refreshin interfaceSession- Throws:
RepositoryException
-
hasPendingChanges
public boolean hasPendingChanges() throws RepositoryExceptionReturn true if it has pending changes.- Specified by:
hasPendingChangesin interfaceSession- Throws:
RepositoryException
-
getValueFactory
public ValueFactory getValueFactory() throws UnsupportedRepositoryOperationException, RepositoryException
Return the value factory.- Specified by:
getValueFactoryin interfaceSession- Throws:
UnsupportedRepositoryOperationExceptionRepositoryException
-
checkPermission
public void checkPermission(String arg0, String arg1) throws AccessControlException, RepositoryException
Check permission.- Specified by:
checkPermissionin interfaceSession- Throws:
AccessControlExceptionRepositoryException
-
getImportContentHandler
public ContentHandler getImportContentHandler(String arg0, int arg1) throws PathNotFoundException, ConstraintViolationException, VersionException, LockException, RepositoryException
Return the import content handler.- Specified by:
getImportContentHandlerin interfaceSession- Throws:
PathNotFoundExceptionConstraintViolationExceptionVersionExceptionLockExceptionRepositoryException
-
importXML
public void importXML(String arg0, InputStream arg1, int arg2) throws IOException, PathNotFoundException, ItemExistsException, ConstraintViolationException, VersionException, InvalidSerializedDataException, LockException, RepositoryException
Import XML content.- Specified by:
importXMLin interfaceSession- Throws:
IOExceptionPathNotFoundExceptionItemExistsExceptionConstraintViolationExceptionVersionExceptionInvalidSerializedDataExceptionLockExceptionRepositoryException
-
exportSystemView
public void exportSystemView(String arg0, ContentHandler arg1, boolean arg2, boolean arg3) throws PathNotFoundException, SAXException, RepositoryException
Export system view.- Specified by:
exportSystemViewin interfaceSession- Throws:
PathNotFoundExceptionSAXExceptionRepositoryException
-
exportSystemView
public void exportSystemView(String arg0, OutputStream arg1, boolean arg2, boolean arg3) throws IOException, PathNotFoundException, RepositoryException
Export system view.- Specified by:
exportSystemViewin interfaceSession- Throws:
IOExceptionPathNotFoundExceptionRepositoryException
-
exportDocumentView
public void exportDocumentView(String arg0, ContentHandler arg1, boolean arg2, boolean arg3) throws PathNotFoundException, SAXException, RepositoryException
Export document view.- Specified by:
exportDocumentViewin interfaceSession- Throws:
PathNotFoundExceptionSAXExceptionRepositoryException
-
exportDocumentView
public void exportDocumentView(String arg0, OutputStream arg1, boolean arg2, boolean arg3) throws IOException, PathNotFoundException, RepositoryException
Export document view.- Specified by:
exportDocumentViewin interfaceSession- Throws:
IOExceptionPathNotFoundExceptionRepositoryException
-
setNamespacePrefix
public void setNamespacePrefix(String arg0, String arg1) throws NamespaceException, RepositoryException
Set namespace prefix.- Specified by:
setNamespacePrefixin interfaceSession- Throws:
NamespaceExceptionRepositoryException
-
getNamespacePrefixes
public String[] getNamespacePrefixes() throws RepositoryException
Return namespace prefixes.- Specified by:
getNamespacePrefixesin interfaceSession- Throws:
RepositoryException
-
getNamespaceURI
public String getNamespaceURI(String arg0) throws NamespaceException, RepositoryException
Return namespace URI.- Specified by:
getNamespaceURIin interfaceSession- Throws:
NamespaceExceptionRepositoryException
-
getNamespacePrefix
public String getNamespacePrefix(String arg0) throws NamespaceException, RepositoryException
Return namespace prefix.- Specified by:
getNamespacePrefixin interfaceSession- Throws:
NamespaceExceptionRepositoryException
-
isLive
public boolean isLive()
Return true if session is live.
-
addLockToken
public void addLockToken(String arg0)
Add lock token.- Specified by:
addLockTokenin interfaceSession
-
getLockTokens
public String[] getLockTokens()
Return the lock tokens.- Specified by:
getLockTokensin interfaceSession
-
removeLockToken
public void removeLockToken(String arg0)
Remove lock token.- Specified by:
removeLockTokenin interfaceSession
-
getAccessControlManager
public AccessControlManager getAccessControlManager() throws RepositoryException
- Specified by:
getAccessControlManagerin interfaceSession- Throws:
RepositoryException
-
getNode
public Node getNode(String arg0) throws RepositoryException
- Specified by:
getNodein interfaceSession- Throws:
RepositoryException
-
getNodeByIdentifier
public Node getNodeByIdentifier(String arg0) throws RepositoryException
- Specified by:
getNodeByIdentifierin interfaceSession- Throws:
RepositoryException
-
getProperty
public Property getProperty(String arg0) throws RepositoryException
- Specified by:
getPropertyin interfaceSession- Throws:
RepositoryException
-
getRetentionManager
public RetentionManager getRetentionManager() throws RepositoryException
- Specified by:
getRetentionManagerin interfaceSession- Throws:
RepositoryException
-
hasCapability
public boolean hasCapability(String arg0, Object arg1, Object[] arg2) throws RepositoryException
- Specified by:
hasCapabilityin interfaceSession- Throws:
RepositoryException
-
hasPermission
public boolean hasPermission(String arg0, String arg1) throws RepositoryException
- Specified by:
hasPermissionin interfaceSession- Throws:
RepositoryException
-
nodeExists
public boolean nodeExists(String path) throws RepositoryException
- Specified by:
nodeExistsin interfaceSession- Throws:
RepositoryException
-
propertyExists
public boolean propertyExists(String path) throws RepositoryException
- Specified by:
propertyExistsin interfaceSession- Throws:
RepositoryException
-
removeItem
public void removeItem(String path) throws RepositoryException
- Specified by:
removeItemin interfaceSession- Throws:
RepositoryException
-
start
public void start(Xid xid, int flags) throws XAException
- Specified by:
startin interfaceXAResource- Throws:
XAException
-
end
public void end(Xid xid, int flags) throws XAException
- Specified by:
endin interfaceXAResource- Throws:
XAException
-
prepare
public int prepare(Xid xid) throws XAException
- Specified by:
preparein interfaceXAResource- Throws:
XAException
-
rollback
public void rollback(Xid xid) throws XAException
- Specified by:
rollbackin interfaceXAResource- Throws:
XAException
-
commit
public void commit(Xid xid, boolean onePhase) throws XAException
- Specified by:
commitin interfaceXAResource- Throws:
XAException
-
forget
public void forget(Xid xid) throws XAException
- Specified by:
forgetin interfaceXAResource- Throws:
XAException
-
recover
public Xid[] recover(int flag) throws XAException
- Specified by:
recoverin interfaceXAResource- Throws:
XAException
-
isSameRM
public boolean isSameRM(XAResource xares) throws XAException
- Specified by:
isSameRMin interfaceXAResource- Throws:
XAException
-
getTransactionTimeout
public int getTransactionTimeout() throws XAException- Specified by:
getTransactionTimeoutin interfaceXAResource- Throws:
XAException
-
setTransactionTimeout
public boolean setTransactionTimeout(int seconds) throws XAException- Specified by:
setTransactionTimeoutin interfaceXAResource- Throws:
XAException
-
-