summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/src/main/java/org/onap/so/client/dmaap/DmaapClient.java10
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/Format.java3
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryResourcesClient.java18
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/entities/uri/GraphInventoryUri.java1
4 files changed, 10 insertions, 22 deletions
diff --git a/common/src/main/java/org/onap/so/client/dmaap/DmaapClient.java b/common/src/main/java/org/onap/so/client/dmaap/DmaapClient.java
index 86d4aa7413..48c2d1495d 100644
--- a/common/src/main/java/org/onap/so/client/dmaap/DmaapClient.java
+++ b/common/src/main/java/org/onap/so/client/dmaap/DmaapClient.java
@@ -49,12 +49,12 @@ public abstract class DmaapClient {
this.msoProperties = dmaapProperties.getProperties();
this.properties = new Properties();
this.properties.load(resource.getInputStream());
- try {
- this.properties.put("auth", CryptoUtils.decrypt(this.getAuth(), this.getKey()).getBytes());
- } catch (GeneralSecurityException e) {
- logger.error(e.getMessage(), e);
+ if (this.getAuth() != null && this.getKey() != null) {
+ this.properties.put("auth", this.getAuth());
+ this.properties.put("key", this.getKey());
+ } else {
+ logger.error("Dmaap auth or key is null");
}
- this.properties.put("key", this.getKey());
this.properties.put("topic", this.getTopic());
Optional<String> host = this.getHost();
if (host.isPresent()) {
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/Format.java b/common/src/main/java/org/onap/so/client/graphinventory/Format.java
index c3cb4b9eaf..078b35aaf4 100644
--- a/common/src/main/java/org/onap/so/client/graphinventory/Format.java
+++ b/common/src/main/java/org/onap/so/client/graphinventory/Format.java
@@ -29,7 +29,8 @@ public enum Format {
CONSOLE("console"),
PATHED("pathed"),
GRAPHSON("graphson"),
- ID("id");
+ ID("id"),
+ COUNT("count");
private final String name;
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryResourcesClient.java b/common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryResourcesClient.java
index 2a76dab107..c7cdb2ff58 100644
--- a/common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryResourcesClient.java
+++ b/common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryResourcesClient.java
@@ -32,9 +32,7 @@ import org.onap.so.client.RestClient;
import org.onap.so.client.RestProperties;
import org.onap.so.client.graphinventory.entities.GraphInventoryEdgeLabel;
import org.onap.so.client.graphinventory.entities.GraphInventoryResultWrapper;
-import org.onap.so.client.graphinventory.entities.uri.Depth;
import org.onap.so.client.graphinventory.entities.uri.GraphInventoryResourceUri;
-import org.onap.so.client.graphinventory.entities.uri.GraphInventoryUri;
public abstract class GraphInventoryResourcesClient<Self, Uri extends GraphInventoryResourceUri, EdgeLabel extends GraphInventoryEdgeLabel, Wrapper extends GraphInventoryResultWrapper, TransactionalClient, SingleTransactionClient> {
@@ -74,7 +72,9 @@ public abstract class GraphInventoryResourcesClient<Self, Uri extends GraphInven
* @return
*/
public boolean exists(Uri uri) {
- GraphInventoryUri forceMinimal = this.addParams(Optional.of(Depth.ZERO), true, uri);
+ GraphInventoryResourceUri forceMinimal = uri.clone();
+ forceMinimal.format(Format.COUNT);
+ forceMinimal.limit(1);
try {
RestClient giRC = client.createClient(forceMinimal);
@@ -314,18 +314,6 @@ public abstract class GraphInventoryResourcesClient<Self, Uri extends GraphInven
*/
public abstract SingleTransactionClient beginSingleTransaction();
- private GraphInventoryUri addParams(Optional<Depth> depth, boolean nodesOnly, GraphInventoryUri uri) {
- GraphInventoryUri clone = uri.clone();
- if (depth.isPresent()) {
- clone.depth(depth.get());
- }
- if (nodesOnly) {
- clone.nodesOnly(nodesOnly);
- }
-
- return clone;
- }
-
public <T extends RestProperties> T getRestProperties() {
return client.getRestProperties();
}
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/GraphInventoryUri.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/GraphInventoryUri.java
index d6d3e5eaa2..6b48ad44ef 100644
--- a/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/GraphInventoryUri.java
+++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/GraphInventoryUri.java
@@ -22,7 +22,6 @@ package org.onap.so.client.graphinventory.entities.uri;
import java.net.URI;
import java.util.Map;
-import org.onap.so.client.graphinventory.entities.uri.Depth;
import org.onap.so.client.graphinventory.GraphInventoryObjectType;
public interface GraphInventoryUri {