public static ReadOnlyIterator<Relation> getAggregationRelations(ContextNode contextNode) { ReadOnlyIterator<Relation> relations = contextNode.getRelations(XDIDictionaryConstants.XDI_ADD_HAS); return relations; }
public static ReadOnlyIterator<Relation> getIdentityRelations(ContextNode contextNode) { ReadOnlyIterator<Relation> relations = contextNode.getRelations(XDIDictionaryConstants.XDI_ADD_IS); return relations; }
@Override public ReadOnlyIterator<Relation> getDeepRelations(XDIAddress relativeContextNodeXDIAddress, XDIAddress XDIaddress) { ContextNode contextNode = this.getDeepContextNode(relativeContextNodeXDIAddress); if (contextNode == null) return null; return contextNode.getRelations(XDIaddress); }
/** * Copies all relations of a context node into a target context node. * @param contextNode A context node from any graph. * @param targetContextNode The target context node. * @param copyStrategy The strategy to determine what to copy. * @return The copied relations in the target graph. */ public static Iterator<Relation> copyRelations(ContextNode contextNode, ContextNode targetContextNode, CopyStrategy copyStrategy) { if (contextNode == null) throw new NullPointerException(); if (targetContextNode == null) throw new NullPointerException(); if (copyStrategy == null) copyStrategy = DEFAULT_COPY_STRATEGY; for (Iterator<Relation> relations = contextNode.getRelations(); relations.hasNext(); ) { Relation relation = relations.next(); copyRelation(relation, targetContextNode, copyStrategy); } return targetContextNode.getRelations(); }
/** * Returns all XDI operations in this XDI message (template). * @return An iterator over all XDI operations. */ public ReadOnlyIterator<Operation> getOperations() { // get all relations that are valid XDI operations Iterator<Relation> relations = this.getOperationsContextNode().getRelations(); return new MappingRelationOperationIterator(this, relations); }
/** * Returns all XDI $connect operations in this XDI message (template). * @return An iterator over all XDI $connect operations. */ public ReadOnlyIterator<ConnectOperation> getConnectOperations() { // get all relations that are valid XDI $connect operations Iterator<Relation> relations = this.getOperationsContextNode().getRelations(); return new MappingRelationConnectOperationIterator(this, relations); }
/** * Returns all XDI $do operations in this XDI message (template). * @return An iterator over all XDI $do operations. */ public ReadOnlyIterator<DoOperation> getDoOperations() { // get all relations that are valid XDI $do operations Iterator<Relation> relations = this.getOperationsContextNode().getRelations(); return new MappingRelationDoOperationIterator(this, relations); }
public ReadOnlyIterator<XdiInnerRoot> getOperationResults() { return new XdiInnerRoot.MappingRelationInnerRootIterator( new SelectingIterator<Relation> (this.getContextNode().getRelations()) { @Override public boolean select(Relation relation) { return Operation.isValidOperationXDIAddress(relation.getXDIAddress()); } }); }
/** * Returns all XDI $del operations in this XDI message (template). * @return An iterator over all XDI $del operations. */ public ReadOnlyIterator<DelOperation> getDelOperations() { // get all relations that are valid XDI $del operations Iterator<Relation> relations = this.getOperationsContextNode().getRelations(); return new MappingRelationDelOperationIterator(this, relations); }
/** * Returns all XDI $push operations in this XDI message (template). * @return An iterator over all XDI $push operations. */ public ReadOnlyIterator<PushOperation> getPushOperations() { // get all relations that are valid XDI $push operations Iterator<Relation> relations = this.getOperationsContextNode().getRelations(); return new MappingRelationPushOperationIterator(this, relations); }
/** * Returns all XDI $get operations in this XDI message (template). * @return An iterator over all XDI $get operations. */ public ReadOnlyIterator<GetOperation> getGetOperations() { // get all relations that are valid XDI $get operations Iterator<Relation> relations = this.getOperationsContextNode().getRelations(); return new MappingRelationGetOperationIterator(this, relations); }
/** * Returns all XDI $set operations in this XDI message (template). * @return An iterator over all XDI $set operations. */ public ReadOnlyIterator<SetOperation> getSetOperations() { // get all relations that are valid XDI $set operations Iterator<Relation> relations = this.getOperationsContextNode().getRelations(); return new MappingRelationSetOperationIterator(this, relations); }
/** * Returns the XDI operators underneath this XDI policy. */ public ReadOnlyIterator<Operator> getOperators() { // get all relations that are valid XDI operators Iterator<Relation> relations = this.getContextNode().getRelations(); return new MappingRelationOperatorIterator(relations); }
/** * Returns all XDI $send operations in this XDI message (template). * @return An iterator over all XDI $send operations. */ public ReadOnlyIterator<SendOperation> getSendOperations() { // get all relations that are valid XDI $send operations Iterator<Relation> relations = this.getOperationsContextNode().getRelations(); return new MappingRelationSendOperationIterator(this, relations); }
public IterableIterator<XDIAddress> getPermissionTargetXDIAddresses(XDIAddress permissionXDIAddress) { if (permissionXDIAddress == null) throw new NullPointerException(); // return the target addresses return new MappingRelationTargetXDIAddressIterator( new SelectingNotXdiInnerRootRelationIterator( this.getPermissionsContextNode().getRelations(permissionXDIAddress))); }
public static Iterator<XDIAddress> getContextNodeTypes(ContextNode contextNode) { Iterator<Relation> contextNodeTypeRelations = contextNode.getRelations(XDIDictionaryConstants.XDI_ADD_IS_TYPE); return new MappingContextNodeXDIAddressIterator(new MappingRelationTargetContextNodeIterator(contextNodeTypeRelations)); }
/** * Get all $is# datatypes associated with a context node * * @param contextNode * @return list of datatypes */ public static List<XDIAddress> getDataTypes(ContextNode contextNode) { ReadOnlyIterator<Relation> relations = contextNode.getRelations(XDIDictionaryConstants.XDI_ADD_IS_TYPE); return new IteratorListMaker<XDIAddress> (new MappingRelationTargetXDIAddressIterator(relations)).list(); }
public void setupPushPermissionInverseRelations() { ReadOnlyIterator<Relation> pushPermissionRelations = this.getPermissionsContextNode().getRelations(XDILinkContractConstants.XDI_ADD_PUSH); for (Relation pushPermissionRelation : pushPermissionRelations) { pushPermissionRelation.followContextNode().setRelation(XDILinkContractConstants.XDI_ADD_IS_PUSH, this.getContextNode().getXDIAddress()); } }
public List<XDIAddress> getControl() { return new IteratorListMaker<XDIAddress> (new MappingRelationTargetXDIAddressIterator(this.getXdiEntity().getContextNode().getRelations(XDI_ADD_CONTROL))).list(); }
public ReadOnlyIterator<XDIArc> getPushToPeerRootXDIArcs() { return new NotNullIterator<XDIArc> ( new MappingContextNodeXDIArcIterator ( new XdiContext.MappingXdiContextContextNodeIterator( new XdiPeerRoot.MappingContextNodePeerRootIterator( new MappingRelationTargetContextNodeIterator( this.getContextNode().getRelations(XDILinkContractConstants.XDI_ADD_TO_PEER_ROOT_ARC)))))); } }