org.edg.data.reptor
Interface ReplicaManager

All Known Implementing Classes:
ReplicaManagerImpl

public interface ReplicaManager

The ReplicaManager interface defines all methods that can be called by a client using the edg-replica-manager Reptor. This is the primary API that should be used by all client applications.

Version:
$Id: ReplicaManager.java,v 1.29 2003/09/15 15:19:20 pkunszt Exp $
Author:
Peter Kunszt, Heinz Stockinger, Gavin McCance

Method Summary
 void addAlias(java.net.URI guid, java.net.URI lfn)
          Add an alias LFN to a known GUID.
 java.net.URI copyAndRegisterFile(java.net.URI source, java.net.URI dest, java.net.URI logicalName, java.lang.String protocol, int nstreams)
          This method performs the task of copying a file into grid-aware storage and registering the copy in the Replica Catalog as an atomic operation.
 void copyFile(java.net.URI source, java.net.URI dest, java.lang.String protocol, int nstreams, boolean force)
          Copies a physical file from source to destination using the specified transport mechanism.
 void deleteFile(java.net.URI file, java.lang.String seHost, boolean all_available)
          Delete a file from storage and unregister it.
 org.edg.data.ros.AccessCost[] getAccessCost(java.net.URI[] logicalName, java.lang.String[] ces, java.lang.String[] protocol)
          Calculates the expected cost of accessing all the files specified by logicalName from each Computing Element host specified by ceHosts.
 java.net.URI getBestFile(java.net.URI logicalName, java.lang.String seHost, java.lang.String protocol, java.lang.String turlProtocol, int nstreams)
          Return the storage file name (SURL) of the best file in terms of network latencies.
 java.net.URI getTurl(java.net.URI surl, java.lang.String protocol)
          Retrieve the Transfer URL (TURL) for a given Storage URL (SURL), using the given protocol.
 java.net.URI listBestFile(java.net.URI logicalName, java.lang.String seHost)
          Return the 'best' replica for a given logical file identifier.
 java.net.URI listGUID(java.net.URI file)
          Returns the GUID of the given LFN or SURL.
 java.util.Set listLocalReplicas(java.net.URI file)
          Returns the set of all local replicas of the file name that may be an LFN, GUID or SURL.
 java.util.Set listReplicas(java.net.URI file)
          Returns the Set of all known replicas of the file name that may be an LFN, GUID or SURL.
 java.net.URI registerEntry(java.net.URI file, java.net.URI logicalName)
          Deprecated.  
 java.net.URI registerFile(java.net.URI file, java.net.URI logicalName)
          Register a file in the Replica Catalog that is already stored on a Storage Element.
 java.net.URI registerGUID(java.net.URI surl, java.net.URI guid)
          Register a file in the Replica Catalog with a known GUID.
 void removeAlias(java.net.URI guid, java.net.URI lfn)
          Remove an alias LFN from a known GUID.
 java.net.URI replicateFile(java.net.URI source, java.net.URI dest, java.lang.String protocol, int nstreams)
          This method performs the task of replicating a file between grid-aware stores and registering the replica in the Replica Catalog as an atomic operation.
 void unregisterEntry(java.net.URI file, java.net.URI logicalName)
          Deprecated.  
 void unregisterFile(java.net.URI surl, java.net.URI guid)
          Unregister a file from the Replica Catalog.
 

Method Detail

registerEntry

public java.net.URI registerEntry(java.net.URI file,
                                  java.net.URI logicalName)
                           throws CatalogCommunicationException,
                                  InvalidInfoException,
                                  java.io.FileNotFoundException,
                                  AlreadyRegisteredException,
                                  InvalidFileNameException,
                                  SurlExistsException,
                                  LfnExistsException,
                                  InfoServiceException,
                                  StorageResourceException,
                                  org.edg.data.util.InvalidFileTypeException
Deprecated.  

Same as registerFile.

CatalogCommunicationException
InvalidInfoException
java.io.FileNotFoundException
AlreadyRegisteredException
InvalidFileNameException
SurlExistsException
LfnExistsException
InfoServiceException
StorageResourceException
org.edg.data.util.InvalidFileTypeException

registerFile

public java.net.URI registerFile(java.net.URI file,
                                 java.net.URI logicalName)
                          throws InvalidFileNameException,
                                 java.io.FileNotFoundException,
                                 InfoServiceException,
                                 CatalogCommunicationException,
                                 AlreadyRegisteredException,
                                 LfnExistsException,
                                 InvalidInfoException,
                                 SurlExistsException,
                                 StorageResourceException,
                                 org.edg.data.util.InvalidFileTypeException
Register a file in the Replica Catalog that is already stored on a Storage Element. It takes two arguments: source file and logical name. The source file needs to be a qualified storage file name URI, following the rule srm://storage.element.host/vopath/file.name The logical name is optional, it may declare a logical identifier that can be used later to look up any instance of the file. The method returns the GUID, the Grid Unique IDentifier of the file. The detailed semantics are:

This method does not include any data movement (i.e. the storage file is not copied) and assumes that the storage file is already located at a known Storage Element.

Parameters:
file - the file. It must be a valid Storage File Name, i.e. the host part of the given URI needs to be a recognized Storage Element.
logicalName - the logical name to be used in the catalog to find the file again. If this parameter is null, an automatic name is generated and used.
Returns:
The GUID of the source file that this entry was registered with.
Throws:
InvalidFileNameException - if file is not valid or the SE is not found
java.io.FileNotFoundException - if file does not exist
InfoServiceException
CatalogCommunicationException
AlreadyRegisteredException
LfnExistsException
InvalidInfoException
SurlExistsException
StorageResourceException
org.edg.data.util.InvalidFileTypeException

registerGUID

public java.net.URI registerGUID(java.net.URI surl,
                                 java.net.URI guid)
                          throws InvalidFileNameException,
                                 java.io.FileNotFoundException,
                                 InfoServiceException,
                                 CatalogCommunicationException,
                                 SurlExistsException,
                                 InvalidInfoException,
                                 StorageResourceException,
                                 org.edg.data.util.InvalidFileTypeException
Register a file in the Replica Catalog with a known GUID. It takes two arguments: source file and GUID. The source file needs to be a qualified storage file name URI, following the rule srm://storage.element.host/vopath/file.name The GUID is the GUID that this file should be registered with for the case if the file was copied by other means. (TruckFTP use case). While there is only one centralized catalog, there is no need for this method, but if the catalogs are not centralized, this method can be used to register a file with a known GUID. Be careful, if the GUID corresponds to a wrong file in the remote (probably unattainable) catalogs then once the connection is established, the distributed catalog will inconsistent data. This method can also be used to register a second replica in the same LRC, usually this does not happen.

Parameters:
surl - the file. It must be a valid Storage File Name, i.e. the host part of the given URI needs to be a recognized Storage Element.
guid - the GUID to be used in the catalog to find the file again.
Returns:
The GUID, just like registerFile.
Throws:
InvalidFileNameException - if file is not valid or the SE is not found
java.io.FileNotFoundException - if file does not exist
InfoServiceException
CatalogCommunicationException
SurlExistsException
InvalidInfoException
StorageResourceException
org.edg.data.util.InvalidFileTypeException

getTurl

public java.net.URI getTurl(java.net.URI surl,
                            java.lang.String protocol)
                     throws InvalidFileNameException,
                            java.io.FileNotFoundException,
                            InfoServiceException,
                            InvalidInfoException,
                            StorageResourceException,
                            FileHandleException,
                            org.edg.data.util.InvalidFileTypeException
Retrieve the Transfer URL (TURL) for a given Storage URL (SURL), using the given protocol. If the file cannot be accessed using the specified protocol, null is returned. On the SE or SRM, this command will cause the file to be cached.

Parameters:
surl - the file. It must be a valid Storage File Name, i.e. the host part of the given URI needs to be a recognized Storage Element.
protocol - The protocol for the TURL (either 'file', 'gsiftp'/'gridftp' or 'rfio'.
Returns:
the TURL
Throws:
InvalidFileNameException - if file is not valid or the SE is not found
java.io.FileNotFoundException - if the file does not exist.
InfoServiceException
InvalidInfoException
StorageResourceException
FileHandleException
org.edg.data.util.InvalidFileTypeException

addAlias

public void addAlias(java.net.URI guid,
                     java.net.URI lfn)
              throws CatalogCommunicationException,
                     org.edg.data.util.InvalidFileTypeException,
                     GUIDDoesNotExistException,
                     LfnExistsException
Add an alias LFN to a known GUID.

Parameters:
guid - GUID to add new alias for
lfn - the new LFN
CatalogCommunicationException
org.edg.data.util.InvalidFileTypeException
GUIDDoesNotExistException
LfnExistsException

unregisterEntry

public void unregisterEntry(java.net.URI file,
                            java.net.URI logicalName)
                     throws CatalogCommunicationException,
                            java.io.FileNotFoundException,
                            InvalidFileNameException,
                            GUIDDoesNotExistException,
                            org.edg.data.util.InvalidFileTypeException
Deprecated.  

Same as unregisterFile.

CatalogCommunicationException
java.io.FileNotFoundException
InvalidFileNameException
GUIDDoesNotExistException
org.edg.data.util.InvalidFileTypeException

unregisterFile

public void unregisterFile(java.net.URI surl,
                           java.net.URI guid)
                    throws InvalidFileNameException,
                           CatalogCommunicationException,
                           GUIDDoesNotExistException,
                           java.io.FileNotFoundException,
                           org.edg.data.util.InvalidFileTypeException
Unregister a file from the Replica Catalog. There are two arguments: the actual fully qualified storage file name URI and the GUID under which it was registered. If the GUID is given and no more SURLs are registered with the same GUID, the logical names will still be recognized by the replica manager, but no replicas will be found. Use removeAlias to delete unneeded LFNs. If the file should be physically removed as well, use deleteFile method instead.

This method does not include any data deletion (i.e. the storage file is not removed).

Parameters:
surl - the storage file to unregister. It must be a valid Storage File Name, i.e. the host part of the given URI needs to be a recognized Storage Element.
guid - the GUID
Throws:
InvalidFileNameException - if file is not valid or the SE is not found
CatalogCommunicationException - if there was an error in contacting the LRC
GUIDDoesNotExistException - if the GUID was not found in the catalog
java.io.FileNotFoundException - if file does not exist
org.edg.data.util.InvalidFileTypeException

removeAlias

public void removeAlias(java.net.URI guid,
                        java.net.URI lfn)
                 throws CatalogCommunicationException,
                        org.edg.data.util.InvalidFileTypeException,
                        GUIDDoesNotExistException
Remove an alias LFN from a known GUID.

Parameters:
guid - GUID to remove the alias from
lfn - the LFN
CatalogCommunicationException
org.edg.data.util.InvalidFileTypeException
GUIDDoesNotExistException

copyFile

public void copyFile(java.net.URI source,
                     java.net.URI dest,
                     java.lang.String protocol,
                     int nstreams,
                     boolean force)
              throws CatalogCommunicationException,
                     FileHandleException,
                     InvalidFileNameException,
                     java.io.FileNotFoundException,
                     InfoServiceException,
                     ConfigurationException,
                     FileCopierException,
                     LfnDoesNotExistException,
                     org.edg.data.util.InvalidFileTypeException
Copies a physical file from source to destination using the specified transport mechanism. This action does not involve any updates to the replica catalogs as the destination cannot be a grid-aware store, in order to avoid catalog corruption. copyAndRegisterFile needs to be used for that purpose, i.e. to bring a file into the grid. The destination does not accept GUIDs, LFNs or SURLs. As said, for those cases copyAndRegisterFile or replicateFile needs to be used. It provides all the capability of globus-url-copy and more, accepting also GUIDs, LFNs and SURLs as the source file. Since the destination is not on grid-storage, the destination file will not be registered in the catalog. Example: To get a local copy of a grid file, the source file can be specified as a GUID or LFN and the destination file as a local file. The result will be that the file will be copied 'out of the grid' to the local file. Local file URIs need to have the 'file' scheme.

Parameters:
source - the source file. source may be one of the following:
  • A GUID - the 'best' SE will be located to find the cheapest replica to copy from
  • An LFN - the 'best' replica will be located as for the GUID
  • A valid SURL URI, having the SE as its host name
  • A valid transport URI, with a real protocol as its schema. Currently http, https, ftp and gsiftp are supported.
  • A local file (specified with the 'file' schema).
dest - the physical destination file. Must be one of the following:
  • A local file
  • A transport URI with a valid protocol. The same protocols are supported as for the source.
protocol - the protocol to be used. This parameter is only considered if the source is specified using an SURL, LFN or GUID. If it's not set (i.e. null), the default protocol is used as specified in the configuration file.
nstreams - the number of streams to be used (if the protocol supports multiple streams, otherwise this parameter has no effect). If it's set <= 0 the default number of streams is used as specified in the configuration file.
force - is the flag that specifies whether the destination should be overwritten or not. If false, the destination will not be overwritten if it exists, but an error will be thrown.
Throws:
InvalidFileNameException - if the source or destination file are invalid
java.io.FileNotFoundException - if the source cannot be found
CatalogCommunicationException - if the RLS or RMC could not be contacted
ConfigurationException - if there is a configuration problem
InfoServiceException - if the info service cannot be contacted or has an error
FileHandleException - if there is a problem with source or destination
FileCopierException - if the copy operation fails
LfnDoesNotExistException
org.edg.data.util.InvalidFileTypeException
See Also:
ReplicaManagerImpl.copyAndRegisterFile(java.net.URI, java.net.URI, java.net.URI, java.lang.String, int)

copyAndRegisterFile

public java.net.URI copyAndRegisterFile(java.net.URI source,
                                        java.net.URI dest,
                                        java.net.URI logicalName,
                                        java.lang.String protocol,
                                        int nstreams)
                                 throws InvalidFileNameException,
                                        InfoServiceException,
                                        ConfigurationException,
                                        FileHandleException,
                                        FileCopierException,
                                        CatalogCommunicationException,
                                        DestinationExistsException,
                                        LfnExistsException,
                                        java.io.FileNotFoundException,
                                        StorageResourceException,
                                        org.edg.data.util.InvalidFileTypeException
This method performs the task of copying a file into grid-aware storage and registering the copy in the Replica Catalog as an atomic operation. This is the preferred method to 'bring files into the grid'. The same could be done by issuing copyFile and registerFile in sequence, but since copyFile may not have an SE or SURL as its destination, the user would need to specify a valid transport file name (using gridftp for example) to a location that happens to be the proper location for the file and then register it using registerFile. That is much more error prone and cumbersome than this method. As a rule, copyFile should be used to copy files around to non-grid aware storage, or to simply copy files out of the grid (i.e. the source may be grid-aware but not the destination). registerFile should be used to register files that are already in the grid-aware store before it was made grid-aware or to register files that appear there through other means (like new data files). If the files that need to be put into the grid are not yet in their grid-aware location, copyAndRegisterFile is the most robust method to use.

Semantics

copyAndRegisterFile also handles all the possible failures if the registration should fail after the copy has taken place (i.e. the copied file is registered using another name or if that is not possible it is actually removed again). If the destination already exists, the operation fails. Re-registrations of existing data files are possible by issuing copyFile and registerFile in sequence as specified above, or by copying the file 'out' using copyFile and re-registering it again using this method but storing it with a different name. If users really want to do a re-registration resulting in having more than one GUID for the same data (of course not for the same file), it can be done this way but we knowingly make this operation difficult so that people don't have many GUIDs to the same data by mistake. Since only files on Storage Elements may be registered, destination must refer to a Storage Element just like for replicateFile. The difference to replicateFile is that the latter requires the source to be a valid grid file descriptor, i.e. either an LFN, GUID or other SURL, while copyAndRegisterFile does explicitly forbid such sources and accepts only non-grid files. For files already in the grid, replicateFile should be used. The method returns the GUID of the new entry.

Parameters:
source - the file to be registered. It must be accessible through this name using the specified protocol in the URI. The source may be:
  • A local file
  • A transport URI with a valid protocol schema.
dest - (optional) The physical destination file. dest may be specified in three different ways:
  • As a fully qualified storage file name (SURL). If this file already exists, the operation fails.
  • Only the host of the SE where the file should be stored, i.e. the URI was constructed just by giving it a host string, which will be stored in the URI path. The storage location will be determined automatically depending on the user's VO and a suitable file name will be chosen.
  • If no destination is specified at all (i.e. the argument is null, the 'closest' SE is located and the file is stored as in the previous case.
logicalName - (optional) The logical name to be used in the catalog to find the file again. If this parameter is null, only the GUID is used.
protocol - (optional) The protocol to be used (can be null in which case the default protocol for the given SE is used)
nstreams - (optional) The number of parallel streams to be used for the copy. If zero or less than zero, the default is used.
Returns:
The GUID of the registered file.
Throws:
java.io.FileNotFoundException - if source does not exist
DestinationExistsException - if destination already exists
FileCopierException - if the copy operation fails
InvalidFileNameException - if source or destination name is not valid
CatalogCommunicationException - if the catalogs to register the file cannot be contacted
LfnExistsException - if the LFN that the file should be registered with already exists
FileHandleException - if there is some problem with source or destination
ConfigurationException - if there is a configuration problem
InfoServiceException - if there is problem with the information services.
StorageResourceException
org.edg.data.util.InvalidFileTypeException
See Also:
ReplicaManagerImpl.replicateFile(java.net.URI, java.net.URI, java.lang.String, int), ReplicaManagerImpl.copyFile(java.net.URI, java.net.URI, java.lang.String, int, boolean), ReplicaManagerImpl.registerFile(java.net.URI, java.net.URI)

replicateFile

public java.net.URI replicateFile(java.net.URI source,
                                  java.net.URI dest,
                                  java.lang.String protocol,
                                  int nstreams)
                           throws java.io.FileNotFoundException,
                                  InvalidFileNameException,
                                  FileHandleException,
                                  FileCopierException,
                                  InfoServiceException,
                                  ConfigurationException,
                                  CatalogCommunicationException,
                                  GUIDDoesNotExistException,
                                  InvalidInfoException,
                                  StorageResourceException,
                                  IllegalArgumentException,
                                  SurlDoesNotExistException,
                                  LfnDoesNotExistException,
                                  org.edg.data.util.InvalidFileTypeException
This method performs the task of replicating a file between grid-aware stores and registering the replica in the Replica Catalog as an atomic operation. This is the preferred method to 'copy files around in the grid'. The difference to copyAndRegisterFile is that this operation only allows for GUID, LFN or SURL as the source file wheras copyAndRegisterFile explicitly forbids that. No new GUID is generated for the replica (hence the term).

Semantics

replicateFile also handles all the possible failures if the registration should fail after the copy has taken place. If the remote site already contains a replica, this operation returns successfully very quickly. Since replication can only be done between Storage Elements, both source and destination must refer to a Storage Element. The method returns the GUID of the entry upon success or throws an appropriate exception upon failure.

Parameters:
source - the file to be replicated. The source may be:
  • A GUID. The SE will be chosen automatically.
  • An LFN. The SE will be chosen automatically.
  • An SURL. The given SE will be used as the source for this file.
dest - The physical destination. dest may be specified in three different ways:
  • As a fully qualified storage file name (SURL). If this file already exists, the operation fails.
  • Only the host of the SE where the file should be stored, i.e. the URI was constructed just by giving it a host string, which will be stored in the URI path. The storage location will be determined automatically depending on the user's VO and a suitable file name will be chosen.
  • If no destination is specified at all (i.e. the argument is null, the 'closest' SE is located and the file is replicated to it as in the previous case (if it's not already available there).
protocol - (optional) The protocol to be used (can be null in which case the default protocol for the given destination SE is used)
nstreams - (optional) The number of parallel streams to be used for the copy. If zero or less than zero, the default is used.
Returns:
The SURL of the new replica.
Throws:
java.io.FileNotFoundException - if source does not exist
GUIDDoesNotExistException - if source is in the catalog but has no GUID - this means the catalog is corrupted
InvalidFileNameException - if source or destination is not valid
FileHandleException - if there is a problem with source or destination
FileCopierException - if the copy operation fails.
InfoServiceException
ConfigurationException
CatalogCommunicationException
InvalidInfoException
StorageResourceException
IllegalArgumentException
SurlDoesNotExistException
LfnDoesNotExistException
org.edg.data.util.InvalidFileTypeException
See Also:
ReplicaManagerImpl.copyAndRegisterFile(java.net.URI, java.net.URI, java.net.URI, java.lang.String, int)

deleteFile

public void deleteFile(java.net.URI file,
                       java.lang.String seHost,
                       boolean all_available)
                throws IllegalArgumentException,
                       InfoServiceException,
                       ConfigurationException,
                       InvalidFileNameException,
                       CatalogCommunicationException,
                       GUIDDoesNotExistException,
                       FileHandleException,
                       SurlDoesNotExistException,
                       LfnDoesNotExistException,
                       org.edg.data.util.InvalidFileTypeException
Delete a file from storage and unregister it. It may be a single replica or all instances. If there is an entry in the catalog but no actual physical file on the storage, only the catalog entry is removed.

Parameters:
file - GUID or SURL of the file to be deleted.
seHost - if GUID is given, this indicates from which SE the replica should be removed. It needn't be given for an SURL.
all_available - boolean flag indicating whether all available instances should be removed (only if file is a GUID). This is best efffort.
Throws:
GUIDDoesNotExistException - if the given file is not a valid GUID or has no GUID
InvalidFileNameException - if file is not a valid SURL or GUID
FileHandleException - if there is a problem with contacting the SE
ConfigurationException - if there is a problem with the configuration
CatalogCommunicationException - if there is a problem with the communication with LRC or RMC
IllegalArgumentException
InfoServiceException
SurlDoesNotExistException
LfnDoesNotExistException
org.edg.data.util.InvalidFileTypeException

listReplicas

public java.util.Set listReplicas(java.net.URI file)
                           throws CatalogCommunicationException,
                                  java.io.FileNotFoundException,
                                  InvalidFileNameException,
                                  IllegalArgumentException,
                                  GUIDDoesNotExistException,
                                  SurlDoesNotExistException,
                                  LfnDoesNotExistException,
                                  org.edg.data.util.InvalidFileTypeException
Returns the Set of all known replicas of the file name that may be an LFN, GUID or SURL.

Parameters:
file - LFN, GUID or SURL of the file to get
Returns:
Set of SURL URIs.
CatalogCommunicationException
java.io.FileNotFoundException
InvalidFileNameException
IllegalArgumentException
GUIDDoesNotExistException
SurlDoesNotExistException
LfnDoesNotExistException
org.edg.data.util.InvalidFileTypeException

listLocalReplicas

public java.util.Set listLocalReplicas(java.net.URI file)
                                throws CatalogCommunicationException,
                                       java.io.FileNotFoundException,
                                       InvalidFileNameException,
                                       IllegalArgumentException,
                                       GUIDDoesNotExistException,
                                       SurlDoesNotExistException,
                                       LfnDoesNotExistException,
                                       org.edg.data.util.InvalidFileTypeException
Returns the set of all local replicas of the file name that may be an LFN, GUID or SURL. Only the LRC is searched.

Parameters:
file - LFN, GUID or SURL of the file to get
Returns:
Set of SURL URIs.
CatalogCommunicationException
java.io.FileNotFoundException
InvalidFileNameException
IllegalArgumentException
GUIDDoesNotExistException
SurlDoesNotExistException
LfnDoesNotExistException
org.edg.data.util.InvalidFileTypeException

listGUID

public java.net.URI listGUID(java.net.URI file)
                      throws InvalidFileNameException,
                             CatalogCommunicationException,
                             java.io.FileNotFoundException,
                             GUIDDoesNotExistException,
                             IllegalArgumentException,
                             SurlDoesNotExistException,
                             LfnDoesNotExistException,
                             org.edg.data.util.InvalidFileTypeException
Returns the GUID of the given LFN or SURL.

Parameters:
file - LFN or SURL of the file to get the GUID of.
Returns:
GUID.
InvalidFileNameException
CatalogCommunicationException
java.io.FileNotFoundException
GUIDDoesNotExistException
IllegalArgumentException
SurlDoesNotExistException
LfnDoesNotExistException
org.edg.data.util.InvalidFileTypeException

listBestFile

public java.net.URI listBestFile(java.net.URI logicalName,
                                 java.lang.String seHost)
                          throws InfoServiceException,
                                 ConfigurationException,
                                 CatalogCommunicationException,
                                 InvalidFileNameException,
                                 IllegalArgumentException,
                                 LfnDoesNotExistException,
                                 org.edg.data.util.InvalidFileTypeException
Return the 'best' replica for a given logical file identifier. Based on network and storage metrics the replica that is cheapest to access from a given Storage Element is returned. If the file is already on that storage, of course that is the one to be returned. getBestFile is identical to listBestFile except that it will trigger replication to the specified destination SE if the file is not there yet.

Parameters:
logicalName - logical file name or GUID of the file to get the cheapest replica of.
seHost - the reference Storage Element. If this is null, the default SE will be taken.
Returns:
URI of the SURL that is the cheapest to access from the seHost.
InfoServiceException
ConfigurationException
CatalogCommunicationException
InvalidFileNameException
IllegalArgumentException
LfnDoesNotExistException
org.edg.data.util.InvalidFileTypeException
See Also:
Design of a Replica Optimisation Framework

getAccessCost

public org.edg.data.ros.AccessCost[] getAccessCost(java.net.URI[] logicalName,
                                                   java.lang.String[] ces,
                                                   java.lang.String[] protocol)
                                            throws InvalidFileNameException,
                                                   InfoServiceException,
                                                   CatalogCommunicationException,
                                                   OptorException,
                                                   IllegalArgumentException,
                                                   LfnDoesNotExistException,
                                                   org.edg.data.util.InvalidFileTypeException
Calculates the expected cost of accessing all the files specified by logicalName from each Computing Element host specified by ceHosts.

Parameters:
logicalName - the array of LFNs or GUIDs.
ces - the array of ComputingElement hosts.
protocol - the array of transport protocols to be used.
Returns:
The AccessCost array in same order as ce array
Throws:
InvalidFileNameException - if one of the logicalNames is not an lfn.
InfoServiceException - if there has been a communication problem with an info service
CatalogCommunicationException - if the LRC, RMC or ROS could not be contacted
OptorException - if there has been a problem with the ROS call
IllegalArgumentException
LfnDoesNotExistException
org.edg.data.util.InvalidFileTypeException
See Also:
Design of a Replica Optimisation Framework

getBestFile

public java.net.URI getBestFile(java.net.URI logicalName,
                                java.lang.String seHost,
                                java.lang.String protocol,
                                java.lang.String turlProtocol,
                                int nstreams)
                         throws InvalidFileNameException,
                                InfoServiceException,
                                ConfigurationException,
                                IllegalArgumentException,
                                CatalogCommunicationException,
                                GUIDDoesNotExistException,
                                InvalidInfoException,
                                java.io.FileNotFoundException,
                                FileHandleException,
                                FileCopierException,
                                StorageResourceException,
                                LfnDoesNotExistException,
                                org.edg.data.util.InvalidFileTypeException
Return the storage file name (SURL) of the best file in terms of network latencies. getBestFile will always trigger replication if the best replica is not on a default SE. After the call (which is blocking) there will be a local replica available. If turlProtocol is not specified, the SURL is returned, otherwise the TURL witrh the specified protocl is returned. If the file cannot be accessed by the specified protocol, null is returned.

Parameters:
logicalName - the LFN or GUID of the file to find the best replica of.
seHost - destination StorageElement.
protocol - The protocol that will be used to replicate the file
turlProtocol - The protocol that the TURL will be returned as.
Returns:
SURL of best file (if turlProtocol is null). Otherwise it returns the TURL in the specified protocol.
InvalidFileNameException
InfoServiceException
ConfigurationException
IllegalArgumentException
CatalogCommunicationException
GUIDDoesNotExistException
InvalidInfoException
java.io.FileNotFoundException
FileHandleException
FileCopierException
StorageResourceException
LfnDoesNotExistException
org.edg.data.util.InvalidFileTypeException
See Also:
Design of a Replica Optimisation Framework