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.Consumer;
24 import org.apache.camel.Processor;
25 import org.apache.camel.Producer;
26 import org.apache.camel.impl.DefaultEndpoint;
27 import org.apache.camel.spi.Metadata;
28 import org.apache.camel.spi.UriEndpoint;
29 import org.apache.camel.spi.UriParam;
30 import org.apache.camel.spi.UriPath;
36 * Represents a RestClient endpoint.
38 @UriEndpoint(scheme = "ecomp-rest", syntax = "ecomp-rest:op",
39 consumerClass = RestClientConsumer.class, label = "RestClient2", title = "")
40 public class RestClientEndpoint extends DefaultEndpoint {
42 public static final String CONTEXT_PARAM_CLIENT_CERT = "ecomp-client-cert";
43 public static final String CONTEXT_PARAM_KEYSTORE = "ecomp-keystore";
44 public static final String CONTEXT_PARAM_KEYSTORE_PWD = "ecomp-keystore-password";
46 public static final String IN_HEADER_URL = "ecomp-url";
48 public static final String OUT_HEADER_RESPONSE_CODE = "ecomp-response-code";
49 public static final String OUT_HEADER_RESPONSE_MSG = "ecomp-response-message";
52 @Metadata(required = "true")
56 private String ecompClientCert;
59 private String ecompKeystore;
62 private String ecompKeystorePassword;
65 public RestClientEndpoint() {}
67 public RestClientEndpoint(String uri, RestClientComponent component) {
68 super(uri, component);
71 public RestClientEndpoint(String endpointUri) {
76 protected void setProperties(Object bean, Map<String, Object> parameters) throws Exception {
77 super.setProperties(bean, parameters);
80 public Producer createProducer() throws Exception {
81 return new RestClientProducer(this);
84 public Consumer createConsumer(Processor processor) throws Exception {
85 return new RestClientConsumer(this, processor);
88 public boolean isSingleton() {
92 public String getOp() {
96 public void setOp(String op) {
100 public String getEcompClientCert() {
101 return ecompClientCert;
104 public void setEcompClientCert(String ecompClientCert) {
105 this.ecompClientCert = ecompClientCert;
108 public String getEcompKeystore() {
109 return ecompKeystore;
112 public void setEcompKeystore(String ecompKeystore) {
113 this.ecompKeystore = ecompKeystore;
116 public String getEcompKeystorePassword() {
117 return ecompKeystorePassword;
120 public void setEcompKeystorePassword(String ecompKeystorePassword) {
121 this.ecompKeystorePassword = ecompKeystorePassword;