Package org.openxri

Examples of org.openxri.XRI


   * @deprecated
   */
  public XRDS resolveAuthToXRDS(String qxri, TrustType trustType, boolean followRefs, ResolverState state)
      throws PartialResolutionException
  {
    XRI xri = parseAbsoluteQXRIOrError(qxri);
    return resolveAuthToXRDS(xri, trustType, followRefs, state);
  }
View Full Code Here


  public XRD resolveAuthToXRD(String qxri, TrustType trustType,
      boolean followRefs, ResolverState state)
      throws PartialResolutionException {
    log.trace("resolveAuthToXRD(s'" + qxri + "', trustType=" + trustType
        + ", followRefs=" + followRefs + ")");
    XRI xri = parseAbsoluteQXRIOrError(qxri);
    return resolveAuthToXRD(xri, trustType, followRefs, state);
  }
View Full Code Here

      ResolverState state) throws PartialResolutionException {
    log.trace("resolveSEPToXRDS(s'" + qxri + "', trustType=" + trustType
        + ", sepType=" + sepType + ", sepMediaType=" + sepMediaType
        + ", followRefs=" + followRefs + ")");

    XRI xri = parseAbsoluteQXRIOrError(qxri);
    return resolveSEPToXRDS(xri, trustType, sepType, sepMediaType,
        followRefs, state);
  }
View Full Code Here

      ResolverState state) throws PartialResolutionException {
    log.trace("resolveSEPToXRD(s'" + qxri + "', trustType=" + trustType
        + ", sepType=" + sepType + ", sepMediaType=" + sepMediaType
        + ", followRefs=" + followRefs + ")");

    XRI xri = parseAbsoluteQXRIOrError(qxri);
    return resolveSEPToXRD(xri, trustType, sepType, sepMediaType,
        followRefs, state);
  }
View Full Code Here

      ResolverState state) throws PartialResolutionException {
    log.trace("resolveSEPToURIList(s'" + qxri + "', trustType=" + trustType
        + ", sepType=" + sepType + ", sepMediaType=" + sepMediaType
        + ", followRefs=" + followRefs + ")");

    XRI xri = parseAbsoluteQXRIOrError(qxri);
    return resolveSEPToURIList(xri, trustType, sepType, sepMediaType,
        followRefs, state);
  }
View Full Code Here

   */
  public String resolveSEPToTextURIList(String qxri, TrustType trustType,
      String sepType, String sepMediaType, boolean followRefs,
      ResolverState state) throws PartialResolutionException {
    ResolverFlags f = new ResolverFlags(trustType, followRefs);
    XRI xri = parseAbsoluteQXRIOrError(qxri);
    return resolveSEPToTextURIList(xri, sepType, sepMediaType, f, state);
  }
View Full Code Here

   
    if (thisCID == null)
      return Status.CID_ABSENT;

    try {
      XRI parentCIDXRI = new XRI(parentCID.getValue());
      XRI thisCIDXRI   = new XRI(thisCID.getValue());
      if (parentCIDXRI.isRelative())
        return Status.CID_FAILED;
     
      if (thisCIDXRI.isRelative())
        return Status.CID_FAILED;
     
      AuthorityPath parentAuthorityAP = parentCIDXRI.getAuthorityPath();
      if (parentAuthorityAP == null)
        return Status.CID_FAILED;
     
      AuthorityPath thisAuthorityAP = thisCIDXRI.getAuthorityPath();
      if (thisAuthorityAP == null)
        return Status.CID_FAILED;
     
      if (!(thisAuthorityAP instanceof XRIAuthority))
        return Status.CID_FAILED;
     
      XRI thisAuthorityParentXRI = ((XRIAuthority)thisAuthorityAP).getParentAsXRI();
      if (thisAuthorityParentXRI == null)
        return Status.CID_FAILED;
     
      String parentXRIStr = parentAuthorityAP.toIRINormalForm();
      String thisParentXRIStr = thisAuthorityParentXRI.getAuthorityPath().toIRINormalForm();
      if (parentXRIStr.equalsIgnoreCase(thisParentXRIStr))
        return Status.CID_VERIFIED;
      else
        return Status.CID_FAILED;
    }
View Full Code Here

 
 
  private boolean verifySynonymElement(SimpleXMLElement e1, SimpleXMLElement e2)
  {
    try {
      XRI x1 = XRI.fromURINormalForm(e1.getValue());       
      XRI x2 = XRI.fromURINormalForm(e2.getValue());
      return x1.equals(x2);
    }
    catch (XRIParseException e) {
      // CanonicalID not an XRI, we ignore here
    }
View Full Code Here

    if (cid == null) {
      log.debug("verifyCEID - No CID in the XRD");
      return Status.CID_FAILED;
    }
   
    XRI cidX;
    try {
      cidX = XRI.fromURINormalForm(cid.getValue());
    }
    catch (Exception e) {
      log.debug("verifyCEID - Unable to parse CID");
      return Status.CID_FAILED;
    }
   
    if (ceid.getValue().equals(cid.getValue())) {
      log.debug("verifyCEID - CID is character-for-character equivalent to CEID.");
      return Status.CID_VERIFIED;
    }
   
    try {
      XRI ceidX = XRI.fromURINormalForm(ceid.getValue());

      log.info("verifyCEID - resolving CEID");
      XRD ceidXRD = resolveAuthToXRD(ceidX, flags, state);
      Status s = ceidXRD.getStatus();
      if (!s.getCID().equals(Status.CID_VERIFIED)) {
        log.debug("verifyCEID - XRD for CEID is not CID verified");
        return Status.CID_FAILED;
      }
     
      CanonicalID cid2 = ceidXRD.getCanonicalID();
      if (cid2 == null) {
        log.debug("verifyCEID - no CID in the XRD in CEID");
        return Status.CID_FAILED;       
      }
     
      XRI cidX2 = XRI.fromURINormalForm(cid2.getValue());
      if (!cidX2.toURINormalForm().equals(cidX.toURINormalForm())) {
        log.debug("verifyCEID - CEID's XRD's CID is not equivalent to the original CID");
        return Status.CID_FAILED;
      }
     
      /// look for an EquivID or CanonicalEquivID backpointer to the original CID
      CanonicalEquivID ceid2 = ceidXRD.getCanonicalEquivID();
      XRI ceidX2 = XRI.fromURINormalForm(ceid2.getValue());
      if (ceidX2.toURINormalForm().equals(cidX.toURINormalForm())) {
        log.debug("verifyCEID - CEID backpointer found");
        return Status.CID_VERIFIED;
      }

      for (int i = 0; i < ceidXRD.getNumEquivIDs(); i++) {
        EquivID e = ceidXRD.getEquivIDAt(i);
        XRI eX = XRI.fromURINormalForm(e.getValue());
        if (eX.toURINormalForm().equals(cidX.toURINormalForm())) {
          log.debug("verifyCEID - EquivID backpointer found");
          return Status.CID_VERIFIED;         
        }
      }
    }
View Full Code Here

    while (it.hasNext()) {
      Ref ref = (Ref)it.next();

      checkMaxRefs(xrdsOut, ref.getValue(), state);

      XRI refXRI;
      try {
        refXRI = parseAbsoluteQXRIOrError(ref.getValue());
      }
      catch (PartialResolutionException e) {
        xrdsOut.add(e.getPartialXRDS());
View Full Code Here

TOP

Related Classes of org.openxri.XRI

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.