use of org.ovirt.engine.core.common.queries.GetSystemOptionParameters in project ovirt-engine by oVirt.
the class BackendSystemOptionResource method get.
@Override
public SystemOption get() {
ConfigValues config;
try {
config = ConfigValues.valueOf(id);
} catch (IllegalArgumentException ex) {
throw new WebApplicationException(Response.Status.NOT_FOUND);
}
GetSystemOptionParameters parameters = new GetSystemOptionParameters(config);
String version = ParametersHelper.getParameter(httpHeaders, uriInfo, VERSION);
if (version != null && !version.isEmpty()) {
parameters.setOptionVersion(version);
}
QueryReturnValue result = runQuery(QueryType.GetSystemOption, parameters);
if (result.getReturnValue() == null) {
throw new WebApplicationException(Response.Status.NOT_FOUND);
}
return LinkHelper.addLinks(SystemOptionsMapper.map(result.getReturnValue(), id));
}
Aggregations