@Api(value = "Policy Engine Services")
@RequestMapping("/")
public class PolicyEngineServices {
- private static Logger LOGGER = FlexLogger
+ private static Logger logger = FlexLogger
.getLogger(PolicyEngineServices.class.getName());
private final AtomicLong configCounter = new AtomicLong();
private final AtomicLong configNameCounter = new AtomicLong();
status = getConfigService.getResponseCode();
}
configCounter.incrementAndGet();
- return new ResponseEntity<Collection<PolicyConfig>>(policyConfig,
- status);
+ return new ResponseEntity<Collection<PolicyConfig>>(policyConfig, status);
}
@ApiImplicitParams({
status = getConfigService.getResponseCode();
}
configNameCounter.incrementAndGet();
- return new ResponseEntity<Collection<PolicyConfig>>(policyConfig,
- status);
+ return new ResponseEntity<>(policyConfig, status);
}
@ApiImplicitParams({
status = listConfigService.getResponseCode();
}
configCounter.incrementAndGet();
- return new ResponseEntity<Collection<String>>(results, status);
+ return new ResponseEntity<>(results, status);
}
@ApiImplicitParams({
status = getMetricsService.getResponseCode();
}
metricCounter.incrementAndGet();
- return new ResponseEntity<MetricsResponse>(response, status);
+ return new ResponseEntity<>(response, status);
}
@ApiImplicitParams({
status = sendEventService.getResponseCode();
}
eventCounter.incrementAndGet();
- return new ResponseEntity<Collection<PolicyResponse>>(policyResponse,
+ return new ResponseEntity<>(policyResponse,
status);
}
status = getDecisionService.getResponseCode();
}
decisionCounter.incrementAndGet();
- return new ResponseEntity<DecisionResponse>(decisionResponse, status);
+ return new ResponseEntity<>(decisionResponse, status);
}
@ApiImplicitParams({
status = pushPolicyService.getResponseCode();
}
pushCounter.incrementAndGet();
- return new ResponseEntity<String>(response, status);
+ return new ResponseEntity<>(response, status);
}
@ApiImplicitParams({
status = deletePolicyService.getResponseCode();
}
deleteCounter.incrementAndGet();
- return new ResponseEntity<String>(response, status);
+ return new ResponseEntity<>(response, status);
}
@ApiImplicitParams({
status = createPolicyService.getResponseCode();
} catch (InstantiationException | IllegalAccessException
| IllegalArgumentException | InvocationTargetException e) {
- LOGGER.error(e.getMessage());
+ logger.error(e.getMessage());
response = "Problem with CreateUpdate Policy Service. ";
status = HttpStatus.INTERNAL_SERVER_ERROR;
}
}
createPolicyCounter.incrementAndGet();
- return new ResponseEntity<String>(response, status);
+ return new ResponseEntity<>(response, status);
}
@ApiImplicitParams({
status = updatePolicyService.getResponseCode();
} catch (InstantiationException | IllegalAccessException
| IllegalArgumentException | InvocationTargetException e) {
- LOGGER.error(e.getMessage());
+ logger.error(e.getMessage());
response = "Problem with CreateUpdate Policy Service. ";
status = HttpStatus.INTERNAL_SERVER_ERROR;
}
}
updatePolicyCounter.incrementAndGet();
- return new ResponseEntity<String>(response, status);
+ return new ResponseEntity<>(response, status);
}
@ApiImplicitParams({
status = createDictionaryService.getResponseCode();
}
createDictionaryCounter.incrementAndGet();
- return new ResponseEntity<String>(response, status);
+ return new ResponseEntity<>(response, status);
}
@ApiImplicitParams({
status = updateDictionaryService.getResponseCode();
}
updateDictionaryCounter.incrementAndGet();
- return new ResponseEntity<String>(response, status);
+ return new ResponseEntity<>(response, status);
}
@ApiImplicitParams({
status = getDictionaryService.getResponseCode();
}
getDictionaryCounter.incrementAndGet();
- return new ResponseEntity<DictionaryResponse>(dictionaryResponse,
+ return new ResponseEntity<>(dictionaryResponse,
status);
}
status = policyEngineImportService.getResponseCode();
}
policyEngineImportCounter.incrementAndGet();
- return new ResponseEntity<String>(response, status);
+ return new ResponseEntity<>(response, status);
}
@ApiImplicitParams({
status = createPolicyService.getResponseCode();
}
deprecatedCounter.incrementAndGet();
- return new ResponseEntity<String>(response, status);
+ return new ResponseEntity<>(response, status);
}
@ApiImplicitParams({
status = updatePolicyService.getResponseCode();
}
deprecatedCounter.incrementAndGet();
- return new ResponseEntity<String>(response, status);
+ return new ResponseEntity<>(response, status);
}
@ApiImplicitParams({
status = createFirewallPolicyService.getResponseCode();
}
deprecatedCounter.incrementAndGet();
- return new ResponseEntity<String>(response, status);
+ return new ResponseEntity<>(response, status);
}
@ApiImplicitParams({
status = updateFirewallPolicyService.getResponseCode();
}
deprecatedCounter.incrementAndGet();
- return new ResponseEntity<String>(response, status);
+ return new ResponseEntity<>(response, status);
}
@ApiOperation(value = "Gets the API Services usage Information")
@ExceptionHandler({ HttpMessageNotReadableException.class })
public ResponseEntity<String> messageNotReadableExceptionHandler(
HttpServletRequest req, HttpMessageNotReadableException exception) {
- LOGGER.error("Request not readable: {}", exception);
+ logger.error("Request not readable: {}", exception);
StringBuilder message = new StringBuilder();
message.append(exception.getMessage());
if (exception.getCause() != null) {