2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright 2018 TechMahindra
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=========================================================
20 package org.onap.universalvesadapter.adapter;
22 import org.onap.universalvesadapter.exception.ConfigFileReadException;
23 import org.onap.universalvesadapter.exception.ConfigFileSmooksConversionException;
24 import org.onap.universalvesadapter.exception.VesException;
27 * This interface defines contract for adapter to convert an incoming json
33 public interface GenericAdapter {
35 // String transform(String incomingJsonString) throws ConfigFileReadException;
38 * It will take in an incoming json and identify the json type for different
39 * events. Based on the event type it will retrieve the corresponding config
40 * file and convert the json to VES format using mappings in the config file.
42 * @param incomingJsonString json that is received on DMaap topic
43 * @param eventType type identified from incoming json
44 * @return VES format json
45 * @throws ConfigFileReadException if unable to read the configuration file
46 * @throws ConfigFileSmooksConversionException if unable to convert config file data to smooks object
47 * @throws VesException if unable to convert into ves json
49 String transform(String incomingJsonString, String eventType) throws ConfigFileReadException, ConfigFileSmooksConversionException, VesException;