Compare commits

..

No commits in common. "master" and "master" have entirely different histories.

25 changed files with 173 additions and 217 deletions

View File

@ -6,23 +6,22 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/> <attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>

View File

@ -1,15 +1,12 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.jdt.core.compiler.source=1.7

View File

@ -1,9 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> <?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="rmp-common-library"> <wb-module deploy-name="rmp-common-library">
<wb-resource deploy-path="/" source-path="/src/main/java"/> <wb-resource deploy-path="/" source-path="/src/main/java"/>
</wb-module> </wb-module>
</project-modules> </project-modules>

View File

@ -1,30 +0,0 @@
# Changelog for workspace
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v2.9.0] - 2023-04-22
- Feature #25384: rmp-common-library ContextManager should read VO IDs as well
## [v2.8.6] - 2022-06-17
- Fixed pom for HL portal removal
## [v2.8.5] - 2022-03-17
- Fix for #21652 Some keys contain the context and some other (the VRE contextes) contains in the context name.
## [v2.8.4] - 2020-12-14
- Fix Bug #20337 infrastructure-monitor: the searchById doesn't work anymore
## [v2.8.3] - 2020-09-25
- Ported to git and revised xqueries to support new Exists DB version
## [v1.0.0] - 2010-10-15
- First release, for other logs see distro/changelog.xml

View File

@ -1,26 +0,0 @@
# Acknowledgments
The projects leading to this software have received funding from a series of European Union programmes including:
- the Sixth Framework Programme for Research and Technological Development
- [DILIGENT](https://cordis.europa.eu/project/id/004260) (grant no. 004260).
- the Seventh Framework Programme for research, technological development and demonstration
- [D4Science](https://cordis.europa.eu/project/id/212488) (grant no. 212488);
- [D4Science-II](https://cordis.europa.eu/project/id/239019) (grant no.239019);
- [ENVRI](https://cordis.europa.eu/project/id/283465) (grant no. 283465);
- [iMarine](https://cordis.europa.eu/project/id/283644) (grant no. 283644);
- [EUBrazilOpenBio](https://cordis.europa.eu/project/id/288754) (grant no. 288754).
- the H2020 research and innovation programme
- [SoBigData](https://cordis.europa.eu/project/id/654024) (grant no. 654024);
- [PARTHENOS](https://cordis.europa.eu/project/id/654119) (grant no. 654119);
- [EGI-Engage](https://cordis.europa.eu/project/id/654142) (grant no. 654142);
- [ENVRI PLUS](https://cordis.europa.eu/project/id/654182) (grant no. 654182);
- [BlueBRIDGE](https://cordis.europa.eu/project/id/675680) (grant no. 675680);
- [PerformFISH](https://cordis.europa.eu/project/id/727610) (grant no. 727610);
- [AGINFRA PLUS](https://cordis.europa.eu/project/id/731001) (grant no. 731001);
- [DESIRA](https://cordis.europa.eu/project/id/818194) (grant no. 818194);
- [ARIADNEplus](https://cordis.europa.eu/project/id/823914) (grant no. 823914);
- [RISIS 2](https://cordis.europa.eu/project/id/824091) (grant no. 824091);
- [EOSC-Pillar](https://cordis.europa.eu/project/id/857650) (grant no. 857650);
- [Blue Cloud](https://cordis.europa.eu/project/id/862409) (grant no. 862409);
- [SoBigData-PlusPlus](https://cordis.europa.eu/project/id/871042) (grant no. 871042);

View File

@ -1,4 +1,4 @@
# gCube System - gCube Resource Management Common LIbrary # gCube System - gCube Resource Management Portlet Common LIbrary
## Structure of the project ## Structure of the project
@ -32,8 +32,16 @@ This project is licensed under the EUPL V.1.1 License - see the [LICENSE.md](LIC
## About the gCube Framework ## About the gCube Framework
This software is part of the [gCubeFramework](https://www.gcube-system.org/ "gCubeFramework"): an This software is part of the [gCubeFramework](https://www.gcube-system.org/ "gCubeFramework"): an
open-source software toolkit used for building and operating Data open-source software toolkit used for building and operating Hybrid Data
Infrastructures enabling the dynamic deployment of Virtual Research Environments Infrastructures enabling the dynamic deployment of Virtual Research Environments
by favouring the realisation of reuse oriented policies. by favouring the realisation of reuse oriented policies.
The projects leading to this software have received funding from a series of European Union programmes see [FUNDING.md](FUNDING.md) The projects leading to this software have received funding from a series of European Union programmes including:
- the Sixth Framework Programme for Research and Technological Development
- DILIGENT (grant no. 004260);
- the Seventh Framework Programme for research, technological development and demonstration
- D4Science (grant no. 212488), D4Science-II (grant no.239019), ENVRI (grant no. 283465), EUBrazilOpenBio (grant no. 288754), iMarine(grant no. 283644);
- the H2020 research and innovation programme
- BlueBRIDGE (grant no. 675680), EGIEngage (grant no. 654142), ENVRIplus (grant no. 654182), Parthenos (grant no. 654119), SoBigData (grant no. 654024),DESIRA (grant no. 818194), ARIADNEplus (grant no. 823914), RISIS2 (grant no. 824091), PerformFish (grant no. 727610), AGINFRAplus (grant no. 731001);

69
pom.xml
View File

@ -11,16 +11,16 @@
<groupId>org.gcube.portlets.admin</groupId> <groupId>org.gcube.portlets.admin</groupId>
<artifactId>rmp-common-library</artifactId> <artifactId>rmp-common-library</artifactId>
<version>2.9.0</version> <version>2.8.2-SNAPSHOT</version>
<name>Resource Management Library</name> <name>Resource Management Library</name>
<description> <description>
gCube Resource Management Library is a common library containing shared code for Information System Operations gCube Resource Management Library is a common library containing shared code for Information System Operations
used by all the Portlets and Widgets partaking into the Monitoring and Management of the Infrasturcture. used by all the Portlets and Widgets partaking into the Monitoring and Management of the Infrasturcture.
</description> </description>
<scm> <scm>
<connection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</connection> <connection>scm:git:https://code-repo.d4science.org/gCubeSystem/rmp-common-library.git</connection>
<developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</developerConnection> <developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/rmp-common-library.git</developerConnection>
<url>https://code-repo.d4science.org/gCubeSystem/${project.artifactId}</url> <url>https://code-repo.d4science.org/gCubeSystem/rmp-common-library</url>
</scm> </scm>
<properties> <properties>
<!-- Convenience property to set the GWT version --> <!-- Convenience property to set the GWT version -->
@ -28,7 +28,7 @@
<distroDirectory>distro</distroDirectory> <distroDirectory>distro</distroDirectory>
<!-- GWT needs at least java 1.6 --> <!-- GWT needs at least java 1.6 -->
<maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.target>1.7</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
@ -38,7 +38,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</version> <version>LATEST</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
@ -104,7 +104,7 @@
<dependency> <dependency>
<groupId>com.thoughtworks.xstream</groupId> <groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId> <artifactId>xstream</artifactId>
<version>1.4.9</version> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
@ -126,14 +126,15 @@
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<configuration> <configuration>
<source>${maven.compiler.source}</source> <source>1.7</source>
<target>${maven.compiler.target}</target> <target>1.7</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
<executions> <executions>
<execution> <execution>
<goals> <goals>
@ -142,27 +143,61 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration> <configuration>
<skipTests>true</skipTests> <skipTests>true</skipTests>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<configuration> <version>2.5</version>
<additionalparam>-Xdoclint:none</additionalparam>
<additionalJOption>-Xdoclint:none</additionalJOption>
</configuration>
<version>3.1.0</version>
<executions> <executions>
<execution> <execution>
<id>generate-doc</id> <id>copy-profile</id>
<phase>install</phase> <phase>install</phase>
<goals> <goals>
<goal>jar</goal> <goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>target</outputDirectory>
<resources>
<resource>
<directory>${distroDirectory}</directory>
<filtering>true</filtering>
<includes>
<include>profile.xml</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>${distroDirectory}/descriptor.xml</descriptor>
</descriptors>
<archive>
<manifest>
<mainClass>fully.qualified.MainClass</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>servicearchive</id>
<phase>install</phase>
<goals>
<goal>single</goal>
</goals> </goals>
</execution> </execution>
</executions> </executions>

View File

@ -4,26 +4,25 @@
# RES_TYPE the main type of the resource # RES_TYPE the main type of the resource
# This query is used by forms # This query is used by forms
declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry'; for $profiles in collection('/db/Profiles/<RES_TYPE ISdefault ='GHN' />')//Resource
for $profiles in collection('/db/Profiles/<RES_TYPE ISdefault ='GHN' />')//Document/Data/ic:Profile/Resource let $ghn-name := $profiles//Resource/Profile/GHN/@UniqueID/string()
let $ghn-name := $profiles/Profile/GHN/@UniqueID/string() let $gcf-version := $profiles//Resource/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'gCF-version']/Value/text()
let $gcf-version := $profiles/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'gCF-version']/Value/text() let $ghn-version := $profiles//Resource/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'GHN-distribution-version']/Value/text()
let $ghn-version := $profiles/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'GHN-distribution-version']/Value/text() let $scopes := string-join( $profiles//Resource/Scopes//Scope/text(), ';')
let $scopes := string-join( $profiles/Scopes//Scope/text(), ';')
let $subtype := let $subtype :=
if ($profiles/Type eq "Service") if ($profiles//Resource/Type eq "Service")
then $profiles/Profile/Class/text() then $profiles//Resource/Profile/Class/text()
else if ($profiles/Type eq "RunningInstance") else if ($profiles//Resource/Type eq "RunningInstance")
then $profiles/Profile/ServiceClass/text() then $profiles//Resource/Profile/ServiceClass/text()
else if ($profiles/Type eq "GenericResource") else if ($profiles//Resource/Type eq "GenericResource")
then $profiles/Profile/SecondaryType/text() then $profiles//Resource/Profile/SecondaryType/text()
else if ($profiles/Type eq "GHN") else if ($profiles//Resource/Type eq "GHN")
then $profiles/Profile/Site/Domain/text() then $profiles//Resource/Profile/Site/Domain/text()
else if ($profiles/Type eq "MetadataCollection") else if ($profiles//Resource/Type eq "MetadataCollection")
then $profiles/Profile/MetadataFormat/Name/text() then $profiles//Resource/Profile/MetadataFormat/Name/text()
else if ($profiles/Type eq "Collection" and ($profiles/Profile/IsUserCollection/string(@value) eq 'true')) else if ($profiles//Resource/Type eq "Collection" and ($profiles//Resource/Profile/IsUserCollection/string(@value) eq 'true'))
then "User" then "User"
else if ($profiles/Type eq "Collection" and ($profiles/Profile/IsUserCollection/string(@value) eq 'false')) else if ($profiles//Resource/Type eq "Collection" and ($profiles//Resource/Profile/IsUserCollection/string(@value) eq 'false'))
then "System" then "System"
else "" else ""
return return

View File

@ -4,26 +4,25 @@
# RES_TYPE the main type of the resource # RES_TYPE the main type of the resource
# This query is used by forms # This query is used by forms
declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry'; for $profiles in collection('/db/Profiles/<RES_TYPE ISdefault ='GHN' />')//Resource
for $profiles in collection('/db/Profiles/<RES_TYPE ISdefault ='GHN' />'))//Document/Data/ic:Profile/Resource let $ghn-name := $profiles//Resource/Profile/GHN/@UniqueID/string()
let $ghn-name := $profiles/Profile/GHN/@UniqueID/string() let $gcf-version := $profiles//Resource/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'gCF-version']/Value/text()
let $gcf-version := $profiles/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'gCF-version']/Value/text() let $ghn-version := $profiles//Resource/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'GHN-distribution-version']/Value/text()
let $ghn-version := $profiles/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'GHN-distribution-version']/Value/text() let $scopes := string-join( $profiles//Resource/Scopes//Scope/text(), ';')
let $scopes := string-join( $profiles/Scopes//Scope/text(), ';')
let $subtype := let $subtype :=
if ($profiles/Type eq "Service") if ($profiles//Resource/Type eq "Service")
then $profiles/Profile/Class/text() then $profiles//Resource/Profile/Class/text()
else if ($profiles/Type eq "RunningInstance") else if ($profiles//Resource/Type eq "RunningInstance")
then $profiles/Profile/ServiceClass/text() then $profiles//Resource/Profile/ServiceClass/text()
else if ($profiles/Type eq "GenericResource") else if ($profiles//Resource/Type eq "GenericResource")
then $profiles/Profile/SecondaryType/text() then $profiles//Resource/Profile/SecondaryType/text()
else if ($profiles/Type eq "GHN") else if ($profiles//Resource/Type eq "GHN")
then $profiles/Profile/Site/Domain/text() then $profiles//Resource/Profile/Site/Domain/text()
else if ($profiles/Type eq "MetadataCollection") else if ($profiles//Resource/Type eq "MetadataCollection")
then $profiles/Profile/MetadataFormat/Name/text() then $profiles//Resource/Profile/MetadataFormat/Name/text()
else if ($profiles/Type eq "Collection" and ($profiles/Profile/IsUserCollection/string(@value) eq 'true')) else if ($profiles//Resource/Type eq "Collection" and ($profiles//Resource/Profile/IsUserCollection/string(@value) eq 'true'))
then "User" then "User"
else if ($profiles/Type eq "Collection" and ($profiles/Profile/IsUserCollection/string(@value) eq 'false')) else if ($profiles//Resource/Type eq "Collection" and ($profiles//Resource/Profile/IsUserCollection/string(@value) eq 'false'))
then "System" then "System"
else "" else ""
where $subtype eq '<RES_SUBTYPE ISdefault='isti.cnr.it'/>' where $subtype eq '<RES_SUBTYPE ISdefault='isti.cnr.it'/>'

View File

@ -1,22 +1,21 @@
declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry';
let $type := '<RES_TYPE ISdefault ='MetadataCollection'/>' let $type := '<RES_TYPE ISdefault ='MetadataCollection'/>'
let $subtypes := let $subtypes :=
for $_profiles in collection('/db/Profiles/<RES_TYPE ISdefault ='MetadataCollection'/>')//Document/Data/ic:Profile/Resource for $_profiles in collection('/db/Profiles/<RES_TYPE ISdefault ='MetadataCollection'/>')//Resource
let $elem := if ($type eq "Service") let $elem := if ($type eq "Service")
then $_profiles/Profile/Class then $_profiles//Resource/Profile/Class
else if ($type eq "RunningInstance") else if ($type eq "RunningInstance")
then $_profiles/Profile/ServiceClass then $_profiles//Resource/Profile/ServiceClass
else if ($type eq "GenericResource") else if ($type eq "GenericResource")
then $_profiles/Profile/SecondaryType then $_profiles//Resource/Profile/SecondaryType
else if ($type eq "GHN") else if ($type eq "GHN")
then $_profiles/Profile/Site/Domain then $_profiles//Resource/Profile/Site/Domain
else if ($type eq "MetadataCollection") else if ($type eq "MetadataCollection")
then $_profiles/Profile/MetadataFormat/Name then $_profiles//Resource/Profile/MetadataFormat/Name
else if ($type eq "RuntimeResource") else if ($type eq "RuntimeResource")
then $_profiles/Profile/Category then $_profiles//Resource/Profile/Category
else if ($type eq "Collection" and ($_profiles/Profile/IsUserCollection/string(@value) eq 'true')) else if ($type eq "Collection" and ($_profiles//Resource/Profile/IsUserCollection/string(@value) eq 'true'))
then "User" then "User"
else if ($type eq "Collection" and ($_profiles/Profile/IsUserCollection/string(@value) eq 'false')) else if ($type eq "Collection" and ($_profiles//Resource/Profile/IsUserCollection/string(@value) eq 'false'))
then "System" then "System"
else "" else ""
return $elem return $elem

View File

@ -12,9 +12,7 @@
<Status>ready</Status> <Status>ready</Status>
</Resource> </Resource>
--> -->
for $ris in collection('/db/Profiles/RunningInstance')//Resource
declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry'; where $ris//Resource/Profile/GHN/@UniqueID/string() eq '<RES_ID/>'
for $ris in collection('/db/Profiles/RunningInstance')//Document/Data/ic:Profile/Resource
where $ris/Profile/GHN/@UniqueID/string() eq '<RES_ID/>'
return return
<RESOURCE/> <RESOURCE/>

View File

@ -2,7 +2,7 @@
{$ris/ID} {$ris/ID}
{$ris/Profile/ServiceName} {$ris/Profile/ServiceName}
{$ris/Profile/ServiceClass} {$ris/Profile/ServiceClass}
<ServiceVersion>{$ris/@version/string()}</ServiceVersion> <ServiceVersion>{$ris//Resource/@version/string()}</ServiceVersion>
<MainVersion>{$ris/Profile/Version/text()}</MainVersion> <MainVersion>{$ris/Profile/Version/text()}</MainVersion>
<Status>{$ris/Profile/DeploymentData/Status/text()}</Status> <Status>{$ris/Profile/DeploymentData/Status/text()}</Status>
</Resource> </Resource>

View File

@ -1,7 +1,7 @@
<Resources> <Resources>
<Resource> <Resource>
<Key>ID</Key> <Key>ID</Key>
<Value>{$ri/ID/string()}</Value> <Value>{$ri//Resource/ID/string()}</Value>
</Resource> </Resource>
<Resource> <Resource>
<Key>ServiceStatus</Key> <Key>ServiceStatus</Key>

View File

@ -1,18 +1,11 @@
<!-- <!--
Notice: the <Resources> node must be removed in using the resource grid factory. Notice: the <Resources> node must be removed in using the resource grid factory.
--> -->
declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry'; let $profiles := collection('/db/Profiles/<RES_TYPE ISdefault ='RunningInstance'/>')//Resource[ID/string() eq '<RES_ID/>']
let $relatedghn := collection('/db/Profiles/GHN')//Resource[ID/string() eq $profiles/Profile/GHN/@UniqueID/string()]
let $_ri_type := '<RES_TYPE ISdefault ='RunningInstance'/>' let $ghn-name := if (empty($relatedghn/Profile/GHNDescription/Name/string()))
let $_ri_id := '<RES_ID/>' then $profiles/Profile/GHN/@UniqueID/string()
else $relatedghn/Profile/GHNDescription/Name/string()
let $ri_docname := concat('/db/Profiles/RunningInstance/',$_ri_id) for $ri in $profiles
let $ri := doc($ri_docname)//Document/Data/ic:Profile/Resource
let $ghn-id := $ri/Profile/GHN/@UniqueID/string()
let $ghn_docname := concat('/db/Profiles/GHN/',$ri/Profile/GHN/@UniqueID/string())
let $relatedghn := doc($ghn_docname)//Document/Data/ic:Profile/Resource
let $_ghn-name := $relatedghn/Profile/GHNDescription/Name/string()
let $ghn-name := if (empty($_ghn-name)) then $ghn-id else $_ghn-name
return return
<RESOURCE/> <RESOURCE/>

View File

@ -2,17 +2,15 @@
PARAMETS: PARAMETS:
RES_ID the ID of the Service RES_ID the ID of the Service
--> -->
--> let $service := collection('/db/Profiles/Service')//Resource//Resource[ID/text() eq '<RES_ID/>']
declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry';
let $service := collection('/db/Profiles/Service')//Document/Data/ic:Profile/Resource[ID/text() eq '<RES_ID/>']
let $ServiceClass := $service/Profile/Class let $ServiceClass := $service/Profile/Class
let $ServiceName := $service/Profile/Name let $ServiceName := $service/Profile/Name
let $ServiceVersion := $service/Profile/Version let $ServiceVersion := $service/Profile/Version
let $riloop := collection('/db/Profiles/RunningInstance')//Document/Data/ic:Profile/Resource[Profile/ServiceClass/string() eq $ServiceClass and Profile/ServiceName/string() eq $ServiceName] let $riloop := collection('/db/Profiles/RunningInstance')//Resource[Profile/ServiceClass/string() eq $ServiceClass and Profile/ServiceName/string() eq $ServiceName]
let $relatedris := let $relatedris :=
for $ri in $riloop for $ri in $riloop
let $ghn-id := $ri/Profile/GHN/@UniqueID/string() let $ghn-id := $ri/Profile/GHN/@UniqueID/string()
let $ghn := doc(concat('/db/Profiles/GHN',$ghn-id))//Document/Data/ic:Profile/Resource let $ghn := collection('/db/Profiles/GHN')//Resource[ID/string() eq $ghn-id]
<!-- and $ri//Profile/Version/string() eq $ServiceVersion --> <!-- and $ri//Profile/Version/string() eq $ServiceVersion -->
return return
<RESOURCE/> <RESOURCE/>

View File

@ -1,8 +1,7 @@
declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry'; for $profiles in collection('/db/Profiles/GenericResource')//Resource, $wsresource in collection('/db/Properties')//Document
for $profiles in collection('/db/Profiles/GenericResource')//Document/Data/ic:Profile/Resource, $wsresource in collection('/db/Properties')//Document
let $scopes := string-join( $profiles/Scopes//Scope/text(), ';') let $scopes := string-join( $profiles/Scopes//Scope/text(), ';')
let $subtype := $profiles//Resource/Profile/SecondaryType/text() let $subtype := $profiles//Resource/Profile/SecondaryType/text()
where $subtype = "DataSource" and $profiles/ID eq $wsresource/SourceKey and $wsresource/Data//child::*[local-name()='ServiceName']/string() eq 'tree-manager-service' where $subtype = "DataSource" and $profiles//Resource/ID eq $wsresource/SourceKey and $wsresource/Data//child::*[local-name()='ServiceName']/string() eq 'tree-manager-service'
<RES_SUBTYPE ISdefault =''/> <RES_SUBTYPE ISdefault =''/>
return return
<RESOURCE/> <RESOURCE/>

View File

@ -1,9 +1,8 @@
declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry'; for $profiles in collection('/db/Profiles/GHN')//Resource
for $profiles in collection('/db/Profiles/GHN')//Document/Data/ic:Profile/Resource let $gcf-version := $profiles//Resource/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'gCF-version']/Value/text() | $profiles//Resource/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'SmartGears']/Value/text()
let $gcf-version := $profiles/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'gCF-version']/Value/text() | $profiles/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'SmartGears']/Value/text() let $ghn-version := $profiles//Resource/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'GHN-distribution-version']/Value/text() | $profiles//Resource/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'SmartGearsDistribution']/Value/text()
let $ghn-version := $profiles/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'GHN-distribution-version']/Value/text() | $profiles/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'SmartGearsDistribution']/Value/text()
let $scopes := string-join( $profiles/Scopes//Scope/text(), ';') let $scopes := string-join( $profiles/Scopes//Scope/text(), ';')
let $subtype := $profiles/Profile/Site/Domain/text() let $subtype := $profiles//Resource/Profile/Site/Domain/text()
<RES_SUBTYPE ISdefault =''/> <RES_SUBTYPE ISdefault =''/>
return return
<RESOURCE/> <RESOURCE/>

View File

@ -1,17 +1,17 @@
<Resource> <Resource>
{$profiles/ID} {$profiles//Resource/ID}
<Type>{$profiles/Type/text()}</Type> <Type>{$profiles//Resource/Type/text()}</Type>
<SubType>{$subtype}</SubType> <SubType>{$subtype}</SubType>
<Status>{$profiles/Profile/GHNDescription/Status/text()}</Status> <Status>{$profiles//Resource/Profile/GHNDescription/Status/text()}</Status>
<Name>{$profiles/Profile/GHNDescription/Name/text()}</Name> <Name>{$profiles//Resource/Profile/GHNDescription/Name/text()}</Name>
<Uptime>{$profiles/Profile/GHNDescription/Uptime/text()}</Uptime> <Uptime>{$profiles//Resource/Profile/GHNDescription/Uptime/text()}</Uptime>
<LastUpdate>{$profiles/Profile/GHNDescription/LastUpdate/text()}</LastUpdate> <LastUpdate>{$profiles//Resource/Profile/GHNDescription/LastUpdate/text()}</LastUpdate>
<LocalAvailableSpace>{$profiles/Profile/GHNDescription/LocalAvailableSpace/text()}</LocalAvailableSpace> <LocalAvailableSpace>{$profiles//Resource/Profile/GHNDescription/LocalAvailableSpace/text()}</LocalAvailableSpace>
<VirtualSize>{$profiles/Profile/GHNDescription/MainMemory/string(@VirtualSize)}</VirtualSize> <VirtualSize>{$profiles//Resource/Profile/GHNDescription/MainMemory/string(@VirtualSize)}</VirtualSize>
<VirtualAvailable>{$profiles/Profile/GHNDescription/MainMemory/string(@VirtualAvailable)}</VirtualAvailable> <VirtualAvailable>{$profiles//Resource/Profile/GHNDescription/MainMemory/string(@VirtualAvailable)}</VirtualAvailable>
<LoadLast1Min>{$profiles/Profile/GHNDescription/Load/string(@Last1Min)}</LoadLast1Min> <LoadLast1Min>{$profiles//Resource/Profile/GHNDescription/Load/string(@Last1Min)}</LoadLast1Min>
<LoadLast5Min>{$profiles/Profile/GHNDescription/Load/string(@Last5Min)}</LoadLast5Min> <LoadLast5Min>{$profiles//Resource/Profile/GHNDescription/Load/string(@Last5Min)}</LoadLast5Min>
<LoadLast15Min>{$profiles/Profile/GHNDescription/Load/string(@Last15Min)}</LoadLast15Min> <LoadLast15Min>{$profiles//Resource/Profile/GHNDescription/Load/string(@Last15Min)}</LoadLast15Min>
<gcf-version>{$gcf-version}</gcf-version> <gcf-version>{$gcf-version}</gcf-version>
<ghn-version>{$ghn-version}</ghn-version> <ghn-version>{$ghn-version}</ghn-version>
<Scopes>{$scopes}</Scopes> <Scopes>{$scopes}</Scopes>

View File

@ -1,8 +1,8 @@
<Resource> <Resource>
{$profiles/ID} {$profiles//Resource/ID}
<Type>{$profiles//Resource/Type/text()}</Type> <Type>{$profiles//Resource/Type/text()}</Type>
<SubType>{$subtype}</SubType> <SubType>{$subtype}</SubType>
<Scopes>{$scopes}</Scopes> <Scopes>{$scopes}</Scopes>
<Name>{$profiles/Profile/Name/text()}</Name> <Name>{$profiles//Resource/Profile/Name/text()}</Name>
<Description>{$profiles/Profile/Description/text()}</Description> <Description>{$profiles//Resource/Profile/Description/text()}</Description>
</Resource> </Resource>

View File

@ -1,8 +1,8 @@
<Resource> <Resource>
{$profiles/ID} {$profiles//Resource/ID}
<Type>{$profiles/Type/text()}</Type> <Type>{$profiles//Resource/Type/text()}</Type>
<SubType>{$subtype}</SubType> <SubType>{$subtype}</SubType>
<Scopes>{$scopes}</Scopes> <Scopes>{$scopes}</Scopes>
<Name>{$profiles/Profile/Name/text()}</Name> <Name>{$profiles//Resource/Profile/Name/text()}</Name>
<Host>{$profiles/Profile/RunTime/HostedOn/text()}</Host> <Host>{$profiles//Resource/Profile/RunTime/HostedOn/text()}</Host>
</Resource> </Resource>

View File

@ -1,10 +1,10 @@
<Resource> <Resource>
{$profiles/ID} {$profiles//Resource/ID}
<Type>{$profiles/Type/text()}</Type> <Type>{$profiles//Resource/Type/text()}</Type>
<SubType>{$subtype}</SubType> <SubType>{$subtype}</SubType>
<Scopes>{$scopes}</Scopes> <Scopes>{$scopes}</Scopes>
<ServiceClass>{$profiles/Profile/Class/text()}</ServiceClass> <ServiceClass>{$profiles//Resource/Profile/Class/text()}</ServiceClass>
<ServiceName>{$profiles/Profile/Name/text()}</ServiceName> <ServiceName>{$profiles//Resource/Profile/Name/text()}</ServiceName>
<Version>{$profiles/Profile/Packages/Software[1]/Version/text()}</Version> <Version>{$profiles//Resource/Profile/Packages/Software[1]/Version/text()}</Version>
<Shareable>{$profiles/Profile/Packages/Software/Shareable/string(@level)}</Shareable> <Shareable>{$profiles//Resource/Profile/Packages/Software/Shareable/string(@level)}</Shareable>
</Resource> </Resource>

View File

@ -1,7 +1,8 @@
declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry'; for $profiles in collection('/db/Profiles/RunningInstance')//Resource
for $profiles in collection('/db/Profiles/RunningInstance')//Document/Data/ic:Profile/Resource let $ghns := collection('/db/Profiles/GHN')//Resource
let $docname := concat('/db/Profiles/GHN/',$profiles/Profile/GHN/@UniqueID/string()) let $_ghn-name := for $ghn in $ghns
let $_ghn-name := doc($docname)//Document/Data/ic:Profile/Resource/Profile/GHNDescription/Name/string() where $ghn/ID/string() eq $profiles/Profile/GHN/@UniqueID/string()
return $ghn/Profile/GHNDescription/Name/string()
let $ghn-name := if (empty($_ghn-name)) then $profiles/Profile/GHN/@UniqueID/string() else $_ghn-name let $ghn-name := if (empty($_ghn-name)) then $profiles/Profile/GHN/@UniqueID/string() else $_ghn-name
let $scopes := string-join( $profiles/Scopes//Scope/text(), ';') let $scopes := string-join( $profiles/Scopes//Scope/text(), ';')
let $subtype := $profiles/Profile/ServiceClass/text() let $subtype := $profiles/Profile/ServiceClass/text()

View File

@ -1,7 +1,6 @@
declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry'; for $profiles in collection('/db/Profiles/RuntimeResource')//Resource
for $profiles in collection('/db/Profiles/RuntimeResource')//Document/Data/ic:Profile/Resource
let $scopes := string-join( $profiles/Scopes//Scope/text(), ';') let $scopes := string-join( $profiles/Scopes//Scope/text(), ';')
let $subtype := $profiles/Profile/Category/text() let $subtype := $profiles//Resource/Profile/Category/text()
<RES_SUBTYPE ISdefault =''/> <RES_SUBTYPE ISdefault =''/>
return return
<RESOURCE/> <RESOURCE/>

View File

@ -1,7 +1,6 @@
declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry'; for $profiles in collection('/db/Profiles/Service')//Resource
for $profiles in collection('/db/Profiles/Service')//Document/Data/ic:Profile/Resource
let $scopes := string-join( $profiles/Scopes//Scope/text(), ';') let $scopes := string-join( $profiles/Scopes//Scope/text(), ';')
let $subtype := $profiles/Profile/Class/text() let $subtype := $profiles//Resource/Profile/Class/text()
<RES_SUBTYPE ISdefault =''/> <RES_SUBTYPE ISdefault =''/>
return return
<RESOURCE/> <RESOURCE/>

View File

@ -58,7 +58,7 @@ import org.xml.sax.SAXException;
public class ContextManager { public class ContextManager {
private static final Map<String, ScopeBean> CONTEXTS = new LinkedHashMap<String, ScopeBean>(); private static final Map<String, ScopeBean> CONTEXTS = new LinkedHashMap<String, ScopeBean>();
private static String confFile = null; private static String confFile = null;
private static final String LOG_PREFIX = "[CONTEXT-MGR]"; private static final String LOG_PREFIX = "[SCOPE-MGR]";
private static final String GEN_RESOURCE_TYPE = "INFRASTRUCTURE"; private static final String GEN_RESOURCE_TYPE = "INFRASTRUCTURE";
private static final String GEN_RESOURCE_NAME = "VirtualOrganisation"; private static final String GEN_RESOURCE_NAME = "VirtualOrganisation";
@ -104,7 +104,7 @@ public class ContextManager {
public static LinkedHashMap<String, ScopeBean> readContexts() throws Exception { public static LinkedHashMap<String, ScopeBean> readContexts() throws Exception {
LinkedHashMap<String, ScopeBean> toReturn = new LinkedHashMap<String, ScopeBean>(); LinkedHashMap<String, ScopeBean> toReturn = new LinkedHashMap<String, ScopeBean>();
String scopeXML = readInfraVoFromIS(); String scopeXML = readInfraVoFromIS();
ServerConsole.info(LOG_PREFIX, "**** readContexts()"); System.out.println("**** readContexts()");
Document scopeDocument = getDocumentGivenXML(scopeXML); Document scopeDocument = getDocumentGivenXML(scopeXML);
NodeList voElements = scopeDocument.getElementsByTagName("vo"); NodeList voElements = scopeDocument.getElementsByTagName("vo");
ServerConsole.debug("voElements="+ voElements.getLength()); ServerConsole.debug("voElements="+ voElements.getLength());
@ -115,9 +115,9 @@ public class ContextManager {
toReturn.put(vo.toString(), vo); toReturn.put(vo.toString(), vo);
try { try {
for (String vreName : getVREFromVO(vo)) { for (String vre : getVREFromVO(vo)) {
// This operation overrides the vo map // This operation overrides the vo map
toReturn.put(new ScopeBean(vo.toString()+"/"+vreName).toString(), new ScopeBean(vo.toString()+"/"+vreName)); toReturn.put(vre.toString(), new ScopeBean(vo.toString()+"/"+vre));
} }
} catch (Exception e) { } catch (Exception e) {
ServerConsole.error("Exception raised while loading VREs for VO : " + vo, e); ServerConsole.error("Exception raised while loading VREs for VO : " + vo, e);
@ -136,21 +136,15 @@ public class ContextManager {
public static LinkedHashMap<String, D4SEnvironment> readContextsWithUUIDs() throws Exception { public static LinkedHashMap<String, D4SEnvironment> readContextsWithUUIDs() throws Exception {
LinkedHashMap<String, D4SEnvironment> toReturn = new LinkedHashMap<String, D4SEnvironment>(); LinkedHashMap<String, D4SEnvironment> toReturn = new LinkedHashMap<String, D4SEnvironment>();
String scopeXML = readInfraVoFromIS(); String scopeXML = readInfraVoFromIS();
ServerConsole.info(LOG_PREFIX, "**** readContexts()"); System.out.println("**** readContexts()");
Document scopeDocument = getDocumentGivenXML(scopeXML); Document scopeDocument = getDocumentGivenXML(scopeXML);
NodeList voElements = scopeDocument.getElementsByTagName("vo"); NodeList voElements = scopeDocument.getElementsByTagName("vo");
ServerConsole.debug("voElements="+ voElements.getLength()); ServerConsole.debug("voElements="+ voElements.getLength());
for (int i = 0; i < voElements.getLength(); i++) { for (int i = 0; i < voElements.getLength(); i++) {
NodeList voDetails = voElements.item(i).getChildNodes(); NodeList voDetails = voElements.item(i).getChildNodes();
String voString = voDetails.item(2).getFirstChild().getNodeValue(); String voString = voDetails.item(2).getFirstChild().getNodeValue();
String voID = "non-existing-vo-id";
try {
voID = voDetails.item(3).getFirstChild().getNodeValue();
} catch (Exception e) {
ServerConsole.error("Exception raised while trying reading VO ID from GenericResource having name: " + GEN_RESOURCE_NAME, e);
}
ScopeBean vo = new ScopeBean(voString); ScopeBean vo = new ScopeBean(voString);
D4SEnvironment voWrapper = new D4SEnvironment(vo, voID); D4SEnvironment voWrapper = new D4SEnvironment(vo, "uuid-not-exisiting-for-vos");
toReturn.put(vo.toString(), voWrapper); toReturn.put(vo.toString(), voWrapper);
try { try {
for (GenericResource resVRE : getVREResourcesFromVO(vo)) { for (GenericResource resVRE : getVREResourcesFromVO(vo)) {