diff options
Diffstat (limited to 'policy-management/src/main')
2 files changed, 24 insertions, 20 deletions
diff --git a/policy-management/src/main/java/org/onap/policy/drools/protocol/configuration/PdpdConfiguration.java b/policy-management/src/main/java/org/onap/policy/drools/protocol/configuration/PdpdConfiguration.java index 76836ba2..1201c26e 100644 --- a/policy-management/src/main/java/org/onap/policy/drools/protocol/configuration/PdpdConfiguration.java +++ b/policy-management/src/main/java/org/onap/policy/drools/protocol/configuration/PdpdConfiguration.java @@ -165,30 +165,32 @@ public class PdpdConfiguration { } protected boolean declaredProperty(String name, Object value) { - return switch (name) { - case "requestID" -> { + switch (name) { + case "requestID": callSetRequestId(value); - yield true; - } - case "entity" -> { + return true; + case "entity": callSetEntity(value); - yield true; - } - case "controllers" -> { + return true; + case "controllers": callSetControllers(value); - yield true; - } - default -> false; - }; + return true; + default: + return false; + } } protected Object declaredPropertyOrNotFound(String name, Object notFoundValue) { - return switch (name) { - case "requestID" -> getRequestId(); - case "entity" -> getEntity(); - case "controllers" -> getControllers(); - default -> notFoundValue; - }; + switch (name) { + case "requestID": + return getRequestId(); + case "entity": + return getEntity(); + case "controllers": + return getControllers(); + default: + return notFoundValue; + } } /** diff --git a/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java b/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java index ecc6c083..ec06882f 100644 --- a/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java +++ b/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java @@ -1722,11 +1722,12 @@ public class RestManager implements SwaggerApi, DefaultApi, FeaturesApi, InputsA @Path("engine/tools/loggers") public Response loggers() { final List<String> names = new ArrayList<>(); - if (!(LoggerFactory.getILoggerFactory() instanceof LoggerContext context)) { + if (!(LoggerFactory.getILoggerFactory() instanceof LoggerContext)) { logger.warn("The SLF4J logger factory is not configured for logback"); return Response.status(Status.INTERNAL_SERVER_ERROR).entity(names).build(); } + final LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); for (final Logger lgr : context.getLoggerList()) { names.add(lgr.getName()); } @@ -1744,11 +1745,12 @@ public class RestManager implements SwaggerApi, DefaultApi, FeaturesApi, InputsA @Path("engine/tools/loggers/{logger}") @Produces(MediaType.TEXT_PLAIN) public Response loggerName1(@PathParam("logger") String loggerName) { - if (!(LoggerFactory.getILoggerFactory() instanceof LoggerContext context)) { + if (!(LoggerFactory.getILoggerFactory() instanceof LoggerContext)) { logger.warn("The SLF4J logger factory is not configured for logback"); return Response.status(Status.INTERNAL_SERVER_ERROR).build(); } + final LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); var lgr = context.getLogger(loggerName); if (lgr == null) { return Response.status(Status.NOT_FOUND).build(); |