org.edg.data.reptor.info
Class InfoServiceRGMA

java.lang.Object
  extended byorg.edg.data.reptor.info.InfoServiceBase
      extended byorg.edg.data.reptor.info.InfoServiceRGMA
All Implemented Interfaces:
InfoService

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

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.28 2004/04/08 12:14:21 jamesc 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  int m_printinfo
           
protected  java.util.List m_SE
          the list of storage elements and computing elements known to the VO
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  java.net.URI chooseLocalService(java.util.List urilist)
           
protected  java.lang.String closeCEForSEHost(java.lang.String SEHost)
           
protected  java.lang.String getAccessPoint(java.lang.String seID)
          Get the AccessPoint (i.e.
 java.util.List getCEList()
          return all CE names
protected  java.util.Iterator getCEVOs(java.lang.String ceID)
           
 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
protected  java.util.Iterator getCloseSEs(java.lang.String ceID)
           
 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
protected  java.lang.String getLRCBySEId(java.lang.String id)
           
 java.net.URI getMetadataCatalogLocation()
          return the single RMC instance for the system
protected  java.lang.String getNameForComputingElement(java.lang.String id)
           
 java.util.Iterator 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 SE identifyer (host).
 java.net.URI getReplicaLocationIndexLocation()
          return the single RLI instance for the system
 java.net.URI getReplicaOptimizationLocation()
          return the single ROS instance for the system
 java.util.List getSEList()
          return all SE names
protected  java.net.URI getServiceURI(java.lang.String service, java.lang.String vo)
           
protected  java.util.Iterator getServiceVOs()
           
protected  java.net.URL getSRMEndpointByHost(boolean secure, java.lang.String host, java.lang.String type)
           
 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 the information System
 boolean haveSE(java.lang.String seHost)
          Check whether a given host is in our list of SEs
protected  org.edg.data.reptor.info.InfoServiceBase.SEInfo infoForSeHost(java.lang.String seHost)
          given an SE hostname, return the information on it
protected  java.net.URL initEndpointURL(java.util.List endpoints, java.lang.String host, boolean secure)
          The endpoint is initialized for the SRM.
protected  org.edg.data.reptor.info.InfoServiceBase.SEInfo makeSeInfo(java.lang.String name)
           
 void printInfo(InfoPrinter p)
          Just like printInfo, but print it in a format that can be reused by the InfoServiceStub object as input file.
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
 

Field Detail

m_config

protected Configuration m_config

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

getRemoteReplicaCatalogLocation

public java.net.URI getRemoteReplicaCatalogLocation(java.lang.String seHost)
                                             throws InfoServiceException
Description copied from interface: InfoService
return the (remote) LRC endpoint for this SE identifyer (host).

Throws:
InfoServiceException

closeCEForSEHost

protected java.lang.String closeCEForSEHost(java.lang.String SEHost)
                                     throws InfoServiceException
Throws:
InfoServiceException

getAccessPoint

protected java.lang.String getAccessPoint(java.lang.String seID)
Description copied from class: org.edg.data.reptor.info.InfoServiceBase
Get the AccessPoint (i.e. GlueCESEBind) for an SE.

Parameters:
seID - the Se ID
Returns:
the accessPoint, or "" if none is found in the information system

getSEList

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

Returns:
list of all SEs (Strings)
Throws:
InfoServiceException

getCEList

public java.util.List getCEList()
                         throws InfoServiceException
Description copied from interface: InfoService
return all CE names

Returns:
list of all SEs (Strings)
Throws:
InfoServiceException

getServiceURI

protected java.net.URI getServiceURI(java.lang.String service,
                                     java.lang.String vo)
                              throws InfoServiceException
Throws:
InfoServiceException

getSRMEndpointByHost

protected java.net.URL getSRMEndpointByHost(boolean secure,
                                            java.lang.String host,
                                            java.lang.String type)
                                     throws InfoServiceException
Throws:
InfoServiceException

getProtocols

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

Parameters:
seID - usually the SE hostname
Returns:
ArrayList of all supported protocol on the SE
Throws:
InfoServiceException

getVOS

protected java.util.List getVOS(java.lang.String seID)
                         throws InfoServiceException
Throws:
InfoServiceException

infoForSeHost

protected org.edg.data.reptor.info.InfoServiceBase.SEInfo infoForSeHost(java.lang.String seHost)
                                                                 throws InfoServiceException
Description copied from class: org.edg.data.reptor.info.InfoServiceBase
given an SE hostname, return the information on it

Parameters:
seHost - the hostname
Returns:
the Info, or null if there is no information for the host in hte info system
Throws:
InfoServiceException - if a problem occurs getting the information

getNameForComputingElement

protected java.lang.String getNameForComputingElement(java.lang.String id)
                                               throws InfoServiceException
Throws:
InfoServiceException

getLRCBySEId

protected java.lang.String getLRCBySEId(java.lang.String id)
                                 throws InfoServiceException
Throws:
InfoServiceException

getCloseSEs

protected java.util.Iterator getCloseSEs(java.lang.String ceID)
                                  throws InfoServiceException
Throws:
InfoServiceException

getCEVOs

protected java.util.Iterator getCEVOs(java.lang.String ceID)
                               throws InfoServiceException
Throws:
InfoServiceException

getServiceVOs

protected java.util.Iterator getServiceVOs()
                                    throws InfoServiceException
Throws:
InfoServiceException

haveSE

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

Specified by:
haveSE in interface InfoService
Returns:
true if it is in the list false if not found
Throws:
InfoServiceException

haveCE

public boolean haveCE(java.lang.String ceID)
               throws InfoServiceException
Check whether a given CE is in the information System

Specified by:
haveCE in interface InfoService
Parameters:
ceID - the ID of the CE to check for
Returns:
true if the CE exists
Throws:
InfoServiceException - if a problem occurs contacing the information system

getCloseCE

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

Specified by:
getCloseCE in interface InfoService
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

Specified by:
getCloseSE in interface InfoService
Parameters:
ceID -
Returns:
ComputingElementInfo object
Throws:
ConfigurationException
InfoServiceException

getLocalReplicaCatalogLocation

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

Specified by:
getLocalReplicaCatalogLocation in interface InfoService
Throws:
InfoServiceException

getMetadataCatalogLocation

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

Specified by:
getMetadataCatalogLocation in interface InfoService
Throws:
InfoServiceException

getReplicaOptimizationLocation

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

Specified by:
getReplicaOptimizationLocation in interface InfoService
Throws:
InfoServiceException

getReplicaLocationIndexLocation

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

Specified by:
getReplicaLocationIndexLocation in interface InfoService
Throws:
InfoServiceException

getStorageElementInfoByHost

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

Specified by:
getStorageElementInfoByHost in interface InfoService
Parameters:
host - the host
Returns:
the StorageElementInfo object if found or null if not found.
Throws:
InfoServiceException
See Also:
StorageElementInfo

getComputingElementInfoById

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

Specified by:
getComputingElementInfoById in interface InfoService
Parameters:
ceID - the ce id
Returns:
the ComputingElementInfo object if found or null if the id is not found to be an CE.
Throws:
InfoServiceException
See Also:
ComputingElementInfo

getStorageResourceByHost

public StorageResource getStorageResourceByHost(java.lang.String seHost)
                                         throws InfoServiceException,
                                                StorageResourceException
Description copied from interface: InfoService
Return the storage resource associated with a given host.

Specified by:
getStorageResourceByHost in interface InfoService
Parameters:
seHost -
Returns:
storage resource.
Throws:
InfoServiceException
StorageResourceException

printInfo

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

Specified by:
printInfo in interface InfoService
Parameters:
p - the PrintStream to print to
Throws:
InfoServiceException
ConfigurationException

makeSeInfo

protected org.edg.data.reptor.info.InfoServiceBase.SEInfo makeSeInfo(java.lang.String name)

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
Throws:
InfoServiceException
ConfigurationException

initEndpointURL

protected java.net.URL initEndpointURL(java.util.List endpoints,
                                       java.lang.String host,
                                       boolean secure)
                                throws InfoServiceException
The endpoint is initialized for the SRM. If it is httpg, the socket factory is initialized for GSI, otherwise for https for SSL. otherwise no security is used, presumably.

Parameters:
endpoints -
Returns:
URL to be used with the SRM services.
Throws:
InfoServiceException