Ejemplo n.º 1
0
  /**
   * Returns an existing XDI policy root in this XDI link contract (template), or creates a new one.
   *
   * @param create Whether to create an XDI policy root if it does not exist.
   * @return The existing or newly created XDI policy root.
   */
  public PolicyRoot getPolicyRoot(boolean create) {

    XdiEntitySingleton xdiEntitySingleton =
        this.getXdiEntity().getXdiEntitySingleton(XDIPolicyConstants.XDI_ARC_IF, create);
    if (xdiEntitySingleton == null) return null;

    return PolicyRoot.fromXdiEntity(xdiEntitySingleton);
  }
Ejemplo n.º 2
0
  /**
   * Returns an existing XDI defer push policy root in this XDI link contract (template), or creates
   * a new one.
   *
   * @param create Whether to create an XDI defer push policy root if it does not exist.
   * @return The existing or newly created XDI defer push policy root.
   */
  public PolicyRoot getDeferPushPolicyRoot(boolean create) {

    XdiEntitySingleton xdiEntitySingleton =
        this.getXdiEntity().getXdiEntitySingleton(XDIPolicyConstants.XDI_ADD_DEFER_PUSH, create);
    if (xdiEntitySingleton == null) return null;
    xdiEntitySingleton =
        xdiEntitySingleton.getXdiEntitySingleton(XDIPolicyConstants.XDI_ARC_IF, create);
    if (xdiEntitySingleton == null) return null;

    return PolicyRoot.fromXdiEntity(xdiEntitySingleton);
  }