Enhancing SO SDC Controller to invoke ONAP-ETSI Catalog APIs
[so.git] / common / src / main / java / org / onap / so / rest / service / HttpRestServiceProvider.java
index 69046a2..4434dce 100644 (file)
@@ -21,6 +21,7 @@
 package org.onap.so.rest.service;
 
 import com.google.common.base.Optional;
+import org.springframework.http.HttpHeaders;
 import org.springframework.http.ResponseEntity;
 
 /**
@@ -37,6 +38,16 @@ public interface HttpRestServiceProvider {
      */
     <T> Optional<T> get(final String url, final Class<T> clazz);
 
+    /**
+     * Execute the HTTP GET to the given URI template
+     * 
+     * @param url the URL
+     * @param headers request headers
+     * @param clazz the type of the return value
+     * @return Returns the body of this entity.
+     */
+    <T> Optional<T> get(final String url, final HttpHeaders headers, final Class<T> clazz);
+
     /**
      * Execute the HTTP GET to the given URI template
      *
@@ -46,6 +57,15 @@ public interface HttpRestServiceProvider {
      */
     <T> ResponseEntity<T> getHttpResponse(final String url, final Class<T> clazz);
 
+    /**
+     * Execute the HTTP GET to the given URI template
+     *
+     * @param url the URL
+     * @param headers request headers
+     * @param clazz the type of the return value
+     * @return Returns the {@link ResponseEntity}.
+     */
+    <T> ResponseEntity<T> getHttpResponse(final String url, final HttpHeaders headers, final Class<T> clazz);
 
     /**
      * Execute the HTTP POST to the given URI template
@@ -67,6 +87,18 @@ public interface HttpRestServiceProvider {
      */
     <T> ResponseEntity<T> postHttpRequest(final Object object, final String url, final Class<T> clazz);
 
+    /**
+     * Execute the HTTP POST to the given URI template
+     *
+     * @param object the entity (i.e. body) to write to the request
+     * @param url the URL
+     * @param clazz the type of the return value
+     * @param headers request headers
+     * @return Returns the {@link ResponseEntity}.
+     */
+    <T> ResponseEntity<T> postHttpRequest(final Object object, final String url, final HttpHeaders headers,
+            final Class<T> clazz);
+
     /**
      * Execute the HTTP PUT to the given URI template
      *