Initial OpenECOMP Data Router Core commit
[aai/router-core.git] / src / main / java / org / openecomp / rest / RestClientComponent.java
1 /**
2  * ============LICENSE_START=======================================================
3  * DataRouter
4  * ================================================================================
5  * Copyright © 2017 AT&T Intellectual Property.
6  * Copyright © 2017 Amdocs
7  * All rights reserved.
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
12  *
13  *    http://www.apache.org/licenses/LICENSE-2.0
14  *
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=========================================================
21  *
22  * ECOMP and OpenECOMP are trademarks
23  * and service marks of AT&T Intellectual Property.
24  */
25 package org.openecomp.rest;
26
27 import org.apache.camel.CamelContext;
28 import org.apache.camel.Endpoint;
29 import org.apache.camel.impl.UriEndpointComponent;
30
31 import java.util.Map;
32
33
34 /**
35  * Represents the component that manages {@link RestClientEndpoint}.
36  */
37 public class RestClientComponent extends UriEndpointComponent {
38
39   public RestClientComponent() {
40     super(RestClientEndpoint.class);
41   }
42
43   public RestClientComponent(CamelContext context) {
44     super(context, RestClientEndpoint.class);
45   }
46
47   @Override
48   protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters)
49       throws Exception {
50
51     Endpoint endpoint = new RestClientEndpoint(uri, this);
52     setProperties(endpoint, parameters);
53     return endpoint;
54   }
55 }