39164e7c5135462996dff5bc26c050dca2d0d4d9
[policy/apex-pdp.git] / plugins / plugins-event / plugins-event-carrier / plugins-event-carrier-restclient / src / main / java / org / onap / policy / apex / plugins / event / carrier / restclient / RestClientCarrierTechnologyParameters.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
4  *  Modifications Copyright (C) 2019-2020 Nordix Foundation.
5  * ================================================================================
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * SPDX-License-Identifier: Apache-2.0
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.onap.policy.apex.plugins.event.carrier.restclient;
23
24 import lombok.Getter;
25 import lombok.Setter;
26
27 import org.onap.policy.apex.service.parameters.carriertechnology.RestPluginCarrierTechnologyParameters;
28
29 // @formatter:off
30 /**
31  * Apex parameters for REST as an event carrier technology with Apex as a REST client.
32  *
33  * <p>The parameters for this plugin are:
34  * <ol>
35  * <li>url: The URL that the Apex Rest client will connect to over REST for event reception or event sending. This
36  * parameter is mandatory.
37  * <li>httpMethod: The HTTP method to use when sending events over REST, legal values are POST (default) and PUT. When
38  * receiving events, the REST client plugin always uses the HTTP GET method.
39  * <li>httpHeaders, the HTTP headers to send on REST requests, optional parameter, defaults to none.
40  * <li>httpCodeFilter: a regular expression filter for returned HTTP codes, if the returned HTTP code passes this
41  * filter, then the request is assumed to have succeeded by the plugin, optional, defaults to allowing 2xx codes
42  * through, that is a regular expression of "[2][0-9][0-9]"
43  * </ol>
44  *
45  * @author Joss Armstrong (joss.armstrong@ericsson.com)
46  */
47 //@formatter:on
48 @Setter
49 @Getter
50 public class RestClientCarrierTechnologyParameters extends RestPluginCarrierTechnologyParameters {
51
52     /**
53      * Constructor to create a REST carrier technology parameters instance and register the instance with the parameter
54      * service.
55      */
56     public RestClientCarrierTechnologyParameters() {
57         super();
58
59         this.setLabel("RESTCLIENT");
60         this.setEventProducerPluginClass(ApexRestClientProducer.class.getName());
61         this.setEventConsumerPluginClass(ApexRestClientConsumer.class.getName());
62     }
63 }