org.apache.jackrabbit.oak.jcr.session
Class SessionImpl

java.lang.Object
  extended by org.apache.jackrabbit.oak.jcr.session.SessionImpl
All Implemented Interfaces:
javax.jcr.Session, org.apache.jackrabbit.api.JackrabbitSession

public class SessionImpl
extends Object
implements org.apache.jackrabbit.api.JackrabbitSession

TODO document


Field Summary
 
Fields inherited from interface javax.jcr.Session
ACTION_ADD_NODE, ACTION_READ, ACTION_REMOVE, ACTION_SET_PROPERTY
 
Constructor Summary
SessionImpl(SessionContext sessionContext)
           
 
Method Summary
 void addLockToken(String lt)
           
 void checkPermission(String absPath, String actions)
           
 void exportDocumentView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse)
           
 void exportDocumentView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse)
           
 void exportSystemView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse)
           
 void exportSystemView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse)
           
 javax.jcr.security.AccessControlManager getAccessControlManager()
           
 Object getAttribute(String name)
           
 String[] getAttributeNames()
           
 ContentHandler getImportContentHandler(String parentAbsPath, int uuidBehavior)
           
 javax.jcr.Item getItem(String absPath)
           
 javax.jcr.Item getItemOrNull(String absPath)
          Returns the node at the specified absolute path in the workspace.
 String[] getLockTokens()
           
 String getNamespacePrefix(String uri)
           
 String[] getNamespacePrefixes()
           
 String getNamespaceURI(String prefix)
           
 javax.jcr.Node getNode(String absPath)
           
 javax.jcr.Node getNodeByIdentifier(String id)
           
 javax.jcr.Node getNodeByUUID(String uuid)
           
 javax.jcr.Node getNodeOrNull(String absPath)
          Returns the node at the specified absolute path in the workspace or null if no such node exists.
 org.apache.jackrabbit.api.security.principal.PrincipalManager getPrincipalManager()
           
 javax.jcr.Property getProperty(String absPath)
           
 javax.jcr.Property getPropertyOrNull(String absPath)
          Returns the property at the specified absolute path in the workspace or null if no such node exists.
 javax.jcr.Repository getRepository()
           
 javax.jcr.retention.RetentionManager getRetentionManager()
           
 javax.jcr.Node getRootNode()
           
 String getUserID()
           
 org.apache.jackrabbit.api.security.user.UserManager getUserManager()
           
 javax.jcr.ValueFactory getValueFactory()
           
 javax.jcr.Workspace getWorkspace()
           
 boolean hasCapability(String methodName, Object target, Object[] arguments)
           
 boolean hasPendingChanges()
           
 boolean hasPermission(String absPath, String actions)
           
 javax.jcr.Session impersonate(javax.jcr.Credentials credentials)
           
 void importXML(String parentAbsPath, InputStream in, int uuidBehavior)
           
 boolean isLive()
           
 boolean itemExists(String absPath)
           
 void logout()
           
 void move(String srcAbsPath, String destAbsPath)
           
 boolean nodeExists(String absPath)
           
 boolean propertyExists(String absPath)
           
 void refresh(boolean keepChanges)
           
 void removeItem(String absPath)
           
 void removeLockToken(String lt)
           
 void save()
           
 void setNamespacePrefix(String prefix, String uri)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SessionImpl

public SessionImpl(SessionContext sessionContext)
Method Detail

getNodeOrNull

@CheckForNull
public javax.jcr.Node getNodeOrNull(String absPath)
                             throws javax.jcr.RepositoryException
Returns the node at the specified absolute path in the workspace or null if no such node exists.

Parameters:
absPath - An absolute path.
Returns:
the specified Node or null.
Throws:
javax.jcr.RepositoryException - If another error occurs.

getPropertyOrNull

@CheckForNull
public javax.jcr.Property getPropertyOrNull(String absPath)
                                     throws javax.jcr.RepositoryException
Returns the property at the specified absolute path in the workspace or null if no such node exists.

Parameters:
absPath - An absolute path.
Returns:
the specified Property or null.
Throws:
javax.jcr.RepositoryException - if another error occurs.

getItemOrNull

@CheckForNull
public javax.jcr.Item getItemOrNull(String absPath)
                             throws javax.jcr.RepositoryException
Returns the node at the specified absolute path in the workspace. If no such node exists, then it returns the property at the specified path. If no such property exists, then it return null.

Parameters:
absPath - An absolute path.
Returns:
the specified Item or null.
Throws:
javax.jcr.RepositoryException - if another error occurs.

getRepository

@Nonnull
public javax.jcr.Repository getRepository()
Specified by:
getRepository in interface javax.jcr.Session

getUserID

public String getUserID()
Specified by:
getUserID in interface javax.jcr.Session

getAttributeNames

public String[] getAttributeNames()
Specified by:
getAttributeNames in interface javax.jcr.Session

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in interface javax.jcr.Session

getWorkspace

@Nonnull
public javax.jcr.Workspace getWorkspace()
Specified by:
getWorkspace in interface javax.jcr.Session

impersonate

@Nonnull
public javax.jcr.Session impersonate(javax.jcr.Credentials credentials)
                              throws javax.jcr.RepositoryException
Specified by:
impersonate in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

getValueFactory

@Nonnull
public javax.jcr.ValueFactory getValueFactory()
                                       throws javax.jcr.RepositoryException
Specified by:
getValueFactory in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

getRootNode

@Nonnull
public javax.jcr.Node getRootNode()
                           throws javax.jcr.RepositoryException
Specified by:
getRootNode in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

getNode

public javax.jcr.Node getNode(String absPath)
                       throws javax.jcr.RepositoryException
Specified by:
getNode in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

nodeExists

public boolean nodeExists(String absPath)
                   throws javax.jcr.RepositoryException
Specified by:
nodeExists in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

getNodeByUUID

@Nonnull
public javax.jcr.Node getNodeByUUID(String uuid)
                             throws javax.jcr.RepositoryException
Specified by:
getNodeByUUID in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

getNodeByIdentifier

@Nonnull
public javax.jcr.Node getNodeByIdentifier(String id)
                                   throws javax.jcr.RepositoryException
Specified by:
getNodeByIdentifier in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

getProperty

public javax.jcr.Property getProperty(String absPath)
                               throws javax.jcr.RepositoryException
Specified by:
getProperty in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

propertyExists

public boolean propertyExists(String absPath)
                       throws javax.jcr.RepositoryException
Specified by:
propertyExists in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

getItem

public javax.jcr.Item getItem(String absPath)
                       throws javax.jcr.RepositoryException
Specified by:
getItem in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

itemExists

public boolean itemExists(String absPath)
                   throws javax.jcr.RepositoryException
Specified by:
itemExists in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

move

public void move(String srcAbsPath,
                 String destAbsPath)
          throws javax.jcr.RepositoryException
Specified by:
move in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

removeItem

public void removeItem(String absPath)
                throws javax.jcr.RepositoryException
Specified by:
removeItem in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

save

public void save()
          throws javax.jcr.RepositoryException
Specified by:
save in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

refresh

public void refresh(boolean keepChanges)
             throws javax.jcr.RepositoryException
Specified by:
refresh in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

hasPendingChanges

public boolean hasPendingChanges()
                          throws javax.jcr.RepositoryException
Specified by:
hasPendingChanges in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

isLive

public boolean isLive()
Specified by:
isLive in interface javax.jcr.Session

logout

public void logout()
Specified by:
logout in interface javax.jcr.Session

getImportContentHandler

@Nonnull
public ContentHandler getImportContentHandler(String parentAbsPath,
                                                      int uuidBehavior)
                                       throws javax.jcr.RepositoryException
Specified by:
getImportContentHandler in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

importXML

public void importXML(String parentAbsPath,
                      InputStream in,
                      int uuidBehavior)
               throws IOException,
                      javax.jcr.RepositoryException
Specified by:
importXML in interface javax.jcr.Session
Throws:
IOException
javax.jcr.RepositoryException

exportSystemView

public void exportSystemView(String absPath,
                             ContentHandler contentHandler,
                             boolean skipBinary,
                             boolean noRecurse)
                      throws SAXException,
                             javax.jcr.RepositoryException
Specified by:
exportSystemView in interface javax.jcr.Session
Throws:
SAXException
javax.jcr.RepositoryException

exportSystemView

public void exportSystemView(String absPath,
                             OutputStream out,
                             boolean skipBinary,
                             boolean noRecurse)
                      throws IOException,
                             javax.jcr.RepositoryException
Specified by:
exportSystemView in interface javax.jcr.Session
Throws:
IOException
javax.jcr.RepositoryException

exportDocumentView

public void exportDocumentView(String absPath,
                               ContentHandler contentHandler,
                               boolean skipBinary,
                               boolean noRecurse)
                        throws SAXException,
                               javax.jcr.RepositoryException
Specified by:
exportDocumentView in interface javax.jcr.Session
Throws:
SAXException
javax.jcr.RepositoryException

exportDocumentView

public void exportDocumentView(String absPath,
                               OutputStream out,
                               boolean skipBinary,
                               boolean noRecurse)
                        throws IOException,
                               javax.jcr.RepositoryException
Specified by:
exportDocumentView in interface javax.jcr.Session
Throws:
IOException
javax.jcr.RepositoryException

addLockToken

public void addLockToken(String lt)
Specified by:
addLockToken in interface javax.jcr.Session

getLockTokens

@Nonnull
public String[] getLockTokens()
Specified by:
getLockTokens in interface javax.jcr.Session

removeLockToken

public void removeLockToken(String lt)
Specified by:
removeLockToken in interface javax.jcr.Session

hasPermission

public boolean hasPermission(String absPath,
                             String actions)
                      throws javax.jcr.RepositoryException
Specified by:
hasPermission in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

checkPermission

public void checkPermission(String absPath,
                            String actions)
                     throws javax.jcr.RepositoryException
Specified by:
checkPermission in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

hasCapability

public boolean hasCapability(String methodName,
                             Object target,
                             Object[] arguments)
                      throws javax.jcr.RepositoryException
Specified by:
hasCapability in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

getAccessControlManager

@Nonnull
public javax.jcr.security.AccessControlManager getAccessControlManager()
                                                                throws javax.jcr.RepositoryException
Specified by:
getAccessControlManager in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

getRetentionManager

@Nonnull
public javax.jcr.retention.RetentionManager getRetentionManager()
                                                         throws javax.jcr.RepositoryException
Specified by:
getRetentionManager in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException
See Also:
Session.getRetentionManager()

setNamespacePrefix

public void setNamespacePrefix(String prefix,
                               String uri)
                        throws javax.jcr.RepositoryException
Specified by:
setNamespacePrefix in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

getNamespacePrefixes

public String[] getNamespacePrefixes()
                              throws javax.jcr.RepositoryException
Specified by:
getNamespacePrefixes in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

getNamespaceURI

public String getNamespaceURI(String prefix)
                       throws javax.jcr.RepositoryException
Specified by:
getNamespaceURI in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

getNamespacePrefix

public String getNamespacePrefix(String uri)
                          throws javax.jcr.RepositoryException
Specified by:
getNamespacePrefix in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

getPrincipalManager

@Nonnull
public org.apache.jackrabbit.api.security.principal.PrincipalManager getPrincipalManager()
                                                                                  throws javax.jcr.RepositoryException
Specified by:
getPrincipalManager in interface org.apache.jackrabbit.api.JackrabbitSession
Throws:
javax.jcr.RepositoryException

getUserManager

@Nonnull
public org.apache.jackrabbit.api.security.user.UserManager getUserManager()
                                                                   throws javax.jcr.RepositoryException
Specified by:
getUserManager in interface org.apache.jackrabbit.api.JackrabbitSession
Throws:
javax.jcr.RepositoryException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.