use of org.onap.aaiclient.client.graphinventory.entities.uri.GraphInventoryResourceUri in project so by onap.
the class GraphInventoryResourcesClient method exists.
/**
* returns false if the object does not exist in GraphInventory
*
* @param uri
* @return
*/
public boolean exists(Uri uri) {
GraphInventoryResourceUri<?, ?> forceMinimal = (Uri) uri.clone();
forceMinimal.format(Format.COUNT);
forceMinimal.limit(1);
try {
RestClient giRC = client.createClient(forceMinimal);
return giRC.get().getStatus() == Status.OK.getStatusCode();
} catch (NotFoundException e) {
return false;
}
}
Aggregations