Package org.openxri.xml

Examples of org.openxri.xml.Status


    response.setStatus(HttpServletResponse.SC_OK);
    XRD xrd = partialXRDS.getFinalXRD();
    String errMsg = "";
    if (xrd != null) {
      Status stat = xrd.getStatus();
      errMsg = "Error code: " + stat.getCode() + " - " + stat.getText();
    }

    if (resMediaType == null) {
      sendResponse(response, HTTP_ERROR_CONTENT_TYPE, errMsg, null);
    }
View Full Code Here


    }
    response.setStatus(HttpServletResponse.SC_OK);
    XRD xrd = partialXRDS.getFinalXRD();
    String errMsg = "";
    if (xrd != null) {
      Status stat = xrd.getStatus();
      errMsg = "Error code: " + stat.getCode() + " - " + stat.getText();
    }

    if (resMediaType == null) {
      sendResponse(response, HTTP_ERROR_CONTENT_TYPE, errMsg, null);
    }
View Full Code Here

  }

  public XRD createErrorXRD(String query, String code, String msg) {
    XRD err = new XRD();
    err.setQuery(query);
    Status stat = new Status(code, msg);
    err.setStatus(stat);
    return err;
  }
View Full Code Here

    }
    response.setStatus(HttpServletResponse.SC_OK);
    XRD xrd = partialXRDS.getFinalXRD();
    String errMsg = "";
    if (xrd != null) {
      Status stat = xrd.getStatus();
      errMsg = "Error code: " + stat.getCode() + " - " + stat.getText();
    }

    if (resMediaType == null) {
      sendError(request, response, qxri, Integer.parseInt(xrd.getStatus().getCode()), errMsg, pre);
    }
View Full Code Here

  public static XRD makeNotFoundXrd(String subSegmentName) {

    XRD xrd = new XRD();

    xrd.setQuery(subSegmentName);
    xrd.setStatus(new Status(Status.QUERY_NOT_FOUND, "No descriptor found for this query."));
    xrd.setServerStatus(new ServerStatus(Status.QUERY_NOT_FOUND, "No descriptor found for this query."));

    return(xrd);
  }
View Full Code Here

    String text = ex.getMessage();
    if (text == null || text.trim().equals("")) text = "An internal error occurred: " + ex.getClass().getName();

    xrd.setQuery(subSegmentName);
    xrd.setStatus(new Status(Status.TEMPORARY_FAIL, text));
    xrd.setServerStatus(new ServerStatus(Status.TEMPORARY_FAIL, text));

    return(xrd);
  }
View Full Code Here

      boolean bSigned)
  throws ServerInternalException {

    // add status, query and provider ID to the XRD

    xrd.setStatus(new Status(Status.SUCCESS));
    xrd.setQuery(subSegmentName);
    xrd.setProviderID(parent.getAuthorityId());

    // add expiration information to the XRD
View Full Code Here

    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();
View Full Code Here

      XRD xrd = tmpXRDS.getDescriptorAt(d);
      xrdsOut.add(xrd);

      // status is not success
      ServerStatus sstat = xrd.getServerStatus();
      Status stat;
      if (sstat == null) {
        // compatibility: if no ServerStatus, look for Status
        stat = xrd.getStatus();
        if (stat != null) {
          xrd.setServerStatus(new ServerStatus(stat.getCode(), stat.getText()));
        }
      }
      else {
        stat = new Status(sstat.getCode(), sstat.getText());
        xrd.setStatus(stat);
      }
     
      if (stat == null)
        throw makeResolutionException(xrdsOut, query, Status.INVALID_XRDS, "Missing ServerStatus or Status element in XRD");


      if (!stat.getCode().equals(Status.SUCCESS)) {
        throw new PartialResolutionException(xrdsOut);
      }

      // check the basic properties of the descriptor
      if (!xrd.isValid()) {       
        xrd.setStatus(new Status(Status.UNEXPECTED_RESPONSE, "XRD is not valid (stale?)"));
        throw new PartialResolutionException(xrdsOut);
      }

      if (flags.isCid()) {
        Status parentStatus = parent.getStatus();
        Status s = xrd.getStatus();
       
        String parentCIDStat = parentStatus.getCID();
        if (parentCIDStat.equals(Status.CID_FAILED)) {
          s.setCID(Status.CID_FAILED);
        }
        else {
          s.setCID(verifyCID(prevXRD, xrd));
        }
      }
     
      // if we need to do trusted resolution checking
      if (flags.isSaml())
View Full Code Here

      XRD finalXRD = xrdsOut.getFinalXRD();
      if (finalXRD == null) {
        finalXRD = createErrorXRD(query, Status.LIMIT_EXCEEDED, "Maximum of authority resolution requests exceeded");
        xrdsOut.add(finalXRD);
      } else {
        finalXRD.setStatus(new Status(Status.LIMIT_EXCEEDED,
            "Maximum of authority resolution requests exceeded"));
      }
      throw new PartialResolutionException(xrdsOut);
    }
   
View Full Code Here

TOP

Related Classes of org.openxri.xml.Status

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.