@Override public Statement setStatement(XDIStatement XDIstatement) { return this.getRootContextNode(false).setStatement(XDIstatement); }
public void setPermissionTargetXDIStatement(XDIAddress permissionXDIAddress, XDIStatement targetXDIStatement) { if (permissionXDIAddress == null || targetXDIStatement == null) throw new NullPointerException(); // prepare the target statement XdiInnerRoot xdiInnerRoot = this.getPermissionsXdiEntity().getXdiInnerRoot(permissionXDIAddress, true); if (xdiInnerRoot == null) return; // set the permission statement xdiInnerRoot.getContextNode().setStatement(targetXDIStatement); }
@Override public void manipulate(Message message, ManipulationContext manipulationContext) throws Xdi2ClientException { if (this.getStatements() != null) { for (XDIStatement statement : this.getStatements()) { message.getContextNode().setStatement(statement); } } }
/** * Creates a new $send operation and adds it to this XDI message (template). * @param targetXDIStatements The target statements to which the operation applies. * @return The newly created $send operation. */ public SendOperation createSendOperation(Iterator<XDIStatement> targetXDIStatements) { XdiInnerRoot xdiInnerRoot = XdiEntitySingleton.fromContextNode(this.getOperationsContextNode()).getXdiInnerRoot(XDIMessagingConstants.XDI_ADD_SEND, true); if (targetXDIStatements != null) while (targetXDIStatements.hasNext()) xdiInnerRoot.getContextNode().setStatement(targetXDIStatements.next()); return SendOperation.fromMessageBaseAndRelation(this, xdiInnerRoot.getPredicateRelation()); }
/** * Creates a new message push result and adds it to this XDI message (template). * @param messagePushResultGraph The message push result graph to add to this XDI message (template). * @return The newly created message push result represented as an XDI inner root. */ public XdiInnerRoot createMessageDeferredPushResult(Graph messagePushResultGraph) { if (messagePushResultGraph == null) throw new NullPointerException(); Iterator<XDIStatement> statements = new MappingXDIStatementIterator(new SelectingNotImpliedStatementIterator(messagePushResultGraph.getAllStatements())); XdiInnerRoot xdiInnerRoot = this.getXdiSubGraph().getXdiInnerRoot(XDIMessagingConstants.XDI_ADD_DEFER_PUSH, true); while (statements.hasNext()) xdiInnerRoot.getContextNode().setStatement(statements.next()); return xdiInnerRoot; }
/** * Creates a new $del operation and adds it to this XDI message (template). * @param targetXDIStatements The target statements to which the operation applies. * @return The newly created $del operation. */ public DelOperation createDelOperation(Iterator<XDIStatement> targetXDIStatements) { XdiInnerRoot xdiInnerRoot = XdiEntitySingleton.fromContextNode(this.getOperationsContextNode()).getXdiInnerRoot(XDIMessagingConstants.XDI_ADD_DEL, true); if (targetXDIStatements != null) while (targetXDIStatements.hasNext()) xdiInnerRoot.getContextNode().setStatement(targetXDIStatements.next()); return DelOperation.fromMessageBaseAndRelation(this, xdiInnerRoot.getPredicateRelation()); }
/** * Creates a new $connect operation and adds it to this XDI message (template). * @param targetXDIStatements The target statements to which the operation applies. * @return The newly created $connect operation. */ public ConnectOperation createConnectOperation(Iterator<XDIStatement> targetXDIStatements) { XdiInnerRoot xdiInnerRoot = XdiEntitySingleton.fromContextNode(this.getOperationsContextNode()).getXdiInnerRoot(XDIMessagingConstants.XDI_ADD_CONNECT, true); if (targetXDIStatements != null) while (targetXDIStatements.hasNext()) xdiInnerRoot.getContextNode().setStatement(targetXDIStatements.next()); return ConnectOperation.fromMessageBaseAndRelation(this, xdiInnerRoot.getPredicateRelation()); }
/** * Creates a new $push operation and adds it to this XDI message (template). * @param targetXDIStatements The target statements to which the operation applies. * @return The newly created $push operation. */ public PushOperation createPushOperation(Iterator<XDIStatement> targetXDIStatements) { XdiInnerRoot xdiInnerRoot = XdiEntitySingleton.fromContextNode(this.getOperationsContextNode()).getXdiInnerRoot(XDIMessagingConstants.XDI_ADD_PUSH, true); if (targetXDIStatements != null) while (targetXDIStatements.hasNext()) xdiInnerRoot.getContextNode().setStatement(targetXDIStatements.next()); return PushOperation.fromMessageBaseAndRelation(this, xdiInnerRoot.getPredicateRelation()); }
/** * Creates a new $get operation and adds it to this XDI message (template). * @param targetXDIStatements The target statements to which the operation applies. * @return The newly created $get operation. */ public GetOperation createGetOperation(Iterator<XDIStatement> targetXDIStatements) { XdiInnerRoot xdiInnerRoot = XdiEntitySingleton.fromContextNode(this.getOperationsContextNode()).getXdiInnerRoot(XDIMessagingConstants.XDI_ADD_GET, true); if (targetXDIStatements != null) while (targetXDIStatements.hasNext()) xdiInnerRoot.getContextNode().setStatement(targetXDIStatements.next()); return GetOperation.fromMessageBaseAndRelation(this, xdiInnerRoot.getPredicateRelation()); }
/** * Creates a new $do operation and adds it to this XDI message (template). * @param targetXDIStatements The target statements to which the operation applies. * @return The newly created $do operation. */ public DoOperation createDoOperation(Iterator<XDIStatement> targetXDIStatements) { XdiInnerRoot xdiInnerRoot = XdiEntitySingleton.fromContextNode(this.getOperationsContextNode()).getXdiInnerRoot(XDIMessagingConstants.XDI_ADD_DO, true); if (targetXDIStatements != null) while (targetXDIStatements.hasNext()) xdiInnerRoot.getContextNode().setStatement(targetXDIStatements.next()); return DoOperation.fromMessageBaseAndRelation(this, xdiInnerRoot.getPredicateRelation()); }
/** * Creates a new operation and adds it to this XDI message (template). * @param operationXDIAddress The operation address to use for the new operation. * @param targetXDIStatements The target statements to which the operation applies. * @return The newly created, empty operation, or null if the operation address is not valid. */ public Operation createOperation(XDIAddress operationXDIAddress, Iterator<XDIStatement> targetXDIStatements) { XdiInnerRoot xdiInnerRoot = XdiEntitySingleton.fromContextNode(this.getOperationsContextNode()).getXdiInnerRoot(operationXDIAddress, true); if (targetXDIStatements != null) while (targetXDIStatements.hasNext()) xdiInnerRoot.getContextNode().setStatement(targetXDIStatements.next()); return Operation.fromMessageBaseAndRelation(this, xdiInnerRoot.getPredicateRelation()); }
/** * Creates a new $set operation and adds it to this XDI message (template). * @param targetXDIStatements The target statements to which the operation applies. * @return The newly created $set operation. */ public SetOperation createSetOperation(Iterator<XDIStatement> targetXDIStatements) { XdiInnerRoot xdiInnerRoot = XdiEntitySingleton.fromContextNode(this.getOperationsContextNode()).getXdiInnerRoot(XDIMessagingConstants.XDI_ADD_SET, true); if (targetXDIStatements != null) while (targetXDIStatements.hasNext()) xdiInnerRoot.getContextNode().setStatement(targetXDIStatements.next()); return SetOperation.fromMessageBaseAndRelation(this, xdiInnerRoot.getPredicateRelation()); }
/** * Creates a new operation result and adds it to this XDI message (template). * @param operationXDIAddress The operation address to use for the new operation result. * @param resultGraph The result graph to add to this XDI message (template). * @return The newly created operation result represented as an XDI inner root. */ public XdiInnerRoot createOperationResult(XDIAddress operationXDIAddress, Graph resultGraph) { if (resultGraph == null) throw new NullPointerException(); Iterator<XDIStatement> statements = new MappingXDIStatementIterator(new SelectingNotImpliedStatementIterator(resultGraph.getAllStatements())); XdiInnerRoot xdiInnerRoot = this.getXdiSubGraph().getXdiInnerRoot(operationXDIAddress, true); while (statements.hasNext()) xdiInnerRoot.getContextNode().setStatement(statements.next()); return xdiInnerRoot; }
public static TrueOperator createTrueOperator(Policy policy, Condition condition) { if (policy == null) throw new NullPointerException(); XdiInnerRoot xdiInnerRoot = policy.getXdiEntity().getXdiInnerRoot(XDIConstants.XDI_ADD_TRUE, true); xdiInnerRoot.getContextNode().setStatement(condition.getXDIStatement()); return fromRelation(xdiInnerRoot.getPredicateRelation()); }
public static FalseOperator createFalseOperator(Policy policy, Condition condition) { if (policy == null) throw new NullPointerException(); XdiInnerRoot xdiInnerRoot = policy.getXdiEntity().getXdiInnerRoot(XDIConstants.XDI_ADD_FALSE, true); xdiInnerRoot.getContextNode().setStatement(condition.getXDIStatement()); return fromRelation(xdiInnerRoot.getPredicateRelation()); }