Class StatusData
- java.lang.Object
-
- org.opencastproject.runtimeinfo.rest.StatusData
-
public class StatusData extends Object
Represents a possible status result for an endpoint
-
-
Constructor Summary
Constructors Constructor Description StatusData(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(org.opencastproject.util.doc.rest.RestResponse restResponse)A constructor that takes a RestResponse annotation type object and constructs a StatusData object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringfindName(int code)This will resolve a human readable name for all known status codes.intgetCode()StringgetDescription()StringgetName()StringgetXmlSchema()voidsetXmlSchema(String xmlSchema)StringtoString()
-
-
-
Constructor Detail
-
StatusData
public StatusData(org.opencastproject.util.doc.rest.RestResponse restResponse) throws IllegalArgumentExceptionA 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 IllegalArgumentExceptionA 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
public StatusData(int code, String description) throws IllegalArgumentExceptionA 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 Detail
-
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
-
-