@OPTIONS
@Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_HTML, MediaType.APPLICATION_XML})
public OptionsResult options() {
OptionsResult optionsResult =
new OptionsResult(__resourceUtil.getResourceName(uriInfo));
try {
//GET meta data
optionsResult.putMethodMetaData("GET", new MethodMetaData());
//POST meta data
String postCommand = getPostCommand();
if (postCommand != null) {
MethodMetaData postMethodMetaData = __resourceUtil.getMethodMetaData(
postCommand, RestService.getHabitat(), RestService.logger);
postMethodMetaData.setDescription("Create");
optionsResult.putMethodMetaData("POST", postMethodMetaData);
}
//DELETE meta data
String deleteCommand = getDeleteCommand();
if (deleteCommand != null) {
MethodMetaData deleteMethodMetaData = __resourceUtil.getMethodMetaData(
deleteCommand, RestService.getHabitat(), RestService.logger);
deleteMethodMetaData.setDescription("Delete");
optionsResult.putMethodMetaData("DELETE", deleteMethodMetaData);
}
} catch (Exception e) {
throw new WebApplicationException(e, Response.Status.INTERNAL_SERVER_ERROR);
}