package org.onap.so.client.grm;
import java.net.URI;
-
import javax.ws.rs.core.UriBuilder;
-
import org.onap.so.client.RestClient;
public class GRMRestInvoker {
-
- private final RestClient client;
- private final GRMProperties properties;
-
- public GRMRestInvoker(GRMAction action) {
- GRMProperties props = GRMPropertiesLoader.getInstance().getImpl();
- this.properties = props;
- this.client = new GRMRestClient(properties, this.createURI(action));
- }
-
- private URI createURI(GRMAction action) {
- return UriBuilder.fromUri("/GRMLWPService")
- .path(this.properties.getDefaultVersion())
- .path("serviceEndPoint")
- .path(action.getAction())
- .build();
- }
-
- private RestClient getClient() {
- return this.client;
- }
-
- public void post(Object obj) {
- getClient().post(obj);
- }
-
- public <T> T post(Object obj, Class<T> resultClass) {
- return getClient().post(obj, resultClass);
- }
-
+
+ private final RestClient client;
+ private final GRMProperties properties;
+
+ public GRMRestInvoker(GRMAction action) {
+ GRMProperties props = GRMPropertiesLoader.getInstance().getImpl();
+ this.properties = props;
+ this.client = new GRMRestClient(properties, this.createURI(action));
+ }
+
+ private URI createURI(GRMAction action) {
+ return UriBuilder.fromUri("/GRMLWPService").path(this.properties.getDefaultVersion()).path("serviceEndPoint")
+ .path(action.getAction()).build();
+ }
+
+ private RestClient getClient() {
+ return this.client;
+ }
+
+ public void post(Object obj) {
+ getClient().post(obj);
+ }
+
+ public <T> T post(Object obj, Class<T> resultClass) {
+ return getClient().post(obj, resultClass);
+ }
+
}