예제 #1
0
파일: Node.cs 프로젝트: gidish/PlanckDB
 /**
  * addChild<p>
  * The method will create new arc which unique name is @param arcName<p>
  * the method is not accessible to the storage user;<p>
  * if the storage user wants to add arc to node he must do the change by the schema;<p>
  * @param child
  * @param arcName
  * @return
  */
 internal Arc addChild(Node child,byte[] arcName)
 {
     Arc arc=new Arc(this,child,arcName);
        this.children.put(arcName,arc);
        child.parents.Add(arc);
     return arc;
 }
예제 #2
0
 public void RemoveArc(Arc arc)
 {
     validate(arc.getChild(),arc.getParent());
     RemoveArcFromNode(arc.getParent(),arc.getName());
 }
예제 #3
0
 public Arc put(byte[] name, Arc arc)
 {
     return map[new ByteArrayWrapper(name)] = arc;
 }
예제 #4
0
 /**
  * removeArcFromNode method
  * Remove arc from node
  * using this method ensure that the server has have accepted
  * the arc removal, and it also ensure that all the clients will
  * receive the change by the same sequence in which the server has.
  * But it is impossible predict the change acceptance time in the remote
  * clients because of networks limits.
  * @param arc
  * @throws AbstractPlanckDBException
  */
 public void RemoveArc(Arc arc)
 {
     if(arc!=null){
         Command command = commandBuilder.buildRemoveChildFromParentNode(arc.getParent().getId(),arc.getName(), arc.getChild().getId(),sessionMetaData.getSchemaId(), core.getCoreManager().getKey(),sessionMetaData.GetSessionId(),lockTimeout);
         commandExecutor.produce(command);
     }else{
         throw new PlanckDBException(CommandStatus.noChildParentReference,CommandStatus.noChildParentReference.getMessage());
     }
 }
예제 #5
0
 public bool containsValue(Arc arc)
 {
     return map.ContainsValue(arc);
 }