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