public class StandardParameters
extends java.lang.Object
Constructor and Description |
---|
StandardParameters() |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
createResponse(java.lang.Object object)
For creating a Response of a single object of the appropriate media type.
|
java.lang.String |
getAgencyId()
Simple getter for the agency ID
|
CommandsInterface |
getCommandsInterface()
Gets the CommandsInterface for the specified agencyId.
|
ConfigInterface |
getConfigInterface()
Gets the ConfigInterface for the specified agencyId.
|
java.lang.String |
getKey()
Simple getter for the key
|
java.lang.String |
getMediaType()
Returns the media type to use for the response based on optional accept
header and the optional format specification in the query string of the
URL.
|
PredictionsInterface |
getPredictionsInterface()
Gets the PredictionsInterface for the agencyId specified as part of the
standard parameters.
|
javax.servlet.http.HttpServletRequest |
getRequest()
Returns the HttpServletRequest.
|
ServerStatusInterface |
getServerStatusInterface()
Gets the ServerStatusInterface for the specified agencyId.
|
VehiclesInterface |
getVehiclesInterface()
Gets the VehiclesInterface for the specified agencyId.
|
void |
validate()
Makes sure not access feed too much and that the key is valid.
|
public java.lang.String getMediaType() throws javax.ws.rs.WebApplicationException
If format specification is incorrect then BadRequest WebApplicationException is thrown.
The media type is not determined in the constructor because then an exception would cause an ugly error message because it would be handled before the root-resource class get method is being called.
javax.ws.rs.WebApplicationException
public void validate() throws javax.ws.rs.WebApplicationException
javax.ws.rs.WebApplicationException
public javax.ws.rs.core.Response createResponse(java.lang.Object object)
object
- Object to be returned in XML or JSONpublic VehiclesInterface getVehiclesInterface() throws javax.ws.rs.WebApplicationException
javax.ws.rs.WebApplicationException
public CommandsInterface getCommandsInterface() throws javax.ws.rs.WebApplicationException
javax.ws.rs.WebApplicationException
public PredictionsInterface getPredictionsInterface() throws javax.ws.rs.WebApplicationException
javax.ws.rs.WebApplicationException
public ConfigInterface getConfigInterface() throws javax.ws.rs.WebApplicationException
javax.ws.rs.WebApplicationException
public ServerStatusInterface getServerStatusInterface() throws javax.ws.rs.WebApplicationException
javax.ws.rs.WebApplicationException
public java.lang.String getKey()
public java.lang.String getAgencyId()
public javax.servlet.http.HttpServletRequest getRequest()