aboutsummaryrefslogtreecommitdiffstats
path: root/common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryClient.java
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryClient.java')
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryClient.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryClient.java b/common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryClient.java
index 98d48ec3a8..09efb5a48d 100644
--- a/common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryClient.java
+++ b/common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryClient.java
@@ -25,6 +25,7 @@ import org.onap.so.client.RestClient;
import org.onap.so.client.RestProperties;
import org.onap.so.client.RestPropertiesLoader;
import org.onap.so.client.graphinventory.entities.uri.GraphInventoryUri;
+import org.onap.so.client.graphinventory.entities.uri.HttpAwareUri;
public abstract class GraphInventoryClient {
@@ -36,9 +37,22 @@ public abstract class GraphInventoryClient {
this.props = props;
}
- protected abstract URI constructPath(GraphInventoryUri uri);
+ protected abstract URI constructPath(URI uri);
+
+ protected abstract RestClient createClient(URI uri);
+
+ public RestClient createClient(GraphInventoryUri uri) {
+ final URI result;
+ if (uri instanceof HttpAwareUri) {
+ result = ((HttpAwareUri) uri).locateAndBuild();
+ } else {
+ result = uri.build();
+ }
+
+ return createClient(result);
+
+ }
- public abstract RestClient createClient(GraphInventoryUri uri);
public <T extends RestProperties> T getRestProperties() {
if (props == null) {