2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.asdctool.migration.config.mocks;
23 import com.att.nsa.apiClient.credentials.ApiCredential;
24 import fj.data.Either;
25 import org.openecomp.sdc.be.components.distribution.engine.CambriaErrorResponse;
26 import org.openecomp.sdc.be.components.distribution.engine.ICambriaHandler;
27 import org.openecomp.sdc.be.components.distribution.engine.INotificationData;
28 import org.openecomp.sdc.be.components.distribution.engine.SubscriberTypeEnum;
29 import org.springframework.stereotype.Component;
31 import java.util.Collection;
32 import java.util.List;
35 @Component("cambriaHandler")
36 public class CambriaHandlerMock implements ICambriaHandler {
39 public Either<Set<String>, CambriaErrorResponse> getTopics(List<String> hostSet) {
44 public CambriaErrorResponse createTopic(Collection<String> hostSet, String apiKey, String secretKey, String topicName, int partitionCount, int replicationCount) {
49 public CambriaErrorResponse unRegisterFromTopic(Collection<String> hostSet, String managerApiKey, String managerSecretKey, String subscriberApiKey, SubscriberTypeEnum subscriberTypeEnum, String topicName) {
54 public CambriaErrorResponse registerToTopic(Collection<String> hostSet, String managerApiKey, String managerSecretKey, String subscriberApiKey, SubscriberTypeEnum subscriberTypeEnum, String topicName) {
59 public com.att.nsa.cambria.client.CambriaConsumer createConsumer(Collection<String> hostSet, String topicName, String apiKey, String secretKey, String consumerId, String consumerGroup, int timeoutMS) throws Exception {
64 public CambriaErrorResponse sendNotification(String topicName, String uebPublicKey, String uebSecretKey, List<String> uebServers, INotificationData data) {
69 public CambriaErrorResponse sendNotificationAndClose(String topicName, String uebPublicKey, String uebSecretKey, List<String> uebServers, INotificationData data, long waitBeforeCloseTimeout) {
74 public CambriaErrorResponse getApiKey(String server, String apiKey) {
79 public Either<ApiCredential, CambriaErrorResponse> createUebKeys(List<String> hostSet) {
84 public Either<Iterable<String>, CambriaErrorResponse> fetchFromTopic(com.att.nsa.cambria.client.CambriaConsumer topicConsumer) {