|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.priha.core.SessionImpl
public class SessionImpl
The SessionImpl class implements a JCR Session. It is non thread safe, so each Thread must have its own Session.
Field Summary | |
---|---|
protected SessionProvider |
m_provider
|
Constructor Summary | |
---|---|
SessionImpl(RepositoryImpl rep,
javax.jcr.Credentials creds,
java.lang.String name)
|
Method Summary | |
---|---|
void |
addLockToken(java.lang.String lt)
|
void |
checkPermission(java.lang.String absPath,
java.lang.String actions)
Any credentials are fine to give full access. |
protected void |
checkWritePermission()
Quick way to check for write permissions. |
protected NodeImpl |
createNode(Path absPath,
QNodeType assignedType,
QNodeDefinition assignedNodeDef,
boolean initDefaults)
This method creates a correct Node subclass based on the NodeType. |
void |
dump()
This method provides debug information about the state of the Session. |
void |
exportDocumentView(java.lang.String absPath,
org.xml.sax.ContentHandler contentHandler,
boolean skipBinary,
boolean noRecurse)
|
void |
exportDocumentView(java.lang.String absPath,
java.io.OutputStream out,
boolean skipBinary,
boolean noRecurse)
|
void |
exportSystemView(java.lang.String absPath,
org.xml.sax.ContentHandler contentHandler,
boolean skipBinary,
boolean noRecurse)
|
void |
exportSystemView(java.lang.String absPath,
java.io.OutputStream out,
boolean skipBinary,
boolean noRecurse)
|
java.lang.String |
fromQName(QName c)
|
java.lang.Object |
getAttribute(java.lang.String name)
|
java.lang.String[] |
getAttributeNames()
|
org.xml.sax.ContentHandler |
getImportContentHandler(java.lang.String parentAbsPath,
int uuidBehavior)
|
ItemImpl |
getItem(Path absPath)
|
ItemImpl |
getItem(java.lang.String absPath)
|
java.lang.String[] |
getLockTokens()
|
java.lang.String |
getNamespacePrefix(java.lang.String uri)
|
java.lang.String[] |
getNamespacePrefixes()
|
java.lang.String |
getNamespaceURI(java.lang.String prefix)
|
NodeImpl |
getNodeByUUID(java.lang.String uuid)
|
Path |
getPath(PathRef p)
Shortcut for getPathManager().getPath(). |
PathManager |
getPathManager()
|
java.util.List<PropertyImpl> |
getReferences(java.lang.String uuid)
|
RepositoryImpl |
getRepository()
|
NodeImpl |
getRootNode()
|
java.lang.String |
getUserID()
|
ValueFactoryImpl |
getValueFactory()
|
WorkspaceImpl |
getWorkspace()
|
boolean |
hasNode(Path absPath)
|
boolean |
hasPendingChanges()
|
javax.jcr.Session |
impersonate(javax.jcr.Credentials credentials)
|
void |
importXML(java.lang.String parentAbsPath,
java.io.InputStream in,
int uuidBehavior)
|
void |
internalMove(Path srcPath,
Path destPath,
boolean obeyConstraints)
|
void |
internalMove(java.lang.String srcAbsPath,
java.lang.String destAbsPath,
boolean obeyConstraints)
Moves work as follows: We add a new Node to the destAbsPath We copy all properties from the old Node to the new Node The old Node gets tagged with a property "priha:oldPath" which contains the current path The Path of the old Node (and all other Nodes which refer to it) is changed to point at the new location The Node is marked as being MOVED instead of REMOVED. |
boolean |
isLive()
|
boolean |
isSuper()
Returns true, if this Session should be considered to be a supersession, which can do whatever it wants (that is, mostly ignore any Constraint Violations. |
boolean |
itemExists(Path absPath)
|
boolean |
itemExists(java.lang.String absPath)
|
java.util.List<Path> |
listNodes(Path parentpath)
|
void |
logout()
|
void |
move(Path srcPath,
Path destPath)
A convenience class to move stuff based on Paths instead of Strings. |
void |
move(java.lang.String srcAbsPath,
java.lang.String destAbsPath)
|
void |
refresh(boolean keepChanges)
|
void |
remove(ItemImpl itemImpl)
|
void |
removeLockToken(java.lang.String lt)
|
void |
rename(Path path1,
Path.Component newName)
|
void |
save()
|
protected void |
saveNodes(Path pathprefix)
Saves all modified nodes that start with the given path prefix. |
void |
setNamespacePrefix(java.lang.String newPrefix,
java.lang.String existingUri)
|
boolean |
setSuper(boolean value)
|
QName |
toQName(java.lang.String c)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected SessionProvider m_provider
Constructor Detail |
---|
public SessionImpl(RepositoryImpl rep, javax.jcr.Credentials creds, java.lang.String name) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
Method Detail |
---|
public boolean setSuper(boolean value)
public boolean isSuper()
One should be careful, since it is possible with this method to end up in a repository with an inconsistent state.
public java.util.List<Path> listNodes(Path parentpath) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public boolean hasNode(Path absPath) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public void addLockToken(java.lang.String lt)
addLockToken
in interface javax.jcr.Session
public void checkPermission(java.lang.String absPath, java.lang.String actions) throws java.security.AccessControlException, javax.jcr.RepositoryException
checkPermission
in interface javax.jcr.Session
java.security.AccessControlException
javax.jcr.RepositoryException
protected void checkWritePermission() throws java.security.AccessControlException, javax.jcr.RepositoryException
java.security.AccessControlException
javax.jcr.RepositoryException
public java.lang.Object getAttribute(java.lang.String name)
getAttribute
in interface javax.jcr.Session
public java.lang.String[] getAttributeNames()
getAttributeNames
in interface javax.jcr.Session
public ItemImpl getItem(Path absPath) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
public ItemImpl getItem(java.lang.String absPath) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
getItem
in interface javax.jcr.Session
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
public java.lang.String[] getLockTokens()
getLockTokens
in interface javax.jcr.Session
public NodeImpl getNodeByUUID(java.lang.String uuid) throws javax.jcr.ItemNotFoundException, javax.jcr.RepositoryException
getNodeByUUID
in interface javax.jcr.Session
javax.jcr.ItemNotFoundException
javax.jcr.RepositoryException
public RepositoryImpl getRepository()
getRepository
in interface javax.jcr.Session
public NodeImpl getRootNode() throws javax.jcr.RepositoryException
getRootNode
in interface javax.jcr.Session
javax.jcr.RepositoryException
public java.lang.String getUserID()
getUserID
in interface javax.jcr.Session
public ValueFactoryImpl getValueFactory() throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
getValueFactory
in interface javax.jcr.Session
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException
public WorkspaceImpl getWorkspace()
getWorkspace
in interface javax.jcr.Session
public boolean hasPendingChanges() throws javax.jcr.RepositoryException
hasPendingChanges
in interface javax.jcr.Session
javax.jcr.RepositoryException
public javax.jcr.Session impersonate(javax.jcr.Credentials credentials) throws javax.jcr.LoginException, javax.jcr.RepositoryException
impersonate
in interface javax.jcr.Session
javax.jcr.LoginException
javax.jcr.RepositoryException
public final boolean isLive()
isLive
in interface javax.jcr.Session
public boolean itemExists(java.lang.String absPath) throws javax.jcr.RepositoryException
itemExists
in interface javax.jcr.Session
javax.jcr.RepositoryException
public void logout()
logout
in interface javax.jcr.Session
public void move(Path srcPath, Path destPath) throws javax.jcr.ItemExistsException, javax.jcr.PathNotFoundException, javax.jcr.version.VersionException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.lock.LockException, javax.jcr.NamespaceException, javax.jcr.RepositoryException
javax.jcr.ItemExistsException
javax.jcr.PathNotFoundException
javax.jcr.version.VersionException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.lock.LockException
javax.jcr.NamespaceException
javax.jcr.RepositoryException
public void move(java.lang.String srcAbsPath, java.lang.String destAbsPath) throws javax.jcr.ItemExistsException, javax.jcr.PathNotFoundException, javax.jcr.version.VersionException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.lock.LockException, javax.jcr.RepositoryException
move
in interface javax.jcr.Session
javax.jcr.ItemExistsException
javax.jcr.PathNotFoundException
javax.jcr.version.VersionException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.lock.LockException
javax.jcr.RepositoryException
public void internalMove(Path srcPath, Path destPath, boolean obeyConstraints) throws javax.jcr.ItemExistsException, javax.jcr.PathNotFoundException, javax.jcr.version.VersionException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.lock.LockException, javax.jcr.NamespaceException, javax.jcr.RepositoryException
javax.jcr.ItemExistsException
javax.jcr.PathNotFoundException
javax.jcr.version.VersionException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.lock.LockException
javax.jcr.NamespaceException
javax.jcr.RepositoryException
public void internalMove(java.lang.String srcAbsPath, java.lang.String destAbsPath, boolean obeyConstraints) throws javax.jcr.ItemExistsException, javax.jcr.PathNotFoundException, javax.jcr.version.VersionException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.lock.LockException, javax.jcr.RepositoryException
javax.jcr.ItemExistsException
javax.jcr.PathNotFoundException
javax.jcr.version.VersionException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.lock.LockException
javax.jcr.RepositoryException
public void refresh(boolean keepChanges) throws javax.jcr.RepositoryException
refresh
in interface javax.jcr.Session
javax.jcr.RepositoryException
public void removeLockToken(java.lang.String lt)
removeLockToken
in interface javax.jcr.Session
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
in interface javax.jcr.Session
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
protected void saveNodes(Path pathprefix) throws javax.jcr.RepositoryException
pathprefix
-
javax.jcr.RepositoryException
public boolean itemExists(Path absPath) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public void remove(ItemImpl itemImpl) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public java.util.List<PropertyImpl> getReferences(java.lang.String uuid) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public void importXML(java.lang.String parentAbsPath, java.io.InputStream in, int uuidBehavior) throws java.io.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
importXML
in interface javax.jcr.Session
java.io.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
public org.xml.sax.ContentHandler getImportContentHandler(java.lang.String parentAbsPath, int uuidBehavior) throws javax.jcr.PathNotFoundException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.version.VersionException, javax.jcr.lock.LockException, javax.jcr.RepositoryException
getImportContentHandler
in interface javax.jcr.Session
javax.jcr.PathNotFoundException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.RepositoryException
public void exportDocumentView(java.lang.String absPath, org.xml.sax.ContentHandler contentHandler, boolean skipBinary, boolean noRecurse) throws javax.jcr.PathNotFoundException, org.xml.sax.SAXException, javax.jcr.RepositoryException
exportDocumentView
in interface javax.jcr.Session
javax.jcr.PathNotFoundException
org.xml.sax.SAXException
javax.jcr.RepositoryException
public void exportDocumentView(java.lang.String absPath, java.io.OutputStream out, boolean skipBinary, boolean noRecurse) throws java.io.IOException, javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
exportDocumentView
in interface javax.jcr.Session
java.io.IOException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
public void exportSystemView(java.lang.String absPath, org.xml.sax.ContentHandler contentHandler, boolean skipBinary, boolean noRecurse) throws javax.jcr.PathNotFoundException, org.xml.sax.SAXException, javax.jcr.RepositoryException
exportSystemView
in interface javax.jcr.Session
javax.jcr.PathNotFoundException
org.xml.sax.SAXException
javax.jcr.RepositoryException
public void exportSystemView(java.lang.String absPath, java.io.OutputStream out, boolean skipBinary, boolean noRecurse) throws java.io.IOException, javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
exportSystemView
in interface javax.jcr.Session
java.io.IOException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
public void setNamespacePrefix(java.lang.String newPrefix, java.lang.String existingUri) throws javax.jcr.NamespaceException, javax.jcr.RepositoryException
setNamespacePrefix
in interface javax.jcr.Session
javax.jcr.NamespaceException
javax.jcr.RepositoryException
public java.lang.String getNamespacePrefix(java.lang.String uri) throws javax.jcr.NamespaceException, javax.jcr.RepositoryException
getNamespacePrefix
in interface javax.jcr.Session
javax.jcr.NamespaceException
javax.jcr.RepositoryException
public java.lang.String[] getNamespacePrefixes() throws javax.jcr.RepositoryException
getNamespacePrefixes
in interface javax.jcr.Session
javax.jcr.RepositoryException
public java.lang.String getNamespaceURI(java.lang.String prefix) throws javax.jcr.NamespaceException, javax.jcr.RepositoryException
getNamespaceURI
in interface javax.jcr.Session
javax.jcr.NamespaceException
javax.jcr.RepositoryException
public java.lang.String fromQName(QName c)
fromQName
in interface NamespaceMapper
public QName toQName(java.lang.String c) throws javax.jcr.NamespaceException, javax.jcr.RepositoryException
toQName
in interface NamespaceMapper
javax.jcr.NamespaceException
javax.jcr.RepositoryException
protected NodeImpl createNode(Path absPath, QNodeType assignedType, QNodeDefinition assignedNodeDef, boolean initDefaults) throws javax.jcr.RepositoryException
absPath
- assignedType
- assignedNodeDef
-
javax.jcr.RepositoryException
public java.lang.String toString()
toString
in class java.lang.Object
public void dump()
public Path getPath(PathRef p) throws javax.jcr.PathNotFoundException
p
-
javax.jcr.PathNotFoundException
public PathManager getPathManager()
public void rename(Path path1, Path.Component newName)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |