org.glite.data.catalog.service.composite
Interface FiremanCatalog

All Superinterfaces:
FASBase, FileCatalog, MetadataBase, ReplicaCatalog, ServiceBase

public interface FiremanCatalog
extends FileCatalog, MetadataBase, ReplicaCatalog

The middleware level API for the composite File and SURLStat catalog operations.
This interface provides combined operations over the File and Replica Catalog interfaces as well as all operations of the FileCatalog and ReplicaCatalog interfaces which are then simply forwarded to the corresponding services The additional methods giving added value are those which require coordination between the two catalog services.


Method Summary
 void addReplica(java.lang.String lfn, SURLEntry[] newSurls)
          New mapping creation for {LFN,SURL[]} pairs.
 void associateDirWithSchema(java.lang.String directoryLfn, java.lang.String schemaName)
          Associates an existing directory with an existing schema.
 void create(FRCEntry[] entries)
          Creates entries based on LFN and SURL only.
 Stat[] getStat(java.lang.String[] lfns)
          Lists LFNStat for a given LFN.
 StringPair[] listLfn(java.lang.String[] surls)
          Lists LFN for SURL of interest
 FRCEntry[] listReplicas(java.lang.String[] lfns, boolean withPermissions)
          List all known SURLs registered to a given LFN.
 void remove(java.lang.String[] lfns)
          Removes LFN and all linked data (corresponding guid and replicas) from catalog.
 void removeReplica(StringPair[] lfnSurls, boolean removeLfnOnLastReplica)
          Removes specified mappings.
 
Methods inherited from interface org.glite.data.catalog.service.file.FileCatalog
createFile, getFileCatalogEntry, getGuidForLfn, getLfnForGuid, locate, mkdir, mv, readDir, rmdir, symlink, unlink, updateModifyTime, updateValidityTime
 
Methods inherited from interface org.glite.data.catalog.service.fas.FASBase
checkPermission, getPermission, setPermission
 
Methods inherited from interface org.glite.data.catalog.service.ServiceBase
getInterfaceVersion, getSchemaVersion, getServiceMetadata, getVersion
 
Methods inherited from interface org.glite.data.catalog.service.meta.MetadataBase
clearAttributes, getAttributes, listAttributes, query, setAttributes
 
Methods inherited from interface org.glite.data.catalog.service.replica.ReplicaCatalog
addGuidReplica, createGuid, getDefaultGlobalPermission, getDefaultPrincipalPermission, getGuidForSurl, getGuidStat, getMasterReplica, getSurlStat, hasGuid, listReplicasByGuid, listSurlsByGuid, removeGuid, removeGuidReplica, setDefaultGlobalPermission, setDefaultPrincipalPermission, setMasterReplica, updateGuidStat, updateStatus, updateSurlStat
 

Method Detail

create

public void create(FRCEntry[] entries)
            throws InternalException,
                   AuthorizationException,
                   ExistsException,
                   NotExistsException,
                   InvalidArgumentException
Creates entries based on LFN and SURL only. If GUID is not provided, it is created by the catalog. Only file items are permitted here.

Parameters:
entries - A list of FRCEntry objects. If permission not passed, one derived from the parent directory is used. Otherwise only the passed one is used.
Throws:
AuthorizationException - No access right to create new entry in the parent directory.
ExistsException - The file already exists.
NotExistsException - One of the parent path elements does not exists.
InvalidArgumentException - Some part of the argument is invalid.
InternalException -

Semantic description of the method:
The following steps are performed for each entry:
  • Check format of path, GUID (if given), SURLS, size, etc;
    if any of them is invalid, throws InvalidArgumentException.
  • Check if parent directory exists;
    if directory does not exist, throws NotExistsException.
  • Check if file exists;
    if file exists, throws ExistsException.
  • Check WRITE permission on parent directory;
    if permission is not granted, throws AuthorizationException.
  • Insert LFN into catalog with all accompanying metadata.

listReplicas

public FRCEntry[] listReplicas(java.lang.String[] lfns,
                               boolean withPermissions)
                        throws InternalException,
                               AuthorizationException,
                               NotExistsException
List all known SURLs registered to a given LFN.

Parameters:
lfns - The Logical File Name to list SURLs for.
withPermissions - Flag whether to include permissions in the listing
Returns:
The list of SURLs.
Throws:
AuthorizationException - No access right to read LFN.
NotExistsException - LFN does not exists.
InvalidArgumentException - Some part of the argument is invalid.
InternalException -

Semantic description of the method:
The following steps are performed for each entry:

listLfn

public StringPair[] listLfn(java.lang.String[] surls)
                     throws InternalException,
                            AuthorizationException,
                            NotExistsException,
                            InvalidArgumentException
Lists LFN for SURL of interest

Parameters:
surls - list of surls we want perform LFN lookup
Returns:
list of {SURL,LFN} pairs
Throws:
AuthorizationException - No access right to list the LFN for a given SURL.
NotExistsException - The SURL does not exist.
InvalidArgumentException - Some part of the argument is invalid.
InternalException -

Semantic description of the method:
The following steps are performed for each entry:

getStat

public Stat[] getStat(java.lang.String[] lfns)
               throws InternalException,
                      AuthorizationException,
                      NotExistsException,
                      InvalidArgumentException
Lists LFNStat for a given LFN.

Parameters:
lfns - list of LFNs we want LFNStat object for.
Returns:
list holding LFNStat for the LFNs.
Throws:
InvalidArgumentException - Some part of the argument is invalid.
AuthorizationException - No access right get status information.
NotExistsException - The LFN does not exist.
InternalException -

Semantic description of the method:
The following steps are performed for each entry:
  • Check format of LFN;
    if it is invalid, throws InvalidArgumentException.
  • Check if LFN exists;
    if it does not exist, throws NotExistsException.
  • Check LIST permission on the LFN;
    if permission is not granted, throws AuthorizationException.
  • Get relevant LFNStat details from the catalog, add them to the list to be returned.

addReplica

public void addReplica(java.lang.String lfn,
                       SURLEntry[] newSurls)
                throws InternalException,
                       AuthorizationException,
                       ExistsException,
                       NotExistsException,
                       InvalidArgumentException
New mapping creation for {LFN,SURL[]} pairs.

Parameters:
lfn - LFN to add new SURLs to, has to be a file.
newSurls - The list of new SURLs to add
Throws:
AuthorizationException - No right to add new SURLs to an existing replica.
ExistsException - The LFN-SURL pair already exists.
InvalidArgumentException - Some part of the argument is invalid.
NotExistsException - The LFN does not exist.
InternalException -

Semantic description of the method:
The following steps are performed:

remove

public void remove(java.lang.String[] lfns)
            throws InternalException,
                   AuthorizationException,
                   NotExistsException,
                   InvalidArgumentException
Removes LFN and all linked data (corresponding guid and replicas) from catalog.

Parameters:
lfns - LFN for removal, cannot be directories
Throws:
AuthorizationException - No right to remove the entry from the catalog.
InvalidArgumentException - Some part of the argument is invalid.
NotExistsException - The LFN does not exist.
InternalException -

Semantic description of the method:
The following steps are performed for each entry:

removeReplica

public void removeReplica(StringPair[] lfnSurls,
                          boolean removeLfnOnLastReplica)
                   throws InternalException,
                          AuthorizationException,
                          NotExistsException,
                          InvalidArgumentException
Removes specified mappings. Each string pair contains a mapping to be removed.

Parameters:
lfnSurls - list of {LFN, SURL} pair objects. The first string is the LFN, the second is the SURL to be removed.
removeLfnOnLastReplica - tells the catalog whether the LFN should be removed if the last SURL is removed.
Throws:
AuthorizationException - No right to remove a replica from the given LFN.
NotExistsException - Either the LFN does not exist or the given SURL is not a registered replica of the LFN.
InvalidArgumentException - The LFN or SURL of an entry is malformed.
InternalException -

Semantic description of the method:
The following steps are performed for each entry:
  • Check if LFN and corresponding SURL are valid;
    if either one of them is not valid, throws InvalidArgumentException.
  • Check if LFN and corresponding SURL exist;
    if any of them does not exist, throws NotExistsException.
  • Check SET_METADATA permission on LFN;
    if permission is not granted, throws AuthorizationException.
  • Check if the SURL in the list is the Master one;
    if it is the Master and it is not the last replica, throws InvalidArgumentException.
  • Remove SURL of LFN from the catalog.
  • Check if the removeLfnOnLastReplica is set;
    if it is set and it was the last replica, then continue, otherwise return.
  • Check REMOVE permission on LFN;
    if permission is not granted, throws AuthorizationException.
  • Remove LFN.

associateDirWithSchema

public void associateDirWithSchema(java.lang.String directoryLfn,
                                   java.lang.String schemaName)
                            throws InternalException
Associates an existing directory with an existing schema. The semantics of this operation should be that all files inside the given directory inherit and share this schema.

Parameters:
directoryLfn - The lfn of the directory.
schemaName - The name of the schema to be associated with the directory.
Throws:
InternalException
AuthorizationException - No right to list entries in the catalog.


Copyright © 2004 EU-EGEE