Package org.openxri.resolve

Examples of org.openxri.resolve.ResolverState


    log.debug("Resolving " + resolveXri);

    try {

      xrd = resolver.resolveSEPToXRD(new XRI(resolveXri), serviceString, null, resolverFlags, new ResolverState());
    } catch (PartialResolutionException ex) {

      log.error("Problem while resolving " + resolveXri + ": " + ex.getMessage(), ex);
      sendResponse(response, HttpServletResponse.SC_NOT_FOUND);
      return;
View Full Code Here


    // resolve the XRI

    try {

      xrd = resolver.resolveAuthToXRD(new XRI(resolveXri), resolverFlags, new ResolverState());
    } catch (PartialResolutionException ex) {

      log.error("Problem while resolving " + resolveXri + ": " + ex.getMessage(), ex);
      sendResponse(response, HttpServletResponse.SC_NOT_FOUND);
      return;
View Full Code Here

    // resolve the XRI

    try {

      uris = resolver.resolveSEPToURIList(new XRI(xri), null, null, resolverFlags, new ResolverState());
    } catch (PartialResolutionException ex) {

      log.error("Problem while resolving " + xri + ": " + ex.getMessage(), ex);
      sendResponse(response, HttpServletResponse.SC_NOT_FOUND);
      return;
View Full Code Here

        try {

          authority = openXRIStore.getSubSegmentAuthority(rootSubSegment);

          XRDS xrds = resolver.resolveAuthority(new XRI(this.namespace), new ResolverFlags(), new ResolverState());
          XRD xrd = (xrds != null) ? xrds.getFinalXRD() : null;
          canonicalID = (xrd != null) ? xrd.getCanonicalID() : null;
        } catch (Exception ex) {

          log.warn("Cannot find corresponding i-number");
View Full Code Here

      if(tempStr != null && (tempStr.equals("true") || tempStr.equals("1")))
        debug = true;

    }

    ResolverState state = new ResolverState();
    ResolverFlags flags = new ResolverFlags();
    flags.setCid(cid);
    flags.setHttps(https);
    flags.setSaml(saml);
    flags.setRefs(refs);
View Full Code Here

      sendPartialResponse(request, response, qxri, debug, resMediaType, pre, trustType);
      return;
    }

    // set the request preferences on the resolver before querying.
    ResolverState state = new ResolverState();
    ResolverFlags flags = new ResolverFlags();
    flags.setCid(cid);
    flags.setHttps(https);
    flags.setSaml(saml);
    flags.setRefs(refs);
View Full Code Here

      if (msProxyURI != null) {
        mediaTypeStr += (";sep" + Boolean.toString(doSEP));
      }
      MimeType resMediaType = MimeType.parse(mediaTypeStr);

      ResolverState state = new ResolverState();
      XRDS xrds = null;
        XRD xrd = null;
      try {
        if (doSEP) {
          if (resMediaType.isType(MimeType.URI_LIST)) {
            String  text = resolver.resolveSEPToTextURIList(msTargetXRI.toString(), trustType, xrdT, xrdM, followRefs, state);
            if (text.length() <= 0)
              sOutput.append("ERROR: SEP_NOT_FOUND(code=241): no url found\n");
            else
              sOutput.append(text);
          }
          else if (resMediaType.isType(MimeType.XRDS_XML)) {
            xrds = resolver.resolveSEPToXRDS(msTargetXRI, trustType, xrdT, xrdM, followRefs, state);
            sOutput.append(xrds.toString());
          }
          else if (resMediaType.isType(MimeType.XRD_XML)) {
            xrd = resolver.resolveSEPToXRD(msTargetXRI, trustType, xrdT, xrdM, followRefs, state);
            sOutput.append(xrd.toResultString());
          }
          else {
            sOutput.append("Unknown resolution media type (sep=true)");
          }
        }
        else {
          if (resMediaType.isType(MimeType.XRDS_XML)) {
            xrds = resolver.resolveAuthToXRDS(msTargetXRI, trustType, followRefs, state);
            sOutput.append(xrds.toString());
          }
          else if (resMediaType.isType(MimeType.XRD_XML)) {
            xrd = resolver.resolveAuthToXRD(msTargetXRI, trustType, followRefs, state);
            sOutput.append(xrd.toString());
          }
          else if (resMediaType.isType(MimeType.URI_LIST)) {
            // ignore (must do SEP when text/uri-list is specified)
            sOutput.append("ERROR: text/uri-list must only be used with service selection (sep=true)\n");
          }
          else {
            sOutput.append("ERROR: Unknown resolution media type (sep=false)");
          }
        }
      }
        catch (PartialResolutionException pre) {

             xrds = pre.getPartialXRDS();
            xrd = xrds.getFinalXRD();
            
             if (resMediaType == null || resMediaType.isType(MimeType.URI_LIST)) {
               sOutput.append("ERROR: resolution failed. Partial XRDS:\n" + xrds.toString());
             }
             else if (resMediaType.isType(MimeType.XRDS_XML)) {
               sOutput.append("ERROR: resolution failed. Partial XRDS:\n" + xrds.toString());
             }
             else if (resMediaType.isType(MimeType.XRD_XML)) {
               sOutput.append("ERROR: resolution failed. Partial XRDS:\n" + xrds.toString());
             }
        }
        finally {
          if (mbIsVerbose)
            sOutput.append("\n\nSTATISTICS:\n" + state.toString() + "\n");
        }
    }
View Full Code Here

      if(tempStr != null && (tempStr.equals("true") || tempStr.equals("1")))
        debug = true;

    }

    ResolverState state = new ResolverState();
    ResolverFlags flags = new ResolverFlags();
    flags.setCid(cid);
    flags.setHttps(https);
    flags.setSaml(saml);
    flags.setRefs(refs);
View Full Code Here

      sendPartialResponse(request, response, qxri, debug, resMediaType, pre, trustType);
      return;
    }

    // set the request preferences on the resolver before querying.
    ResolverState state = new ResolverState();
    ResolverFlags flags = new ResolverFlags();
    flags.setCid(cid);
    flags.setHttps(https);
    flags.setSaml(saml);
    flags.setRefs(refs);
View Full Code Here

      if (msProxyURI != null) {
        mediaTypeStr += (";sep" + Boolean.toString(doSEP));
      }
      MimeType resMediaType = MimeType.parse(mediaTypeStr);

      ResolverState state = new ResolverState();
      XRDS xrds = null;
        XRD xrd = null;
      try {
        if (doSEP) {
          if (resMediaType.isType(MimeType.URI_LIST)) {
            String  text = resolver.resolveSEPToTextURIList(msTargetXRI.toString(), trustType, xrdT, xrdM, followRefs, state);
            if (text.length() <= 0)
              sOutput.append("ERROR: SEP_NOT_FOUND(code=241): no url found\n");
            else
              sOutput.append(text);
          }
          else if (resMediaType.isType(MimeType.XRDS_XML)) {
            xrds = resolver.resolveSEPToXRDS(msTargetXRI, trustType, xrdT, xrdM, followRefs, state);
            sOutput.append(xrds.toString());
          }
          else if (resMediaType.isType(MimeType.XRD_XML)) {
            xrd = resolver.resolveSEPToXRD(msTargetXRI, trustType, xrdT, xrdM, followRefs, state);
            sOutput.append(xrd.toResultString());
          }
          else {
            sOutput.append("Unknown resolution media type (sep=true)");
          }
        }
        else {
          if (resMediaType.isType(MimeType.XRDS_XML)) {
            xrds = resolver.resolveAuthToXRDS(msTargetXRI, trustType, followRefs, state);
            sOutput.append(xrds.toString());
          }
          else if (resMediaType.isType(MimeType.XRD_XML)) {
            xrd = resolver.resolveAuthToXRD(msTargetXRI, trustType, followRefs, state);
            sOutput.append(xrd.toString());
          }
          else if (resMediaType.isType(MimeType.URI_LIST)) {
            // ignore (must do SEP when text/uri-list is specified)
            sOutput.append("ERROR: text/uri-list must only be used with service selection (sep=true)\n");
          }
          else {
            sOutput.append("ERROR: Unknown resolution media type (sep=false)");
          }
        }
      }
        catch (PartialResolutionException pre) {

             xrds = pre.getPartialXRDS();
            xrd = xrds.getFinalXRD();
            
             if (resMediaType == null || resMediaType.isType(MimeType.URI_LIST)) {
               sOutput.append("ERROR: resolution failed. Partial XRDS:\n" + xrds.toString());
             }
             else if (resMediaType.isType(MimeType.XRDS_XML)) {
               sOutput.append("ERROR: resolution failed. Partial XRDS:\n" + xrds.toString());
             }
             else if (resMediaType.isType(MimeType.XRD_XML)) {
               sOutput.append("ERROR: resolution failed. Partial XRDS:\n" + xrds.toString());
             }
        }
        finally {
          if (mbIsVerbose)
            sOutput.append("\n\nSTATISTICS:\n" + state.toString() + "\n");
        }
    }
View Full Code Here

TOP

Related Classes of org.openxri.resolve.ResolverState

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.