org.edg.data.reptor.info
Class InfoServiceRGMA

java.lang.Object
  |
  +--org.edg.data.reptor.info.InfoServiceBase
        |
        +--org.edg.data.reptor.info.InfoServiceRGMA
All Implemented Interfaces:
InfoService

public final class InfoServiceRGMA
extends org.edg.data.reptor.info.InfoServiceBase
implements InfoService

Interface to get information about the Storage Elements and Computing Elements and other Services (like RLS, RMC, ROS) from R-GMA.

Version:
$Id: InfoServiceRGMA.java,v 1.18 2003/08/28 10:42:19 hst Exp $
Author:
Peter Kunszt, Heinz Stockinger

Field Summary
protected static int FILE
           
protected static java.lang.String LRC_SERVICE
           
protected  java.util.List m_CE
           
protected  Configuration m_config
           
protected  java.net.URI m_lrcURI
           
protected  int m_printinfo
           
protected  java.net.URI m_rliURI
           
protected  java.net.URI m_rmcURI
           
protected  java.net.URI m_rosURI
           
protected  java.util.List m_SE
          the list of storage elements and computing elements known to the VO
protected  java.util.HashMap m_storageResource
           
protected static java.lang.String RLI_SERVICE
           
protected static java.lang.String RMC_SERVICE
           
protected static java.lang.String ROS_SERVICE
           
protected static int SCREEN
           
 
Constructor Summary
InfoServiceRGMA(Configuration config)
           
 
Method Summary
protected  void addSE(java.lang.String name, java.lang.String seHost, int port, java.lang.String seID, java.net.URL endpoint)
           
protected  java.net.URI chooseLocalService(java.util.List urilist)
           
protected  java.lang.String getAccessPoint(java.lang.String seID)
           
protected  void getAllCEs(java.io.PrintStream out)
           
protected  void getAllSEs(java.io.PrintStream out)
           
 java.lang.String getCloseCE(java.lang.String SEHost)
          Return the close CE information based on an SE host
 java.lang.String getCloseSE(java.lang.String ceID)
          Return the close SE information based on an CE
 ComputingElementInfo getComputingElementInfoById(java.lang.String ceID)
          Return the CE-Info object based on a host name.
 java.net.URI getLocalReplicaCatalogLocation()
          return the single LRC instance for the system
 java.net.URI getLocalReplicaCatalogLocationVO(java.lang.String vo)
          return the single LRC instance for the system
 java.net.URI getMetadataCatalogLocation()
          return the single RMC instance for the system
 java.net.URI getMetadataCatalogLocationVO(java.lang.String vo)
          return the single RMC instance for the system
 java.lang.String[] getProtocols(java.lang.String name, java.lang.String seID)
          Get the list of protocols for a given SE.
 java.net.URI getRemoteReplicaCatalogLocation(java.lang.String seHost)
          return the (remote) LRC endpoint for this host.
 java.net.URI getReplicaLocationIndexLocation()
          return the single RLI instance for the system
 java.net.URI getReplicaLocationIndexLocationVO(java.lang.String vo)
          return the single RLI instance for the system
 java.net.URI getReplicaOptimizationLocation()
          return the single ROS instance for the system
 java.net.URI getReplicaOptimizationLocationVO(java.lang.String vo)
          return the single ROS instance for the system
 java.util.ArrayList getSEList()
          return all SE names
protected  java.net.URI getServiceURI(java.lang.String service, java.lang.String vo)
           
protected  java.util.List getServiceVOs()
           
 StorageElementInfo getStorageElementInfoByHost(java.lang.String host)
          Return the SE-Info object based on a host name.
 StorageResource getStorageResourceByHost(java.lang.String seHost)
          Return the storage resource associated with a given host.
protected  java.util.List getVOS(java.lang.String seID)
           
 boolean haveCE(java.lang.String ceID)
          Check whether a given CE is in our list
 boolean haveSE(java.lang.String seHost)
          Check whether a given host is in our list of SEs
protected  boolean lookupCE(java.lang.String id)
           
protected  boolean lookupSE(java.lang.String seHost)
           
 void printInfo(java.io.PrintStream out)
          Print the information used by the replica manager, as obtained from the info service specified by the configuration file, to the given stream.
 void printInfoForStub(java.io.PrintStream out)
          Just like printInfo, but print it in a format that can be reused by the InfoServiceStub object as input file.
protected  java.lang.String replaceColon(java.lang.String ceHost)
           
protected  java.lang.String retrieveCloseCE(java.lang.String SEHost)
           
protected  java.lang.String[] toStringArray(java.util.List l)
          convert List to String[]
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.edg.data.reptor.info.InfoService
getCloseCE, getCloseSE, getComputingElementInfoById, getLocalReplicaCatalogLocation, getMetadataCatalogLocation, getRemoteReplicaCatalogLocation, getReplicaLocationIndexLocation, getReplicaOptimizationLocation, getStorageElementInfoByHost, getStorageResourceByHost, haveCE, haveSE, printInfo, printInfoForStub
 

Field Detail

m_config

protected Configuration m_config

m_lrcURI

protected java.net.URI m_lrcURI

m_rosURI

protected java.net.URI m_rosURI

m_rmcURI

protected java.net.URI m_rmcURI

m_rliURI

protected java.net.URI m_rliURI

m_storageResource

protected java.util.HashMap m_storageResource

m_SE

protected java.util.List m_SE
the list of storage elements and computing elements known to the VO


m_CE

protected java.util.List m_CE

LRC_SERVICE

protected static java.lang.String LRC_SERVICE

RMC_SERVICE

protected static java.lang.String RMC_SERVICE

ROS_SERVICE

protected static java.lang.String ROS_SERVICE

RLI_SERVICE

protected static java.lang.String RLI_SERVICE

m_printinfo

protected int m_printinfo

SCREEN

protected static int SCREEN

FILE

protected static int FILE
Constructor Detail

InfoServiceRGMA

public InfoServiceRGMA(Configuration config)
Method Detail

retrieveCloseCE

protected java.lang.String retrieveCloseCE(java.lang.String SEHost)
                                    throws InfoServiceException
Specified by:
retrieveCloseCE in class org.edg.data.reptor.info.InfoServiceBase
InfoServiceException

getAccessPoint

protected java.lang.String getAccessPoint(java.lang.String seID)
                                   throws InfoServiceException
Specified by:
getAccessPoint in class org.edg.data.reptor.info.InfoServiceBase
InfoServiceException

getAllSEs

protected void getAllSEs(java.io.PrintStream out)
                  throws InfoServiceException
Specified by:
getAllSEs in class org.edg.data.reptor.info.InfoServiceBase
InfoServiceException

getSEList

public java.util.ArrayList getSEList()
                              throws InfoServiceException
Description copied from interface: InfoService
return all SE names

Specified by:
getSEList in interface InfoService
Returns:
ArrayList array of all SEs (Strings)
InfoServiceException

getAllCEs

protected void getAllCEs(java.io.PrintStream out)
                  throws InfoServiceException
Specified by:
getAllCEs in class org.edg.data.reptor.info.InfoServiceBase
InfoServiceException

getServiceURI

protected java.net.URI getServiceURI(java.lang.String service,
                                     java.lang.String vo)
                              throws InfoServiceException
Specified by:
getServiceURI in class org.edg.data.reptor.info.InfoServiceBase
InfoServiceException

getProtocols

public java.lang.String[] getProtocols(java.lang.String name,
                                       java.lang.String seID)
                                throws InfoServiceException
Get the list of protocols for a given SE.

Specified by:
getProtocols in interface InfoService
Specified by:
getProtocols in class org.edg.data.reptor.info.InfoServiceBase
Parameters:
seID - usually the SE hostname
Returns:
ArrayList of all supported protocol on the SE
InfoServiceException

getVOS

protected java.util.List getVOS(java.lang.String seID)
                         throws InfoServiceException
Specified by:
getVOS in class org.edg.data.reptor.info.InfoServiceBase
InfoServiceException

lookupSE

protected boolean lookupSE(java.lang.String seHost)
                    throws InfoServiceException
Specified by:
lookupSE in class org.edg.data.reptor.info.InfoServiceBase
InfoServiceException

lookupCE

protected boolean lookupCE(java.lang.String id)
                    throws InfoServiceException
Specified by:
lookupCE in class org.edg.data.reptor.info.InfoServiceBase
InfoServiceException

getServiceVOs

protected java.util.List getServiceVOs()
                                throws InfoServiceException
Specified by:
getServiceVOs in class org.edg.data.reptor.info.InfoServiceBase
InfoServiceException

haveSE

public boolean haveSE(java.lang.String seHost)
               throws InfoServiceException
Check whether a given host is in our list of SEs

Returns:
true if it is in the list false if not found
InfoServiceException

haveCE

public boolean haveCE(java.lang.String ceID)
               throws InfoServiceException
Check whether a given CE is in our list

Returns:
true if it is in the list false if not found
InfoServiceException

getCloseCE

public java.lang.String getCloseCE(java.lang.String SEHost)
                            throws ConfigurationException,
                                   InfoServiceException
Return the close CE information based on an SE host

Parameters:
SEHost -
Returns:
ComputingElementInfo object
Throws:
ConfigurationException
InfoServiceException

getCloseSE

public java.lang.String getCloseSE(java.lang.String ceID)
                            throws ConfigurationException,
                                   InfoServiceException
Return the close SE information based on an CE

Parameters:
ceID -
Returns:
ComputingElementInfo object
Throws:
ConfigurationException
InfoServiceException

getLocalReplicaCatalogLocation

public java.net.URI getLocalReplicaCatalogLocation()
                                            throws InfoServiceException
return the single LRC instance for the system

InfoServiceException

getMetadataCatalogLocation

public java.net.URI getMetadataCatalogLocation()
                                        throws InfoServiceException
return the single RMC instance for the system

InfoServiceException

getReplicaOptimizationLocation

public java.net.URI getReplicaOptimizationLocation()
                                            throws InfoServiceException
return the single ROS instance for the system

InfoServiceException

getReplicaLocationIndexLocation

public java.net.URI getReplicaLocationIndexLocation()
                                             throws InfoServiceException
return the single RLI instance for the system

InfoServiceException

getLocalReplicaCatalogLocationVO

public java.net.URI getLocalReplicaCatalogLocationVO(java.lang.String vo)
                                              throws InfoServiceException
return the single LRC instance for the system

InfoServiceException

getMetadataCatalogLocationVO

public java.net.URI getMetadataCatalogLocationVO(java.lang.String vo)
                                          throws InfoServiceException
return the single RMC instance for the system

InfoServiceException

getReplicaOptimizationLocationVO

public java.net.URI getReplicaOptimizationLocationVO(java.lang.String vo)
                                              throws InfoServiceException
return the single ROS instance for the system

InfoServiceException

getReplicaLocationIndexLocationVO

public java.net.URI getReplicaLocationIndexLocationVO(java.lang.String vo)
                                               throws InfoServiceException
return the single RLI instance for the system

InfoServiceException

getStorageElementInfoByHost

public StorageElementInfo getStorageElementInfoByHost(java.lang.String host)
                                               throws InfoServiceException
Return the SE-Info object based on a host name.

Parameters:
host - the host
Returns:
the StorageElementInfo object if found or null if not found.
InfoServiceException
See Also:
StorageElementInfo

getComputingElementInfoById

public ComputingElementInfo getComputingElementInfoById(java.lang.String ceID)
                                                 throws InfoServiceException
Return the CE-Info object based on a host name.

Parameters:
ceID - the ce id
Returns:
the ComputingElementInfo object if found or null if the id is not found to be an CE.
InfoServiceException
See Also:
ComputingElementInfo

getStorageResourceByHost

public StorageResource getStorageResourceByHost(java.lang.String seHost)
                                         throws InfoServiceException,
                                                StorageResourceException
InfoServiceException
StorageResourceException

getRemoteReplicaCatalogLocation

public java.net.URI getRemoteReplicaCatalogLocation(java.lang.String seHost)
                                             throws InfoServiceException
InfoServiceException

printInfo

public void printInfo(java.io.PrintStream out)
               throws InfoServiceException,
                      ConfigurationException
Print the information used by the replica manager, as obtained from the info service specified by the configuration file, to the given stream.

Parameters:
out - The PrintStream object to print to.
InfoServiceException
ConfigurationException

printInfoForStub

public void printInfoForStub(java.io.PrintStream out)
                      throws InfoServiceException,
                             ConfigurationException
Just like printInfo, but print it in a format that can be reused by the InfoServiceStub object as input file.

Parameters:
out - the PrintStream to print to
InfoServiceException
ConfigurationException

addSE

protected void addSE(java.lang.String name,
                     java.lang.String seHost,
                     int port,
                     java.lang.String seID,
                     java.net.URL endpoint)
              throws java.net.MalformedURLException,
                     InfoServiceException
java.net.MalformedURLException
InfoServiceException

toStringArray

protected java.lang.String[] toStringArray(java.util.List l)
convert List to String[]

Parameters:
l -
Returns:
the list, as a string array

chooseLocalService

protected java.net.URI chooseLocalService(java.util.List urilist)
                                   throws InfoServiceException,
                                          ConfigurationException
InfoServiceException
ConfigurationException

replaceColon

protected java.lang.String replaceColon(java.lang.String ceHost)