|
|||||||||
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,
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()
|
java.lang.String |
getId()
|
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()
|
Session |
impersonate(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, Credentials creds, java.lang.String name) throws RepositoryException
RepositoryException
Method Detail |
---|
public java.lang.String getId()
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 RepositoryException
RepositoryException
public boolean hasNode(Path absPath) throws RepositoryException
RepositoryException
public void addLockToken(java.lang.String lt)
public void checkPermission(java.lang.String absPath, java.lang.String actions) throws java.security.AccessControlException, RepositoryException
java.security.AccessControlException
RepositoryException
protected void checkWritePermission() throws java.security.AccessControlException, RepositoryException
java.security.AccessControlException
RepositoryException
public java.lang.Object getAttribute(java.lang.String name)
public java.lang.String[] getAttributeNames()
public ItemImpl getItem(Path absPath) throws PathNotFoundException, RepositoryException
PathNotFoundException
RepositoryException
public ItemImpl getItem(java.lang.String absPath) throws PathNotFoundException, RepositoryException
PathNotFoundException
RepositoryException
public java.lang.String[] getLockTokens()
public NodeImpl getNodeByUUID(java.lang.String uuid) throws ItemNotFoundException, RepositoryException
ItemNotFoundException
RepositoryException
public RepositoryImpl getRepository()
public NodeImpl getRootNode() throws RepositoryException
RepositoryException
public java.lang.String getUserID()
public ValueFactoryImpl getValueFactory() throws UnsupportedRepositoryOperationException, RepositoryException
UnsupportedRepositoryOperationException
RepositoryException
public WorkspaceImpl getWorkspace()
public boolean hasPendingChanges() throws RepositoryException
RepositoryException
public Session impersonate(Credentials credentials) throws LoginException, RepositoryException
LoginException
RepositoryException
public final boolean isLive()
public boolean itemExists(java.lang.String absPath) throws RepositoryException
RepositoryException
public void logout()
public void move(Path srcPath, Path destPath) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, NamespaceException, RepositoryException
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
NamespaceException
RepositoryException
public void move(java.lang.String srcAbsPath, java.lang.String destAbsPath) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, RepositoryException
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
RepositoryException
public void internalMove(Path srcPath, Path destPath, boolean obeyConstraints) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, NamespaceException, RepositoryException
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
NamespaceException
RepositoryException
public void internalMove(java.lang.String srcAbsPath, java.lang.String destAbsPath, boolean obeyConstraints) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, RepositoryException
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
RepositoryException
public void refresh(boolean keepChanges) throws RepositoryException
RepositoryException
public void removeLockToken(java.lang.String lt)
public void save() throws AccessDeniedException, ItemExistsException, ConstraintViolationException, InvalidItemStateException, VersionException, LockException, NoSuchNodeTypeException, RepositoryException
AccessDeniedException
ItemExistsException
ConstraintViolationException
InvalidItemStateException
VersionException
LockException
NoSuchNodeTypeException
RepositoryException
protected void saveNodes(Path pathprefix) throws RepositoryException
pathprefix
-
RepositoryException
public boolean itemExists(Path absPath) throws RepositoryException
RepositoryException
public void remove(ItemImpl itemImpl) throws RepositoryException
RepositoryException
public java.util.List<PropertyImpl> getReferences(java.lang.String uuid) throws RepositoryException
RepositoryException
public void importXML(java.lang.String parentAbsPath, java.io.InputStream in, int uuidBehavior) throws java.io.IOException, PathNotFoundException, ItemExistsException, ConstraintViolationException, VersionException, InvalidSerializedDataException, LockException, RepositoryException
java.io.IOException
PathNotFoundException
ItemExistsException
ConstraintViolationException
VersionException
InvalidSerializedDataException
LockException
RepositoryException
public org.xml.sax.ContentHandler getImportContentHandler(java.lang.String parentAbsPath, int uuidBehavior) throws PathNotFoundException, ConstraintViolationException, VersionException, LockException, RepositoryException
PathNotFoundException
ConstraintViolationException
VersionException
LockException
RepositoryException
public void exportDocumentView(java.lang.String absPath, org.xml.sax.ContentHandler contentHandler, boolean skipBinary, boolean noRecurse) throws PathNotFoundException, org.xml.sax.SAXException, RepositoryException
PathNotFoundException
org.xml.sax.SAXException
RepositoryException
public void exportDocumentView(java.lang.String absPath, java.io.OutputStream out, boolean skipBinary, boolean noRecurse) throws java.io.IOException, PathNotFoundException, RepositoryException
java.io.IOException
PathNotFoundException
RepositoryException
public void exportSystemView(java.lang.String absPath, org.xml.sax.ContentHandler contentHandler, boolean skipBinary, boolean noRecurse) throws PathNotFoundException, org.xml.sax.SAXException, RepositoryException
PathNotFoundException
org.xml.sax.SAXException
RepositoryException
public void exportSystemView(java.lang.String absPath, java.io.OutputStream out, boolean skipBinary, boolean noRecurse) throws java.io.IOException, PathNotFoundException, RepositoryException
java.io.IOException
PathNotFoundException
RepositoryException
public void setNamespacePrefix(java.lang.String newPrefix, java.lang.String existingUri) throws NamespaceException, RepositoryException
NamespaceException
RepositoryException
public java.lang.String getNamespacePrefix(java.lang.String uri) throws NamespaceException, RepositoryException
NamespaceException
RepositoryException
public java.lang.String[] getNamespacePrefixes() throws RepositoryException
RepositoryException
public java.lang.String getNamespaceURI(java.lang.String prefix) throws NamespaceException, RepositoryException
NamespaceException
RepositoryException
public java.lang.String fromQName(QName c)
fromQName
in interface NamespaceMapper
public QName toQName(java.lang.String c) throws NamespaceException, RepositoryException
toQName
in interface NamespaceMapper
NamespaceException
RepositoryException
protected NodeImpl createNode(Path absPath, QNodeType assignedType, QNodeDefinition assignedNodeDef, boolean initDefaults) throws RepositoryException
absPath
- assignedType
- assignedNodeDef
-
RepositoryException
public java.lang.String toString()
toString
in class java.lang.Object
public void dump()
public Path getPath(PathRef p) throws PathNotFoundException
p
-
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 |