use of org.apache.jackrabbit.jcr2spi.state.NodeState in project jackrabbit by apache.
the class AccessControlManagerImpl method addNode.
private NodeState addNode(SetTree treeOperation, NodeState parent, Name nodeName, String uuid, Name nodeTypeName) throws RepositoryException {
Operation sp = treeOperation.addChildNode(parent, nodeName, nodeTypeName, uuid);
itemStateMgr.execute(sp);
return (NodeState) ((AddNode) sp).getAddedStates().get(0);
}
use of org.apache.jackrabbit.jcr2spi.state.NodeState in project jackrabbit by apache.
the class AccessControlManagerImpl method checkAcccessControlItem.
/**
* Checks whether if the given nodePath points to an access
* control policy or entry node.
* @param nodePath
* @throws AccessControlException
* @throws RepositoryException
*/
private void checkAcccessControlItem(String nodePath) throws AccessControlException, RepositoryException {
NodeState controlledState = getNodeState(nodePath);
Name ntName = controlledState.getNodeTypeName();
boolean isAcItem = ntName.equals(NT_REP_ACL) || ntName.equals(NT_REP_GRANT_ACE) || ntName.equals(NT_REP_DENY_ACE);
if (isAcItem) {
throw new AccessControlException("The path: " + nodePath + " points to an access control content node");
}
}
use of org.apache.jackrabbit.jcr2spi.state.NodeState in project jackrabbit by apache.
the class VersionHistoryImpl method removeVersion.
/**
* @see VersionHistory#removeVersion(String)
*/
public void removeVersion(String versionName) throws ReferentialIntegrityException, AccessDeniedException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
checkStatus();
NodeState vState = getVersionState(versionName);
session.getVersionStateManager().removeVersion((NodeState) getItemState(), vState);
}
use of org.apache.jackrabbit.jcr2spi.state.NodeState in project jackrabbit by apache.
the class VersionHistoryImpl method getVersion.
/**
* @see VersionHistory#getVersion(String)
*/
public Version getVersion(String versionName) throws VersionException, RepositoryException {
checkStatus();
NodeState vState = getVersionState(versionName);
return (Version) getItemManager().getItem(vState.getHierarchyEntry());
}
use of org.apache.jackrabbit.jcr2spi.state.NodeState in project jackrabbit by apache.
the class VersionHistoryImpl method removeVersionLabel.
/**
* @see VersionHistory#removeVersionLabel(String)
*/
public void removeVersionLabel(String label) throws VersionException, RepositoryException {
checkStatus();
Name qLabel = getQLabel(label);
Version version = getVersionByLabel(qLabel);
NodeState vState = getVersionState(version.getName());
// delegate to version manager that operates on workspace directly
session.getVersionStateManager().removeVersionLabel((NodeState) getItemState(), vState, qLabel);
}
Aggregations