org.apache.jackrabbit.jca
Class JCASessionHandle

java.lang.Object
  extended by 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
JCASessionHandle(JCAManagedConnection mc)
          Construct a new session.
 
Method Summary
 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, ContentHandler arg1, boolean arg2, boolean arg3)
          Export document view.
 void exportDocumentView(String arg0, OutputStream arg1, boolean arg2, boolean arg3)
          Export document view.
 void exportSystemView(String arg0, ContentHandler arg1, boolean arg2, boolean arg3)
          Export system view.
 void exportSystemView(String arg0, OutputStream 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 interface Session

getUserID

public String getUserID()
Return the user id.

Specified by:
getUserID in interface Session

getAttribute

public Object getAttribute(String name)
Return the attribute.

Specified by:
getAttribute in interface Session

getAttributeNames

public String[] getAttributeNames()
Return the attribute names.

Specified by:
getAttributeNames in interface Session

getWorkspace

public Workspace getWorkspace()
Return the workspace.

Specified by:
getWorkspace in interface Session

impersonate

public Session impersonate(Credentials cred)
                    throws LoginException,
                           RepositoryException
Impersonate another user.

Specified by:
impersonate in interface Session
Throws:
LoginException
RepositoryException

getRootNode

public Node getRootNode()
                 throws RepositoryException
Return the root node.

Specified by:
getRootNode in interface Session
Throws:
RepositoryException

getNodeByUUID

public Node getNodeByUUID(String uuid)
                   throws ItemNotFoundException,
                          RepositoryException
Return node by UUID.

Specified by:
getNodeByUUID in interface Session
Throws:
ItemNotFoundException
RepositoryException

getItem

public Item getItem(String arg0)
             throws PathNotFoundException,
                    RepositoryException
Return the item.

Specified by:
getItem in interface Session
Throws:
PathNotFoundException
RepositoryException

itemExists

public boolean itemExists(String arg0)
                   throws RepositoryException
Return true if item exists.

Specified by:
itemExists in interface Session
Throws:
RepositoryException

move

public void move(String arg0,
                 String arg1)
          throws ItemExistsException,
                 PathNotFoundException,
                 VersionException,
                 ConstraintViolationException,
                 LockException,
                 RepositoryException
Move the item.

Specified by:
move in interface Session
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 interface Session
Throws:
AccessDeniedException
ItemExistsException
ConstraintViolationException
InvalidItemStateException
VersionException
LockException
NoSuchNodeTypeException
RepositoryException

refresh

public void refresh(boolean arg0)
             throws RepositoryException
Refresh the session.

Specified by:
refresh in interface Session
Throws:
RepositoryException

hasPendingChanges

public boolean hasPendingChanges()
                          throws RepositoryException
Return true if it has pending changes.

Specified by:
hasPendingChanges in interface Session
Throws:
RepositoryException

getValueFactory

public ValueFactory getValueFactory()
                             throws UnsupportedRepositoryOperationException,
                                    RepositoryException
Return the value factory.

Specified by:
getValueFactory in interface Session
Throws:
UnsupportedRepositoryOperationException
RepositoryException

checkPermission

public void checkPermission(String arg0,
                            String arg1)
                     throws AccessControlException,
                            RepositoryException
Check permission.

Specified by:
checkPermission in interface Session
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 interface Session
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 interface Session
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 interface Session
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 interface Session
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 interface Session
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 interface Session
Throws:
IOException
PathNotFoundException
RepositoryException

setNamespacePrefix

public void setNamespacePrefix(String arg0,
                               String arg1)
                        throws NamespaceException,
                               RepositoryException
Set namespace prefix.

Specified by:
setNamespacePrefix in interface Session
Throws:
NamespaceException
RepositoryException

getNamespacePrefixes

public String[] getNamespacePrefixes()
                              throws RepositoryException
Return namespace prefixes.

Specified by:
getNamespacePrefixes in interface Session
Throws:
RepositoryException

getNamespaceURI

public String getNamespaceURI(String arg0)
                       throws NamespaceException,
                              RepositoryException
Return namespace URI.

Specified by:
getNamespaceURI in interface Session
Throws:
NamespaceException
RepositoryException

getNamespacePrefix

public String getNamespacePrefix(String arg0)
                          throws NamespaceException,
                                 RepositoryException
Return namespace prefix.

Specified by:
getNamespacePrefix in interface Session
Throws:
NamespaceException
RepositoryException

logout

public void logout()
Logout the session.

Specified by:
logout in interface Session

isLive

public boolean isLive()
Return true if session is live.

Specified by:
isLive in interface Session

addLockToken

public void addLockToken(String arg0)
Add lock token.

Specified by:
addLockToken in interface Session

getLockTokens

public String[] getLockTokens()
Return the lock tokens.

Specified by:
getLockTokens in interface Session

removeLockToken

public void removeLockToken(String arg0)
Remove lock token.

Specified by:
removeLockToken in interface Session

getAccessControlManager

public AccessControlManager getAccessControlManager()
                                             throws RepositoryException
Specified by:
getAccessControlManager in interface Session
Throws:
RepositoryException

getNode

public Node getNode(String arg0)
             throws RepositoryException
Specified by:
getNode in interface Session
Throws:
RepositoryException

getNodeByIdentifier

public Node getNodeByIdentifier(String arg0)
                         throws RepositoryException
Specified by:
getNodeByIdentifier in interface Session
Throws:
RepositoryException

getProperty

public Property getProperty(String arg0)
                     throws RepositoryException
Specified by:
getProperty in interface Session
Throws:
RepositoryException

getRetentionManager

public RetentionManager getRetentionManager()
                                     throws RepositoryException
Specified by:
getRetentionManager in interface Session
Throws:
RepositoryException

hasCapability

public boolean hasCapability(String arg0,
                             Object arg1,
                             Object[] arg2)
                      throws RepositoryException
Specified by:
hasCapability in interface Session
Throws:
RepositoryException

hasPermission

public boolean hasPermission(String arg0,
                             String arg1)
                      throws RepositoryException
Specified by:
hasPermission in interface Session
Throws:
RepositoryException

nodeExists

public boolean nodeExists(String path)
                   throws RepositoryException
Specified by:
nodeExists in interface Session
Throws:
RepositoryException

propertyExists

public boolean propertyExists(String path)
                       throws RepositoryException
Specified by:
propertyExists in interface Session
Throws:
RepositoryException

removeItem

public void removeItem(String path)
                throws RepositoryException
Specified by:
removeItem in interface Session
Throws:
RepositoryException

start

public void start(Xid xid,
                  int flags)
           throws XAException
Specified by:
start in interface XAResource
Throws:
XAException

end

public void end(Xid xid,
                int flags)
         throws XAException
Specified by:
end in interface XAResource
Throws:
XAException

prepare

public int prepare(Xid xid)
            throws XAException
Specified by:
prepare in interface XAResource
Throws:
XAException

rollback

public void rollback(Xid xid)
              throws XAException
Specified by:
rollback in interface XAResource
Throws:
XAException

commit

public void commit(Xid xid,
                   boolean onePhase)
            throws XAException
Specified by:
commit in interface XAResource
Throws:
XAException

forget

public void forget(Xid xid)
            throws XAException
Specified by:
forget in interface XAResource
Throws:
XAException

recover

public Xid[] recover(int flag)
              throws XAException
Specified by:
recover in interface XAResource
Throws:
XAException

isSameRM

public boolean isSameRM(XAResource xares)
                 throws XAException
Specified by:
isSameRM in interface XAResource
Throws:
XAException

getTransactionTimeout

public int getTransactionTimeout()
                          throws XAException
Specified by:
getTransactionTimeout in interface XAResource
Throws:
XAException

setTransactionTimeout

public boolean setTransactionTimeout(int seconds)
                              throws XAException
Specified by:
setTransactionTimeout in interface XAResource
Throws:
XAException


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.