Package org.openxri.resolve

Examples of org.openxri.resolve.TrustType


        }

        String content = null;
        try
        {
          XRDS xrds = moResolver.resolveAuthToXRDS(oXRI, new TrustType(), true);
          content = xrds.toString();
        }
        catch (Exception e)
        {
          if (e instanceof PartialResolutionException) {
View Full Code Here


            return;
        }


      // defaults if resolution media type is null
      TrustType trustType = new TrustType();
      boolean refs = true;
      boolean sep = true;

      String tempStr = null;
      if(resMediaType != null) {
        tempStr = resMediaType.getParam(MimeType.PARAM_REFS);
        if(tempStr != null && tempStr.equals("false"))
          refs = false;
       
        tempStr = resMediaType.getParam(MimeType.PARAM_SEP);
        if(tempStr != null && tempStr.equals("false"))
          sep = false;
       
        tempStr = resMediaType.getParam(MimeType.PARAM_TRUST);
        if (tempStr != null) {
          try {
            trustType.setType(tempStr);
          }
          catch (IllegalTrustTypeException e) {
            sendResponse(response, HTTP_ERROR_CONTENT_TYPE, "INVALID_RESOLUTION_MEDAIA_TYPE(code=212): " + resMediaType, null);
            return;
          }
View Full Code Here

      return;
    }


    // defaults if resolution media type is null
    TrustType trustType = new TrustType();
    boolean refs = true;
    boolean sep = true;

    String tempStr = null;
    if(resMediaType != null) {
      tempStr = resMediaType.getParam(MimeType.PARAM_REFS);
      if(tempStr != null && tempStr.equals("false"))
        refs = false;

      tempStr = resMediaType.getParam(MimeType.PARAM_SEP);
      if(tempStr != null && tempStr.equals("false"))
        sep = false;

      tempStr = resMediaType.getParam(MimeType.PARAM_TRUST);
      if (tempStr != null) {
        try {
          trustType.setType(tempStr);
        }
        catch (IllegalTrustTypeException e) {
          sendResponse(response, HTTP_ERROR_CONTENT_TYPE, "INVALID_RESOLUTION_MEDAIA_TYPE(code=212): " + resMediaType, null);
          return;
        }
View Full Code Here

        // try to resolve a invalid xri
        //
        try
        {
            String sXRI = "xri!foo";
            oResolver.resolveAuthToXRDS(sXRI, new TrustType(), true);
            assertTrue("Did not get expected PartialResolutionException", false);
        }
        catch (XRIParseException E)
        {
            // ok
View Full Code Here

        // try to resolve a xri without setting up global authority
        //
        try
        {
            String sXRI = "xri://@foo";
            oResolver.resolveAuthToXRDS(new XRI(sXRI), new TrustType(), true);
            assertTrue(
                "Did not get expected PartialResolutionException", false);
        }
        catch (PartialResolutionException E)
        {
View Full Code Here

        //
        try
        {
            String sXRI = "xri://@gates*com";
            XRD oDesc =
                oResolver.resolveAuthToXRD(new XRI(sXRI), new TrustType(), false);
            assertTrue("Thought " + sXRI + " did not exist.", oDesc == null);
        }
        catch (PartialResolutionException e) {
          // ok
        }
        catch (Exception E)
        {
            E.printStackTrace();
            assertTrue("Unexpected " + E, false);
        }

        //
        // resolve existing xri
        //
        try
        {
            String sXRI = "xri://@foo";
            XRD oDesc =
                oResolver.resolveAuthToXRD(new XRI(sXRI), new TrustType(), false);
            assertTrue("Thought " + sXRI + " exists.", oDesc != null);
            assertTrue("Invalid XRD Query", oDesc.getQuery().equals("*foo"));
        }
        catch (Exception E)
        {
            E.printStackTrace();
            assertTrue("Unexpected " + E, false);
        }

        //
        // resolve nonexistent segment
        //
        try
        {
            String sXRI = "xri://@foo*bar";
            XRD oDesc =
                oResolver.resolveAuthToXRD(new XRI(sXRI), new TrustType(), false);
            assertTrue("Expected PartialResolutionException but not thrown", false);
        }
        catch (PartialResolutionException e) {
          // ok
        }
View Full Code Here

        String server;
        String identifier = request.getRequestURI().substring(request.getContextPath().length() + 1);
         
        XRD xrd = resolver.resolveSEPToXRD(
            sPath,
            new TrustType(TrustType.TRUST_NONE),
            AuthenticationService.SERVICE_TYPE1,
            null,
            true);

        if (xrd == null || xrd.getSelectedServices().getList().size() == 0) {
View Full Code Here

      return;
    }


    // defaults if resolution media type is null
    TrustType trustType = new TrustType();
    boolean refs = true;
    boolean sep = true;

    String tempStr = null;
    if(resMediaType != null) {
      tempStr = resMediaType.getParam(MimeType.PARAM_REFS);
      if(tempStr != null && tempStr.equals("false"))
        refs = false;

      tempStr = resMediaType.getParam(MimeType.PARAM_SEP);
      if(tempStr != null && tempStr.equals("false"))
        sep = false;

      tempStr = resMediaType.getParam(MimeType.PARAM_TRUST);
      if (tempStr != null) {
        try {
          trustType.setType(tempStr);
        }
        catch (IllegalTrustTypeException e) {
          sendResponse(response, HTTP_ERROR_CONTENT_TYPE, "INVALID_RESOLUTION_MEDAIA_TYPE(code=212): " + resMediaType, null);
          return;
        }
View Full Code Here

      return;
    }


    // defaults if resolution media type is null
    TrustType trustType = new TrustType();
    boolean refs = true;
    boolean sep = true;
    boolean https = false;
    boolean saml = false;
    boolean cid = true;
    boolean uric = false;
    boolean nodefault_t = false;
    boolean nodefault_p = false;
    boolean nodefault_m = false;
    boolean debug = false;

    String tempStr = null;
    if(resMediaType != null) {
      tempStr = resMediaType.getParam(MimeType.PARAM_REFS);
      if(tempStr != null && tempStr.equals("false"))
        refs = false;

      tempStr = resMediaType.getParam(MimeType.PARAM_SEP);
      if(tempStr != null && tempStr.equals("false"))
        sep = false;

      tempStr = resMediaType.getParam(MimeType.PARAM_TRUST);
      if (tempStr != null) {
        try {
          trustType.setType(tempStr);
        }
        catch (IllegalTrustTypeException e) {
          sendResponse(response, HTTP_ERROR_CONTENT_TYPE, "INVALID_RESOLUTION_MEDAIA_TYPE(code=212): " + resMediaType, null);
          return;
        }
       
        https = trustType.isHTTPS();
        saml = trustType.isSAML();
      }

      tempStr = resMediaType.getParam(MimeType.PARAM_HTTPS);
      if(tempStr != null && tempStr.equals("true"))
        https = true;

      tempStr = resMediaType.getParam(MimeType.PARAM_SAML);
      if(tempStr != null && tempStr.equals("true"))
        saml = true;

      // override the trusttype
      trustType.setParameterPair(https, saml);
     
      tempStr = resMediaType.getParam(MimeType.PARAM_URIC);
      if(tempStr != null && tempStr.equals("true"))
        uric = true;
View Full Code Here

      sendError(request, response, qxri, 211, "INVALID_QXRI(code=211): "+oEx.getMessage(), oEx);
      return;
    }

    // defaults if resolution media type is null
    TrustType trustType = new TrustType();
    boolean refs = true;
    boolean sep = true;
    boolean https = false;
    boolean saml = false;
    boolean cid = true;
    boolean uric = false;
    boolean nodefault_t = false;
    boolean nodefault_p = false;
    boolean nodefault_m = false;
    boolean debug = false;

    String tempStr = null;
    if(resMediaType != null) {
      tempStr = resMediaType.getParam(MimeType.PARAM_REFS);
      if(tempStr != null && tempStr.equals("false"))
        refs = false;

      tempStr = resMediaType.getParam(MimeType.PARAM_SEP);
      if(tempStr != null && tempStr.equals("false"))
        sep = false;

      tempStr = resMediaType.getParam(MimeType.PARAM_TRUST);
      if (tempStr != null) {
        try {
          trustType.setType(tempStr);
        }
        catch (IllegalTrustTypeException e) {
          sendError(request, response, qxri, 212, "INVALID_RESOLUTION_MEDAIA_TYPE(code=212): " + resMediaType, e);
          return;
        }

        https = trustType.isHTTPS();
        saml = trustType.isSAML();
      }

      tempStr = resMediaType.getParam(MimeType.PARAM_HTTPS);
      if(tempStr != null && tempStr.equals("true"))
        https = true;

      tempStr = resMediaType.getParam(MimeType.PARAM_SAML);
      if(tempStr != null && tempStr.equals("true"))
        saml = true;

      // override the trusttype
      trustType.setParameterPair(https, saml);

      tempStr = resMediaType.getParam(MimeType.PARAM_URIC);
      if(tempStr != null && tempStr.equals("true"))
        uric = true;
View Full Code Here

TOP

Related Classes of org.openxri.resolve.TrustType

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.