2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017 AT&T Intellectual Property.
6 * Copyright © 2017 Amdocs
8 * ================================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License ati
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=========================================================
22 * ECOMP and OpenECOMP are trademarks
23 * and service marks of AT&T Intellectual Property.
25 package org.openecomp.event;
28 import org.apache.camel.Consumer;
29 import org.apache.camel.Processor;
30 import org.apache.camel.Producer;
31 import org.apache.camel.impl.DefaultEndpoint;
32 import org.apache.camel.spi.Metadata;
33 import org.apache.camel.spi.UriEndpoint;
34 import org.apache.camel.spi.UriParam;
35 import org.apache.camel.spi.UriPath;
36 import org.eclipse.jetty.util.security.Password;
39 * Represents a EventBus endpoint.
41 @UriEndpoint(scheme = "event-bus", syntax = "event-bus:name",
42 consumerClass = EventBusConsumer.class, title = "event-bus")
43 public class EventBusEndpoint extends DefaultEndpoint {
45 @Metadata(required = "true")
48 @UriParam(label = "eventTopic")
49 @Metadata(required = "true")
50 private String eventTopic;
51 @UriParam(label = "groupName")
52 @Metadata(required = "true")
53 private String groupName;
54 @UriParam(label = "groupId")
55 @Metadata(required = "true")
56 private String groupId;
57 @UriParam(label = "apiKey")
58 private String apiKey;
59 @UriParam(label = "apiSecret")
60 private String apiSecret;
61 @UriParam(label = "url")
62 @Metadata(required = "true")
64 @UriParam(label = "poolSize")
65 @Metadata(required = "true", defaultValue="20")
66 private int poolSize = 20;
67 @UriParam(label = "pollingDelay")
68 @Metadata(required = "true", defaultValue="30000")
69 private int pollingDelay = 30000;
71 public EventBusEndpoint() {}
73 public EventBusEndpoint(String uri, EventBusComponent component) {
74 super(uri, component);
77 public EventBusEndpoint(String endpointUri) {
81 public Producer createProducer() throws Exception {
82 return new EventBusProducer(this);
85 public Consumer createConsumer(Processor processor) throws Exception {
86 return new EventBusConsumer(this, processor);
89 public boolean isSingleton() {
93 public void setName(String name) {
97 public String getName() {
101 public String getEventTopic() {
105 public void setEventTopic(String eventTopic) {
106 this.eventTopic = eventTopic;
109 public String getGroupName() {
113 public void setGroupName(String groupName) {
114 this.groupName = groupName;
117 public String getGroupId() {
121 public void setGroupId(String groupId) {
122 this.groupId = groupId;
125 public String getApiKey() {
126 return apiKey == null ? null : Password.deobfuscate(apiKey);
129 public void setApiKey(String apiKey) {
130 this.apiKey = apiKey;
133 public String getApiSecret() {
134 return apiSecret == null ? null : Password.deobfuscate(apiSecret);
137 public void setApiSecret(String apiSecret) {
138 this.apiSecret = apiSecret;
141 public int getPoolSize() {
145 public void setPoolSize(int poolsize) {
146 this.poolSize = poolsize;
149 public int getPollingDelay() {
153 public void setPollingDelay(int pollingDelay) {
154 this.pollingDelay = pollingDelay;
157 public String getUrl() {
161 public void setUrl(String url) {