|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.priha.core.ItemImpl
org.priha.core.NodeImpl
public class NodeImpl
Implements a Node. This is one of the most heavy classes in Priha, with a lot of stuff happening. The NodeImpl class does some basic caching for some state objects, so keeping references can be faster in some cases.
Field Summary | |
---|---|
protected java.lang.String |
m_cachedUUID
|
static QName |
Q_PRIHA_TMPMOVE
|
Fields inherited from class org.priha.core.ItemImpl |
---|
m_isNew, m_path, m_session |
Constructor Summary | |
---|---|
protected |
NodeImpl(SessionImpl session,
Path path,
QNodeType primaryType,
QNodeDefinition nDef,
boolean populateDefaults)
|
protected |
NodeImpl(SessionImpl session,
java.lang.String path,
QNodeType primaryType,
QNodeDefinition nDef,
boolean populateDefaults)
|
Method Summary | |
---|---|
void |
addMixin(java.lang.String mixinName)
|
NodeImpl |
addNode(java.lang.String relPath)
|
NodeImpl |
addNode(java.lang.String relPath,
java.lang.String primaryNodeTypeName)
|
boolean |
canAddMixin(java.lang.String mixinName)
|
void |
cancelMerge(Version version)
|
VersionImpl |
checkin()
|
void |
checkout()
|
int |
compareTo(Node nd)
|
void |
doneMerge(Version version)
|
boolean |
equals(java.lang.Object obj)
We consider nodes to be equal if they have the exact same path, and all the properties are equal too. |
QPropertyDefinition |
findPropertyDefinition(QName propertyName,
boolean multiple)
Locates a PropertyDefinition for the given property name from the array of the mixintypes and the primary type for this Node. |
VersionImpl |
getBaseVersion()
|
protected java.util.List<Path> |
getChildOrder()
|
PropertyImpl |
getChildProperty(java.lang.String name)
|
java.lang.String |
getCorrespondingNodePath(java.lang.String workspaceName)
|
NodeDefinition |
getDefinition()
|
int |
getIndex()
|
QLock.Impl |
getLock()
|
NodeType[] |
getMixinNodeTypes()
|
NodeImpl |
getNode(Path absPath)
|
NodeImpl |
getNode(QName name)
|
NodeImpl |
getNode(java.lang.String relPath)
|
NodeIterator |
getNodes()
Returns a lazy iterator over the children of this Node. |
NodeIterator |
getNodes(java.lang.String namePattern)
|
ItemImpl |
getPrimaryItem()
|
QNodeType.Impl |
getPrimaryNodeType()
|
QNodeType |
getPrimaryQNodeType()
|
LazyPropertyIteratorImpl |
getProperties()
|
PropertyIterator |
getProperties(java.lang.String namePattern)
|
PropertyImpl |
getProperty(QName propName)
|
PropertyImpl |
getProperty(java.lang.String relPath)
|
QNodeDefinition |
getQDefinition()
|
PropertyIterator |
getReferences()
|
java.lang.String |
getUUID()
Returns the UUID for this node. |
VersionHistoryImpl |
getVersionHistory()
|
boolean |
hasMixinType(java.lang.String mixinType)
|
boolean |
hasNode(QName name)
Returns true, if this Node has a child with the given QName. |
boolean |
hasNode(java.lang.String relPath)
|
boolean |
hasNodes()
|
boolean |
hasProperties()
|
boolean |
hasProperty(QName propName)
|
boolean |
hasProperty(java.lang.String relPath)
|
boolean |
hasTag(java.lang.String name)
Returns true, if this Node has the named tag (i.e. |
boolean |
holdsLock()
|
protected void |
internalSave()
|
boolean |
isCheckedOut()
|
boolean |
isLocked()
|
protected boolean |
isLockedWithoutToken()
Returns true, if this Node is locked (that is, it or it's parents are locked) but the Session which owns this Session does not hold a token to modify it. |
boolean |
isNode()
|
boolean |
isNodeType(java.lang.String nodeTypeName)
|
Lock |
lock(boolean isDeep,
boolean isSessionScoped)
|
NodeIterator |
merge(java.lang.String srcWorkspace,
boolean bestEffort)
|
void |
orderBefore(java.lang.String srcChildRelPath,
java.lang.String destChildRelPath)
|
protected PropertyImpl |
prepareProperty(QName name,
java.lang.Object value)
Finds a property and checks if we're supposed to remove it or not. |
protected PropertyImpl |
prepareProperty(java.lang.String name,
java.lang.Object value)
|
protected void |
preSave()
Performs mandatory housekeeping right before saving. |
void |
remove()
|
void |
removeMixin(java.lang.String mixinName)
|
void |
removeNodeOnly()
|
protected void |
removeProperty(PropertyImpl prop)
Removes a given property from the node. |
void |
restore(java.lang.String versionName,
boolean removeExisting)
|
void |
restore(Version version,
boolean removeExisting)
|
void |
restore(Version version,
java.lang.String relPath,
boolean removeExisting)
|
void |
restoreByLabel(java.lang.String versionLabel,
boolean removeExisting)
|
void |
sanitize()
Assumes nothing, goes through the properties, makes sure all things are correct. |
void |
save()
|
protected void |
setChildOrder(java.util.List<Path> list)
|
PropertyImpl |
setProperty(java.lang.String name,
Node value)
|
Property |
setProperty(java.lang.String name,
java.lang.String[] values)
|
Property |
setProperty(java.lang.String name,
java.lang.String[] values,
int type)
|
PropertyImpl |
setProperty(java.lang.String name,
Value value)
|
PropertyImpl |
setProperty(java.lang.String name,
Value[] values)
|
Property |
setProperty(java.lang.String name,
Value[] values,
int type)
|
PropertyImpl |
setProperty(java.lang.String name,
Value value,
int type)
|
void |
tag(java.lang.String name)
Tag a Node with the given transient property. |
void |
tag(java.lang.String name,
java.lang.String value)
Tags a Node with a given transient property with a String value. |
void |
unlock()
|
void |
update(java.lang.String srcWorkspaceName)
|
Methods inherited from class org.priha.core.ItemImpl |
---|
accept, enterState, getAncestor, getCreationTime, getDepth, getInternalPath, getName, getParent, getPath, getPathReference, getQName, getSession, getState, hashCode, isModified, isNew, isSame, postSave, refresh, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final QName Q_PRIHA_TMPMOVE
protected java.lang.String m_cachedUUID
Constructor Detail |
---|
protected NodeImpl(SessionImpl session, Path path, QNodeType primaryType, QNodeDefinition nDef, boolean populateDefaults) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
protected NodeImpl(SessionImpl session, java.lang.String path, QNodeType primaryType, QNodeDefinition nDef, boolean populateDefaults) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
Method Detail |
---|
public NodeImpl addNode(java.lang.String relPath) throws ItemExistsException, PathNotFoundException, NoSuchNodeTypeException, LockException, VersionException, ConstraintViolationException, RepositoryException
ItemExistsException
PathNotFoundException
NoSuchNodeTypeException
LockException
VersionException
ConstraintViolationException
RepositoryException
public NodeImpl addNode(java.lang.String relPath, java.lang.String primaryNodeTypeName) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, RepositoryException
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
RepositoryException
public java.lang.String getCorrespondingNodePath(java.lang.String workspaceName) throws ItemNotFoundException, NoSuchWorkspaceException, AccessDeniedException, RepositoryException
ItemNotFoundException
NoSuchWorkspaceException
AccessDeniedException
RepositoryException
public NodeDefinition getDefinition() throws RepositoryException
RepositoryException
public QNodeDefinition getQDefinition()
public int getIndex() throws RepositoryException
RepositoryException
protected java.util.List<Path> getChildOrder()
protected void setChildOrder(java.util.List<Path> list)
public NodeImpl getNode(Path absPath) throws PathNotFoundException, RepositoryException
PathNotFoundException
RepositoryException
public NodeImpl getNode(java.lang.String relPath) throws PathNotFoundException, RepositoryException
PathNotFoundException
RepositoryException
public NodeImpl getNode(QName name) throws PathNotFoundException, RepositoryException
PathNotFoundException
RepositoryException
public NodeIterator getNodes() throws RepositoryException
RepositoryException
public NodeIterator getNodes(java.lang.String namePattern) throws RepositoryException
RepositoryException
public ItemImpl getPrimaryItem() throws ItemNotFoundException, RepositoryException
ItemNotFoundException
RepositoryException
public QNodeType getPrimaryQNodeType()
public QNodeType.Impl getPrimaryNodeType() throws RepositoryException
RepositoryException
public LazyPropertyIteratorImpl getProperties() throws RepositoryException
RepositoryException
public PropertyIterator getProperties(java.lang.String namePattern) throws RepositoryException
RepositoryException
public PropertyImpl getChildProperty(java.lang.String name) throws RepositoryException
RepositoryException
public PropertyImpl getProperty(QName propName) throws PathNotFoundException, RepositoryException
PathNotFoundException
RepositoryException
public PropertyImpl getProperty(java.lang.String relPath) throws PathNotFoundException, RepositoryException
PathNotFoundException
RepositoryException
public PropertyIterator getReferences() throws RepositoryException
RepositoryException
public java.lang.String getUUID() throws UnsupportedRepositoryOperationException, RepositoryException
UnsupportedRepositoryOperationException
RepositoryException
public VersionHistoryImpl getVersionHistory() throws UnsupportedRepositoryOperationException, RepositoryException
UnsupportedRepositoryOperationException
RepositoryException
public boolean hasNode(java.lang.String relPath) throws RepositoryException
RepositoryException
public boolean hasNode(QName name) throws RepositoryException
name
- A QName.
RepositoryException
public boolean hasNodes() throws RepositoryException
RepositoryException
public boolean hasProperties() throws RepositoryException
RepositoryException
public boolean hasProperty(QName propName) throws RepositoryException
RepositoryException
public boolean hasProperty(java.lang.String relPath) throws RepositoryException
RepositoryException
public boolean isNodeType(java.lang.String nodeTypeName) throws RepositoryException
RepositoryException
public void orderBefore(java.lang.String srcChildRelPath, java.lang.String destChildRelPath) throws UnsupportedRepositoryOperationException, VersionException, ConstraintViolationException, ItemNotFoundException, LockException, RepositoryException
UnsupportedRepositoryOperationException
VersionException
ConstraintViolationException
ItemNotFoundException
LockException
RepositoryException
protected PropertyImpl prepareProperty(java.lang.String name, java.lang.Object value) throws PathNotFoundException, RepositoryException
PathNotFoundException
RepositoryException
protected PropertyImpl prepareProperty(QName name, java.lang.Object value) throws PathNotFoundException, RepositoryException
name
- value
-
PathNotFoundException
RepositoryException
protected void removeProperty(PropertyImpl prop) throws RepositoryException
prop
-
RepositoryException
public PropertyImpl setProperty(java.lang.String name, Value value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public PropertyImpl setProperty(java.lang.String name, Value value, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public PropertyImpl setProperty(java.lang.String name, Value[] values) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public Property setProperty(java.lang.String name, Value[] values, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public Property setProperty(java.lang.String name, java.lang.String[] values) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public Property setProperty(java.lang.String name, java.lang.String[] values, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public void tag(java.lang.String name) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
name
-
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
PropertyImpl.isTransient()
public void tag(java.lang.String name, java.lang.String value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
name
- Name of the property to setvalue
- Value for the property
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
PropertyImpl.isTransient()
public boolean hasTag(java.lang.String name) throws RepositoryException
name
- Tag to check for
RepositoryException
- If the Repository is b0rken.PropertyImpl.isTransient()
public PropertyImpl setProperty(java.lang.String name, Node value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public void update(java.lang.String srcWorkspaceName) throws NoSuchWorkspaceException, AccessDeniedException, LockException, InvalidItemStateException, RepositoryException
NoSuchWorkspaceException
AccessDeniedException
LockException
InvalidItemStateException
RepositoryException
public boolean isNode()
ItemImpl
isNode
in class ItemImpl
protected void internalSave() throws RepositoryException
RepositoryException
public void save() throws AccessDeniedException, ItemExistsException, ConstraintViolationException, InvalidItemStateException, ReferentialIntegrityException, VersionException, LockException, NoSuchNodeTypeException, RepositoryException
ItemImpl
save
in class ItemImpl
AccessDeniedException
ItemExistsException
ConstraintViolationException
InvalidItemStateException
ReferentialIntegrityException
VersionException
LockException
NoSuchNodeTypeException
RepositoryException
public int compareTo(Node nd)
compareTo
in interface java.lang.Comparable<Node>
public void remove() throws VersionException, LockException, ConstraintViolationException, RepositoryException
ItemImpl
remove
in class ItemImpl
VersionException
LockException
ConstraintViolationException
RepositoryException
public void removeNodeOnly() throws VersionException, LockException, ConstraintViolationException, RepositoryException
VersionException
LockException
ConstraintViolationException
RepositoryException
public QPropertyDefinition findPropertyDefinition(QName propertyName, boolean multiple) throws RepositoryException
propertyName
- The QName of the property to look formultiple
- Is this a multiproperty or a single property?
RepositoryException
- If mixin node types cannot be determined.public void sanitize() throws RepositoryException
RepositoryException
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
protected void preSave() throws RepositoryException
ItemImpl
preSave
in class ItemImpl
RepositoryException
- If something goes wrongpublic void addMixin(java.lang.String mixinName) throws NoSuchNodeTypeException, VersionException, ConstraintViolationException, LockException, RepositoryException
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
RepositoryException
public boolean canAddMixin(java.lang.String mixinName) throws NoSuchNodeTypeException, RepositoryException
NoSuchNodeTypeException
RepositoryException
public boolean hasMixinType(java.lang.String mixinType)
public NodeType[] getMixinNodeTypes() throws RepositoryException
RepositoryException
public void removeMixin(java.lang.String mixinName) throws NoSuchNodeTypeException, VersionException, ConstraintViolationException, LockException, RepositoryException
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
RepositoryException
public Lock lock(boolean isDeep, boolean isSessionScoped) throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, InvalidItemStateException, RepositoryException
UnsupportedRepositoryOperationException
LockException
AccessDeniedException
InvalidItemStateException
RepositoryException
public void unlock() throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, InvalidItemStateException, RepositoryException
UnsupportedRepositoryOperationException
LockException
AccessDeniedException
InvalidItemStateException
RepositoryException
public QLock.Impl getLock() throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException
UnsupportedRepositoryOperationException
LockException
AccessDeniedException
RepositoryException
public boolean holdsLock() throws RepositoryException
RepositoryException
public boolean isLocked() throws RepositoryException
RepositoryException
protected boolean isLockedWithoutToken()
public boolean isCheckedOut() throws RepositoryException
RepositoryException
public void cancelMerge(Version version) throws VersionException, InvalidItemStateException, UnsupportedRepositoryOperationException, RepositoryException
VersionException
InvalidItemStateException
UnsupportedRepositoryOperationException
RepositoryException
public VersionImpl checkin() throws VersionException, UnsupportedRepositoryOperationException, InvalidItemStateException, LockException, RepositoryException
VersionException
UnsupportedRepositoryOperationException
InvalidItemStateException
LockException
RepositoryException
public void checkout() throws UnsupportedRepositoryOperationException, LockException, RepositoryException
UnsupportedRepositoryOperationException
LockException
RepositoryException
public void doneMerge(Version version) throws VersionException, InvalidItemStateException, UnsupportedRepositoryOperationException, RepositoryException
VersionException
InvalidItemStateException
UnsupportedRepositoryOperationException
RepositoryException
public VersionImpl getBaseVersion() throws UnsupportedRepositoryOperationException, RepositoryException
UnsupportedRepositoryOperationException
RepositoryException
public void restore(java.lang.String versionName, boolean removeExisting) throws VersionException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException
VersionException
ItemExistsException
UnsupportedRepositoryOperationException
LockException
InvalidItemStateException
RepositoryException
public void restore(Version version, boolean removeExisting) throws VersionException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, RepositoryException
VersionException
ItemExistsException
UnsupportedRepositoryOperationException
LockException
RepositoryException
public void restore(Version version, java.lang.String relPath, boolean removeExisting) throws PathNotFoundException, ItemExistsException, VersionException, ConstraintViolationException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException
PathNotFoundException
ItemExistsException
VersionException
ConstraintViolationException
UnsupportedRepositoryOperationException
LockException
InvalidItemStateException
RepositoryException
public void restoreByLabel(java.lang.String versionLabel, boolean removeExisting) throws VersionException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException
VersionException
ItemExistsException
UnsupportedRepositoryOperationException
LockException
InvalidItemStateException
RepositoryException
public NodeIterator merge(java.lang.String srcWorkspace, boolean bestEffort) throws NoSuchWorkspaceException, AccessDeniedException, MergeException, LockException, InvalidItemStateException, RepositoryException
NoSuchWorkspaceException
AccessDeniedException
MergeException
LockException
InvalidItemStateException
RepositoryException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |