Ejemplo n.º 1
0
 /**
  * removeArc 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 parent
  * @param arcName
  * @throws AbstractPlanckDBException
  */
 public void RemoveArcFromNode(Node parent, byte[] arcName)
 {
     Arc arc=parent.getChildArc(arcName);
     if(arc!=null){
         Command command = commandBuilder.buildRemoveChildFromParentNode(parent.getId(),arcName, arc.getChild().getId(),sessionMetaData.getSchemaId(), core.getCoreManager().getKey(),sessionMetaData.GetSessionId(),lockTimeout);
         commandExecutor.produce(command);
     }else{
         throw new PlanckDBException(CommandStatus.noChildParentReference,CommandStatus.noChildParentReference.getMessage());
     }
 }
Ejemplo n.º 2
0
 public void removeChildFromParent(Node parent, byte[] arcName)
 {
     if(transaction!=null){
         transaction.removeChildFromParent(parent, arcName);
     }else{
         validateSchemaEntity(parent);
         Arc arc = parent.getChildArc(arcName);
         if(arc!=null){
             int schemaId=sessionMetaData.getSchemaId();
             int coreManagerId=core.getCoreManager().getKey();
             int sessionId=core.getSessionMetaData().GetSessionId();
             Command command = commandBuilder.buildRemoveChildFromParentNode(parent.getId(),arc.getName(), arc.getChild().getId(), schemaId,coreManagerId, sessionId, schemaAdapter.getLockTimeout());
             command.Push(PlanckDBConstants.TRANSACTION, PlanckDBConstants.INTEGER, PlanckDBConstants.TRUE);
             commandExecutor.consume(command);
             commandsList.Add(command);
         }else{
             throw new PlanckDBException(CommandStatus.noChildParentReference,CommandStatus.noChildParentReference.getMessage());
         }
     }
 }