X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=datarouter-node%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdatarouter%2Fnode%2FNodeConfigManager.java;h=1debcf63867a4192ba3292288081f6649dcdd6d0;hb=bda6aeaa60607ab4fe5af508156019d7bd5c0ce4;hp=aeddc729f47e7f3528502b7cf22814c9e919ca1f;hpb=9df67948f715f9cddd51287cd3e91f7cbcf1912b;p=dmaap%2Fdatarouter.git diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeConfigManager.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeConfigManager.java index aeddc729..1debcf63 100644 --- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeConfigManager.java +++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeConfigManager.java @@ -25,6 +25,7 @@ package org.onap.dmaap.datarouter.node; import static java.lang.System.exit; +import static java.lang.System.getProperty; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -53,12 +54,10 @@ import org.onap.dmaap.datarouter.node.eelf.EelfMsgs; */ public class NodeConfigManager implements DeliveryQueueHelper { - private static final String CHANGE_ME = "changeme"; private static final String NODE_CONFIG_MANAGER = "NodeConfigManager"; - private static EELFLogger eelfLogger = EELFManager.getInstance().getLogger(NodeConfigManager.class); - private static NodeConfigManager base = new NodeConfigManager(); + private static final EELFLogger eelfLogger = EELFManager.getInstance().getLogger(NodeConfigManager.class); + private static NodeConfigManager base; - private Timer timer = new Timer("Node Configuration Timer", true); private long maxfailuretimer; private long initfailuretimer; private long waitForFileProcessFailureTimer; @@ -69,16 +68,17 @@ public class NodeConfigManager implements DeliveryQueueHelper { private double fdpstart; private double fdpstop; private int deliverythreads; - private String provurl; + private final String provurl; private String provhost; - private IsFrom provcheck; - private int gfport; - private int svcport; - private int port; - private String spooldir; - private String logdir; - private long logretention; - private String redirfile; + private final int intHttpPort; + private final int intHttpsPort; + private final int extHttpsPort; + private String[] enabledprotocols; + private final boolean cadiEnabled; + private String aafType; + private String aafInstance; + private String aafAction; + private final boolean tlsEnabled; private String kstype; private String ksfile; private String kspass; @@ -87,67 +87,45 @@ public class NodeConfigManager implements DeliveryQueueHelper { private String tsfile; private String tspass; private String myname; - private RedirManager rdmgr; - private RateLimitedOperation pfetcher; - private NodeConfig config; - private File quiesce; - private PublishId pid; - private String nak; - private TaskList configtasks = new TaskList(); - private String eventlogurl; - private String eventlogprefix; - private String eventlogsuffix; + private final String nak; + private final File quiesce; + private final String spooldir; + private final String logdir; + private final long logretention; + private final String eventlogurl; + private final String eventlogprefix; + private final String eventlogsuffix; private String eventloginterval; private boolean followredirects; - private String[] enabledprotocols; - private String aafType; - private String aafInstance; - private String aafAction; - private String aafURL; - private boolean cadiEnabled; + private final TaskList configtasks = new TaskList(); + private final PublishId publishId; + private final IsFrom provcheck; + private final RedirManager rdmgr; + private final Timer timer = new Timer("Node Configuration Timer", true); + private final RateLimitedOperation pfetcher; + private NodeConfig config; private NodeAafPropsUtils nodeAafPropsUtils; - - + private static Properties drNodeProperties; + + public static Properties getDrNodeProperties() { + if (drNodeProperties == null) { + try (FileInputStream props = new FileInputStream(getProperty( + "org.onap.dmaap.datarouter.node.properties", + "/opt/app/datartr/etc/node.properties"))) { + drNodeProperties = new Properties(); + drNodeProperties.load(props); + } catch (IOException e) { + eelfLogger.error("Failed to load NODE properties: " + e.getMessage(), e); + exit(1); + } + } + return drNodeProperties; + } /** * Initialize the configuration of a Data Router node. */ private NodeConfigManager() { - - Properties drNodeProperties = new Properties(); - try { - eelfLogger.debug("NODE0301 Loading local config file node.properties"); - drNodeProperties.load(new FileInputStream(System - .getProperty("org.onap.dmaap.datarouter.node.properties", "/opt/app/datartr/etc/node.properties"))); - } catch (Exception e) { - NodeUtils.setIpAndFqdnForEelf(NODE_CONFIG_MANAGER); - eelfLogger.error(EelfMsgs.MESSAGE_PROPERTIES_LOAD_ERROR, e, - System.getProperty("org.onap.dmaap.datarouter.node.properties", - "/opt/app/datartr/etc/node.properties")); - } - provurl = drNodeProperties.getProperty("ProvisioningURL", "https://dmaap-dr-prov:8443/internal/prov"); - String aafPropsFilePath = drNodeProperties - .getProperty("AAFPropsFilePath", "/opt/app/osaaf/local/org.onap.dmaap-dr.props"); - try { - nodeAafPropsUtils = new NodeAafPropsUtils(new File(aafPropsFilePath)); - } catch (IOException e) { - eelfLogger.error("NODE0314 Failed to load AAF props. Exiting", e); - exit(1); - } - /* - * START - AAF changes: TDP EPIC US# 307413 - * Pull AAF settings from node.properties - */ - aafType = drNodeProperties.getProperty("AAFType", "org.onap.dmaap-dr.feed"); - aafInstance = drNodeProperties.getProperty("AAFInstance", "legacy"); - aafAction = drNodeProperties.getProperty("AAFAction", "publish"); - cadiEnabled = Boolean.parseBoolean(drNodeProperties.getProperty("CadiEnabled", "false")); - aafURL = nodeAafPropsUtils.getPropAccess().getProperty("aaf_locate_url", "https://aaf-locate:8095"); - /* - * END - AAF changes: TDP EPIC US# 307413 - * Pull AAF settings from node.properties - */ - //Disable and enable protocols*/ - enabledprotocols = ((drNodeProperties.getProperty("NodeHttpsProtocols")).trim()).split("\\|"); + provurl = getDrNodeProperties().getProperty("ProvisioningURL", "http://dmaap-dr-prov:8080/internal/prov"); try { provhost = (new URL(provurl)).getHost(); } catch (Exception e) { @@ -155,13 +133,50 @@ public class NodeConfigManager implements DeliveryQueueHelper { eelfLogger.error(EelfMsgs.MESSAGE_BAD_PROV_URL, e, provurl); exit(1); } - eelfLogger.debug("NODE0303 Provisioning server is " + provhost); - eventlogurl = drNodeProperties.getProperty("LogUploadURL", "https://feeds-drtr.web.att.com/internal/logs"); + eelfLogger.debug("NODE0303 Provisioning server is at: " + provhost); provcheck = new IsFrom(provhost); - gfport = Integer.parseInt(drNodeProperties.getProperty("IntHttpPort", "8080")); - svcport = Integer.parseInt(drNodeProperties.getProperty("IntHttpsPort", "8443")); - port = Integer.parseInt(drNodeProperties.getProperty("ExtHttpsPort", "443")); - spooldir = drNodeProperties.getProperty("SpoolDir", "spool"); + + cadiEnabled = Boolean.parseBoolean(getDrNodeProperties().getProperty("CadiEnabled", "false")); + if (cadiEnabled) { + aafType = getDrNodeProperties().getProperty("AAFType", "org.onap.dmaap-dr.feed"); + aafInstance = getDrNodeProperties().getProperty("AAFInstance", "legacy"); + aafAction = getDrNodeProperties().getProperty("AAFAction", "publish"); + } + tlsEnabled = Boolean.parseBoolean(getDrNodeProperties().getProperty("TlsEnabled", "true")); + if (isTlsEnabled()) { + try { + kstype = getDrNodeProperties().getProperty("KeyStoreType", "PKCS12"); + tstype = getDrNodeProperties().getProperty("TrustStoreType", "jks"); + enabledprotocols = ((getDrNodeProperties().getProperty("NodeHttpsProtocols")).trim()).split("\\|"); + nodeAafPropsUtils = new NodeAafPropsUtils(new File(getDrNodeProperties() + .getProperty("AAFPropsFilePath", "/opt/app/osaaf/local/org.onap.dmaap-dr.props"))); + getSslContextData(); + if (tsfile != null && tsfile.length() > 0) { + System.setProperty("javax.net.ssl.trustStoreType", tstype); + System.setProperty("javax.net.ssl.trustStore", tsfile); + System.setProperty("javax.net.ssl.trustStorePassword", tspass); + } + myname = NodeUtils.getCanonicalName(kstype, ksfile, kspass); + if (myname == null) { + NodeUtils.setIpAndFqdnForEelf(NODE_CONFIG_MANAGER); + eelfLogger.error(EelfMsgs.MESSAGE_KEYSTORE_FETCH_ERROR, ksfile); + eelfLogger.error("NODE0309 Unable to fetch canonical name from keystore file " + ksfile); + exit(1); + } + eelfLogger.debug("NODE0304 My certificate says my name is " + myname); + } catch (Exception e) { + eelfLogger.error("NODE0314 Failed to load AAF props. Exiting", e); + exit(1); + } + } + myname = "dmaap-dr-node"; + + eventlogurl = getDrNodeProperties().getProperty("LogUploadURL", "https://feeds-drtr.web.att.com/internal/logs"); + intHttpPort = Integer.parseInt(getDrNodeProperties().getProperty("IntHttpPort", "80")); + intHttpsPort = Integer.parseInt(getDrNodeProperties().getProperty("IntHttpsPort", "443")); + extHttpsPort = Integer.parseInt(getDrNodeProperties().getProperty("ExtHttpsPort", "443")); + spooldir = getDrNodeProperties().getProperty("SpoolDir", "spool"); + File fdir = new File(spooldir + "/f"); fdir.mkdirs(); for (File junk : Objects.requireNonNull(fdir.listFiles())) { @@ -171,39 +186,19 @@ public class NodeConfigManager implements DeliveryQueueHelper { eelfLogger.error("NODE0313 Failed to clear junk files from " + fdir.getPath(), e); } } - logdir = drNodeProperties.getProperty("LogDir", "logs"); + logdir = getDrNodeProperties().getProperty("LogDir", "logs"); (new File(logdir)).mkdirs(); - logretention = Long.parseLong(drNodeProperties.getProperty("LogRetention", "30")) * 86400000L; + logretention = Long.parseLong(getDrNodeProperties().getProperty("LogRetention", "30")) * 86400000L; eventlogprefix = logdir + "/events"; eventlogsuffix = ".log"; - redirfile = drNodeProperties.getProperty("RedirectionFile", "etc/redirections.dat"); - kstype = drNodeProperties.getProperty("KeyStoreType", "PKCS12"); - ksfile = nodeAafPropsUtils.getPropAccess().getProperty("cadi_keystore"); - kspass = nodeAafPropsUtils.getDecryptedPass("cadi_keystore_password"); - kpass = nodeAafPropsUtils.getDecryptedPass("cadi_keystore_password"); - tstype = drNodeProperties.getProperty("TrustStoreType", "jks"); - tsfile = nodeAafPropsUtils.getPropAccess().getProperty("cadi_truststore"); - tspass = nodeAafPropsUtils.getDecryptedPass("cadi_truststore_password"); - if (tsfile != null && tsfile.length() > 0) { - System.setProperty("javax.net.ssl.trustStoreType", tstype); - System.setProperty("javax.net.ssl.trustStore", tsfile); - System.setProperty("javax.net.ssl.trustStorePassword", tspass); - } - nak = drNodeProperties.getProperty("NodeAuthKey", "Node123!"); - quiesce = new File(drNodeProperties.getProperty("QuiesceFile", "etc/SHUTDOWN")); - myname = NodeUtils.getCanonicalName(kstype, ksfile, kspass); - if (myname == null) { - NodeUtils.setIpAndFqdnForEelf(NODE_CONFIG_MANAGER); - eelfLogger.error(EelfMsgs.MESSAGE_KEYSTORE_FETCH_ERROR, ksfile); - eelfLogger.error("NODE0309 Unable to fetch canonical name from keystore file " + ksfile); - exit(1); - } - eelfLogger.debug("NODE0304 My certificate says my name is " + myname); - pid = new PublishId(myname); - long minrsinterval = Long.parseLong(drNodeProperties.getProperty("MinRedirSaveInterval", "10000")); - long minpfinterval = Long.parseLong(drNodeProperties.getProperty("MinProvFetchInterval", "10000")); - rdmgr = new RedirManager(redirfile, minrsinterval, timer); - pfetcher = new RateLimitedOperation(minpfinterval, timer) { + String redirfile = getDrNodeProperties().getProperty("RedirectionFile", "etc/redirections.dat"); + publishId = new PublishId(myname); + nak = getDrNodeProperties().getProperty("NodeAuthKey", "Node123!"); + quiesce = new File(getDrNodeProperties().getProperty("QuiesceFile", "etc/SHUTDOWN")); + rdmgr = new RedirManager(redirfile, + Long.parseLong(getDrNodeProperties().getProperty("MinRedirSaveInterval", "10000")), timer); + pfetcher = new RateLimitedOperation( + Long.parseLong(getDrNodeProperties().getProperty("MinProvFetchInterval", "10000")), timer) { public void run() { fetchconfig(); } @@ -212,10 +207,21 @@ public class NodeConfigManager implements DeliveryQueueHelper { pfetcher.request(); } + private void getSslContextData() { + ksfile = nodeAafPropsUtils.getPropAccess().getProperty("cadi_keystore"); + kspass = nodeAafPropsUtils.getDecryptedPass("cadi_keystore_password"); + kpass = nodeAafPropsUtils.getDecryptedPass("cadi_keystore_password"); + tsfile = nodeAafPropsUtils.getPropAccess().getProperty("cadi_truststore"); + tspass = nodeAafPropsUtils.getDecryptedPass("cadi_truststore_password"); + } + /** * Get the default node configuration manager. */ public static NodeConfigManager getInstance() { + if (base == null) { + base = new NodeConfigManager(); + } return base; } @@ -300,15 +306,16 @@ public class NodeConfigManager implements DeliveryQueueHelper { private void fetchconfig() { try { eelfLogger.debug("NodeConfigMan.fetchConfig: provurl:: " + provurl); - Reader reader = new InputStreamReader((new URL(provurl)).openStream()); - config = new NodeConfig(new ProvData(reader), myname, spooldir, port, nak); + URL url = new URL(provurl); + Reader reader = new InputStreamReader(url.openStream()); + config = new NodeConfig(new ProvData(reader), myname, spooldir, extHttpsPort, nak); localconfig(); configtasks.startRun(); runTasks(); } catch (Exception e) { NodeUtils.setIpAndFqdnForEelf("fetchconfigs"); eelfLogger.error(EelfMsgs.MESSAGE_CONF_FAILED, e.toString()); - eelfLogger.error("NODE0306 Configuration failed " + e.toString() + " - try again later", e); + eelfLogger.error("NODE0306 Configuration failed " + e + " - try again later", e); pfetcher.request(); } } @@ -329,7 +336,7 @@ public class NodeConfigManager implements DeliveryQueueHelper { * fetch the provisioning data, ignore the request. If the data has been fetched very recently (default 10 * seconds), wait a while before fetching again. */ - public synchronized void gofetch(String remoteAddr) { + synchronized void gofetch(String remoteAddr) { if (provcheck.isReachable(remoteAddr)) { eelfLogger.debug("NODE0307 Received configuration fetch request from provisioning server " + remoteAddr); pfetcher.request(); @@ -341,15 +348,15 @@ public class NodeConfigManager implements DeliveryQueueHelper { /** * Am I configured. */ - public boolean isConfigured() { - return (config != null); + boolean isConfigured() { + return config != null; } /** * Am I shut down. */ - public boolean isShutdown() { - return (quiesce.exists()); + boolean isShutdown() { + return quiesce.exists(); } /** @@ -358,8 +365,8 @@ public class NodeConfigManager implements DeliveryQueueHelper { * @param routing Target string * @return array of targets */ - public Target[] parseRouting(String routing) { - return (config.parseRouting(routing)); + Target[] parseRouting(String routing) { + return config.parseRouting(routing); } /** @@ -369,8 +376,8 @@ public class NodeConfigManager implements DeliveryQueueHelper { * @param ip IP address the request came from * @return If the credentials and IP address are recognized, true, otherwise false. */ - public boolean isAnotherNode(String credentials, String ip) { - return (config.isAnotherNode(credentials, ip)); + boolean isAnotherNode(String credentials, String ip) { + return config.isAnotherNode(credentials, ip); } /** @@ -381,8 +388,8 @@ public class NodeConfigManager implements DeliveryQueueHelper { * @param ip The requesting IP address * @return True if the IP and credentials are valid for the specified feed. */ - public String isPublishPermitted(String feedid, String credentials, String ip) { - return (config.isPublishPermitted(feedid, credentials, ip)); + String isPublishPermitted(String feedid, String credentials, String ip) { + return config.isPublishPermitted(feedid, credentials, ip); } /** @@ -392,8 +399,8 @@ public class NodeConfigManager implements DeliveryQueueHelper { * @param ip The requesting IP address * @return True if the IP and credentials are valid for the specified feed. */ - public String isPublishPermitted(String feedid, String ip) { - return (config.isPublishPermitted(feedid, ip)); + String isPublishPermitted(String feedid, String ip) { + return config.isPublishPermitted(feedid, ip); } /** @@ -402,8 +409,8 @@ public class NodeConfigManager implements DeliveryQueueHelper { * @param subId The ID of the subscription being requested * @return True if the delete file is permitted for the subscriber. */ - public boolean isDeletePermitted(String subId) { - return (config.isDeletePermitted(subId)); + boolean isDeletePermitted(String subId) { + return config.isDeletePermitted(subId); } /** @@ -413,8 +420,8 @@ public class NodeConfigManager implements DeliveryQueueHelper { * @param credentials The offered credentials * @return Null if the credentials are invalid or the user if they are valid. */ - public String getAuthUser(String feedid, String credentials) { - return (config.getAuthUser(feedid, credentials)); + String getAuthUser(String feedid, String credentials) { + return config.getAuthUser(feedid, credentials); } /** @@ -422,11 +429,11 @@ public class NodeConfigManager implements DeliveryQueueHelper { * * @param feedid The ID of the feed specified */ - public String getAafInstance(String feedid) { - return (config.getAafInstance(feedid)); + String getAafInstance(String feedid) { + return config.getAafInstance(feedid); } - public String getAafInstance() { + String getAafInstance() { return aafInstance; } @@ -438,8 +445,8 @@ public class NodeConfigManager implements DeliveryQueueHelper { * @param ip The IP address of the publish endpoint * @return Null if the request should be accepted or the correct hostname if it should be sent to another node. */ - public String getIngressNode(String feedid, String user, String ip) { - return (config.getIngressNode(feedid, user, ip)); + String getIngressNode(String feedid, String user, String ip) { + return config.getIngressNode(feedid, user, ip); } /** @@ -448,8 +455,8 @@ public class NodeConfigManager implements DeliveryQueueHelper { * @param name The name of the parameter * @return The value of the parameter or null if it is not defined. */ - public String getProvParam(String name) { - return (config.getProvParam(name)); + private String getProvParam(String name) { + return config.getProvParam(name); } /** @@ -459,39 +466,39 @@ public class NodeConfigManager implements DeliveryQueueHelper { * @param defaultValue The value to use if the parameter is not defined * @return The value of the parameter or deflt if it is not defined. */ - public String getProvParam(String name, String defaultValue) { + private String getProvParam(String name, String defaultValue) { name = config.getProvParam(name); if (name == null) { name = defaultValue; } - return (name); + return name; } /** * Generate a publish ID. */ public String getPublishId() { - return (pid.next()); + return publishId.next(); } /** * Get all the outbound spooling destinations. This will include both subscriptions and nodes. */ - public DestInfo[] getAllDests() { - return (config.getAllDests()); + DestInfo[] getAllDests() { + return config.getAllDests(); } /** * Register a task to run whenever the configuration changes. */ - public void registerConfigTask(Runnable task) { + void registerConfigTask(Runnable task) { configtasks.addTask(task); } /** * Deregister a task to run whenever the configuration changes. */ - public void deregisterConfigTask(Runnable task) { + void deregisterConfigTask(Runnable task) { configtasks.removeTask(task); } @@ -542,49 +549,49 @@ public class NodeConfigManager implements DeliveryQueueHelper { * Get the timeout before retrying after an initial delivery failure. */ public long getInitFailureTimer() { - return (initfailuretimer); + return initfailuretimer; } /** * Get the timeout before retrying after delivery and wait for file processing. */ public long getWaitForFileProcessFailureTimer() { - return (waitForFileProcessFailureTimer); + return waitForFileProcessFailureTimer; } /** * Get the maximum timeout between delivery attempts. */ public long getMaxFailureTimer() { - return (maxfailuretimer); + return maxfailuretimer; } /** * Get the ratio between consecutive delivery attempts. */ public double getFailureBackoff() { - return (failurebackoff); + return failurebackoff; } /** * Get the expiration timer for deliveries. */ public long getExpirationTimer() { - return (expirationtimer); + return expirationtimer; } /** * Get the maximum number of file delivery attempts before checking if another queue has work to be performed. */ public int getFairFileLimit() { - return (fairfilelimit); + return fairfilelimit; } /** * Get the maximum amount of time spent delivering files before checking if another queue has work to be performed. */ public long getFairTimeLimit() { - return (fairtimelimit); + return fairtimelimit; } /** @@ -593,21 +600,21 @@ public class NodeConfigManager implements DeliveryQueueHelper { * @param feedid The feed ID * @return The targets this feed should be delivered to */ - public Target[] getTargets(String feedid) { - return (config.getTargets(feedid)); + Target[] getTargets(String feedid) { + return config.getTargets(feedid); } /** * Get the spool directory for temporary files. */ - public String getSpoolDir() { - return (spooldir + "/f"); + String getSpoolDir() { + return spooldir + "/f"; } /** * Get the spool directory for a subscription. */ - public String getSpoolDir(String subid, String remoteaddr) { + String getSpoolDir(String subid, String remoteaddr) { if (provcheck.isFrom(remoteaddr)) { String sdir = config.getSpoolDir(subid); if (sdir != null) { @@ -617,137 +624,150 @@ public class NodeConfigManager implements DeliveryQueueHelper { eelfLogger.debug("NODE0311 Received subscription reset request for unknown subscription " + subid + " from provisioning server " + remoteaddr); } - return (sdir); + return sdir; } else { eelfLogger.debug("NODE0312 Received subscription reset request from unexpected server " + remoteaddr); - return (null); + return null; } } /** * Get the base directory for spool directories. */ - public String getSpoolBase() { - return (spooldir); + String getSpoolBase() { + return spooldir; } /** * Get the key store type. */ - public String getKSType() { - return (kstype); + String getKSType() { + return kstype; } /** * Get the key store file. */ - public String getKSFile() { - return (ksfile); + String getKSFile() { + return ksfile; } /** * Get the key store password. */ - public String getKSPass() { - return (kspass); + String getKSPass() { + return kspass; } /** * Get the key password. */ - public String getKPass() { - return (kpass); + String getKPass() { + return kpass; + } + + + String getTstype() { + return tstype; + } + + String getTsfile() { + return tsfile; + } + + String getTspass() { + return tspass; } /** * Get the http port. */ - public int getHttpPort() { - return (gfport); + int getHttpPort() { + return intHttpPort; } /** * Get the https port. */ - public int getHttpsPort() { - return (svcport); + int getHttpsPort() { + return intHttpsPort; } /** * Get the externally visible https port. */ - public int getExtHttpsPort() { - return (port); + int getExtHttpsPort() { + return extHttpsPort; } /** * Get the external name of this machine. */ - public String getMyName() { - return (myname); + String getMyName() { + return myname; } /** * Get the number of threads to use for delivery. */ - public int getDeliveryThreads() { - return (deliverythreads); + int getDeliveryThreads() { + return deliverythreads; } /** * Get the URL for uploading the event log data. */ - public String getEventLogUrl() { - return (eventlogurl); + String getEventLogUrl() { + return eventlogurl; } /** * Get the prefix for the names of event log files. */ - public String getEventLogPrefix() { - return (eventlogprefix); + String getEventLogPrefix() { + return eventlogprefix; } /** * Get the suffix for the names of the event log files. */ - public String getEventLogSuffix() { - return (eventlogsuffix); + String getEventLogSuffix() { + return eventlogsuffix; } /** * Get the interval between event log file rollovers. */ - public String getEventLogInterval() { - return (eventloginterval); + String getEventLogInterval() { + return eventloginterval; } /** * Should I follow redirects from subscribers. */ public boolean isFollowRedirects() { - return (followredirects); + return followredirects; } /** * Get the directory where the event and node log files live. */ - public String getLogDir() { - return (logdir); + String getLogDir() { + return logdir; } /** * How long do I keep log files (in milliseconds). */ - public long getLogRetention() { - return (logretention); + long getLogRetention() { + return logretention; } /** * Get the timer. */ public Timer getTimer() { - return (timer); + return timer; } /** @@ -757,7 +777,7 @@ public class NodeConfigManager implements DeliveryQueueHelper { * @return The feed ID */ public String getFeedId(String subid) { - return (config.getFeedId(subid)); + return config.getFeedId(subid); } /** @@ -765,53 +785,50 @@ public class NodeConfigManager implements DeliveryQueueHelper { * * @return The Authorization string for this node */ - public String getMyAuth() { - return (config.getMyAuth()); + String getMyAuth() { + return config.getMyAuth(); } /** * Get the fraction of free spool disk space where we start throwing away undelivered files. This is * FREE_DISK_RED_PERCENT / 100.0. Default is 0.05. Limited by 0.01 <= FreeDiskStart <= 0.5. */ - public double getFreeDiskStart() { - return (fdpstart); + double getFreeDiskStart() { + return fdpstart; } /** * Get the fraction of free spool disk space where we stop throwing away undelivered files. This is * FREE_DISK_YELLOW_PERCENT / 100.0. Default is 0.2. Limited by FreeDiskStart <= FreeDiskStop <= 0.5. */ - public double getFreeDiskStop() { - return (fdpstop); + double getFreeDiskStop() { + return fdpstop; } /** * Disable and enable protocols. */ - public String[] getEnabledprotocols() { + String[] getEnabledprotocols() { return enabledprotocols; } - public String getAafType() { + String getAafType() { return aafType; } - public String getAafAction() { + String getAafAction() { return aafAction; } - /* - * Get aafURL from SWM variable - * */ - public String getAafURL() { - return aafURL; + protected boolean isTlsEnabled() { + return tlsEnabled; } - public boolean getCadiEnabled() { + boolean getCadiEnabled() { return cadiEnabled; } - public NodeAafPropsUtils getNodeAafPropsUtils() { + NodeAafPropsUtils getNodeAafPropsUtils() { return nodeAafPropsUtils; } @@ -821,7 +838,7 @@ public class NodeConfigManager implements DeliveryQueueHelper { * @param aafInstance The aaf instance * @return The permissions */ - protected String getPermission(String aafInstance) { + String getPermission(String aafInstance) { try { String type = getAafType(); String action = getAafAction();