Example #1
0
  public void delPermissionTargetXDIStatement(
      XDIAddress permissionXDIAddress, XDIStatement targetXDIStatement) {

    if (permissionXDIAddress == null || targetXDIStatement == null)
      throw new NullPointerException();

    // delete the permission statement

    XdiInnerRoot xdiInnerRoot = this.getXdiEntity().getXdiInnerRoot(permissionXDIAddress, false);
    if (xdiInnerRoot == null) return;

    Statement statement = xdiInnerRoot.getContextNode().getStatement(targetXDIStatement);
    if (statement == null) return;

    statement.delete();
  }
Example #2
0
  public boolean executeDelOnStatement(
      XRI3Segment[] contributorXris,
      Statement relativeTargetStatement,
      Statement targetStatement,
      DelOperation operation,
      MessageResult messageResult,
      ExecutionContext executionContext)
      throws Xdi2MessagingException {

    if (targetStatement instanceof ContextNodeStatement)
      return this.executeDelOnContextNodeStatement(
          contributorXris,
          (ContextNodeStatement) relativeTargetStatement,
          (ContextNodeStatement) targetStatement,
          operation,
          messageResult,
          executionContext);
    else if (targetStatement instanceof RelationStatement)
      return this.executeDelOnRelationStatement(
          contributorXris,
          (RelationStatement) relativeTargetStatement,
          (RelationStatement) targetStatement,
          operation,
          messageResult,
          executionContext);
    else if (targetStatement instanceof LiteralStatement)
      return this.executeDelOnLiteralStatement(
          contributorXris,
          (LiteralStatement) relativeTargetStatement,
          (LiteralStatement) targetStatement,
          operation,
          messageResult,
          executionContext);
    else
      throw new Xdi2MessagingException(
          "Unknown statement type: " + targetStatement.getClass().getCanonicalName(),
          null,
          executionContext);
  }