Massimiliano Assante 11 years ago
parent 105d216ba8
commit e3557d0200

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>ResourceManagementSupport</name> <name>rmp-common-library</name>
<comment></comment> <comment></comment>
<projects> <projects>
</projects> </projects>

@ -3,7 +3,7 @@
<ID></ID> <ID></ID>
<Type>Library</Type> <Type>Library</Type>
<Profile> <Profile>
<Description>Resource Management Portlet Common IS Operations Support Library</Description> <Description>${description}</Description>
<Class>PortletsAdmin</Class> <Class>PortletsAdmin</Class>
<Name>${artifactId}</Name> <Name>${artifactId}</Name>
<Version>1.0.0</Version> <Version>1.0.0</Version>

@ -12,8 +12,16 @@
<groupId>org.gcube.portlets.admin</groupId> <groupId>org.gcube.portlets.admin</groupId>
<artifactId>rmp-common-library</artifactId> <artifactId>rmp-common-library</artifactId>
<version>1.1.0-SNAPSHOT</version> <version>1.1.0-SNAPSHOT</version>
<name>Resource Management Portlet Common IS Operations Support Library</name> <name>Resource Management Library</name>
<description>
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.
</description>
<scm>
<connection>scm:svn:http://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/admin/${project.artifactId}</connection>
<developerConnection>scm:https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/admin/${project.artifactId}</developerConnection>
<url>http://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/admin/${project.artifactId}</url>
</scm>
<properties> <properties>
<!-- Convenience property to set the GWT version --> <!-- Convenience property to set the GWT version -->
<gwtVersion>2.4.0</gwtVersion> <gwtVersion>2.4.0</gwtVersion>
@ -63,7 +71,7 @@
<groupId>com.thoughtworks.xstream</groupId> <groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId> <artifactId>xstream</artifactId>
<version>1.3.1</version> <version>1.3.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.gcube.resourcemanagement</groupId> <groupId>org.gcube.resourcemanagement</groupId>
<artifactId>resource-manager-stubs</artifactId> <artifactId>resource-manager-stubs</artifactId>

@ -21,8 +21,8 @@ package org.gcube.resourcemanagement.support.server.exceptions;
* *
* @author Daniele Strollo (ISTI-CNR) * @author Daniele Strollo (ISTI-CNR)
*/ */
@SuppressWarnings("serial")
public class ResourceAccessException extends AbstractResourceException { public class ResourceAccessException extends AbstractResourceException {
private static final long serialVersionUID = -4491094127600507185L;
public ResourceAccessException() { public ResourceAccessException() {
super(); super();

@ -129,8 +129,7 @@ public abstract class AbstractResourceManager {
public AbstractResourceManager( public AbstractResourceManager(
final String id, final String id,
final String name, final String name,
final AllowedResourceTypes type) final AllowedResourceTypes type) throws ResourceParameterException, ResourceAccessException {
throws ResourceParameterException, ResourceAccessException {
this(id, type); this(id, type);
Assertion<ResourceParameterException> checker = new Assertion<ResourceParameterException>(); Assertion<ResourceParameterException> checker = new Assertion<ResourceParameterException>();
checker.validate(name != null && name.trim().length() > 0, new ResourceParameterException("Invalid Parameter name")); checker.validate(name != null && name.trim().length() > 0, new ResourceParameterException("Invalid Parameter name"));
@ -233,8 +232,8 @@ public abstract class AbstractResourceManager {
* @return a raw list of resource manager descriptors. * @return a raw list of resource manager descriptors.
* @throws Exception * @throws Exception
*/ */
private List<GCUBERunningInstance> getResourceManagerFromScope(final GCUBEScope scope) private List<GCUBERunningInstance> getResourceManagerFromScope(final GCUBEScope scope) throws Exception {
throws Exception { System.out.println("Looking for ResourceManager in scope: " + scope);
GCUBERIQuery query = this.client.getQuery(GCUBERIQuery.class); GCUBERIQuery query = this.client.getQuery(GCUBERIQuery.class);
query.addAtomicConditions(new AtomicCondition("//Profile/ServiceClass", "VREManagement")); query.addAtomicConditions(new AtomicCondition("//Profile/ServiceClass", "VREManagement"));
query.addAtomicConditions(new AtomicCondition("//Profile/ServiceName", "ResourceManager")); query.addAtomicConditions(new AtomicCondition("//Profile/ServiceName", "ResourceManager"));
@ -246,6 +245,7 @@ public abstract class AbstractResourceManager {
toReturn.add(ri); toReturn.add(ri);
} }
} }
System.out.println("Found " + toReturn.size() +" ResourceManager in scope: " + scope);
return toReturn; return toReturn;
} }
@ -260,6 +260,7 @@ public abstract class AbstractResourceManager {
Assertion<ResourceParameterException> checker = new Assertion<ResourceParameterException>(); Assertion<ResourceParameterException> checker = new Assertion<ResourceParameterException>();
checker.validate(scope != null, new ResourceParameterException("Invalid scope")); checker.validate(scope != null, new ResourceParameterException("Invalid scope"));
List<GCUBERunningInstance> resourceManagerList = null; List<GCUBERunningInstance> resourceManagerList = null;
try { try {
resourceManagerList = this.getResourceManagerFromScope(scope); resourceManagerList = this.getResourceManagerFromScope(scope);
@ -269,7 +270,8 @@ public abstract class AbstractResourceManager {
} }
List<ResourceBinderPortType> retval = new Vector<ResourceBinderPortType>(); List<ResourceBinderPortType> retval = new Vector<ResourceBinderPortType>();
if (resourceManagerList.isEmpty()) { if (resourceManagerList.isEmpty()) {
System.out.println("\n\n\n\n\n****** Schianta qui size: " + resourceManagerList.size() + " scope: " + scope);
throw new ResourceAccessException("Unable to find ResourceManagers for resource " + this.getType() + " in scope: " + scope.toString()); throw new ResourceAccessException("Unable to find ResourceManagers for resource " + this.getType() + " in scope: " + scope.toString());
} }

Loading…
Cancel
Save