use of org.apache.jackrabbit.jcr2spi.hierarchy.PropertyEntry in project jackrabbit by apache.
the class Checkin method persisted.
/**
* Invalidate the target <code>NodeState</code>.
*
* @see Operation#persisted()
*/
public void persisted() {
assert status == STATUS_PENDING;
status = STATUS_PERSISTED;
try {
NodeEntry vhe = mgr.getVersionHistoryEntry(nodeState);
if (vhe != null) {
vhe.invalidate(true);
}
} catch (RepositoryException e) {
log.debug("Failed to access Version history entry -> skip invalidation.", e);
}
Iterator<PropertyEntry> entries = ((NodeEntry) nodeState.getHierarchyEntry()).getPropertyEntries();
while (entries.hasNext()) {
PropertyEntry pe = entries.next();
pe.invalidate(false);
}
nodeState.getHierarchyEntry().invalidate(false);
}
use of org.apache.jackrabbit.jcr2spi.hierarchy.PropertyEntry in project jackrabbit by apache.
the class Checkout method persisted.
/**
* Invalidate the target <code>NodeState</code>.
*
* @see Operation#persisted()
*/
public void persisted() {
assert status == STATUS_PENDING;
status = STATUS_PERSISTED;
try {
NodeEntry vhe = mgr.getVersionHistoryEntry(nodeState);
if (vhe != null) {
vhe.invalidate(true);
}
} catch (RepositoryException e) {
log.warn("Failed to access Version history entry -> skip invalidation.", e);
}
// non-recursive invalidation (but including all properties)
NodeEntry nodeEntry = (NodeEntry) nodeState.getHierarchyEntry();
Iterator<PropertyEntry> entries = nodeEntry.getPropertyEntries();
while (entries.hasNext()) {
PropertyEntry pe = entries.next();
pe.invalidate(false);
}
nodeEntry.invalidate(false);
}
use of org.apache.jackrabbit.jcr2spi.hierarchy.PropertyEntry in project jackrabbit by apache.
the class Checkpoint method persisted.
/**
* Invalidate the target <code>NodeState</code>.
*
* @see org.apache.jackrabbit.jcr2spi.operation.Operation#persisted()
*/
public void persisted() {
assert status == STATUS_PENDING;
status = STATUS_PERSISTED;
try {
NodeEntry vhe = mgr.getVersionHistoryEntry(nodeState);
if (vhe != null) {
vhe.invalidate(true);
}
} catch (RepositoryException e) {
log.warn("Failed to access Version history entry -> skip invalidation.", e);
}
// non-recursive invalidation (but including all properties)
NodeEntry nodeEntry = (NodeEntry) nodeState.getHierarchyEntry();
Iterator<PropertyEntry> entries = nodeEntry.getPropertyEntries();
while (entries.hasNext()) {
PropertyEntry pe = entries.next();
pe.invalidate(false);
}
nodeEntry.invalidate(false);
}
use of org.apache.jackrabbit.jcr2spi.hierarchy.PropertyEntry in project jackrabbit by apache.
the class LockRelease method persisted.
/**
* Invalidates the <code>NodeState</code> that has been unlocked and all its
* child properties.
*
* @see Operation#persisted()
*/
public void persisted() {
assert status == STATUS_PENDING;
status = STATUS_PERSISTED;
// non-recursive invalidation but including all properties
NodeEntry nodeEntry = nodeState.getNodeEntry();
Iterator<PropertyEntry> entries = nodeEntry.getPropertyEntries();
while (entries.hasNext()) {
PropertyEntry pe = entries.next();
pe.invalidate(false);
}
nodeEntry.invalidate(false);
}
use of org.apache.jackrabbit.jcr2spi.hierarchy.PropertyEntry in project jackrabbit by apache.
the class NodeImpl method resolveRelativePropertyPath.
/**
* Returns the id of the property at <code>relPath</code> or <code>null</code>
* if no property exists at <code>relPath</code>.
* <p>
* Note that access rights are not checked.
*
* @param relPath relative path of a (possible) property
* @return the PropertyEntry of the property at <code>relPath</code> or
* <code>null</code> if no property exists at <code>relPath</code>
* @throws RepositoryException if <code>relPath</code> is not a valid
* relative path
*/
private PropertyEntry resolveRelativePropertyPath(String relPath) throws RepositoryException {
PropertyEntry targetEntry = null;
try {
Path rp = session.getPathResolver().getQPath(relPath);
if (rp.getLength() == 1 && rp.denotesName()) {
// a single path element must always denote a name. '.' and '..'
// will never point to a property. If the NodeEntry does not
// contain such a property entry, the targetEntry is 'null;
Name propName = rp.getName();
// check if property entry exists
targetEntry = getNodeEntry().getPropertyEntry(propName, true);
} else {
// build and resolve absolute path
Path p = getPath(rp).getCanonicalPath();
try {
targetEntry = session.getHierarchyManager().getPropertyEntry(p);
} catch (PathNotFoundException e) {
// ignore -> return null;
}
}
} catch (NameException e) {
String msg = "failed to resolve property path " + relPath + " relative to " + safeGetJCRPath();
log.debug(msg);
throw new RepositoryException(msg, e);
}
return targetEntry;
}
Aggregations