use of org.xel.AccountRestrictions.PhasingOnly in project elastic-core-maven by OrdinaryDude.
the class GetAllPhasingOnlyControls method processRequest.
@Override
protected JSONStreamAware processRequest(HttpServletRequest req) throws ParameterException {
int firstIndex = ParameterParser.getFirstIndex(req);
int lastIndex = ParameterParser.getLastIndex(req);
JSONObject response = new JSONObject();
JSONArray jsonArray = new JSONArray();
try (DbIterator<PhasingOnly> iterator = PhasingOnly.getAll(firstIndex, lastIndex)) {
for (PhasingOnly phasingOnly : iterator) {
jsonArray.add(JSONData.phasingOnly(phasingOnly));
}
}
response.put("phasingOnlyControls", jsonArray);
return response;
}
use of org.xel.AccountRestrictions.PhasingOnly in project elastic-core-maven by OrdinaryDude.
the class GetPhasingOnlyControl method processRequest.
@Override
protected JSONStreamAware processRequest(HttpServletRequest req) throws ParameterException {
long accountId = ParameterParser.getAccountId(req, true);
PhasingOnly phasingOnly = PhasingOnly.get(accountId);
return phasingOnly == null ? JSON.emptyJSON : JSONData.phasingOnly(phasingOnly);
}
Aggregations