Task #11788

Add list of VO in a resource on root context and provides a facility class to retrieve the list of scopes

Added by Luca Frosini over 1 year ago. Updated over 1 year ago.

Status:ClosedStart date:May 17, 2018
Priority:UrgentDue date:
Assignee:Massimiliano Assante% Done:

100%

Category:resource-management
Sprint:zz - Smartgears
Milestones:
Duration:

Description

The class org.gcube.resourcemanagement.support.server.managers.scope.ScopeManager provides support to retrieve all available contexts starting from a file (e.g. scopedata.xml) which contains the list of VOs. The subsequest list of VREs is retrieved from the facility methods from IS.

This is very annoying because the file must be substituted when a VO is created or deleted. Moreover uses a mixed approach.

As far as I remembers during a meeting it was requested from @pasquale.pagano@isti.cnr.it that a resource containing the list of VOs on root context must be created.

I would like a class behaving like ScopeManager (I suggest the name with the keyword Context instead of scopes) which uses only the IS eliminating the needs for VO file.

scopedata.xml Magnifier - related to gcube infrastructure (612 Bytes) Roberto Cirillo, May 17, 2018 12:29 PM

History

#1 Updated by Luca Frosini over 1 year ago

@roberto.cirillo@isti.cnr.it or @massimiliano.assante@isti.cnr.it in the meanwhile can you provide me the scopedata.xml file for /gcube infrastructure?

#2 Updated by Roberto Cirillo over 1 year ago

#5 Updated by Massimiliano Assante over 1 year ago

  • Status changed from New to In Progress

#6 Updated by Massimiliano Assante over 1 year ago

  • % Done changed from 0 to 100
  • Status changed from In Progress to Feedback

The scope data.xml is now a body of a Generic Resource that must exists in the root VO having:

    SecondaryType = "INFRASTRUCTURE";
    NAME = "VirtualOrganisation";

I added a new class to the library that performs what you ask: org.gcube.resourcemanagement.support.server.managers.context.ContextManager. The class assumes that either the token or the scope are set in the ThreadLocal vars, token has priority. Whatever context is found the query is performed on the root VO (inferred from the context found if necessary).

Usage Example:

    @Test
    public void testContextManager() {
        ScopeProvider.instance.set("/gcube");
        try {
            LinkedHashMap<String, ScopeBean> contexts = ContextManager.readContexts();
            for (String c : contexts.keySet()) {
                System.out.println(contexts.get(c).toString());
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

Output of the test above:

/gcube
/gcube/devsec
/gcube/devsec/SmartCamera
/gcube/devsec/RMinerDev
/gcube/devsec/devVRE
/gcube/devsec/TestFri26Feb2016
/gcube/devsec/TabProcessing
/gcube/devNext
/gcube/devNext/TestVREThu7Dec1611
/gcube/devNext/NextNext
/gcube/devNext/TestVREWed61555
/gcube/preprod
/gcube/preprod/preVRE
/gcube/preprod/Dorne
/gcube/preprod/preECO
/gcube/preprod/Wed15March17_1845
/gcube/preprod/PARTHENOS_PRE
/gcube/preprod/devEDISON

Dependency:

<dependency>
  <groupId>org.gcube.portlets.admin</groupId>
  <artifactId>rmp-common-library</artifactId>
  <version>[2.7.2-SNAPSHOT,)</version>
</dependency>

#7 Updated by Luca Frosini over 1 year ago

  • Status changed from Feedback to Closed

I seems working for me

Also available in: Atom PDF