/** * Get the names of this node's mixin types. * * @return the mixin type names; never null but possibly empty * @throws ItemNotFoundException if this node no longer exists in the repository * @throws InvalidItemStateException if the node has been removed in this session's transient state */ Set<Name> getMixinTypeNames() throws ItemNotFoundException, InvalidItemStateException { return node().getMixinTypes(sessionCache()); }
/** * Get the name of this node's primary type. * * @return the primary type name * @throws ItemNotFoundException if this node no longer exists in the repository * @throws InvalidItemStateException if the node has been removed in this session's transient state */ Name getPrimaryTypeName() throws ItemNotFoundException, InvalidItemStateException { return node().getPrimaryType(sessionCache()); }
/** * Get the name of this node's primary type. * * @return the primary type name * @throws ItemNotFoundException if this node no longer exists in the repository * @throws InvalidItemStateException if the node has been removed in this session's transient state */ Name getPrimaryTypeName() throws ItemNotFoundException, InvalidItemStateException { return node().getPrimaryType(sessionCache()); }
/** * Get the names of this node's mixin types. * * @return the mixin type names; never null but possibly empty * @throws ItemNotFoundException if this node no longer exists in the repository * @throws InvalidItemStateException if the node has been removed in this session's transient state */ Set<Name> getMixinTypeNames() throws ItemNotFoundException, InvalidItemStateException { return node().getMixinTypes(sessionCache()); }
protected final MutableCachedNode mutableParent() throws RepositoryException { SessionCache cache = sessionCache(); return cache.mutable(parentKey()); }
@Override public NodeType[] getMixinNodeTypes() throws RepositoryException { checkSession(); JcrNodeTypeManager nodeTypeManager = session().nodeTypeManager(); List<NodeType> mixinNodeTypes = new LinkedList<NodeType>(); for (Name mixinTypeName : node().getMixinTypes(sessionCache())) { NodeType nodeType = nodeTypeManager.getNodeType(mixinTypeName); if (nodeType != null) mixinNodeTypes.add(nodeType); } return mixinNodeTypes.toArray(new NodeType[mixinNodeTypes.size()]); }
@Override public boolean hasProperties() throws RepositoryException { checkSession(); return node().hasProperties(sessionCache()); }
@Override public boolean hasProperties() throws RepositoryException { checkSession(); return node().hasProperties(sessionCache()); }
boolean removeProperty( AbstractJcrProperty property ) { if (jcrProperties.remove(property.name(), property)) { mutable().removeProperty(sessionCache(), property.name()); return true; } return false; }
boolean removeProperty( AbstractJcrProperty property ) { if (jcrProperties.remove(property.name(), property)) { mutable().removeProperty(sessionCache(), property.name()); return true; } return false; }
/** * Get the total number of children. * * @return the total number of children * @throws RepositoryException */ protected final long childCount() throws RepositoryException { return node().getChildReferences(sessionCache()).size(); }
@Override public PropertyIterator getProperties() throws RepositoryException { checkSession(); Iterator<Property> iter = node().getProperties(sessionCache()); return new JcrPropertyIterator(findJcrProperties(iter)); }
boolean isReferenceable() throws RepositoryException { SessionCache cache = sessionCache(); NodeTypes nodeTypes = session().nodeTypes(); try { CachedNode node = node(); return nodeTypes.isReferenceable(node.getPrimaryType(cache), node.getMixinTypes(cache)); } catch (ItemNotFoundException e) { // The node has been removed, so do nothing } return false; }
@Override public JcrNodeType getPrimaryNodeType() throws RepositoryException { checkSession(); return session().nodeTypeManager().getNodeType(node().getPrimaryType(sessionCache())); }
boolean isReferenceable() throws RepositoryException { SessionCache cache = sessionCache(); NodeTypes nodeTypes = session().nodeTypes(); try { CachedNode node = node(); return nodeTypes.isReferenceable(node.getPrimaryType(cache), node.getMixinTypes(cache)); } catch (ItemNotFoundException e) { // The node has been removed, so do nothing } return false; }
@Override public JcrNodeType getPrimaryNodeType() throws RepositoryException { checkSession(); return session().nodeTypeManager().getNodeType(node().getPrimaryType(sessionCache())); }
protected NodeIterator getNodesInternal() throws RepositoryException { ChildReferences childReferences = node().getChildReferences(sessionCache()); if (childReferences.isEmpty()) return JcrEmptyNodeIterator.INSTANCE; return new JcrChildNodeIterator(new ChildNodeResolver(session, key(), false), childReferences); }
protected AbstractJcrNode getNodeIfExists( Name childName ) throws RepositoryException { // It's just a name, so look for a child ... ChildReference ref = node().getChildReferences(sessionCache()).getChild(childName); return ref != null ? session().node(ref.getKey(), null, key()) : null; }
AbstractJcrNode getNode( Name childName ) throws PathNotFoundException, RepositoryException { // It's just a name, so look for a child ... ChildReference ref = node().getChildReferences(sessionCache()).getChild(childName); if (ref == null) { String msg = JcrI18n.childNotFoundUnderNode.text(readable(childName), location(), session.workspaceName()); throw new PathNotFoundException(msg); } return session().node(ref.getKey(), null, key()); }
@Override public NodeIterator getNodes() throws RepositoryException { checkSession(); ChildReferences childReferences = node().getChildReferences(sessionCache()); if (childReferences.isEmpty()) return JcrEmptyNodeIterator.INSTANCE; // if we don't require permission checking, we should use the child references directly since it may have precomputed the size return session.checkPermissionsWhenIteratingChildren() ? new JcrChildNodeIterator(new ChildNodeResolver(session, key()), childReferences.iterator()) : new JcrChildNodeIterator(new ChildNodeResolver(session, key()), childReferences); }