2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2018 Samsung Electronics Co., Ltd. All rights reserved.
4 * Modifications Copyright (C) 2019 AT&T Intellectual Property.
5 * ================================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 * SPDX-License-Identifier: Apache-2.0
19 * ============LICENSE_END=========================================================
22 package org.onap.policy.drools.protocol.coders;
24 import org.onap.policy.drools.protocol.coders.TopicCoderFilterConfiguration.CustomCoder;
26 public class EventProtocolParams {
27 private String groupId;
28 private String artifactId;
30 private String eventClass;
31 private JsonProtocolFilter protocolFilter;
32 private TopicCoderFilterConfiguration.CustomGsonCoder customGsonCoder;
33 private int modelClassLoaderHash;
35 public String getGroupId() {
39 public String getArtifactId() {
43 public String getTopic() {
47 public String getEventClass() {
51 public JsonProtocolFilter getProtocolFilter() {
52 return protocolFilter;
55 public TopicCoderFilterConfiguration.CustomGsonCoder getCustomGsonCoder() {
56 return customGsonCoder;
59 public int getModelClassLoaderHash() {
60 return modelClassLoaderHash;
63 public static EventProtocolParams builder() {
64 return new EventProtocolParams();
70 * @param groupId of the controller
71 * @return EventProtocolParams
73 public EventProtocolParams groupId(String groupId) {
74 this.groupId = groupId;
81 * @param artifactId of the controller
82 * @return EventProtocolParams
84 public EventProtocolParams artifactId(String artifactId) {
85 this.artifactId = artifactId;
92 * @param topic the topic
93 * @return EventProtocolParams
95 public EventProtocolParams topic(String topic) {
103 * @param eventClass the event class
104 * @return EventProtocolParams
106 public EventProtocolParams eventClass(String eventClass) {
107 this.eventClass = eventClass;
114 * @param protocolFilter filters to selectively choose a particular decoder
115 * when there are multiples
116 * @return EventProtocolParams
118 public EventProtocolParams protocolFilter(JsonProtocolFilter protocolFilter) {
119 this.protocolFilter = protocolFilter;
126 * @param customGsonCoder custom gscon coder
127 * @return EventProtocolParams
129 public EventProtocolParams customGsonCoder(
130 TopicCoderFilterConfiguration.CustomGsonCoder customGsonCoder) {
131 this.customGsonCoder = customGsonCoder;
137 * @param modelClassLoaderHash integer representing model hash
138 * @return EventProtocolParams
140 public EventProtocolParams modelClassLoaderHash(int modelClassLoaderHash) {
141 this.modelClassLoaderHash = modelClassLoaderHash;
145 public CustomCoder getCustomCoder() {
146 return this.customGsonCoder;