+ private static void startThreads(ONAPLoggingContext baseLoggingContext, Thread thread) {
+ environment = XACMLProperties.getProperty("ENVIRONMENT", "DEVL");
+ //
+ // Kick off our thread to register with the PAP servlet.
+ //
+ if (Boolean.parseBoolean(XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_REGISTER))) {
+ XACMLPdpServlet.registerRunnable = new XACMLPdpRegisterThread(baseLoggingContext);
+ XACMLPdpServlet.registerThread = new Thread(XACMLPdpServlet.registerRunnable);
+ XACMLPdpServlet.registerThread.start();
+ }
+ //
+ // This is our thread that manages incoming configuration
+ // changes.
+ //
+ XACMLPdpServlet.configThread = thread;
+ XACMLPdpServlet.configThread.start();
+ }
+
+ private static void setDependencyNodes(String dependencyGroups) {
+ // dependency_groups is a semicolon-delimited list of groups, and
+ // each group is a comma-separated list of nodes. For our purposes
+ // we just need a list of dependencies without regard to grouping,
+ // so split the list into nodes separated by either comma or semicolon.
+ dependencyNodes = dependencyGroups.split("[;,]");
+ for (int i = 0 ; i < dependencyNodes.length ; i++){
+ dependencyNodes[i] = dependencyNodes[i].trim();
+ }
+ }
+
+ private static void setPDPResourceName(Properties properties) throws ServletException {
+ pdpResourceName = properties.getProperty(XACMLRestProperties.PDP_RESOURCE_NAME);
+ if(pdpResourceName == null){
+ PolicyLogger.error(MessageCodes.MISS_PROPERTY_ERROR, XACMLRestProperties.PDP_RESOURCE_NAME, "xacml.pdp");
+ throw new ServletException("pdpResourceName is null");
+ }
+ }
+
+ private static void initQueue(int queueSize) {
+ queue = new LinkedBlockingQueue<>(queueSize);
+ }
+
+ private static void setNotificationDelay() {
+ try{
+ XACMLPdpServlet.notificationDelay = Integer.parseInt(XACMLProperties.getProperty(XACMLRestProperties.PROP_NOTIFICATION_DELAY));
+ }catch(NumberFormatException e){
+ logger.error("Error in notification delay format, Taking the default value.", e);
+ }
+ }
+
+ /**