2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017 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 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
23 package org.openecomp.rest;
25 import org.apache.camel.Consumer;
26 import org.apache.camel.Processor;
27 import org.apache.camel.Producer;
28 import org.apache.camel.impl.DefaultEndpoint;
29 import org.apache.camel.spi.Metadata;
30 import org.apache.camel.spi.UriEndpoint;
31 import org.apache.camel.spi.UriParam;
32 import org.apache.camel.spi.UriPath;
38 * Represents a RestClient endpoint.
40 @UriEndpoint(scheme = "ecomp-rest", syntax = "ecomp-rest:op",
41 consumerClass = RestClientConsumer.class, label = "RestClient2", title = "")
42 public class RestClientEndpoint extends DefaultEndpoint {
44 public static final String CONTEXT_PARAM_CLIENT_CERT = "ecomp-client-cert";
45 public static final String CONTEXT_PARAM_KEYSTORE = "ecomp-keystore";
46 public static final String CONTEXT_PARAM_KEYSTORE_PWD = "ecomp-keystore-password";
48 public static final String IN_HEADER_URL = "ecomp-url";
50 public static final String OUT_HEADER_RESPONSE_CODE = "ecomp-response-code";
51 public static final String OUT_HEADER_RESPONSE_MSG = "ecomp-response-message";
54 @Metadata(required = "true")
58 private String ecompClientCert;
61 private String ecompKeystore;
64 private String ecompKeystorePassword;
67 public RestClientEndpoint() {}
69 public RestClientEndpoint(String uri, RestClientComponent component) {
70 super(uri, component);
73 public RestClientEndpoint(String endpointUri) {
78 protected void setProperties(Object bean, Map<String, Object> parameters) throws Exception {
79 super.setProperties(bean, parameters);
82 public Producer createProducer() throws Exception {
83 return new RestClientProducer(this);
86 public Consumer createConsumer(Processor processor) throws Exception {
87 return new RestClientConsumer(this, processor);
90 public boolean isSingleton() {
94 public String getOp() {
98 public void setOp(String op) {
102 public String getEcompClientCert() {
103 return ecompClientCert;
106 public void setEcompClientCert(String ecompClientCert) {
107 this.ecompClientCert = ecompClientCert;
110 public String getEcompKeystore() {
111 return ecompKeystore;
114 public void setEcompKeystore(String ecompKeystore) {
115 this.ecompKeystore = ecompKeystore;
118 public String getEcompKeystorePassword() {
119 return ecompKeystorePassword;
122 public void setEcompKeystorePassword(String ecompKeystorePassword) {
123 this.ecompKeystorePassword = ecompKeystorePassword;