Updated to support the deploy on pre e prod

This commit is contained in:
Giancarlo Panichi 2023-05-10 16:06:31 +02:00
parent ff5d706554
commit fd214ed16d
7 changed files with 117 additions and 74 deletions

10
pom.xml
View File

@ -72,7 +72,7 @@
<dependency> <dependency>
<groupId>org.gcube.distribution</groupId> <groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId> <artifactId>maven-portal-bom</artifactId>
<version>3.7.0-SNAPSHOT</version> <version>3.8.0-SNAPSHOT</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
@ -98,22 +98,22 @@
<dependency> <dependency>
<groupId>org.gcube.information-system</groupId> <groupId>org.gcube.information-system</groupId>
<artifactId>information-system-model</artifactId> <artifactId>information-system-model</artifactId>
<version>[5.0.0-SNAPSHOT,6.0.0-SNAPSHOT)</version> <version>[7.0.0-SNAPSHOT,8.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.gcube.resource-management</groupId> <groupId>org.gcube.resource-management</groupId>
<artifactId>gcube-model</artifactId> <artifactId>gcube-model</artifactId>
<version>[4.0.0-SNAPSHOT,5.0.0-SNAPSHOT)</version> <version>[5.0.0-SNAPSHOT,6.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.gcube.information-system</groupId> <groupId>org.gcube.information-system</groupId>
<artifactId>resource-registry-api</artifactId> <artifactId>resource-registry-api</artifactId>
<version>[4.1.0,5.0.0-SNAPSHOT)</version> <version>[5.0.0-SNAPSHOT,6.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.gcube.information-system</groupId> <groupId>org.gcube.information-system</groupId>
<artifactId>resource-registry-client</artifactId> <artifactId>resource-registry-client</artifactId>
<version>[4.1.0,5.0.0-SNAPSHOT)</version> <version>[4.4.0-SNAPSHOT,5.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<!-- endnew registry deps --> <!-- endnew registry deps -->

View File

@ -56,8 +56,9 @@ public interface ServiceProxy extends RemoteService {
/** /**
* @return the list of all available scopes. * @return the list of all available scopes.
* @throws Exception
*/ */
List<String> getAvailableScopes(); List<String> getAvailableScopes() throws Exception;
List<String> getAvailableAddScopes(); List<String> getAvailableAddScopes();

View File

@ -93,8 +93,8 @@ public class Callbacks {
} }
public void onFailure(final Throwable caught) { public void onFailure(final Throwable caught) {
Commands.unmask(UIIdentifiers.MAIN_CONTAINER_VIEWPORT_ID); Commands.unmask(UIIdentifiers.MAIN_CONTAINER_VIEWPORT_ID);
MessageBox.info("Failure", "cannot retrieve the scopes", null); MessageBox.info("Error", "Cannot retrieve the available contexts", null);
GWT.log("cannot retrieve the scopes", caught); GWT.log("Cannot retrieve the available contexts:", caught);
} }
}; };

View File

@ -10,9 +10,12 @@ import java.util.LinkedHashMap;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Properties;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.servlet.ServletContext;
import org.gcube.common.authorization.library.provider.AccessTokenProvider; import org.gcube.common.authorization.library.provider.AccessTokenProvider;
import org.gcube.common.keycloak.KeycloakClient; import org.gcube.common.keycloak.KeycloakClient;
import org.gcube.common.keycloak.KeycloakClientFactory; import org.gcube.common.keycloak.KeycloakClientFactory;
@ -37,39 +40,69 @@ import org.slf4j.LoggerFactory;
*/ */
public class RegistryClientRequester { public class RegistryClientRequester {
private static final String CLIENT_PROPERTIES = "/WEB-INF/client.properties";
private static final String ENDPOINT = "endpoint";
private static final String CLIENT_ID = "clientID";
private static final String SECRET = "secret";
private static final String ROOT_SCOPE = "rootScope";
private static final boolean IncludeContextInHeader = true;
private static Logger logger = LoggerFactory.getLogger(RegistryClientRequester.class); private static Logger logger = LoggerFactory.getLogger(RegistryClientRequester.class);
private static ResourceRegistryClient resourceRegistryClient; private static ResourceRegistryClient resourceRegistryClient;
private static KeycloakClient client = KeycloakClientFactory.newInstance(); private static KeycloakClient client = KeycloakClientFactory.newInstance();
private static final String endpoint = "https://accounts.dev.d4science.org/auth/realms/d4science/protocol/openid-connect/token"; // private static final String endpoint =
private static final String clientID = "resource-registry-portlet-expieve"; // "https://accounts.dev.d4science.org/auth/realms/d4science/protocol/openid-connect/token";
private static final String secret = "179bd3bc-5cc4-11ec-bf63-0242ac130001"; // private static final String clientID =
// "resource-registry-portlet-expieve";
// private static final String secret =
// "179bd3bc-5cc4-11ec-bf63-0242ac130001";
// private static final String rootScope = "/gcube";
private static final String rootScope = "/gcube"; public static final Set<String> getAvailableContexts(ServletContext servletContext) throws Exception {
Properties clientProperties=getClientProperties(servletContext);
public static final Set<String> getAvailableContexts() throws Exception { String rootScope=clientProperties.getProperty(ROOT_SCOPE);
logger.info("GetAvailableContexts: [Scope: {}]", rootScope);
Set<String> contextList = new HashSet<String>(); Set<String> contextList = new HashSet<String>();
ScopeProvider.instance.set(rootScope); ScopeProvider.instance.set(rootScope);
AccessTokenProvider.instance.set(getTokenForContext(rootScope)); AccessTokenProvider.instance.set(getTokenForContext(rootScope,clientProperties));
try { try {
resourceRegistryClient = ResourceRegistryClientFactory.create(); resourceRegistryClient = ResourceRegistryClientFactory.create();
//resourceRegistryClient.setIncludeContextsInHeader(IncludeContextInHeader);
ContextCache contextCache = ContextCache.getInstance(); ContextCache contextCache = ContextCache.getInstance();
contextList = contextCache.getContextFullNameToUUIDAssociation().keySet(); contextList = contextCache.getContextFullNameToUUIDAssociation().keySet();
} catch (Exception e) { } catch (Exception e) {
return Collections.emptySet(); logger.error("Error retrieving available contexts: {}",e.getLocalizedMessage(),e);
throw new Exception("Error retrieving available contexts: "+e.getLocalizedMessage(),e);
} finally { } finally {
AccessTokenProvider.instance.reset(); AccessTokenProvider.instance.reset();
ScopeProvider.instance.reset(); ScopeProvider.instance.reset();
} }
logger.info("Available contexts: {}",contextList);
return contextList; return contextList;
} }
private static String getTokenForContext(String context) { private static Properties getClientProperties(ServletContext servletContext) throws Exception {
Properties properties = new Properties();
properties.load(servletContext.getResourceAsStream(CLIENT_PROPERTIES));
return properties;
}
private static String getTokenForContext(String context, Properties clientProperties) {
logger.info("GetTokenForContext: {}",context);
String endpoint=clientProperties.getProperty(ENDPOINT);
String clientID=clientProperties.getProperty(CLIENT_ID);
String secret=clientProperties.getProperty(SECRET);
try { try {
TokenResponse response = client.queryUMAToken(new URL(endpoint), clientID, secret, context, null); TokenResponse response = client.queryUMAToken(new URL(endpoint), clientID, secret, context, null);
return response.getAccessToken(); return response.getAccessToken();
@ -89,13 +122,14 @@ public class RegistryClientRequester {
*/ */
// list a resource with a sub category // list a resource with a sub category
public static final HashMap<String, ArrayList<String>> getResourcesTree(String scope) throws Exception { public static final HashMap<String, ArrayList<String>> getResourcesTree(ServletContext servletContext,String scope) throws Exception {
logger.info("GetResourcesTree: [Scope: {}]", scope);
Properties clientProperties=getClientProperties(servletContext);
HashMap<String, ArrayList<String>> retval = new HashMap<String, ArrayList<String>>(); HashMap<String, ArrayList<String>> retval = new HashMap<String, ArrayList<String>>();
ScopeProvider.instance.set(scope); ScopeProvider.instance.set(scope);
AccessTokenProvider.instance.set(getTokenForContext(scope)); AccessTokenProvider.instance.set(getTokenForContext(scope,clientProperties));
try { try {
logger.info("GetResourcesTree: [Scope: {}]", scope);
resourceRegistryClient = ResourceRegistryClientFactory.create(); resourceRegistryClient = ResourceRegistryClientFactory.create();
List<Type> types = resourceRegistryClient.getType(Resource.class, true); List<Type> types = resourceRegistryClient.getType(Resource.class, true);
@ -200,16 +234,19 @@ public class RegistryClientRequester {
} }
// list string (xml formatted) for table // list string (xml formatted) for table
public static final List<String> getResourcesByTypeSubType(String scope, String type, String subType) public static final List<String> getResourcesByTypeSubType(ServletContext servletContext,String scope, String type, String subType)
throws Exception { throws Exception {
logger.info("GetResourcesByTypeSubType: [Scope: {}]", scope);
Properties clientProperties=getClientProperties(servletContext);
// CacheList.resourceid.clear(); // CacheList.resourceid.clear();
ScopeProvider.instance.set(scope); ScopeProvider.instance.set(scope);
AccessTokenProvider.instance.set(getTokenForContext(scope)); AccessTokenProvider.instance.set(getTokenForContext(scope,clientProperties));
try { try {
logger.info("GetResourcesByTypeSubType: [Scope: {}, Type: {}, SubType: {}]",new String[]{ scope, type, subType }); logger.info("GetResourcesByTypeSubType: [Scope: {}, Type: {}, SubType: {}]",
new String[] { scope, type, subType });
resourceRegistryClient = ResourceRegistryClientFactory.create(); resourceRegistryClient = ResourceRegistryClientFactory.create();
// resourceRegistryClient.setIncludeContextsInHeader(IncludeContextInHeader);
List<String> resources = new ArrayList<String>(); List<String> resources = new ArrayList<String>();
switch (type) { switch (type) {
@ -287,7 +324,7 @@ public class RegistryClientRequester {
public static CompleteResourceProfile getResourceByID(String xml2htmlMapping, String scope, String type, public static CompleteResourceProfile getResourceByID(String xml2htmlMapping, String scope, String type,
String resID) { String resID) {
logger.info("GetResourceByID: [Scope: {}]", scope);
String representation = CacheList.resourceid.get(resID).getBody(); String representation = CacheList.resourceid.get(resID).getBody();
// get resource by id // get resource by id
String title = CacheList.resourceid.get(resID).getTitle(); String title = CacheList.resourceid.get(resID).getTitle();

View File

@ -114,6 +114,7 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
private HttpSession getHttpSession() { private HttpSession getHttpSession() {
return this.getThreadLocalRequest().getSession(); return this.getThreadLocalRequest().getSession();
} }
public final void initScopes(final boolean doClean) { public final void initScopes(final boolean doClean) {
@ -258,25 +259,24 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
} }
} }
public final List<String> getAvailableScopes() { public final List<String> getAvailableScopes() throws Exception {
ServerConsole.trace(LOG_PREFIX, "[GET-SCOPES] getting available scopes"); ServerConsole.trace(LOG_PREFIX, "[GET-SCOPES] getting available scopes");
Vector<String> retval = new Vector<String>(); Vector<String> retval = new Vector<String>();
try { try {
retval.addAll(RegistryClientRequester.getAvailableContexts()); retval.addAll(RegistryClientRequester.getAvailableContexts(this.getServletContext()));
} catch (Exception e) { } catch (Exception e) {
retval.add("/gcube"); logger.error("Error retrieving available contexts: {}",e.getLocalizedMessage(),e);
retval.add("/gcube/devsec"); throw new Exception("Error retrieving available contexts: "+e.getLocalizedMessage(),e);
e.printStackTrace();
} }
return retval; return retval;
} }
public final List<String> getAvailableAddScopes() { public final List<String> getAvailableAddScopes() {
this.getServletContext();
List<String> retval = new Vector<String>(); List<String> retval = new Vector<String>();
try { try {
retval.addAll(RegistryClientRequester.getAvailableContexts()); retval.addAll(RegistryClientRequester.getAvailableContexts(this.getServletContext()));
} catch (Exception e) { } catch (Exception e) {
ServerConsole.error(LOG_PREFIX, e); ServerConsole.error(LOG_PREFIX, e);
} }
@ -287,7 +287,7 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
public final HashMap<String, ArrayList<String>> getResourceTypeTree(final String scope) throws Exception { public final HashMap<String, ArrayList<String>> getResourceTypeTree(final String scope) throws Exception {
try { try {
HashMap<String, ArrayList<String>> results = RegistryClientRequester.getResourcesTree(scope); HashMap<String, ArrayList<String>> results = RegistryClientRequester.getResourcesTree(this.getServletContext(),scope);
logger.info("get result type tree: ("+results.size()+") /n" logger.info("get result type tree: ("+results.size()+") /n"
+ results.keySet() ); + results.keySet() );
@ -306,7 +306,7 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
{ {
try { try {
logger.info("---------------->getResourcesByType: [Scope: {}, type: {}]",scope,type); logger.info("---------------->getResourcesByType: [Scope: {}, type: {}]",scope,type);
List<String> request=RegistryClientRequester.getResourcesByTypeSubType(scope, type,null); List<String> request=RegistryClientRequester.getResourcesByTypeSubType(this.getServletContext(),scope, type,null);
return request; return request;
} catch (Exception e) { } catch (Exception e) {
@ -410,7 +410,7 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
//List<String> request=ISClientRequester.getResourcesByType(getCacheManager(this.getCurrentStatus()), new ScopeBean(scope), type, subType); //List<String> request=ISClientRequester.getResourcesByType(getCacheManager(this.getCurrentStatus()), new ScopeBean(scope), type, subType);
//New code //New code
List<String> request=RegistryClientRequester.getResourcesByTypeSubType(scope, type,subType); List<String> request=RegistryClientRequester.getResourcesByTypeSubType(this.getServletContext(),scope, type,subType);
return request; return request;

View File

@ -13,7 +13,7 @@ import org.gcube.informationsystem.model.reference.entities.Facet;
import org.gcube.informationsystem.model.reference.entities.Resource; import org.gcube.informationsystem.model.reference.entities.Resource;
import org.gcube.informationsystem.model.reference.relations.ConsistsOf; import org.gcube.informationsystem.model.reference.relations.ConsistsOf;
import org.gcube.informationsystem.resourceregistry.client.ResourceRegistryClient; import org.gcube.informationsystem.resourceregistry.client.ResourceRegistryClient;
import org.gcube.informationsystem.utils.ElementMapper; import org.gcube.informationsystem.serialization.ElementMapper;
import org.gcube.resourcemanagement.model.reference.entities.facets.AccessPointFacet; import org.gcube.resourcemanagement.model.reference.entities.facets.AccessPointFacet;
import org.gcube.resourcemanagement.model.reference.entities.facets.ContactFacet; import org.gcube.resourcemanagement.model.reference.entities.facets.ContactFacet;
import org.gcube.resourcemanagement.model.reference.entities.facets.IdentifierFacet; import org.gcube.resourcemanagement.model.reference.entities.facets.IdentifierFacet;
@ -108,16 +108,16 @@ public class UtilityResource {
if (f instanceof IdentifierFacet) { if (f instanceof IdentifierFacet) {
logger.info("------------ConfigurationTemplate--IdentifierFacet"); logger.info("------------ConfigurationTemplate--IdentifierFacet");
IdentifierFacet sf = (IdentifierFacet) f; IdentifierFacet sf = (IdentifierFacet) f;
if (!list.contains(sf.getType().toString())) if (!list.contains(sf.getIdentificationType().toString()))
list.add(sf.getType().toString()); list.add(sf.getIdentificationType().toString());
} }
break; break;
case "Configuration": case "Configuration":
if (f instanceof SoftwareFacet) { if (f instanceof SoftwareFacet) {
logger.info("------------Configuration--IdentifierFacet"); logger.info("------------Configuration--IdentifierFacet");
IdentifierFacet sf = (IdentifierFacet) f; IdentifierFacet sf = (IdentifierFacet) f;
if (!list.contains(sf.getType().toString())) { if (!list.contains(sf.getIdentificationType().toString())) {
list.add(sf.getType().toString()); list.add(sf.getIdentificationType().toString());
} }
} }
break; break;
@ -126,8 +126,8 @@ public class UtilityResource {
if (f instanceof IdentifierFacet) { if (f instanceof IdentifierFacet) {
logger.info("------------Dataset--IdentifierFacet"); logger.info("------------Dataset--IdentifierFacet");
IdentifierFacet sf = (IdentifierFacet) f; IdentifierFacet sf = (IdentifierFacet) f;
if (!list.contains(sf.getType().toString())) { if (!list.contains(sf.getIdentificationType().toString())) {
list.add(sf.getType().toString()); list.add(sf.getIdentificationType().toString());
} }
} }
break; break;
@ -135,8 +135,8 @@ public class UtilityResource {
if (f instanceof IdentifierFacet) { if (f instanceof IdentifierFacet) {
logger.info("------------ConcreteDataset--IdentifierFacet"); logger.info("------------ConcreteDataset--IdentifierFacet");
IdentifierFacet sf = (IdentifierFacet) f; IdentifierFacet sf = (IdentifierFacet) f;
if (!list.contains(sf.getType().toString())) { if (!list.contains(sf.getIdentificationType().toString())) {
list.add(sf.getType().toString()); list.add(sf.getIdentificationType().toString());
} }
} }
break; break;
@ -191,8 +191,8 @@ public class UtilityResource {
if (f instanceof IdentifierFacet) { if (f instanceof IdentifierFacet) {
logger.info("------------Site--IdentifierFacet"); logger.info("------------Site--IdentifierFacet");
IdentifierFacet sf = (IdentifierFacet) f; IdentifierFacet sf = (IdentifierFacet) f;
if (!list.contains(sf.getType().toString())) if (!list.contains(sf.getIdentificationType().toString()))
list.add(sf.getType().toString()); list.add(sf.getIdentificationType().toString());
} }
break; break;
@ -351,7 +351,7 @@ public class UtilityResource {
} }
for (Actor actor : actors) { for (Actor actor : actors) {
id = actor.getHeader().getUUID().toString(); id = actor.getID().toString();
List<? extends Facet> facets = actor.getIdentificationFacets(); List<? extends Facet> facets = actor.getIdentificationFacets();
for (Facet f : facets) { for (Facet f : facets) {
@ -408,7 +408,7 @@ public class UtilityResource {
} }
for (LegalBody actor : legalBodys) { for (LegalBody actor : legalBodys) {
id = actor.getHeader().getUUID().toString(); id = actor.getID().toString();
List<? extends Facet> facets = actor.getIdentificationFacets(); List<? extends Facet> facets = actor.getIdentificationFacets();
for (Facet f : facets) { for (Facet f : facets) {
@ -465,7 +465,7 @@ public class UtilityResource {
} }
for (Person person : persons) { for (Person person : persons) {
id = person.getHeader().getUUID().toString(); id = person.getID().toString();
List<? extends Facet> facets = person.getIdentificationFacets(); List<? extends Facet> facets = person.getIdentificationFacets();
for (Facet f : facets) { for (Facet f : facets) {
@ -530,14 +530,14 @@ public class UtilityResource {
} }
for (ConfigurationTemplate configurationTemplate : configurationTemplates) { for (ConfigurationTemplate configurationTemplate : configurationTemplates) {
id = configurationTemplate.getHeader().getUUID().toString(); id = configurationTemplate.getID().toString();
List<? extends Facet> facets = configurationTemplate.getIdentificationFacets(); List<? extends Facet> facets = configurationTemplate.getIdentificationFacets();
for (Facet f : facets) { for (Facet f : facets) {
if (f instanceof IdentifierFacet) { if (f instanceof IdentifierFacet) {
IdentifierFacet sf = (IdentifierFacet) f; IdentifierFacet sf = (IdentifierFacet) f;
name = sf.getValue(); name = sf.getValue();
description = sf.getType().toString(); description = sf.getIdentificationType().toString();
subType = sf.getType().toString(); subType = sf.getIdentificationType().toString();
} }
} }
@ -594,14 +594,14 @@ public class UtilityResource {
return resource; return resource;
} }
for (Configuration configuration : configurations) { for (Configuration configuration : configurations) {
id = configuration.getHeader().getUUID().toString(); id = configuration.getID().toString();
List<? extends Facet> facets = configuration.getIdentificationFacets(); List<? extends Facet> facets = configuration.getIdentificationFacets();
for (Facet f : facets) { for (Facet f : facets) {
if (f instanceof IdentifierFacet) { if (f instanceof IdentifierFacet) {
IdentifierFacet sf = (IdentifierFacet) f; IdentifierFacet sf = (IdentifierFacet) f;
name = sf.getValue(); name = sf.getValue();
subType = sf.getType().toString(); subType = sf.getIdentificationType().toString();
description = sf.getType().toString(); description = sf.getIdentificationType().toString();
} }
} }
@ -650,7 +650,7 @@ public class UtilityResource {
} }
for (Dataset dataset : datasets) { for (Dataset dataset : datasets) {
id = dataset.getHeader().getUUID().toString(); id = dataset.getID().toString();
List<? extends Facet> facets = dataset.getIdentificationFacets(); List<? extends Facet> facets = dataset.getIdentificationFacets();
for (Facet f : facets) { for (Facet f : facets) {
@ -659,8 +659,8 @@ public class UtilityResource {
// version = sf.getVersion(); // version = sf.getVersion();
serviceName = sf.getValue(); serviceName = sf.getValue();
serviceClass = sf.getType().toString(); serviceClass = sf.getIdentificationType().toString();
subType = sf.getType().toString(); subType = sf.getIdentificationType().toString();
} }
} }
CacheList.resourceid.put(id, new ResourceObject(serviceName, dataset.toString())); CacheList.resourceid.put(id, new ResourceObject(serviceName, dataset.toString()));
@ -707,7 +707,7 @@ public class UtilityResource {
} }
for (ConcreteDataset concreteDataset : concretedatasets) { for (ConcreteDataset concreteDataset : concretedatasets) {
id = concreteDataset.getHeader().getUUID().toString(); id = concreteDataset.getID().toString();
List<? extends Facet> facets = concreteDataset.getIdentificationFacets(); List<? extends Facet> facets = concreteDataset.getIdentificationFacets();
for (Facet f : facets) { for (Facet f : facets) {
@ -716,8 +716,8 @@ public class UtilityResource {
// version = sf.getVersion(); // version = sf.getVersion();
serviceName = sf.getValue(); serviceName = sf.getValue();
serviceClass = sf.getType().toString(); serviceClass = sf.getIdentificationType().toString();
subType = sf.getType().toString(); subType = sf.getIdentificationType().toString();
} }
} }
CacheList.resourceid.put(id, new ResourceObject(serviceName, concreteDataset.toString())); CacheList.resourceid.put(id, new ResourceObject(serviceName, concreteDataset.toString()));
@ -765,7 +765,7 @@ public class UtilityResource {
} }
for (Schema schema : schemas) { for (Schema schema : schemas) {
id = schema.getHeader().getUUID().toString(); id = schema.getID().toString();
List<? extends Facet> facets = schema.getIdentificationFacets(); List<? extends Facet> facets = schema.getIdentificationFacets();
for (Facet f : facets) { for (Facet f : facets) {
@ -827,7 +827,7 @@ public class UtilityResource {
List<EService> eservices = (List<EService>) resourceRegistryClient.getInstances(EService.class, false); List<EService> eservices = (List<EService>) resourceRegistryClient.getInstances(EService.class, false);
for (EService et : eservices) { for (EService et : eservices) {
id = et.getHeader().getUUID().toString(); id = et.getID().toString();
List<? extends Facet> facets = et.getIdentificationFacets(); List<? extends Facet> facets = et.getIdentificationFacets();
for (Facet f : facets) { for (Facet f : facets) {
if (f instanceof SoftwareFacet) { if (f instanceof SoftwareFacet) {
@ -905,7 +905,7 @@ public class UtilityResource {
} }
for (RunningPlugin runningPlugin : runningPlugins) { for (RunningPlugin runningPlugin : runningPlugins) {
id = runningPlugin.getHeader().getUUID().toString(); id = runningPlugin.getID().toString();
List<? extends Facet> facets = runningPlugin.getIdentificationFacets(); List<? extends Facet> facets = runningPlugin.getIdentificationFacets();
for (Facet f : facets) { for (Facet f : facets) {
@ -973,10 +973,11 @@ public class UtilityResource {
String gcfVersion = ""; String gcfVersion = "";
String ghnVersion = ""; String ghnVersion = "";
resourceRegistryClient.setIncludeMeta(true);
List<HostingNode> ehosting = (List<HostingNode>) resourceRegistryClient.getInstances(HostingNode.class, false); List<HostingNode> ehosting = (List<HostingNode>) resourceRegistryClient.getInstances(HostingNode.class, false);
for (HostingNode eh : ehosting) { for (HostingNode eh : ehosting) {
id = eh.getHeader().getUUID().toString(); id = eh.getID().toString();
lastUpdate = eh.getHeader().getLastUpdateTime().toString(); lastUpdate = eh.getMetadata().getLastUpdateTime().toString();
List<? extends Facet> facets = eh.getIdentificationFacets(); List<? extends Facet> facets = eh.getIdentificationFacets();
for (Facet f : facets) { for (Facet f : facets) {
if (f instanceof NetworkingFacet) { if (f instanceof NetworkingFacet) {
@ -1081,7 +1082,7 @@ public class UtilityResource {
return resource; return resource;
} }
for (VirtualService vs : virtualServices) { for (VirtualService vs : virtualServices) {
id = vs.getHeader().getUUID().toString(); id = vs.getID().toString();
List<? extends Facet> facets = vs.getIdentificationFacets(); List<? extends Facet> facets = vs.getIdentificationFacets();
for (Facet f : facets) { for (Facet f : facets) {
@ -1138,7 +1139,7 @@ public class UtilityResource {
} }
for (Site site : sites) { for (Site site : sites) {
id = site.getHeader().getUUID().toString(); id = site.getID().toString();
List<? extends Facet> facets = site.getIdentificationFacets(); List<? extends Facet> facets = site.getIdentificationFacets();
for (Facet f : facets) { for (Facet f : facets) {
@ -1147,8 +1148,8 @@ public class UtilityResource {
// version = sf.getVersion(); // version = sf.getVersion();
serviceName = sf.getValue(); serviceName = sf.getValue();
serviceClass = sf.getType().toString(); serviceClass = sf.getIdentificationType().toString();
subType = sf.getType().toString(); subType = sf.getIdentificationType().toString();
} }
} }
CacheList.resourceid.put(id, new ResourceObject(serviceName, site.toString())); CacheList.resourceid.put(id, new ResourceObject(serviceName, site.toString()));
@ -1196,7 +1197,7 @@ public class UtilityResource {
} }
for (Software software : softwares) { for (Software software : softwares) {
id = software.getHeader().getUUID().toString(); id = software.getID().toString();
List<? extends Facet> facets = software.getIdentificationFacets(); List<? extends Facet> facets = software.getIdentificationFacets();
for (Facet f : facets) { for (Facet f : facets) {
@ -1253,7 +1254,7 @@ public class UtilityResource {
} }
for (Plugin plugin : plugins) { for (Plugin plugin : plugins) {
id = plugin.getHeader().getUUID().toString(); id = plugin.getID().toString();
List<? extends Facet> facets = plugin.getIdentificationFacets(); List<? extends Facet> facets = plugin.getIdentificationFacets();
for (Facet f : facets) { for (Facet f : facets) {

View File

@ -0,0 +1,4 @@
endpoint=https://accounts.dev.d4science.org/auth/realms/d4science/protocol/openid-connect/token
clientID=resource-registry-portlet-expieve
secret=
rootScope=/gcube