Ejemplo n.º 1
0
 /**
  * deleteNode method;
  * Delete node
  * Deleting node by this method ensure that the server has have accepted
  * the node deletion, 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 node
  * @throws PlanckDBException
  * @throws TransactionException
  */
 public void DeleteNode(Node node)
 {
     List<NodeAttribute> values = node.getAttributes().values();
     NodeAttribute[] oldAttributes =values.ToArray();
     Command command = commandBuilder.buildDeleteNode(node.getId(), node.getLock(), sessionMetaData.getSchemaId(), core.getCoreManager().getKey(), sessionMetaData.GetSessionId(),  lockTimeout,oldAttributes);
     commandExecutor.produce(command);
 }
Ejemplo n.º 2
0
 /**
  * deleteNode method<p>
  * deletes node inside transaction
  * Like the non transactional schemaAdapter in deleteNode entity,<p>
  * but unlike the non transactional schemaAdapter, the change doesn't the effect in the server until they will be commited
  * @param node
  * @throws PlanckDBException
  * @throws TransactionException
  * @throws EntityLockException
  */
 public void deleteNode(Node node)
 {
     if(transaction!=null){
         transaction.deleteNode(node);
     }else{
         validateSchemaEntity(node);
         int schemaId=sessionMetaData.getSchemaId();
         int coreManagerId=core.getCoreManager().getKey();
         int sessionId=core.getSessionMetaData().GetSessionId();
         List<NodeAttribute> values = node.getAttributes().values();
         NodeAttribute[] attributes = values.ToArray();
         Command command = commandBuilder.buildDeleteNode(node.getId(), node.getLock(), schemaId, coreManagerId, sessionId, schemaAdapter.getLockTimeout(), attributes);
         command.Push(PlanckDBConstants.TRANSACTION, PlanckDBConstants.INTEGER, PlanckDBConstants.TRUE);
         commandExecutor.consume(command);
         commandsList.Add(command);
     }
 }