org.gcube.informationsystem.glitebridge.publisher
Class GenericResourcesPublisher

java.lang.Object
  extended by org.gcube.informationsystem.glitebridge.publisher.GenericResourcesPublisher

public class GenericResourcesPublisher
extends java.lang.Object

Author:
Luca Frosini (ISTI-CNR)

Nested Class Summary
static interface GenericResourcesPublisher.GCUBEGenericResourceCreator<T>
           
 
Constructor Summary
GenericResourcesPublisher()
          Constructor.
 
Method Summary
 java.util.List<java.lang.String> getGenericResourcesID(GCUBEScope gCubeScope, java.lang.String secondaryType)
           
<T> void
publishGliteResource(GenericResourcesPublisher.GCUBEGenericResourceCreator<T> g, GCUBEScope gCubeScope)
           
 java.util.List<java.lang.String> publishResources(java.util.List<KSite> kSitesTotal, java.util.List<KCluster> kClustersTotal, java.util.List<KStorageElement> kStorageElementsTotal, GCUBEScope gcubeScope)
          Public Harvested gLite Resources
 void removeGenericResource(java.lang.String id, GCUBEScope gCubeScope)
          Remove all Generic Resources in the specified GCUBEScope with the IDs specified as argument
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericResourcesPublisher

public GenericResourcesPublisher()
                          throws java.lang.Exception
Constructor. Initialize the ISPublisher.

Throws:
java.lang.Exception - if fails to initialize the ISPublisher.
Method Detail

publishGliteResource

public <T> void publishGliteResource(GenericResourcesPublisher.GCUBEGenericResourceCreator<T> g,
                                     GCUBEScope gCubeScope)
                          throws java.lang.Exception
Type Parameters:
T - class
Parameters:
g - GCUBEGenericResourceCreator
gCubeScope - GCUBEScope
Throws:
java.lang.Exception - if fails

getGenericResourcesID

public java.util.List<java.lang.String> getGenericResourcesID(GCUBEScope gCubeScope,
                                                              java.lang.String secondaryType)
                                                       throws java.lang.Exception
Parameters:
gCubeScope - GCUBEScope where to look for Generic Resources IDs
secondaryType - Secondary Type of the Generic Resources to get the IDs
Returns:
List of String
Throws:
java.lang.Exception - if fails to retrieve the IDs of the Generic Resources with secondaryType in the specified gCubeScope

removeGenericResource

public void removeGenericResource(java.lang.String id,
                                  GCUBEScope gCubeScope)
                           throws java.lang.Exception
Remove all Generic Resources in the specified GCUBEScope with the IDs specified as argument

Parameters:
id - List of String with Generic Resources ID
gCubeScope - scope
Throws:
java.lang.Exception - if fails

publishResources

public java.util.List<java.lang.String> publishResources(java.util.List<KSite> kSitesTotal,
                                                         java.util.List<KCluster> kClustersTotal,
                                                         java.util.List<KStorageElement> kStorageElementsTotal,
                                                         GCUBEScope gcubeScope)
                                                  throws java.lang.Exception
Public Harvested gLite Resources

Parameters:
kSitesTotal - List of KSite to publish
kClustersTotal - List of KCluster to publish
kStorageElementsTotal - List of KStorageElement to publish
gcubeScope - GCUBEScope where publish the Generic Resources
Returns:
List of String with IDs of published Generic Resources
Throws:
java.lang.Exception - if fails