use of bio.terra.workspace.model.ControlledResourceMetadata in project terra-workspace-manager by DataBiosphere.
the class EnumerateResources method logResult.
private void logResult(String tag, ResourceList resourceList) {
List<ResourceDescription> descList = resourceList.getResources();
logger.info("Enumeration results for {} - {} resources", tag, descList.size());
for (ResourceDescription desc : descList) {
ResourceMetadata metadata = desc.getMetadata();
String access = "<null>";
String managed = "<null>";
String user = "<null>";
if (metadata.getStewardshipType() == StewardshipType.CONTROLLED && metadata.getControlledResourceMetadata() != null) {
ControlledResourceMetadata controlled = metadata.getControlledResourceMetadata();
access = controlled.getAccessScope().toString();
managed = controlled.getManagedBy().toString();
user = controlled.getPrivateResourceUser().getUserName();
}
logger.info(" {}: id={} type={} stew={} cloud={} access={} managed={} user={}", metadata.getName(), metadata.getResourceId(), metadata.getResourceType(), metadata.getStewardshipType(), metadata.getCloudPlatform(), access, managed, user);
}
}
Aggregations