Class StatusData

java.lang.Object
org.opencastproject.runtimeinfo.rest.StatusData

public class StatusData extends Object
Represents a possible status result for an endpoint
  • Constructor Details

    • StatusData

      public StatusData(org.opencastproject.util.doc.rest.RestResponse restResponse) throws IllegalArgumentException
      A constructor that takes a RestResponse annotation type object and constructs a StatusData object.
      Parameters:
      restResponse - a RestResponse annotation type object that stores a response code and its description
      Throws:
      IllegalArgumentException - if the response code is out of range (e.g. <100 or >1100)
    • StatusData

      public StatusData(int code, String description, String xmlSchema) throws IllegalArgumentException
      A constructor that takes a HTTP response code and a description for this response, and an XML schema for the response and constructs a StatusData object. A reference of response code constants can be found in javax.servlet.http.HttpServletResponse.
      Parameters:
      code - a HTTP response code
      description - a description of the response
      Throws:
      IllegalArgumentException - if code is out of range (e.g. <100 or >1100)
    • StatusData

      public StatusData(int code, String description) throws IllegalArgumentException
      A constructor that takes a HTTP response code and a description for this response and constructs a StatusData object. A reference of response code constants can be found in javax.servlet.http.HttpServletResponse.
      Parameters:
      code - a HTTP response code
      description - a description of the response
      Throws:
      IllegalArgumentException - if code is out of range (e.g. <100 or > 1100)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getCode

      public int getCode()
      Returns:
      the response code of this status
    • getName

      public String getName()
      Returns:
      a string name of this status
    • getDescription

      public String getDescription()
      Returns:
      a description of this status
    • findName

      public static String findName(int code) throws IllegalArgumentException
      This will resolve a human readable name for all known status codes.
      Parameters:
      code - the status code
      Returns:
      the name OR UNKNOWN if none found
      Throws:
      IllegalArgumentException - if the code is outside the valid range
    • getXmlSchema

      public String getXmlSchema()
      Returns:
      the xmlSchema
    • setXmlSchema

      public void setXmlSchema(String xmlSchema)
      Parameters:
      xmlSchema - the xmlSchema to set