2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017-2018 Amdocs
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
21 package org.onap.aai.rest;
23 import org.apache.camel.Category;
24 import org.apache.camel.Consumer;
25 import org.apache.camel.Processor;
26 import org.apache.camel.Producer;
27 import org.apache.camel.support.DefaultEndpoint;
28 import org.apache.camel.spi.Metadata;
29 import org.apache.camel.spi.UriEndpoint;
30 import org.apache.camel.spi.UriParam;
31 import org.apache.camel.spi.UriPath;
36 @UriEndpoint(scheme = "ecomp-rest", syntax = "ecomp-rest:op",
37 consumerClass = RestClientConsumer.class, label = "RestClient2", title = "ecomp-rest",
38 firstVersion = "1.0.0", category = {Category.CORE})
39 public class RestClientEndpoint extends DefaultEndpoint {
41 public static final String CONTEXT_PARAM_CLIENT_CERT = "ecomp-client-cert";
42 public static final String CONTEXT_PARAM_KEYSTORE = "ecomp-keystore";
43 public static final String CONTEXT_PARAM_KEYSTORE_PWD = "ecomp-keystore-password";
45 public static final String IN_HEADER_URL = "ecomp-url";
47 public static final String OUT_HEADER_RESPONSE_CODE = "ecomp-response-code";
48 public static final String OUT_HEADER_RESPONSE_MSG = "ecomp-response-message";
50 @UriPath(description = "op")
51 @Metadata(required = true)
53 @UriParam(description = "ecomp client cert")
54 private String ecompClientCert;
55 @UriParam(description = "ecomp key store")
56 private String ecompKeystore;
57 @UriParam(description = "ecomp key store passwd")
58 private String ecompKeystorePassword;
60 public RestClientEndpoint() {}
62 public RestClientEndpoint(String uri, RestClientComponent component) {
63 super(uri, component);
67 public void setProperties(Object bean, Map<String, Object> parameters) {
68 super.setProperties(bean, parameters);
71 public Producer createProducer() throws Exception {
72 return new RestClientProducer(this);
75 public Consumer createConsumer(Processor processor) throws Exception {
76 return new RestClientConsumer(this, processor);
79 public boolean isSingleton() {
83 public String getOp() {
87 public void setOp(String op) {
91 public String getEcompClientCert() {
92 return ecompClientCert;
95 public void setEcompClientCert(String ecompClientCert) {
96 this.ecompClientCert = ecompClientCert;
99 public String getEcompKeystore() {
100 return ecompKeystore;
103 public void setEcompKeystore(String ecompKeystore) {
104 this.ecompKeystore = ecompKeystore;
107 public String getEcompKeystorePassword() {
108 return ecompKeystorePassword;
111 public void setEcompKeystorePassword(String ecompKeystorePassword) {
112 this.ecompKeystorePassword = ecompKeystorePassword;