Package org.openxri.xml

Examples of org.openxri.xml.ServerStatus


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


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


      ServerStatus sstat = xrd.getServerStatus();
      Status stat;
      if (sstat == null) {
        // compatibility: if no ServerStatus, look for Status
        stat = xrd.getStatus();
      }
      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 Redirect XRD");
View Full Code Here

    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

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

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


      ServerStatus sstat = xrd.getServerStatus();
      Status stat;
      if (sstat == null) {
        // compatibility: if no ServerStatus, look for Status
        stat = xrd.getStatus();
      }
      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 Redirect XRD");
View Full Code Here

    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

    if (this.code == null || this.text == null) throw new StageException("Not initialized.");

    // add a <ServerStatus> tag to the XRD

    xrd.setServerStatus(new ServerStatus(this.code, this.text));

    // done

    return(xrd);
  }
View Full Code Here


  void parseFetchedXRD(XRDS xrdsOut, XRD xrd, XRD prevXRD, XRISubSegment query, Service prevService, ResolverFlags flags) throws PartialResolutionException
  {
    // 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) {
      xrd.setStatus(new Status(Status.INVALID_XRDS, "Missing ServerStatus or Status element in XRD"));
View Full Code Here

TOP

Related Classes of org.openxri.xml.ServerStatus

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.