Changed to unmaintained
[appc.git] / appc-adapters / appc-dmaap-adapter / appc-message-adapter-factory / src / main / java / org / onap / appc / adapter / factory / DmaapMessageAdapterFactoryImpl.java
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * ONAP : APPC\r
4  * ================================================================================\r
5  * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.\r
6  * ================================================================================\r
7  * Copyright (C) 2017 Amdocs\r
8  * ================================================================================\r
9  * Modifications Copyright (C) 2019 Ericsson\r
10  * =============================================================================\r
11  * Licensed under the Apache License, Version 2.0 (the "License");\r
12  * you may not use this file except in compliance with the License.\r
13  * You may obtain a copy of the License at\r
14  * \r
15  *      http://www.apache.org/licenses/LICENSE-2.0\r
16  * \r
17  * Unless required by applicable law or agreed to in writing, software\r
18  * distributed under the License is distributed on an "AS IS" BASIS,\r
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
20  * See the License for the specific language governing permissions and\r
21  * limitations under the License.\r
22  * \r
23  * ============LICENSE_END=========================================================\r
24  */\r
25 \r
26 package org.onap.appc.adapter.factory;\r
27 \r
28 import java.util.Collection;\r
29 import java.util.Set;\r
30 \r
31 import org.onap.appc.adapter.message.Consumer;\r
32 import org.onap.appc.adapter.message.MessageAdapterFactory;\r
33 import org.onap.appc.adapter.message.Producer;\r
34 import org.onap.appc.adapter.messaging.dmaap.http.HttpDmaapConsumerImpl;\r
35 import org.onap.appc.adapter.messaging.dmaap.http.HttpDmaapProducerImpl;\r
36 \r
37 public class DmaapMessageAdapterFactoryImpl implements MessageAdapterFactory {\r
38 \r
39 \r
40     @Override\r
41     public Producer createProducer(Collection<String> pools, String writeTopic, String apiKey, String apiSecret) {\r
42         return  new  HttpDmaapProducerImpl(pools, writeTopic);\r
43     }\r
44 \r
45     @Override\r
46     public Producer createProducer(Collection<String> pools, Set<String> writeTopics, String apiKey, String apiSecret) {\r
47         String topic = "";\r
48         for(String s : writeTopics){\r
49             topic = s;\r
50         }\r
51         return new HttpDmaapProducerImpl(pools, topic);\r
52     }\r
53 \r
54     @Override\r
55     public Consumer createConsumer(Collection<String> pool, String readTopic, \r
56             String clientName, String clientId, String filterJson, String apiKey, String apiSecret) {\r
57         return new HttpDmaapConsumerImpl(pool, readTopic, clientName, clientId, apiKey, apiSecret, filterJson);\r
58     }\r
59 }\r