Initial commit for AAI-UI(sparky-backend)
[aai/sparky-be.git] / src / main / java / org / openecomp / sparky / dal / rest / RestDataProvider.java
1 /**
2  * ============LICENSE_START===================================================
3  * SPARKY (AAI UI service)
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 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  * ECOMP and OpenECOMP are trademarks
23  * and service marks of AT&T Intellectual Property.
24  */
25
26 package org.openecomp.sparky.dal.rest;
27
28 /**
29  * The Interface RestDataProvider.
30  */
31 public interface RestDataProvider {
32
33   /**
34    * Do get.
35    *
36    * @param url the url
37    * @param acceptContentType the accept content type
38    * @return the operation result
39    */
40   OperationResult doGet(String url, String acceptContentType);
41
42   /**
43    * Do delete.
44    *
45    * @param url the url
46    * @param acceptContentType the accept content type
47    * @return the operation result
48    */
49   OperationResult doDelete(String url, String acceptContentType);
50
51   /**
52    * Do post.
53    *
54    * @param url the url
55    * @param jsonPayload the json payload
56    * @param acceptContentType the accept content type
57    * @return the operation result
58    */
59   OperationResult doPost(String url, String jsonPayload, String acceptContentType);
60
61   /**
62    * Do put.
63    *
64    * @param url the url
65    * @param jsonPayload the json payload
66    * @param acceptContentType the accept content type
67    * @return the operation result
68    */
69   OperationResult doPut(String url, String jsonPayload, String acceptContentType);
70
71   /**
72    * Do patch.
73    *
74    * @param url the url
75    * @param jsonPayload the json payload
76    * @param acceptContentType the accept content type
77    * @return the operation result
78    */
79   OperationResult doPatch(String url, String jsonPayload, String acceptContentType);
80
81   /**
82    * Do head.
83    *
84    * @param url the url
85    * @param acceptContentType the accept content type
86    * @return the operation result
87    */
88   OperationResult doHead(String url, String acceptContentType);
89
90   /**
91    * Do restful operation.
92    *
93    * @param method the method
94    * @param url the url
95    * @param payload the payload
96    * @param payloadType the payload type
97    * @param acceptContentType the accept content type
98    * @return the operation result
99    */
100   OperationResult doRestfulOperation(HttpMethod method, String url, String payload,
101       String payloadType, String acceptContentType);
102
103   /**
104    * Shutdown.
105    */
106   void shutdown();
107
108   /**
109    * Clear cache.
110    */
111   void clearCache();
112 }