Пример #1
0
 /**
  * invalidates the item
  *
  * @param id
  * @param recursive
  */
 public void invalidateItem(ItemId id, boolean recursive) {
   VirtualNodeState state = id.equals(rootNodeId) ? root : (VirtualNodeState) nodes.get(id);
   if (state != null) {
     if (recursive) {
       VirtualPropertyState[] props = state.getProperties();
       for (int i = 0; i < props.length; i++) {
         props[i].notifyStateUpdated();
       }
       for (ChildNodeEntry pe : state.getChildNodeEntries()) {
         invalidateItem(pe.getId(), true);
       }
     }
     state.notifyStateUpdated();
   }
 }
Пример #2
0
 /** {@inheritDoc} */
 public VirtualPropertyState createPropertyState(
     VirtualNodeState parent, Name name, int type, boolean multiValued)
     throws RepositoryException {
   PropertyId id = new PropertyId(parent.getNodeId(), name);
   VirtualPropertyState prop = new VirtualPropertyState(id);
   prop.setType(type);
   prop.setMultiValued(multiValued);
   return prop;
 }
Пример #3
0
  /** {@inheritDoc} */
  public VirtualNodeState createNodeState(
      VirtualNodeState parent, Name name, NodeId id, Name nodeTypeName) throws RepositoryException {

    assert id != null;

    // create a new node state
    VirtualNodeState state =
        new VirtualNodeState(this, parent.getNodeId(), id, nodeTypeName, Name.EMPTY_ARRAY);

    cache(state);
    return state;
  }