use of org.glassfish.admin.rest.results.OptionsResult in project Payara by payara.
the class SystemPropertiesCliResource method deleteProperty.
/**
* Delete a system property using the delete-system-property asadmin command.
*
* @param parent the name of the parent object of the target
* @param propName the name of the property to delete
* @return the result of the command
*/
protected Response deleteProperty(String parent, String propName) {
ParameterMap pm = new ParameterMap();
pm.add("DEFAULT", propName);
pm.add("target", (parent == null) ? getParent(uriInfo) : parent);
RestActionReporter actionReport = ResourceUtil.runCommand("delete-system-property", pm, getSubject());
ActionReport.ExitCode exitCode = actionReport.getActionExitCode();
ActionReportResult results = new ActionReportResult(commandName, actionReport, new OptionsResult());
int status = HttpURLConnection.HTTP_OK;
/*200 - ok*/
if (exitCode == ActionReport.ExitCode.FAILURE) {
status = HttpURLConnection.HTTP_INTERNAL_ERROR;
}
return Response.status(status).entity(results).build();
}
Aggregations