org.gcube.application.framework.vremanagement.vremanagement.impl
Class ISInfo

java.lang.Object
  extended by org.gcube.application.framework.vremanagement.vremanagement.impl.ISInfo
All Implemented Interfaces:
ISInfoI

public class ISInfo
extends java.lang.Object
implements ISInfoI

Author:
Valia Tsaqgkalidou (NKUA)

Constructor Summary
ISInfo(ASLSession session)
          Constructs a ISInfo object
 
Method Summary
 void addExternalRIToVRE(java.io.File file)
          
 void addGHNToScope(java.lang.String url)
          Adds a GHN to the active VRE
 void addRIToScope(java.lang.String url, java.lang.String className, java.lang.String name)
          Adds a service to the active VRE
 boolean existsGHN(java.lang.String namePort)
          
 GCUBECollection getCollection(GCUBEScope scope, java.lang.String collectionID)
          Return a collection profile.
 java.util.List<RPDocument> getCollectionIndices(GCUBEScope scope, java.lang.String collectionID)
          Return all indices associated with a given collection.
 java.util.List<GCUBECollection> getCollections(GCUBEScope scope)
          Returns all profiles of collections present in the given scope.
 java.util.List<RPDocument> getIndices(GCUBEScope scope, java.lang.String mcollectionID)
          Return all indices associated with a given metadata collection.
 java.util.List<GCUBEMCollection> getMCollections(GCUBEScope scope, java.lang.String collectionID)
          Return all metadata-collections associated with the given collection.
 java.util.List<RPDocument> getWS(java.lang.String type)
          
 java.util.List<RPDocument> getXMLIndices(GCUBEScope scope, java.lang.String mcollectionID)
          Return all XML indices associated with the given metadata collection.
 java.util.List<XMLResult> queryIS(java.lang.String query)
          
 void removeExternalRIToVRE(java.lang.String id)
          
 void removeGHNToScope(java.lang.String url)
          
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ISInfo

public ISInfo(ASLSession session)
Constructs a ISInfo object

Parameters:
session - the D4Science session to be used for retrieving information needed
Method Detail

queryIS

public java.util.List<XMLResult> queryIS(java.lang.String query)

Specified by:
queryIS in interface ISInfoI
Parameters:
query - an XQuery to be submitted on IS
Returns:
a list of XMLResults that represent resources form IS (like RIs, Generic Resources, Collections, etc)

getWS

public java.util.List<RPDocument> getWS(java.lang.String type)

Specified by:
getWS in interface ISInfoI
Parameters:
type - the of the WSs to be retrieved
Returns:
a list of RPDocuments

addGHNToScope

public void addGHNToScope(java.lang.String url)
Adds a GHN to the active VRE

Specified by:
addGHNToScope in interface ISInfoI
Parameters:
url - the GHN url

removeGHNToScope

public void removeGHNToScope(java.lang.String url)

Specified by:
removeGHNToScope in interface ISInfoI
Parameters:
url - server:port of the GHN to be removed

addRIToScope

public void addRIToScope(java.lang.String url,
                         java.lang.String className,
                         java.lang.String name)
Adds a service to the active VRE

Specified by:
addRIToScope in interface ISInfoI
Parameters:
url - the Running Instance url
className - the name of the class where the RI will belong
name - the name of teh service it provides

addExternalRIToVRE

public void addExternalRIToVRE(java.io.File file)

Specified by:
addExternalRIToVRE in interface ISInfoI
Parameters:
file - the file that contains the external running instance to be added

removeExternalRIToVRE

public void removeExternalRIToVRE(java.lang.String id)

Specified by:
removeExternalRIToVRE in interface ISInfoI
Parameters:
id - the id of the external running instance to be removed

existsGHN

public boolean existsGHN(java.lang.String namePort)

Specified by:
existsGHN in interface ISInfoI
Parameters:
namePort - GHN name:port
Returns:
true if GHN exists, otherwise false

getCollections

public java.util.List<GCUBECollection> getCollections(GCUBEScope scope)
                                               throws java.lang.Exception
Returns all profiles of collections present in the given scope.

Specified by:
getCollections in interface ISInfoI
Parameters:
scope - the scope of the collections.
Returns:
a list of collections profile.
Throws:
java.lang.Exception - when an error occurs.

getMCollections

public java.util.List<GCUBEMCollection> getMCollections(GCUBEScope scope,
                                                        java.lang.String collectionID)
                                                 throws java.lang.Exception
Return all metadata-collections associated with the given collection.

Specified by:
getMCollections in interface ISInfoI
Parameters:
scope - the scope of the metadata collections.
collectionID - the associated collection.
Returns:
a list of metadata collections profile.
Throws:
java.lang.Exception

getXMLIndices

public java.util.List<RPDocument> getXMLIndices(GCUBEScope scope,
                                                java.lang.String mcollectionID)
                                         throws java.lang.Exception
Return all XML indices associated with the given metadata collection.

Specified by:
getXMLIndices in interface ISInfoI
Parameters:
scope - the indices scope.
mcollectionID - the metadata collection id.
Returns:
a list of Resource document.
Throws:
java.lang.Exception

getIndices

public java.util.List<RPDocument> getIndices(GCUBEScope scope,
                                             java.lang.String mcollectionID)
                                      throws java.lang.Exception
Return all indices associated with a given metadata collection.

Specified by:
getIndices in interface ISInfoI
Parameters:
scope - the indices scope.
mcollectionID - the metadata collection id.
Returns:
a list of Resource document.
Throws:
java.lang.Exception

getCollectionIndices

public java.util.List<RPDocument> getCollectionIndices(GCUBEScope scope,
                                                       java.lang.String collectionID)
                                                throws java.lang.Exception
Return all indices associated with a given collection.

Specified by:
getCollectionIndices in interface ISInfoI
Parameters:
scope - the indices scope.
collectionID - the collection id.
Returns:
a list of Resource document.
Throws:
java.lang.Exception

getCollection

public GCUBECollection getCollection(GCUBEScope scope,
                                     java.lang.String collectionID)
                              throws java.lang.Exception
Return a collection profile.

Specified by:
getCollection in interface ISInfoI
Parameters:
scope - the collection scope.
collectionID - the collection id.
Returns:
a collection profile.
Throws:
java.lang.Exception