use of org.glassfish.admin.rest.results.OptionsResult in project Payara by payara.
the class TemplateExecCommand method optionsLegacyFormat.
@OPTIONS
@Produces({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public ActionReportResult optionsLegacyFormat() {
RestActionReporter ar = new RestActionReporter();
ar.setExtraProperties(new Properties());
ar.setActionDescription(commandDisplayName);
OptionsResult optionsResult = new OptionsResult(resourceName);
Map<String, MethodMetaData> mmd = new HashMap<String, MethodMetaData>();
MethodMetaData methodMetaData = ResourceUtil.getMethodMetaData(commandName, getCommandParams(), locatorBridge.getRemoteLocator());
optionsResult.putMethodMetaData(commandMethod, methodMetaData);
mmd.put(commandMethod, methodMetaData);
ResourceUtil.addMethodMetaData(ar, mmd);
ActionReportResult ret = new ActionReportResult(ar, null, optionsResult);
ret.setCommandDisplayName(commandDisplayName);
return ret;
}
use of org.glassfish.admin.rest.results.OptionsResult in project Payara by payara.
the class FindHttpProtocolResource method get.
@GET
@Produces({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.APPLICATION_FORM_URLENCODED })
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.APPLICATION_FORM_URLENCODED })
public ActionReportResult get() {
Dom dom = getEntity();
NetworkListener nl = dom.createProxy(NetworkListener.class);
Protocol p = nl.findHttpProtocol();
RestActionReporter ar = new RestActionReporter();
ar.setActionExitCode(ActionReport.ExitCode.SUCCESS);
ar.getTopMessagePart().getProps().put("protocol", p.getName());
ActionReportResult result = new ActionReportResult("find-http-protocol", ar, new OptionsResult());
return result;
}
use of org.glassfish.admin.rest.results.OptionsResult in project Payara by payara.
the class SystemPropertiesCliResource method deleteProperty.
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