Class StatusData
java.lang.Object
org.opencastproject.runtimeinfo.rest.StatusData
Represents a possible status result for an endpoint
-
Constructor Summary
ConstructorsConstructorDescriptionStatusData(int code, String description) A constructor that takes a HTTP response code and a description for this response and constructs a StatusData object.StatusData(int code, String description, String xmlSchema) 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.StatusData(RestResponse restResponse) A constructor that takes a RestResponse annotation type object and constructs a StatusData object. -
Method Summary
-
Constructor Details
-
StatusData
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
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 codedescription- a description of the response- Throws:
IllegalArgumentException- if code is out of range (e.g. <100 or >1100)
-
StatusData
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 codedescription- a description of the response- Throws:
IllegalArgumentException- if code is out of range (e.g. <100 or > 1100)
-
-
Method Details
-
toString
-
getCode
public int getCode()- Returns:
- the response code of this status
-
getName
- Returns:
- a string name of this status
-
getDescription
- Returns:
- a description of this status
-
findName
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
- Returns:
- the xmlSchema
-
setXmlSchema
- Parameters:
xmlSchema- the xmlSchema to set
-