aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Hernandez <jorge.hernandez-herrero@att.com>2018-11-27 16:28:40 +0000
committerGerrit Code Review <gerrit@onap.org>2018-11-27 16:28:40 +0000
commitdc569fec077a6d6acce415925685699d5907cd2d (patch)
tree1d1f9b80b23f03d317426508ff83256a1f01a665
parentf6658bcf0374eaf2efa8e5a7c6fb135ced67d44c (diff)
parentc3cba1ad09e4bca029490e18fe51e972089f7ec7 (diff)
Merge "Fix checkstyle issue in policy common"
-rw-r--r--.gitignore2
-rw-r--r--integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitor.java201
-rw-r--r--integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTestBase.java1
-rw-r--r--integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementTest.java9
-rw-r--r--policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/DmaapTopicSinkFactory.java65
5 files changed, 137 insertions, 141 deletions
diff --git a/.gitignore b/.gitignore
index 13d4a1eb..444559c5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,3 +23,5 @@ integrity-audit/testingLogs/common-modules/integrity-audit/error.log
integrity-audit/testingLogs/common-modules/integrity-audit/metrics.log
integrity-monitor/IntegrityMonitor.log.*
*.log
+*.ipr
+*.iws
diff --git a/integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitor.java b/integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitor.java
index 9412606d..8e9dd3dd 100644
--- a/integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitor.java
+++ b/integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitor.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -48,15 +48,16 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * IntegrityMonitor Main class for monitoring the integrity of a resource and managing its state.
- * State management follows the X.731 ITU standard.
+ * IntegrityMonitor Main class for monitoring the integrity of a resource and managing its state. State management
+ * follows the X.731 ITU standard.
*/
public class IntegrityMonitor {
+
private static final Logger logger = LoggerFactory.getLogger(IntegrityMonitor.class.getName());
// only allow one instance of IntegrityMonitor
private static IntegrityMonitor instance = null;
-
+
/*
* Common strings
*/
@@ -65,15 +66,15 @@ public class IntegrityMonitor {
private static final String PROPERTY_EXCEPTION_STRING = "IntegrityMonitor Property Exception: ";
private static final String EXCEPTION_STRING = "IntegrityMonitor threw exception.";
private static final String STATE_CHECK_STRING = "IntegrityMonitor.stateCheck(): "
- + "Failed to diableFail dependent resource = ";
+ + "Failed to disableFail dependent resource = ";
private static final String RESOURCE_STRING = "Resource ";
private static final String LC_RESOURCE_STRING = "resource";
-
+
/*
* Query String
*/
private static final String QUERY_STRING = "Select f from ForwardProgressEntity f where f.resourceName=:rn";
-
+
// may be changed by junit tests
private static Factory factory = new Factory();
@@ -143,7 +144,7 @@ public class IntegrityMonitor {
private static long writeFpcIntervalMs = toMillis(IntegrityMonitorProperties.DEFAULT_WRITE_FPC_INTERVAL);
// check the health of dependencies
private static long checkDependencyIntervalMs =
- toMillis(IntegrityMonitorProperties.DEFAULT_CHECK_DEPENDENCY_INTERVAL);
+ toMillis(IntegrityMonitorProperties.DEFAULT_CHECK_DEPENDENCY_INTERVAL);
// A lead subsystem will have dependency groups with resource names in the
// properties file.
@@ -190,11 +191,10 @@ public class IntegrityMonitor {
private Map<String, String> allNotWellMap;
/**
- * IntegrityMonitor constructor. It is invoked from the getInstance() method in this class or
- * from the constructor of a child or sub-class. A class can extend the IntegrityMonitor class
- * if there is a need to override any of the base methods (ex. subsystemTest()). Only one
- * instance is allowed to be created per resource name.
- *
+ * IntegrityMonitor constructor. It is invoked from the getInstance() method in this class or from the constructor
+ * of a child or sub-class. A class can extend the IntegrityMonitor class if there is a need to override any of the
+ * base methods (ex. subsystemTest()). Only one instance is allowed to be created per resource name.
+ *
* @param resourceName The resource name of the resource
* @param properties a set of properties passed in from the resource
* @throws IntegrityMonitorException if any errors are encountered in the constructor
@@ -229,8 +229,8 @@ public class IntegrityMonitor {
// Did it get created?
//
if (emf == null) {
- logger.error("Error creating IM entity manager factory with persistence unit: {}",
- factory.getPersistenceUnit());
+ logger.error("Error creating IM entity manager factory with persistence unit: {}",
+ factory.getPersistenceUnit());
throw new IntegrityMonitorException("Unable to create IM Entity Manager Factory");
}
@@ -323,7 +323,7 @@ public class IntegrityMonitor {
}
try {
- // create instance of StateMangement class and pass emf to it
+ // create instance of StateManagement class and pass emf to it
stateManager = new StateManagement(emf, resourceName);
/**
@@ -352,14 +352,13 @@ public class IntegrityMonitor {
}
/**
- * Get an instance of IntegrityMonitor for a given resource name. It creates one if it does not
- * exist. Only one instance is allowed to be created per resource name.
- *
+ * Get an instance of IntegrityMonitor for a given resource name. It creates one if it does not exist. Only one
+ * instance is allowed to be created per resource name.
+ *
* @param resourceName The resource name of the resource
* @param properties a set of properties passed in from the resource
* @return The new instance of IntegrityMonitor
- * @throws IntegrityMonitorException if unable to create jmx url or the constructor returns an
- * exception
+ * @throws IntegrityMonitorException if unable to create jmx url or the constructor returns an exception
*/
public static IntegrityMonitor getInstance(String resourceName, Properties properties)
throws IntegrityMonitorException {
@@ -381,7 +380,7 @@ public class IntegrityMonitor {
/**
* Get the single instance.
- *
+ *
* @return the instance
* @throws IntegrityMonitorException if no instance exists
*/
@@ -397,8 +396,8 @@ public class IntegrityMonitor {
}
/**
- * This is a facility used by JUnit testing to destroy the IntegrityMonitor instance before
- * creating a new one. It waits a bit to allow the FPManager to fully exit.
+ * This is a facility used by JUnit testing to destroy the IntegrityMonitor instance before creating a new one. It
+ * waits a bit to allow the FPManager to fully exit.
*/
public static void deleteInstance() throws IntegrityMonitorException {
logger.debug("deleteInstance() called");
@@ -413,7 +412,7 @@ public class IntegrityMonitor {
// Make sure it has exited
fpm.join(2000L);
} catch (InterruptedException e) {
- logger.error("deleteInstance: Interrupted while waiting for FPManaager to fully exit", e);
+ logger.error("deleteInstance: Interrupted while waiting for FPManager to fully exit", e);
Thread.currentThread().interrupt();
}
@@ -473,16 +472,15 @@ public class IntegrityMonitor {
// assemble the jmx url
String jmxUrl = "service:jmx:rmi:///jndi/rmi://" + jmxFqdn + ":" + port + "/jmxrmi";
- logger.debug("IntegerityMonitor - jmx url={}", jmxUrl);
+ logger.debug("IntegrityMonitor - jmx url={}", jmxUrl);
return jmxUrl;
}
/**
- * evaluateSanity() is designed to be called by an external entity to evealuate the sanity of
- * the node. It checks the operational and administrative states and the standby status. If the
- * operational state is disabled, it will include the dependencyCheckErrorMsg which includes
- * information about any dependency (node) which has failed.
+ * evaluateSanity() is designed to be called by an external entity to evaluate the sanity of the node. It checks the
+ * operational and administrative states and the standby status. If the operational state is disabled, it will
+ * include the dependencyCheckErrorMsg which includes information about any dependency (node) which has failed.
*/
public void evaluateSanity() throws IntegrityMonitorException {
logger.debug("evaluateSanity called ....");
@@ -516,11 +514,10 @@ public class IntegrityMonitor {
}
/**
- * This method checks the forward progress counter and the state of a dependency. If the
- * dependency is unavailable or failed, an error message is created which is checked when
- * evaluateSanity interface is called. If the error message is set then the evaluateSanity will
- * return an error.
- *
+ * This method checks the forward progress counter and the state of a dependency. If the dependency is unavailable
+ * or failed, an error message is created which is checked when evaluateSanity interface is called. If the error
+ * message is set then the evaluateSanity will return an error.
+ *
* @param dep the dependency
*/
public String stateCheck(String dep) {
@@ -632,9 +629,7 @@ public class IntegrityMonitor {
String msg = STATE_CHECK_STRING + dep
+ "; " + " forwardProgressEntity == null.";
logger.error("{}", msg);
- }
-
- else {
+ } else {
String msg = STATE_CHECK_STRING + dep
+ "; " + " stateManagementEntity == null.";
logger.error("{}", msg);
@@ -739,7 +734,7 @@ public class IntegrityMonitor {
/**
* Get all forward progress entities.
- *
+ *
* @return list of all forward progress entities
*/
public List<ForwardProgressEntity> getAllForwardProgressEntity() {
@@ -856,7 +851,7 @@ public class IntegrityMonitor {
/**
* Perform a dependency check.
- *
+ *
* @return an error message detailing any issues found
*/
public String dependencyCheck() {
@@ -979,7 +974,7 @@ public class IntegrityMonitor {
+ " to enableNoDependency");
if (stateManager.getAvailStatus() != null
&& ((stateManager.getAvailStatus()).equals(StateManagement.DEPENDENCY)
- || (stateManager.getAvailStatus()).equals(StateManagement.DEPENDENCY_FAILED))) {
+ || (stateManager.getAvailStatus()).equals(StateManagement.DEPENDENCY_FAILED))) {
// Note: redundant calls are made by
// refreshStateAudit
this.stateManager.enableNoDependency();
@@ -1005,7 +1000,7 @@ public class IntegrityMonitor {
logger.debug("There are no dependents. Updating this resource's state to enableNoDependency");
if (stateManager.getAvailStatus() != null
&& ((stateManager.getAvailStatus()).equals(StateManagement.DEPENDENCY)
- || (stateManager.getAvailStatus()).equals(StateManagement.DEPENDENCY_FAILED))) {
+ || (stateManager.getAvailStatus()).equals(StateManagement.DEPENDENCY_FAILED))) {
// Note: redundant calls are made by refreshStateAudit
this.stateManager.enableNoDependency();
}
@@ -1033,9 +1028,9 @@ public class IntegrityMonitor {
}
/**
- * Execute a test transaction. It is called when the test transaction timer fires. It could be
- * overridden to provide additional test functionality. If overridden, the overriding method
- * must invoke startTransaction() and endTransaction() and check if the allNotWellMap is empty.
+ * Execute a test transaction. It is called when the test transaction timer fires. It could be overridden to provide
+ * additional test functionality. If overridden, the overriding method must invoke startTransaction() and
+ * endTransaction() and check if the allNotWellMap is empty.
*/
public void testTransaction() {
synchronized (testTransactionLock) {
@@ -1050,8 +1045,8 @@ public class IntegrityMonitor {
}
/**
- * Additional testing for subsystems that do not have a /test interface (for ex. 3rd party
- * processes like elk). This method would be overridden by the subsystem.
+ * Additional testing for subsystems that do not have a /test interface (for ex. 3rd party processes like elk). This
+ * method would be overridden by the subsystem.
*/
public void subsystemTest() throws IntegrityMonitorException {
// Testing provided by subsystem
@@ -1059,9 +1054,8 @@ public class IntegrityMonitor {
}
/**
- * Checks admin state and resets transaction timer. Called by application at the start of a
- * transaction.
- *
+ * Checks admin state and resets transaction timer. Called by application at the start of a transaction.
+ *
* @throws AdministrativeStateException throws admin state exception if resource is locked
* @throws StandbyStatusException if resource is in standby
*/
@@ -1078,7 +1072,7 @@ public class IntegrityMonitor {
if ((stateManager.getStandbyStatus() != null)
&& (stateManager.getStandbyStatus().equals(StateManagement.HOT_STANDBY)
- || stateManager.getStandbyStatus().equals(StateManagement.COLD_STANDBY))) {
+ || stateManager.getStandbyStatus().equals(StateManagement.COLD_STANDBY))) {
String msg = RESOURCE_STRING + resourceName + " is standby";
throw new StandbyStatusException("IntegrityMonitor Standby Status Exception: " + msg);
@@ -1090,8 +1084,8 @@ public class IntegrityMonitor {
}
/**
- * Increment the local forward progress counter. Called by application at the end of each
- * transaction (successful or not).
+ * Increment the local forward progress counter. Called by application at the end of each transaction (successful or
+ * not).
*/
public void endTransaction() {
synchronized (endTransactionLock) {
@@ -1185,7 +1179,7 @@ public class IntegrityMonitor {
/**
* Read and validate properties.
- *
+ *
* @throws IntegrityMonitorPropertiesException if a property is invalid
*/
private static void validateProperties(Properties prop) throws IntegrityMonitorPropertiesException {
@@ -1343,7 +1337,7 @@ public class IntegrityMonitor {
/**
* Update properties.
- *
+ *
* @param newprop the new properties
*/
public static void updateProperties(Properties newprop) {
@@ -1369,9 +1363,8 @@ public class IntegrityMonitor {
}
/**
- * Look for "Forward Progress" -- if the 'FPMonitor' is stalled for too long, the operational
- * state is changed to 'Disabled', and an alarm is set. The state is restored when forward
- * progress continues.
+ * Look for "Forward Progress" -- if the 'FPMonitor' is stalled for too long, the operational state is changed to
+ * 'Disabled', and an alarm is set. The state is restored when forward progress continues.
*/
private void fpMonitorCycle() {
logger.debug("fpMonitorCycle(): entry");
@@ -1430,8 +1423,8 @@ public class IntegrityMonitor {
}
/**
- * Look for "Forward Progress" on other nodes. If they are not making forward progress, check
- * their operational state. If it is not disabled, then disable them.
+ * Look for "Forward Progress" on other nodes. If they are not making forward progress, check their operational
+ * state. If it is not disabled, then disable them.
*/
private void stateAudit() {
logger.debug("IntegrityMonitor.stateAudit(): entry");
@@ -1450,8 +1443,8 @@ public class IntegrityMonitor {
return;
}
if (!stateManager.getStandbyStatus().equals(StateManagement.NULL_VALUE)
- && stateManager.getStandbyStatus() != null
- && !stateManager.getStandbyStatus().equals(StateManagement.PROVIDING_SERVICE)) {
+ && stateManager.getStandbyStatus() != null
+ && !stateManager.getStandbyStatus().equals(StateManagement.PROVIDING_SERVICE)) {
logger.debug("IntegrityMonitor.stateAudit(): NOT PROVIDING_SERVICE. returning");
return;
}
@@ -1504,7 +1497,7 @@ public class IntegrityMonitor {
if (diffMs > staleMs) {
// ForwardProgress is stale. Disable it
// Start a transaction
- logger.debug("IntegrityMonitor.executeStateAudit(): resource = {}, FPC is stale. Disabling it",
+ logger.debug("IntegrityMonitor.executeStateAudit(): resource = {}, FPC is stale. Disabling it",
fpe.getResourceName());
EntityTransaction et = em.getTransaction();
et.begin();
@@ -1648,9 +1641,9 @@ public class IntegrityMonitor {
/*
* This is a simple refresh audit which is periodically run to assure that the states and status
* attributes are aligned and notifications are sent to any listeners. It is possible for
- * state/status to get out of synch and notified systems to be out of synch due to database
+ * state/status to get out of sync and notified systems to be out of synch due to database
* corruption (manual or otherwise) or because a node became isolated.
- *
+ *
* When the operation (lock/unlock) is called, it will cause a re-evaluation of the state and
* send a notification to all registered observers.
*/
@@ -1703,11 +1696,11 @@ public class IntegrityMonitor {
}
/**
- * The following nested class periodically performs the forward progress check, checks
- * dependencies, does a refresh state audit and runs the stateAudit.
+ * The following nested class periodically performs the forward progress check, checks dependencies, does a refresh
+ * state audit and runs the stateAudit.
*/
class FpManager extends Thread {
-
+
private volatile boolean stopRequested = false;
// Constructor - start FP manager thread
@@ -1725,8 +1718,8 @@ public class IntegrityMonitor {
while (!stopRequested) {
MonitorTime.getInstance().sleep(CYCLE_INTERVAL_MILLIS);
-
- IntegrityMonitor.this.runOnce();
+
+ this.runOnce();
factory.monitorCompleted();
}
@@ -1736,49 +1729,48 @@ public class IntegrityMonitor {
}
}
- public void stopAndExit() {
+ void stopAndExit() {
stopRequested = true;
this.interrupt();
}
- }
- private void runOnce() {
- try {
- logger.debug("FPManager calling fpMonitorCycle()");
- // check forward progress timer
- fpMonitorCycle();
+ private void runOnce() {
+ try {
+ logger.debug("FPManager calling fpMonitorCycle()");
+ // check forward progress timer
+ fpMonitorCycle();
- logger.debug("FPManager calling checkTestTransaction()");
- // check test transaction timer
- checkTestTransaction();
+ logger.debug("FPManager calling checkTestTransaction()");
+ // check test transaction timer
+ checkTestTransaction();
- logger.debug("FPManager calling checkWriteFpc()");
- // check write Fpc timer
- checkWriteFpc();
+ logger.debug("FPManager calling checkWriteFpc()");
+ // check write Fpc timer
+ checkWriteFpc();
- logger.debug("FPManager calling checkDependentHealth()");
- // check dependency health
- checkDependentHealth();
+ logger.debug("FPManager calling checkDependentHealth()");
+ // check dependency health
+ checkDependentHealth();
- logger.debug("FPManager calling refreshStateAudit()");
- // check if it is time to run the refreshStateAudit
- refreshStateAudit();
+ logger.debug("FPManager calling refreshStateAudit()");
+ // check if it is time to run the refreshStateAudit
+ refreshStateAudit();
- logger.debug("FPManager calling stateAudit()");
- // check if it is time to run the stateAudit
- stateAudit();
+ logger.debug("FPManager calling stateAudit()");
+ // check if it is time to run the stateAudit
+ stateAudit();
- } catch (Exception e) {
- logger.error("Ignore FPManager thread processing timer(s) exception: ", e);
+ } catch (Exception e) {
+ logger.error("Ignore FPManager thread processing timer(s) exception: ", e);
+ }
}
}
/**
* Set all seems well or not well for the specified key.
- *
+ *
* @param key the key
- * @param asw <code>true</code> if all seems well for the key, <code>false</code> if all seems
- * not well for the key
+ * @param asw <code>true</code> if all seems well for the key, <code>false</code> if all seems not well for the key
* @param msg message to add for the key
* @throws AllSeemsWellException if an error occurs
*/
@@ -1855,10 +1847,10 @@ public class IntegrityMonitor {
logger.debug("allSeemsWell exit");
}
}
-
+
/**
* Converts the given value to milliseconds using the current {@link #propertyUnits}.
- *
+ *
* @param value value to be converted, or -1
* @return the value, in milliseconds, or -1
*/
@@ -1880,9 +1872,8 @@ public class IntegrityMonitor {
public static class Factory {
/**
- * Indicates that the {@link FpManager#run()} method has started. This method
- * simply returns.
- *
+ * Indicates that the {@link FpManager#run()} method has started. This method simply returns.
+ *
* @throws InterruptedException can be interrupted
*/
public void runStarted() throws InterruptedException {
@@ -1891,7 +1882,7 @@ public class IntegrityMonitor {
/**
* Indicates that a monitor activity has completed. This method simply returns.
- *
+ *
* @throws InterruptedException can be interrupted
*/
public void monitorCompleted() throws InterruptedException {
@@ -1900,7 +1891,7 @@ public class IntegrityMonitor {
/**
* Get persistence unit.
- *
+ *
* @return the persistence unit to be used
*/
public String getPersistenceUnit() {
diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTestBase.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTestBase.java
index ba1fc344..f3ad1d32 100644
--- a/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTestBase.java
+++ b/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTestBase.java
@@ -134,7 +134,6 @@ public class IntegrityMonitorTestBase {
/**
* Saves current configuration information and then sets new values.
*
- * @param dbDriver the name of the DB Driver class
* @param dbUrl the URL to the DB
* @throws IOException if an IO error occurs
*/
diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementTest.java
index 1d0d34ea..9bc49861 100644
--- a/integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementTest.java
+++ b/integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementTest.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -49,6 +49,7 @@ import org.slf4j.LoggerFactory;
* privileges and can execute time-sensitive tasks.
*/
public class StateManagementTest extends IntegrityMonitorTestBase {
+
private static final String TEST_RESOURCE_NAME = "test_resource1";
private static Logger logger = LoggerFactory.getLogger(StateManagementTest.class);
//
@@ -276,8 +277,8 @@ public class StateManagementTest extends IntegrityMonitorTestBase {
/**
* Converts a state element to a comma-separated string.
- *
- * @param se element to be converted
+ *
+ * @param sm element to be converted
* @return a string representing the element
*/
private String makeString(final StateManagement sm) {
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/DmaapTopicSinkFactory.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/DmaapTopicSinkFactory.java
index 09078720..7e666417 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/DmaapTopicSinkFactory.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/DmaapTopicSinkFactory.java
@@ -38,6 +38,7 @@ import org.slf4j.LoggerFactory;
* DMAAP Topic Sink Factory.
*/
public interface DmaapTopicSinkFactory {
+
String DME2_READ_TIMEOUT_PROPERTY = "AFT_DME2_EP_READ_TIMEOUT_MS";
String DME2_EP_CONN_TIMEOUT_PROPERTY = "AFT_DME2_EP_CONN_TIMEOUT";
String DME2_ROUNDTRIP_TIMEOUT_PROPERTY = "AFT_DME2_ROUNDTRIP_TIMEOUT_MS";
@@ -48,6 +49,7 @@ public interface DmaapTopicSinkFactory {
String DME2_SESSION_STICKINESS_REQUIRED_PROPERTY = "sessionstickinessrequired";
/**
+ * <pre>
* Instantiate a new DMAAP Topic Sink, with following params.
* servers list of servers
* topic topic name
@@ -63,6 +65,7 @@ public interface DmaapTopicSinkFactory {
* longitude DME2 longitude
* additionalProps additional properties to pass to DME2
* managed is this sink endpoint managed?
+ * </pre>
* @param busTopicParams parameter object
* @return DmaapTopicSink object
* @throws IllegalArgumentException if invalid parameters are present
@@ -82,7 +85,7 @@ public interface DmaapTopicSinkFactory {
* Instantiates a new DMAAP Topic Sink.
*
* @param servers list of servers
- * @param topic topic name
+ * @param topic topic name
* @return an DMAAP Topic Sink
* @throws IllegalArgumentException if invalid parameters are present
*/
@@ -107,7 +110,7 @@ public interface DmaapTopicSinkFactory {
* @param topic the topic name
* @return an DMAAP Topic Sink with topic name
* @throws IllegalArgumentException if an invalid topic is provided
- * @throws IllegalStateException if the DMAAP Topic Reader is an incorrect state
+ * @throws IllegalStateException if the DMAAP Topic Reader is an incorrect state
*/
DmaapTopicSink get(String topic);
@@ -126,6 +129,7 @@ public interface DmaapTopicSinkFactory {
* Factory of DMAAP Reader Topics indexed by topic name.
*/
class IndexedDmaapTopicSinkFactory implements DmaapTopicSinkFactory {
+
private static final String MISSING_TOPIC = "A topic must be provided";
/**
@@ -197,70 +201,70 @@ class IndexedDmaapTopicSinkFactory implements DmaapTopicSinkFactory {
serverList = new ArrayList<>();
}
- final String apiKey = properties.getProperty(PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
- + "." + topic + PolicyEndPointProperties.PROPERTY_TOPIC_API_KEY_SUFFIX);
- final String apiSecret = properties.getProperty(PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
- + "." + topic + PolicyEndPointProperties.PROPERTY_TOPIC_API_SECRET_SUFFIX);
+ final String apiKey = properties.getProperty(PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ + "." + topic + PolicyEndPointProperties.PROPERTY_TOPIC_API_KEY_SUFFIX);
+ final String apiSecret = properties.getProperty(PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ + "." + topic + PolicyEndPointProperties.PROPERTY_TOPIC_API_SECRET_SUFFIX);
- final String aafMechId = properties.getProperty(PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
- + "." + topic + PolicyEndPointProperties.PROPERTY_TOPIC_AAF_MECHID_SUFFIX);
- final String aafPassword = properties.getProperty(PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
- + "." + topic + PolicyEndPointProperties.PROPERTY_TOPIC_AAF_PASSWORD_SUFFIX);
+ final String aafMechId = properties.getProperty(PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ + "." + topic + PolicyEndPointProperties.PROPERTY_TOPIC_AAF_MECHID_SUFFIX);
+ final String aafPassword = properties.getProperty(PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ + "." + topic + PolicyEndPointProperties.PROPERTY_TOPIC_AAF_PASSWORD_SUFFIX);
final String partitionKey = properties.getProperty(PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
- + "." + topic + PolicyEndPointProperties.PROPERTY_TOPIC_SINK_PARTITION_KEY_SUFFIX);
+ + "." + topic + PolicyEndPointProperties.PROPERTY_TOPIC_SINK_PARTITION_KEY_SUFFIX);
- final String managedString = properties.getProperty(PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
- + "." + topic + PolicyEndPointProperties.PROPERTY_MANAGED_SUFFIX);
+ final String managedString = properties.getProperty(PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ + "." + topic + PolicyEndPointProperties.PROPERTY_MANAGED_SUFFIX);
/* DME2 Properties */
final String dme2Environment = properties.getProperty(
- PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ "." + topic + PolicyEndPointProperties.PROPERTY_DMAAP_DME2_ENVIRONMENT_SUFFIX);
final String dme2AftEnvironment = properties.getProperty(
- PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ "." + topic + PolicyEndPointProperties.PROPERTY_DMAAP_DME2_AFT_ENVIRONMENT_SUFFIX);
- final String dme2Partner = properties.getProperty(PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
- + "." + topic + PolicyEndPointProperties.PROPERTY_DMAAP_DME2_PARTNER_SUFFIX);
+ final String dme2Partner = properties.getProperty(PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ + "." + topic + PolicyEndPointProperties.PROPERTY_DMAAP_DME2_PARTNER_SUFFIX);
final String dme2RouteOffer = properties.getProperty(
- PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ "." + topic + PolicyEndPointProperties.PROPERTY_DMAAP_DME2_ROUTE_OFFER_SUFFIX);
final String dme2Latitude = properties.getProperty(
- PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS + "."
- + topic + PolicyEndPointProperties.PROPERTY_DMAAP_DME2_LATITUDE_SUFFIX);
+ PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS + "."
+ + topic + PolicyEndPointProperties.PROPERTY_DMAAP_DME2_LATITUDE_SUFFIX);
final String dme2Longitude = properties.getProperty(
- PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ "." + topic + PolicyEndPointProperties.PROPERTY_DMAAP_DME2_LONGITUDE_SUFFIX);
final String dme2EpReadTimeoutMs = properties.getProperty(
- PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ "." + topic + PolicyEndPointProperties.PROPERTY_DMAAP_DME2_EP_READ_TIMEOUT_MS_SUFFIX);
final String dme2EpConnTimeout = properties.getProperty(
- PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ "." + topic + PolicyEndPointProperties.PROPERTY_DMAAP_DME2_EP_CONN_TIMEOUT_SUFFIX);
final String dme2RoundtripTimeoutMs =
- properties.getProperty(PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
- + "." + topic
+ properties.getProperty(PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ + "." + topic
+ PolicyEndPointProperties.PROPERTY_DMAAP_DME2_ROUNDTRIP_TIMEOUT_MS_SUFFIX);
final String dme2Version = properties.getProperty(
- PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS + "."
- + topic + PolicyEndPointProperties.PROPERTY_DMAAP_DME2_VERSION_SUFFIX);
+ PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS + "."
+ + topic + PolicyEndPointProperties.PROPERTY_DMAAP_DME2_VERSION_SUFFIX);
final String dme2SubContextPath = properties.getProperty(
- PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ "." + topic + PolicyEndPointProperties.PROPERTY_DMAAP_DME2_SUB_CONTEXT_PATH_SUFFIX);
final String dme2SessionStickinessRequired =
- properties.getProperty(PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ properties.getProperty(PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS
+ "." + topic
+ PolicyEndPointProperties.PROPERTY_DMAAP_DME2_SESSION_STICKINESS_REQUIRED_SUFFIX);
@@ -307,7 +311,6 @@ class IndexedDmaapTopicSinkFactory implements DmaapTopicSinkFactory {
useHttps = Boolean.parseBoolean(useHttpsString);
}
-
String allowSelfSignedCertsString =
properties.getProperty(PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS + "." + topic
+ PolicyEndPointProperties.PROPERTY_ALLOW_SELF_SIGNED_CERTIFICATES_SUFFIX);
@@ -345,7 +348,7 @@ class IndexedDmaapTopicSinkFactory implements DmaapTopicSinkFactory {
/**
* Makes a new sink.
- *
+ *
* @param busTopicParams parameters to use to configure the sink
* @return a new sink
*/