move Subscriber.java to dsa model 75/11875/1
authorShiwei Tian <tian.shiwei@zte.com.cn>
Tue, 12 Sep 2017 07:21:35 +0000 (15:21 +0800)
committerShiwei Tian <tian.shiwei@zte.com.cn>
Tue, 12 Sep 2017 07:21:35 +0000 (15:21 +0800)
Issue-ID: HOLMES-29

Change-Id: I8668261250276aae9b60a328fa157f49f699c96a
Signed-off-by: Shiwei Tian <tian.shiwei@zte.com.cn>
holmes-actions/src/main/java/org/onap/holmes/common/dmaap/Subscriber.java [deleted file]

diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/Subscriber.java b/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/Subscriber.java
deleted file mode 100644 (file)
index bef3c2b..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*\r
- * Copyright 2017 ZTE Corporation.\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-package org.onap.holmes.common.dmaap;\r
-\r
-import java.util.Collections;\r
-import java.util.List;\r
-import javax.ws.rs.client.Client;\r
-import javax.ws.rs.client.ClientBuilder;\r
-import javax.ws.rs.client.WebTarget;\r
-import javax.ws.rs.core.Response;\r
-import lombok.Getter;\r
-import lombok.Setter;\r
-import org.glassfish.jersey.client.ClientConfig;\r
-import org.onap.holmes.common.dmaap.entity.VesAlarm;\r
-import org.onap.holmes.common.exception.CorrelationException;\r
-\r
-@Getter\r
-@Setter\r
-public class Subscriber {\r
-    /**\r
-     * The number of milliseconds to wait for messages if none are immediately\r
-     * available. This should normally be used, and set at 15000 or higher.\r
-     */\r
-    private int timeout = 15000;\r
-\r
-    /**\r
-     * The maximum number of messages to return\r
-     */\r
-    private int limit = 100;\r
-\r
-    private boolean secure;\r
-    private String topic;\r
-    private String url;\r
-    private String consumerGroup = "g0";\r
-    private String consumer = "u1";\r
-    private String authInfo;\r
-    private String authExpDate;\r
-\r
-    List<VesAlarm> subscribe() throws CorrelationException {\r
-        Client client = ClientBuilder.newClient(new ClientConfig());\r
-        WebTarget webTarget = client.target(url);\r
-        Response response = webTarget.path(topic).path(consumerGroup).path(consumer).request().get();\r
-\r
-        try {\r
-            return extractAlarms(response);\r
-        }\r
-        catch (Exception e) {\r
-            throw new CorrelationException("Failed to convert the response data to VES alarms.", e);\r
-        }\r
-    }\r
-\r
-    private List<VesAlarm> extractAlarms(Response response) {\r
-        return Collections.emptyList();\r
-    }\r
-}\r