listener bundle change for multiple ansible 24/77624/7
authorBalaji, Ramya (rb111y) <rb111y@att.com>
Thu, 31 Jan 2019 03:26:13 +0000 (22:26 -0500)
committerPatrick Brady <patrick.brady@att.com>
Tue, 5 Feb 2019 18:08:40 +0000 (18:08 +0000)
Changes to event listener and dependent
bundles

Issue-ID: APPC-1376
Change-Id: I26e9f6f39caa2a0b0ad46a3a61d21db9f0c05d47
Signed-off-by: Balaji, Ramya (rb111y) <rb111y@att.com>
15 files changed:
appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/JunitTopicOne_junit-consumer-one_consumer.properties
appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/JunitTopicOne_junit-consumer-two_consumer.properties
appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/JunitTopicOne_junit-producer-one_producer.properties
appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/http/HttpDmaapConsumerImpl.java
appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/http/HttpDmaapProducerImpl.java
appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/impl/DmaapConsumerImpl.java
appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/impl/DmaapProducerImpl.java
appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/utils/DmaapUtil.java
appc-adapters/appc-dmaap-adapter/appc-message-adapter-api/src/main/java/org/onap/appc/adapter/message/Consumer.java
appc-adapters/appc-dmaap-adapter/appc-message-adapter-api/src/main/java/org/onap/appc/adapter/message/Producer.java
appc-event-listener/appc-event-listener-bundle/src/main/java/org/onap/appc/listener/EventHandler.java
appc-event-listener/appc-event-listener-bundle/src/main/java/org/onap/appc/listener/ListenerProperties.java
appc-event-listener/appc-event-listener-bundle/src/main/java/org/onap/appc/listener/impl/EventHandlerImpl.java
appc-event-listener/appc-event-listener-bundle/src/test/java/org/onap/appc/listener/ListenerPropertiesTest.java
appc-event-listener/appc-event-listener-bundle/src/test/resources/org/onap/appc/default.properties

index c92e987..d607137 100644 (file)
@@ -1,34 +1,34 @@
-#consumer.properties file created on the fly for topic:JunitTopicOne on:1542997120536\r
-#Fri Nov 23 13:18:40 EST 2018\r
-AFT_DME2_EP_CONN_TIMEOUT=15000\r
-MethodType=GET\r
-password=admin\r
-routeOffer=MR1\r
-DME2preferredRouterFilePath=JunitTopicOnepreferredRoute.properties\r
-Longitude=-100.000000\r
-username=admin\r
-Version=1.0\r
-group=junit-client\r
-timeout=15000\r
-SubContextPath=/\r
-authDate=2016-02-18T13\:57\:37-0800\r
-filter=none\r
-authKey=01234567890abcde\:01234567890abcdefghijklmn\r
-Environment=TEST\r
-host=192.168.10.10\r
-Protocol=http\r
-Partner=BOT_R\r
-contenttype=application/json\r
-id=junit-consumer-one\r
-Latitude=50.000000\r
-ServiceName=dmaap-v1.dev.dmaap.dt.saat.acsi.openecomp.org/events\r
-AFT_DME2_EXCHANGE_REPLY_HANDLERS=com.att.nsa.test.PreferredRouteReplyHandler\r
-AFT_DME2_EXCHANGE_REQUEST_HANDLERS=com.att.nsa.test.PreferredRouteRequestHandler\r
-topic=JunitTopicOne\r
-TransportType=HTTPNOAUTH\r
-AFT_ENVIRONMENT=AFTUAT\r
-limit=1000\r
-AFT_DME2_EP_READ_TIMEOUT_MS=50000\r
-sessionstickinessrequired=NO\r
-AFT_DME2_REQ_TRACE_ON=true\r
-AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000\r
+#consumer.properties - This file is generated automatically for topic:JunitTopicOne on:1549243025739
+#Sun Feb 03 20:17:05 EST 2019
+AFT_DME2_EP_CONN_TIMEOUT=15000
+MethodType=GET
+password=admin
+routeOffer=MR1
+DME2preferredRouterFilePath=JunitTopicOnepreferredRoute.properties
+Longitude=-100.000000
+username=admin
+Version=1.0
+group=junit-client
+timeout=15000
+SubContextPath=/
+authDate=2016-02-18T13\:57\:37-0800
+filter=none
+authKey=01234567890abcde\:01234567890abcdefghijklmn
+Environment=TEST
+host=192.168.10.10
+Protocol=http
+Partner=BOT_R
+contenttype=application/json
+id=junit-consumer-one
+Latitude=50.000000
+ServiceName=dmaap-v1.dev.dmaap.dt.saat.acsi.openecomp.org/events
+AFT_DME2_EXCHANGE_REPLY_HANDLERS=com.att.nsa.test.PreferredRouteReplyHandler
+AFT_DME2_EXCHANGE_REQUEST_HANDLERS=com.att.nsa.test.PreferredRouteRequestHandler
+topic=JunitTopicOne
+TransportType=HTTPNOAUTH
+AFT_ENVIRONMENT=AFTUAT
+limit=1000
+AFT_DME2_EP_READ_TIMEOUT_MS=50000
+sessionstickinessrequired=NO
+AFT_DME2_REQ_TRACE_ON=true
+AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000
index d36ad03..0cc25b3 100644 (file)
@@ -1,30 +1,30 @@
-#consumer.properties file created on the fly for topic:JunitTopicOne on:1542997120526\r
-#Fri Nov 23 13:18:40 EST 2018\r
-AFT_DME2_EP_CONN_TIMEOUT=15000\r
-MethodType=GET\r
-routeOffer=MR1\r
-DME2preferredRouterFilePath=JunitTopicOnepreferredRoute.properties\r
-Longitude=-100.000000\r
-Version=1.0\r
-group=junit-client\r
-timeout=15000\r
-SubContextPath=/\r
-filter=none\r
-Environment=TEST\r
-host=192.168.10.10\r
-Protocol=http\r
-Partner=BOT_R\r
-contenttype=application/json\r
-Latitude=50.000000\r
-id=junit-consumer-two\r
-ServiceName=dmaap-v1.dev.dmaap.dt.saat.acsi.openecomp.org/events\r
-AFT_DME2_EXCHANGE_REPLY_HANDLERS=com.att.nsa.test.PreferredRouteReplyHandler\r
-AFT_DME2_EXCHANGE_REQUEST_HANDLERS=com.att.nsa.test.PreferredRouteRequestHandler\r
-topic=JunitTopicOne\r
-TransportType=HTTPAAF\r
-AFT_ENVIRONMENT=AFTUAT\r
-limit=1000\r
-AFT_DME2_EP_READ_TIMEOUT_MS=50000\r
-sessionstickinessrequired=NO\r
-AFT_DME2_REQ_TRACE_ON=true\r
-AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000\r
+#consumer.properties - This file is generated automatically for topic:JunitTopicOne on:1549243025689
+#Sun Feb 03 20:17:05 EST 2019
+AFT_DME2_EP_CONN_TIMEOUT=15000
+MethodType=GET
+routeOffer=MR1
+DME2preferredRouterFilePath=JunitTopicOnepreferredRoute.properties
+Longitude=-100.000000
+Version=1.0
+group=junit-client
+timeout=15000
+SubContextPath=/
+filter=none
+Environment=TEST
+host=192.168.10.10
+Protocol=http
+Partner=BOT_R
+contenttype=application/json
+Latitude=50.000000
+id=junit-consumer-two
+ServiceName=dmaap-v1.dev.dmaap.dt.saat.acsi.openecomp.org/events
+AFT_DME2_EXCHANGE_REPLY_HANDLERS=com.att.nsa.test.PreferredRouteReplyHandler
+AFT_DME2_EXCHANGE_REQUEST_HANDLERS=com.att.nsa.test.PreferredRouteRequestHandler
+topic=JunitTopicOne
+TransportType=HTTPAAF
+AFT_ENVIRONMENT=AFTUAT
+limit=1000
+AFT_DME2_EP_READ_TIMEOUT_MS=50000
+sessionstickinessrequired=NO
+AFT_DME2_REQ_TRACE_ON=true
+AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000
index 055e8cc..ca04b28 100644 (file)
@@ -1,35 +1,35 @@
-#producer.properties file created on the fly for topic:JunitTopicOne on:1542997120515\r
-#Fri Nov 23 13:18:40 EST 2018\r
-AFT_DME2_EP_CONN_TIMEOUT=15000\r
-MethodType=POST\r
-password=admin\r
-DME2preferredRouterFilePath=JunitTopicOnepreferredRoute.properties\r
-Longitude=-100.000000\r
-username=admin\r
-partition=2\r
-Version=1.0\r
-maxBatchSize=100\r
-group=junit-client\r
-SubContextPath=/\r
-authDate=2016-07-20T11\:30\:56-0700\r
-filter=none\r
-authKey=01234567890abcde\:01234567890abcdefghijklmn\r
-Environment=TEST\r
-host=192.168.10.10\r
-Protocol=http\r
-Partner=BOT_R\r
-contenttype=application/json\r
-id=junit-producer-one\r
-Latitude=50.000000\r
-ServiceName=dmaap-v1.dev.dmaap.dt.saat.acsi.openecomp.org/events\r
-AFT_DME2_EXCHANGE_REPLY_HANDLERS=com.att.nsa.test.PreferredRouteReplyHandler\r
-AFT_DME2_EXCHANGE_REQUEST_HANDLERS=com.att.nsa.test.PreferredRouteRequestHandler\r
-topic=JunitTopicOne\r
-TransportType=HTTPNOAUTH\r
-AFT_ENVIRONMENT=AFTUAT\r
-AFT_DME2_EP_READ_TIMEOUT_MS=50000\r
-sessionstickinessrequired=NO\r
-AFT_DME2_REQ_TRACE_ON=true\r
-AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000\r
-MessageSentThreadOccurance=50\r
-maxAgeMs=250\r
+#producer.properties - This file is generated automatically for topic:JunitTopicOne on:1549243025647
+#Sun Feb 03 20:17:05 EST 2019
+AFT_DME2_EP_CONN_TIMEOUT=15000
+MethodType=POST
+password=admin
+DME2preferredRouterFilePath=JunitTopicOnepreferredRoute.properties
+Longitude=-100.000000
+username=admin
+partition=2
+Version=1.0
+maxBatchSize=100
+group=junit-client
+SubContextPath=/
+authDate=2016-07-20T11\:30\:56-0700
+filter=none
+authKey=01234567890abcde\:01234567890abcdefghijklmn
+Environment=TEST
+host=192.168.10.10
+Protocol=http
+Partner=BOT_R
+contenttype=application/json
+id=junit-producer-one
+Latitude=50.000000
+ServiceName=dmaap-v1.dev.dmaap.dt.saat.acsi.openecomp.org/events
+AFT_DME2_EXCHANGE_REPLY_HANDLERS=com.att.nsa.test.PreferredRouteReplyHandler
+AFT_DME2_EXCHANGE_REQUEST_HANDLERS=com.att.nsa.test.PreferredRouteRequestHandler
+topic=JunitTopicOne
+TransportType=HTTPNOAUTH
+AFT_ENVIRONMENT=AFTUAT
+AFT_DME2_EP_READ_TIMEOUT_MS=50000
+sessionstickinessrequired=NO
+AFT_DME2_REQ_TRACE_ON=true
+AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000
+MessageSentThreadOccurance=50
+maxAgeMs=250
index 94b06b5..e2a20ee 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP : APPC
  * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Copyright (C) 2017 Amdocs
  * =============================================================================
index 3a986c3..a9af8c7 100644 (file)
@@ -2,22 +2,22 @@
  * ============LICENSE_START=======================================================
  * ONAP : APPC
  * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Copyright (C) 2017 Amdocs
  * =============================================================================
  * 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.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * ============LICENSE_END=========================================================
  */
 
@@ -68,7 +68,7 @@ public class HttpDmaapProducerImpl extends CommonHttpClient implements Producer
 
     @Override
     public boolean post(String partition, String data) {
-       LOG.debug("Entering HttpDmaapProducerImpl::: post ");
+        LOG.debug("Entering HttpDmaapProducerImpl::: post ");
         long sent = 0;
         try {
             HttpPost request = postReq(null);
@@ -102,7 +102,7 @@ public class HttpDmaapProducerImpl extends CommonHttpClient implements Producer
                 successful = true;
             }
             else {
-               LOG.debug("HttpDmaapProducerImpl::: did not receive 200 for sendRequest");
+                LOG.debug("HttpDmaapProducerImpl::: did not receive 200 for sendRequest");
             }
             response.close();
         } catch (Exception sendEx) {
@@ -131,4 +131,5 @@ public class HttpDmaapProducerImpl extends CommonHttpClient implements Producer
         return String.format("%d.%d.%s%s", prt.length(), msg.length(), prt, msg);
     }
 
+
 }
index ca551c6..686bb07 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP : APPC
  * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Copyright (C) 2017 Amdocs
  * ================================================================================
  * 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.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * ============LICENSE_END=========================================================
  */
 
@@ -235,4 +235,5 @@ public class DmaapConsumerImpl implements Consumer {
     public boolean isHttps() {
         return useHttps;
     }
+
 }
index 445f919..ee4061c 100644 (file)
@@ -2,16 +2,16 @@
  * ============LICENSE_START=======================================================
  * ONAP : APPC
  * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Copyright (C) 2017 Amdocs
  * =============================================================================
  * 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.
@@ -140,7 +140,7 @@ public class DmaapProducerImpl implements Producer {
 
     @Override
     public boolean post(String partition, String data) {
-       LOG.debug("In DmaapProducerImpl.post()");
+        LOG.debug("In DmaapProducerImpl.post()");
         boolean success = true;
         Properties properties = configuration.getProperties();
         if (properties != null && properties.getProperty("metric.enabled") != null) {
@@ -219,4 +219,5 @@ public class DmaapProducerImpl implements Producer {
     public boolean isHttps() {
         return useHttps;
     }
+
 }
index 7e5f158..af20ac7 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP : APPC
  * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Copyright (C) 2017 Amdocs
  * =============================================================================
@@ -59,7 +59,7 @@ public class DmaapUtil {
             props.setProperty("preferredRouteKey", fileName);
             topicPreferredRouteFileName = topic + "preferredRoute.properties";
             props.store(new FileOutputStream(topicPreferredRouteFileName),
-                    "preferredRoute.properties file created on the fly for topic:" + topic + " on:"
+                    "preferredRoute.properties -This file is generated automatically for topic:" + topic + " on:"
                             + System.currentTimeMillis());
         }
         return topicPreferredRouteFileName;
@@ -99,7 +99,7 @@ public class DmaapUtil {
                 : DELIMITER + topicConsumerPropFileName;
 
         defaultProps.store(new FileOutputStream(topicConsumerPropFileName), defaultProfFileName
-                + " file created on the fly for topic:" + topic + " on:" + System.currentTimeMillis());
+                + " - This file is generated automatically for topic:" + topic + " on:" + System.currentTimeMillis());
         return topicConsumerPropFileName;
     }
 
index cac044f..542797e 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP : APPC
  * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Copyright (C) 2017 Amdocs
  * =============================================================================
@@ -64,6 +64,26 @@ public interface Consumer {
      */
     default void useHttps(boolean yes) {}
 
+    /**
+     *  Sets Blacklist time for a server with response problem in seconds
+     */
+    default void setResponseProblemBlacklistTime(String duration) {}
+
+    /**
+     *  Sets Blacklist time for a server with server problem in seconds
+     */
+    default void setServerProblemBlacklistTime(String duration) {}
+
+    /**
+     *  Sets Blacklist time for a server with DNS problem in seconds
+     */
+    default void setDnsIssueBlacklistTime(String duration) {}
+
+    /**
+     *  Sets Blacklist time for a server with IO Exception problem in seconds
+     */
+    default void setIOExceptionBlacklistTime(String duration) {}
+
     /**
      * Closes the dmaap client https connection.
      */
index d7ca519..8536d82 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP : APPC
  * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Copyright (C) 2017 Amdocs
  * =============================================================================
@@ -45,6 +45,27 @@ public interface Producer {
      */
     default void useHttps(boolean yes) {}
 
+    /**
+     *  Sets Blacklist time for a server with response problem in seconds
+     */
+    default void setResponseProblemBlacklistTime(String duration) { }
+
+    /**
+     *  Sets Blacklist time for a server with server problem in seconds
+     */
+    default void setServerProblemBlacklistTime(String duration) {}
+
+    /**
+     *  Sets Blacklist time for a server with DNS problem in seconds
+     */
+    default void setDnsIssueBlacklistTime(String duration) {}
+
+    /**
+     *  Sets Blacklist time for a server with IO Exception problem in seconds
+     */
+    default void setIOExceptionBlacklistTime(String duration) {}
+
+
     /**
      * Closes the dmaap client https connection.
      */
index 20d4a6a..c2b7c4b 100644 (file)
@@ -2,22 +2,22 @@
  * ============LICENSE_START=======================================================
  * ONAP : APPC
  * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Copyright (C) 2017 Amdocs
  * =============================================================================
  * 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.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * ============LICENSE_END=========================================================
  */
 
@@ -36,14 +36,14 @@ public interface EventHandler {
 
     /**
      * Gets a list of messages as Strings on the read topic.
-     * 
+     *
      * @return A list of String messages. Never returns null.
      */
     public List<String> getIncomingEvents();
 
     /**
      * Gets a list of messages as String on the read topic.
-     * 
+     *
      * @param limit
      *            The maximum amount of entries to return
      * @return A list of String messages. Never returns null.
@@ -72,7 +72,7 @@ public interface EventHandler {
 
     /**
      * Posts the String message to the write topic(s).
-     * 
+     *
      * @param event
      *            The String to post.
      */
@@ -96,7 +96,7 @@ public interface EventHandler {
 
     /**
      * Set the client/group id used to read messages
-     * 
+     *
      * @param clientId
      *            The new clientId to use
      */
@@ -109,7 +109,7 @@ public interface EventHandler {
 
     /**
      * Set the client/group name used to read messages.
-     * 
+     *
      * @param clientName
      *            The new clientName to use
      */
@@ -122,7 +122,7 @@ public interface EventHandler {
 
     /**
      * Set the name of the topic to read from.
-     * 
+     *
      * @param topic
      *            The new topic to read from
      */
@@ -135,7 +135,7 @@ public interface EventHandler {
 
     /**
      * Set the name of the topic to write to
-     * 
+     *
      * @param topic
      *            The new topic to write to
      */
@@ -143,7 +143,7 @@ public interface EventHandler {
 
     /**
      * Adds a DMaaP host to the host pool
-     * 
+     *
      * @param host
      *            The host to add to the pool in &lt;host&gt;:&lt;port&gt; format
      */
@@ -151,7 +151,7 @@ public interface EventHandler {
 
     /**
      * Remove the host name from the pool if it exists
-     * 
+     *
      * @param host
      *            The host to add to the pool in &lt;host&gt;:&lt;port&gt; format
      */
@@ -159,7 +159,7 @@ public interface EventHandler {
 
     /**
      * Get all of the hosts in the DMaaP pool
-     * 
+     *
      * @return A collection of host in &lt;host&gt;:&lt;port&gt; format
      */
     public Collection<String> getPool();
@@ -169,16 +169,37 @@ public interface EventHandler {
      */
     public void clearCredentials();
 
+    /**
+     *  Sets Blacklist time for a server with response problem in seconds
+     */
+    void setResponseProblemBlacklistTime(String duration);
+
+    /**
+     *  Sets Blacklist time for a server with server problem in seconds
+     */
+    void setServerProblemBlacklistTime(String duration);
+
+    /**
+     *  Sets Blacklist time for a server with DNS problem in seconds
+     */
+    void setDnsIssueBlacklistTime(String duration);
+
+    /**
+     *  Sets Blacklist time for a server with IO Exception problem in seconds
+     */
+    void setIOExceptionBlacklistTime(String duration);
     /**
      * Set the api credentials and make future requests as an authenticated user
-     * 
+     *
      * @param access
      *            The access portion of the credentials (either user name or api key)
      * @param secret
      *            The secret portion of the credentials (either password or api secret)
      */
+
+
     public void setCredentials(String access, String secret);
-    
+
     /**
      * Close consumer/producer DMaaP clients
      */
index 107b0f6..74ead94 100644 (file)
@@ -2,22 +2,22 @@
  * ============LICENSE_START=======================================================
  * ONAP : APPC
  * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Copyright (C) 2017 Amdocs
  * =============================================================================
  * 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.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * ============LICENSE_END=========================================================
  */
 
@@ -89,7 +89,7 @@ public class ListenerProperties {
 
     /**
      * Returns a property matching a given KEYS
-     * 
+     *
      * @param key
      *            The KEYS object who's value to return.
      * @return The value of the property or null if none exists
@@ -100,7 +100,7 @@ public class ListenerProperties {
 
     /**
      * Returns a property matching a given string.
-     * 
+     *
      * @param key
      *            The key who's value to return.
      * @return The value of the property or null if none exists
@@ -111,7 +111,7 @@ public class ListenerProperties {
 
     /**
      * Returns a property matching a given KEYS
-     * 
+     *
      * @param key
      *            The KEYS object who's value to return.
      * @param defaultValue
@@ -124,7 +124,7 @@ public class ListenerProperties {
 
     /**
      * Returns a property matching a given string.
-     * 
+     *
      * @param key
      *            The key who's value to return.
      * @param defaultValue
@@ -217,6 +217,27 @@ public class ListenerProperties {
          */
         TOPIC_READ_TIMEOUT("topic.read.timeout"),
 
+        /**
+         *  Blacklist time for a server with response problem in seconds
+         */
+
+        PROBLEM_WITH_RESPONSE_BLACKLIST_TIME("topic.responseProblem.blacklistTime"),
+        /**
+         *  Blacklist time for a server with server problem in seconds
+         */
+
+        PROBLEM_SERVERSIDE_ERROR_BLACKLIST_TIME("topic.serverError.blacklistTime"),
+        /**
+         *  Blacklist time for a server with DNS problem in seconds
+         */
+
+        PROBLEM_DNS_BLACKLIST_TIME("topic.dnsIssue.blacklistTime"),
+        /**
+         *  Blacklist time for a server with IO Exception problem in seconds
+         */
+
+        PROBLEM_IO_EXCEPTION_BLACKLIST_TIME("topic.ioException.blacklistTime"),
+
         /**
          * The name of the client to use. Should be unique to the application.
          */
index 3019aaf..74193c2 100644 (file)
@@ -2,22 +2,22 @@
  * ============LICENSE_START=======================================================
  * ONAP : APPC
  * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Copyright (C) 2017 Amdocs
  * =============================================================================
  * 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.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * ============LICENSE_END=========================================================
  */
 
@@ -100,6 +100,27 @@ public class EventHandlerImpl implements EventHandler {
      */
     private String filter_json;
 
+
+    /*
+     * Blacklist time for a server with response problem in seconds
+     */
+    private String responseProblemBlacklistTime;
+
+    /*
+     *  Blacklist time for a server with server problem in seconds
+     */
+    private String serverProblemBlacklistTime;
+
+    /*
+     * Blacklist time for a server with DNS problem in seconds
+     */
+    private String dnsIssueBlacklistTime;
+
+    /*
+     * Blacklist time for a server with IO Exception problem in seconds
+     */
+    private String ioExceptionBlacklistTime;
+
     private MessageService messageService;
 
     private Consumer reader = null;
@@ -115,6 +136,10 @@ public class EventHandlerImpl implements EventHandler {
             clientId = props.getProperty(ListenerProperties.KEYS.CLIENT_ID, "0");
             apiKey = props.getProperty(ListenerProperties.KEYS.AUTH_USER_KEY);
             apiSecret = props.getProperty(ListenerProperties.KEYS.AUTH_SECRET_KEY);
+            responseProblemBlacklistTime = props.getProperty(ListenerProperties.KEYS.PROBLEM_WITH_RESPONSE_BLACKLIST_TIME);
+            serverProblemBlacklistTime = props.getProperty(ListenerProperties.KEYS.PROBLEM_SERVERSIDE_ERROR_BLACKLIST_TIME);
+            dnsIssueBlacklistTime = props.getProperty(ListenerProperties.KEYS.PROBLEM_DNS_BLACKLIST_TIME);
+            ioExceptionBlacklistTime = props.getProperty(ListenerProperties.KEYS.PROBLEM_IO_EXCEPTION_BLACKLIST_TIME);
 
             filter_json = props.getProperty(ListenerProperties.KEYS.TOPIC_READ_FILTER);
 
@@ -218,6 +243,26 @@ public class EventHandlerImpl implements EventHandler {
                 try {
                     out = ((MessageAdapterFactory) ctx.getService(svcRef))
                             .createConsumer(pool, readTopic, clientName, clientId, filter_json, apiKey, apiSecret);
+
+                    if (out != null && responseProblemBlacklistTime != null && responseProblemBlacklistTime.length() > 0)
+                    {
+                        out.setResponseProblemBlacklistTime(responseProblemBlacklistTime);
+                    }
+
+                    if (out != null && serverProblemBlacklistTime != null && serverProblemBlacklistTime.length() > 0)
+                    {
+                        out.setServerProblemBlacklistTime(serverProblemBlacklistTime);
+                    }
+
+                    if (out != null && dnsIssueBlacklistTime != null && dnsIssueBlacklistTime.length() > 0)
+                    {
+                        out.setDnsIssueBlacklistTime(dnsIssueBlacklistTime);
+                    }
+
+                    if (out != null && ioExceptionBlacklistTime != null && ioExceptionBlacklistTime.length() > 0)
+                    {
+                        out.setIOExceptionBlacklistTime(ioExceptionBlacklistTime);
+                    }
                 } catch (Exception e) {
                     //TODO:create eelf message
                     LOG.error("EvenHandlerImp.getConsumer calling MessageAdapterFactor.createConsumer", e);
@@ -250,6 +295,25 @@ public class EventHandlerImpl implements EventHandler {
             if (svcRef != null) {
                 out = ((MessageAdapterFactory) ctx.getService(svcRef))
                         .createProducer(pool, writeTopics, apiKey, apiSecret);
+                if (out != null && responseProblemBlacklistTime != null && responseProblemBlacklistTime.length() > 0)
+                {
+                    out.setResponseProblemBlacklistTime(responseProblemBlacklistTime);
+                }
+
+                if (out != null && serverProblemBlacklistTime != null && serverProblemBlacklistTime.length() > 0)
+                {
+                    out.setServerProblemBlacklistTime(serverProblemBlacklistTime);
+                }
+
+                if (out != null && dnsIssueBlacklistTime != null && dnsIssueBlacklistTime.length() > 0)
+                {
+                    out.setDnsIssueBlacklistTime(dnsIssueBlacklistTime);
+                }
+
+                if (out != null && ioExceptionBlacklistTime != null && ioExceptionBlacklistTime.length() > 0)
+                {
+                    out.setIOExceptionBlacklistTime(ioExceptionBlacklistTime);
+                }
                 if (out != null) {
                     for (String url : pool) {
                         if (url.contains("3905") || url.contains("https")) {
@@ -330,6 +394,26 @@ public class EventHandlerImpl implements EventHandler {
         this.writeTopics = writeTopics;
     }
 
+    @Override
+    public void setResponseProblemBlacklistTime(String duration){
+        this.responseProblemBlacklistTime = duration;
+    }
+
+    @Override
+    public void setServerProblemBlacklistTime(String duration){
+        this.serverProblemBlacklistTime = duration;
+    }
+
+    @Override
+    public void setDnsIssueBlacklistTime(String duration){
+        this.dnsIssueBlacklistTime = duration;
+    }
+
+    @Override
+    public void setIOExceptionBlacklistTime(String duration){
+        this.ioExceptionBlacklistTime = duration;
+    }
+
     @Override
     public void clearCredentials() {
         apiKey = null;
index 088553e..c83555c 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP : APPC
  * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Copyright (C) 2017 Amdocs
  * =============================================================================
@@ -121,7 +121,7 @@ public class ListenerPropertiesTest {
     @Test
     public void testKeys() {
         // Hardcode count so tests must be updated when values are added
-        assertEquals(15, ListenerProperties.KEYS.values().length);
+        assertEquals(19, ListenerProperties.KEYS.values().length);
 
         Properties tmp = new Properties();
         try {
index bacbe53..c729c7b 100644 (file)
@@ -2,7 +2,7 @@
 # ============LICENSE_START=======================================================
 # ONAP : APPC
 # ================================================================================
-# Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
 # ================================================================================
 # Copyright (C) 2017 Amdocs
 # =============================================================================
@@ -58,7 +58,10 @@ appc.ClosedLoop.threads.queuesize.max=1000
 appc.ClosedLoop.threads.poolsize.min=1
 appc.ClosedLoop.threads.poolsize.max=2
 appc.ClosedLoop.provider.url=https://admin:password@localhost:8443/restconf/operations/appc-provider:topology-operation
-
+appc.ClosedLoop.topic.responseProblem.blacklistTime=60
+appc.ClosedLoop.topic.serverError.blacklistTime=60
+appc.ClosedLoop.topic.dnsIssue.blacklistTime=60
+appc.ClosedLoop.topic.ioException.blacklistTime=60