migrate model-impl from drools-applications
[policy/models.git] / models-interactions / model-impl / rest / src / main / java / org / onap / policy / rest / HttpDeleteWithBody.java
1 /*
2  * ============LICENSE_START=======================================================
3  * rest
4  * ================================================================================
5  * Copyright (C) 2018 Amdocs. All rights reserved.
6  * Modifications Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
7  * Modifications Copyright (C) 2019 Nordix Foundation.
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 at
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
23 package org.onap.policy.rest;
24
25 import java.net.URI;
26 import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
27
28 /**
29  * Allows for HTTP DELETE requests to contain a body, which the HttpDelete
30  * class does not support.
31  */
32 public class HttpDeleteWithBody extends HttpEntityEnclosingRequestBase {
33     public static final String METHOD_NAME = "DELETE";
34
35     public HttpDeleteWithBody(final String uri) {
36         super();
37         setURI(URI.create(uri));
38     }
39
40     public HttpDeleteWithBody(final URI uri) {
41         super();
42         setURI(uri);
43     }
44
45     public HttpDeleteWithBody() {
46         super();
47     }
48
49     @Override
50     public String getMethod() {
51         return METHOD_NAME;
52     }
53
54 }