org.apache.jackrabbit.jca
Class JCASessionHandle

java.lang.Object
  extended by org.apache.jackrabbit.jca.JCASessionHandle
All Implemented Interfaces:
javax.jcr.Session, XASession

public final class JCASessionHandle
extends Object
implements XASession

This class implements the JCA implementation of session.


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 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.
 Object getAttribute(String name)
          Return the attribute.
 String[] getAttributeNames()
          Return the attribute names.
 ContentHandler getImportContentHandler(String arg0, int arg1)
          Return the import content handler.
 javax.jcr.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.
 javax.jcr.Node getNodeByUUID(String uuid)
          Return node by UUID.
 javax.jcr.Repository getRepository()
          Return the repository.
 javax.jcr.Node getRootNode()
          Return the root node.
 String getUserID()
          Return the user id.
 javax.jcr.ValueFactory getValueFactory()
          Return the value factory.
 javax.jcr.Workspace getWorkspace()
          Return the workspace.
 XAResource getXAResource()
          Returns the XAResource associated with this session.
 boolean hasPendingChanges()
          Return true if it has pending changes.
 javax.jcr.Session impersonate(javax.jcr.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 itemExists(String arg0)
          Return true if item exists.
 void logout()
          Logout the session.
 void move(String arg0, String arg1)
          Move the item.
 void refresh(boolean arg0)
          Refresh the session.
 void removeLockToken(String arg0)
          Remove lock token.
 void save()
          Save the session.
 void setManagedConnection(JCAManagedConnection mc)
          Set the managed connection.
 void setNamespacePrefix(String arg0, String arg1)
          Set namespace prefix.
 
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 javax.jcr.Repository getRepository()
Return the repository.

Specified by:
getRepository in interface javax.jcr.Session

getUserID

public String getUserID()
Return the user id.

Specified by:
getUserID in interface javax.jcr.Session

getAttribute

public Object getAttribute(String name)
Return the attribute.

Specified by:
getAttribute in interface javax.jcr.Session

getAttributeNames

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

Specified by:
getAttributeNames in interface javax.jcr.Session

getWorkspace

public javax.jcr.Workspace getWorkspace()
Return the workspace.

Specified by:
getWorkspace in interface javax.jcr.Session

impersonate

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

Specified by:
impersonate in interface javax.jcr.Session
Throws:
javax.jcr.LoginException
javax.jcr.RepositoryException

getRootNode

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

Specified by:
getRootNode in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

getNodeByUUID

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

Specified by:
getNodeByUUID in interface javax.jcr.Session
Throws:
javax.jcr.ItemNotFoundException
javax.jcr.RepositoryException

getItem

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

Specified by:
getItem in interface javax.jcr.Session
Throws:
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException

itemExists

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

Specified by:
itemExists in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

move

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

Specified by:
move in interface javax.jcr.Session
Throws:
javax.jcr.ItemExistsException
javax.jcr.PathNotFoundException
javax.jcr.version.VersionException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.lock.LockException
javax.jcr.RepositoryException

save

public void save()
          throws javax.jcr.AccessDeniedException,
                 javax.jcr.ItemExistsException,
                 javax.jcr.nodetype.ConstraintViolationException,
                 javax.jcr.InvalidItemStateException,
                 javax.jcr.version.VersionException,
                 javax.jcr.lock.LockException,
                 javax.jcr.nodetype.NoSuchNodeTypeException,
                 javax.jcr.RepositoryException
Save the session.

Specified by:
save in interface javax.jcr.Session
Throws:
javax.jcr.AccessDeniedException
javax.jcr.ItemExistsException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.InvalidItemStateException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.NoSuchNodeTypeException
javax.jcr.RepositoryException

refresh

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

Specified by:
refresh in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

hasPendingChanges

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

Specified by:
hasPendingChanges in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

getValueFactory

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

Specified by:
getValueFactory in interface javax.jcr.Session
Throws:
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException

checkPermission

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

Specified by:
checkPermission in interface javax.jcr.Session
Throws:
AccessControlException
javax.jcr.RepositoryException

getImportContentHandler

public ContentHandler getImportContentHandler(String arg0,
                                              int arg1)
                                       throws javax.jcr.PathNotFoundException,
                                              javax.jcr.nodetype.ConstraintViolationException,
                                              javax.jcr.version.VersionException,
                                              javax.jcr.lock.LockException,
                                              javax.jcr.RepositoryException
Return the import content handler.

Specified by:
getImportContentHandler in interface javax.jcr.Session
Throws:
javax.jcr.PathNotFoundException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.RepositoryException

importXML

public void importXML(String arg0,
                      InputStream arg1,
                      int arg2)
               throws IOException,
                      javax.jcr.PathNotFoundException,
                      javax.jcr.ItemExistsException,
                      javax.jcr.nodetype.ConstraintViolationException,
                      javax.jcr.version.VersionException,
                      javax.jcr.InvalidSerializedDataException,
                      javax.jcr.lock.LockException,
                      javax.jcr.RepositoryException
Import XML content.

Specified by:
importXML in interface javax.jcr.Session
Throws:
IOException
javax.jcr.PathNotFoundException
javax.jcr.ItemExistsException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.version.VersionException
javax.jcr.InvalidSerializedDataException
javax.jcr.lock.LockException
javax.jcr.RepositoryException

exportSystemView

public void exportSystemView(String arg0,
                             ContentHandler arg1,
                             boolean arg2,
                             boolean arg3)
                      throws javax.jcr.PathNotFoundException,
                             SAXException,
                             javax.jcr.RepositoryException
Export system view.

Specified by:
exportSystemView in interface javax.jcr.Session
Throws:
javax.jcr.PathNotFoundException
SAXException
javax.jcr.RepositoryException

exportSystemView

public void exportSystemView(String arg0,
                             OutputStream arg1,
                             boolean arg2,
                             boolean arg3)
                      throws IOException,
                             javax.jcr.PathNotFoundException,
                             javax.jcr.RepositoryException
Export system view.

Specified by:
exportSystemView in interface javax.jcr.Session
Throws:
IOException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException

exportDocumentView

public void exportDocumentView(String arg0,
                               ContentHandler arg1,
                               boolean arg2,
                               boolean arg3)
                        throws javax.jcr.PathNotFoundException,
                               SAXException,
                               javax.jcr.RepositoryException
Export document view.

Specified by:
exportDocumentView in interface javax.jcr.Session
Throws:
javax.jcr.PathNotFoundException
SAXException
javax.jcr.RepositoryException

exportDocumentView

public void exportDocumentView(String arg0,
                               OutputStream arg1,
                               boolean arg2,
                               boolean arg3)
                        throws IOException,
                               javax.jcr.PathNotFoundException,
                               javax.jcr.RepositoryException
Export document view.

Specified by:
exportDocumentView in interface javax.jcr.Session
Throws:
IOException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException

setNamespacePrefix

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

Specified by:
setNamespacePrefix in interface javax.jcr.Session
Throws:
javax.jcr.NamespaceException
javax.jcr.RepositoryException

getNamespacePrefixes

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

Specified by:
getNamespacePrefixes in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

getNamespaceURI

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

Specified by:
getNamespaceURI in interface javax.jcr.Session
Throws:
javax.jcr.NamespaceException
javax.jcr.RepositoryException

getNamespacePrefix

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

Specified by:
getNamespacePrefix in interface javax.jcr.Session
Throws:
javax.jcr.NamespaceException
javax.jcr.RepositoryException

logout

public void logout()
Logout the session.

Specified by:
logout in interface javax.jcr.Session

isLive

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

Specified by:
isLive in interface javax.jcr.Session

addLockToken

public void addLockToken(String arg0)
Add lock token.

Specified by:
addLockToken in interface javax.jcr.Session

getLockTokens

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

Specified by:
getLockTokens in interface javax.jcr.Session

removeLockToken

public void removeLockToken(String arg0)
Remove lock token.

Specified by:
removeLockToken in interface javax.jcr.Session

getXAResource

public XAResource getXAResource()
Returns the XAResource associated with this session.

Specified by:
getXAResource in interface XASession
Returns:
XA resource


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.