org.edg.data.rls
Interface EdgLocalReplicaCatalog


public interface EdgLocalReplicaCatalog

This is the interface to the Local Replica Catalog component of an RLS Server.

Version:
$Id: EdgLocalReplicaCatalog.java,v 1.37 2004/04/16 16:30:22 jamesc Exp $
Author:
Peter Kunszt, James Casey, Sophie Lemaitre, Levi Lucio

Method Summary
 void addMapping(java.lang.String guid, java.lang.String pfn)
          add a new mapping to the Catalog.
 boolean addRLISubscription(java.lang.String rliURL)
          Add an RLI URL to the list of RLI subscribers.
 boolean addRLISubscription(java.lang.String lrcURL, java.lang.String rliURL)
          Deprecated.  
 boolean attributeDefinitionExists(java.lang.String attrName)
          do we have an attribute definition for a given attribute name?
 void createAttributeDefinition(org.edg.data.util.attribute.AttributeDefinition attrDefn)
          Create a new Attribute Definition in the Catalog.
 void createAttributeDefinition(java.lang.String attrDefn)
          Deprecated.  
 void deleteMapping(java.lang.String guid)
          Deprecated.  
 void forceRLIUpdate()
          Force a bloom filter update to all the RLI subscribers
 org.edg.data.util.attribute.AttributeDefinition getAttributeDefinition(java.lang.String attrName)
          Get the AttributeDefinition corresponding to the attribute name.
 org.edg.data.util.attribute.AttributeDefinition[] getAttributeDefinitions()
          Get the current list of attribute definition names and type in an array of AttributeDefinition
 ColumnSizes getColumnSizes()
          Return the maximum number of characters for a GUID, a PFN and an attribute.
 java.util.Date getDatePfnAttribute(java.lang.String pfnName, java.lang.String attrDefnName)
          return the value of a given date attribute for an PFN.
 int getDefaultResultLength()
          Deprecated.  
 float getFloatPfnAttribute(java.lang.String pfnName, java.lang.String attrDefnName)
          return the value of a given float attribute for an PFN.
 java.lang.String getInterfaceVersion()
           
 int getIntPfnAttribute(java.lang.String pfnName, java.lang.String attrDefnName)
          return the value of a given int attribute for an PFN.
 java.lang.String[] getMappingsByAttribute(java.lang.String SQLQuery)
          Deprecated.  
 java.lang.String[] getMappingsByAttribute(java.lang.String SQLQuery, int resultLength)
          Return the guid to physical filename mappings which contain the PFNs corresponding to the given attributes conditions.
 java.lang.String[] getMappingsByAttribute(java.lang.String SQLQuery, int resultLength, int resultStart)
          Return the guid to physical filename mappings which the PFNs corresponding to the given attributes conditions.
 java.lang.String[] getMappingsByGuid(java.lang.String guidPattern)
          Deprecated.  
 java.lang.String[] getMappingsByGuid(java.lang.String guidPattern, int resultLength)
          Return the guid to physical filename mappings which contain a guid thay matches the given guidPattern.
 java.lang.String[] getMappingsByGuid(java.lang.String guidPattern, int resultLength, int resultStart)
          Return the guid to physical filename mappings which contain a guid thay matches the given guidPattern.
 java.lang.String[] getMappingsByPfn(java.lang.String pfnPattern)
          Deprecated.  
 java.lang.String[] getMappingsByPfn(java.lang.String pfnPattern, int resultLength)
          Return the guid to physical filename mappings which contain a pfn thay matches the given pfnPattern.
 java.lang.String[] getMappingsByPfn(java.lang.String pfnPattern, int resultLength, int resultStart)
          Return the guid to physical filename mappings which contain a pfn thay matches the given pfnPattern.
 java.lang.String[] getMappingsByPfnAttribute(java.lang.String attrName, java.lang.String attrPattern)
          Deprecated.  
 java.lang.String[] getMappingsByPfnAttribute(java.lang.String attrName, java.lang.String attrPattern, int resultLength)
          Deprecated.  
 java.lang.String[] getMappingsByPfnAttribute(java.lang.String attrName, java.lang.String attrPattern, int resultLength, int resultStart)
          Deprecated.  
 org.edg.data.util.attribute.Mapping[] getMappingsWithAttributes(java.lang.String[] guids)
          Return the mappings for a list of guids.
 org.edg.data.util.attribute.Mapping[] getMappingsWithAttributes(java.lang.String query, int resultLength)
           
 org.edg.data.util.attribute.Mapping[] getMappingsWithAttributes(java.lang.String query, int resultLength, int resultStart)
           
 Metadata getMetadata()
           
 java.lang.String getPfnAttribute(java.lang.String pfnName, java.lang.String attrDefnName)
          Deprecated.  
 java.lang.String[] getPfns(java.lang.String guid)
          For a given guid, return all the physical filenames we map to in this Catalog.
 java.lang.String[] getRLISubscriptions()
          Return the list of RLIs that currently subscribe to this LRC
 java.lang.String getSchemaVersion()
           
 java.lang.String getStringPfnAttribute(java.lang.String pfnName, java.lang.String attrDefnName)
          return the value of a given string attribute for a PFN.
 java.lang.String getVersion()
           
 boolean guidExists(java.lang.String guid)
          Do we have a given guid in the catalog.
 java.lang.String guidForPfn(java.lang.String pfn)
          For a given pfn, return the guid that points to it.
 boolean pfnExists(java.lang.String pfn)
          Do we have a given physical filename in the catalog
 java.lang.String ping()
          Is the server alive.
 void removeAttributeDefinition(java.lang.String attrName)
          Delete an Attribute Definition from the Catalog.
 void removeMapping(java.lang.String guid, java.lang.String pfn)
          remove from the catalog a single guid to pfn mapping.
 void removePfnAttribute(java.lang.String pfnName, java.lang.String attrDefnName)
          remove the value of a given attribute for an PFN.
 boolean removeRLISubscription(java.lang.String rliURL)
          Remove a RLI URL from the list of RLI subscribers.
 java.util.Date setDatePfnAttribute(java.lang.String pfnName, java.lang.String attrDefnName, java.util.Date attrValue)
          Add an attribute value to a PFN attribute of type date.
 void setDefaultResultLength(int resultLength)
          Deprecated.  
 float setFloatPfnAttribute(java.lang.String pfnName, java.lang.String attrDefnName, float attrValue)
          Add an attribute value to a PFN attribute of type float.
 int setIntPfnAttribute(java.lang.String pfnName, java.lang.String attrDefnName, int attrValue)
          Add an attribute value to a PFN attribute of type int.
 void setMappingsWithAttributes(org.edg.data.util.attribute.Mapping[] mappings)
          Add a set of guid to pfn mappings, with optional pfn attributes to the database.
 java.lang.String setPfnAttribute(java.lang.String pfnName, java.lang.String attrDefnName, java.lang.String attrValue)
          Deprecated.  
 java.lang.String setStringPfnAttribute(java.lang.String pfnName, java.lang.String attrDefnName, java.lang.String attrValue)
          Add an attribute value to a PFN attribute of type string.
 

Method Detail

addMapping

public void addMapping(java.lang.String guid,
                       java.lang.String pfn)
add a new mapping to the Catalog. If there is already a mapping, we add this mapping to the set of mappings. If there are no mappings already, we create a new mapping.

Parameters:
guid - The guid
pfn - The physical filename

deleteMapping

public void deleteMapping(java.lang.String guid)
Deprecated.  

delete all parts of an guid to pfn mapping including attached attributes. Deprecated now to be consistent with the RMC API.

Parameters:
guid - The guid for which to delete the mapping

removeMapping

public void removeMapping(java.lang.String guid,
                          java.lang.String pfn)
remove from the catalog a single guid to pfn mapping.

Parameters:
guid - the guid whose mapping we look at
pfn - the physical filename to remove

guidExists

public boolean guidExists(java.lang.String guid)
Do we have a given guid in the catalog.

Parameters:
guid - The guid we are checking for
Returns:
true if we have a mapping for the guid, false otherwise

pfnExists

public boolean pfnExists(java.lang.String pfn)
Do we have a given physical filename in the catalog

Parameters:
pfn - The physical filename we are checking for
Returns:
true if we have a mapping for the physical filename, false otherwise

getPfns

public java.lang.String[] getPfns(java.lang.String guid)
For a given guid, return all the physical filenames we map to in this Catalog. This will always have at least one entry, and never be empty.

Parameters:
guid - The GUID
Throws:
NoSuchGuidException - If the guid does not exist in the catalog.

guidForPfn

public java.lang.String guidForPfn(java.lang.String pfn)
For a given pfn, return the guid that points to it. The return value will never be null.

Parameters:
pfn - The physical filename.
Returns:
the guid that maps to it
Throws:
NoSuchPfnException - If the pfn does not exist in the catalog.

createAttributeDefinition

public void createAttributeDefinition(org.edg.data.util.attribute.AttributeDefinition attrDefn)
Create a new Attribute Definition in the Catalog.

Parameters:
attrDefn - the attribute definition
Throws:
AttributeDefinitionExistsException - if an attribute with the given name already exists

createAttributeDefinition

public void createAttributeDefinition(java.lang.String attrDefn)
Deprecated.  

Create a new Attribute Definition in the Catalog.

Parameters:
attrDefn - the attribute definition
Throws:
AttributeDefinitionExistsException - if an attribute with the given name already exists

getAttributeDefinition

public org.edg.data.util.attribute.AttributeDefinition getAttributeDefinition(java.lang.String attrName)
Get the AttributeDefinition corresponding to the attribute name.

Parameters:
attrName - the attribute name
Throws:
NoSuchAttributeDefinitionException - if an attribute with the given name doesn't exist

getAttributeDefinitions

public org.edg.data.util.attribute.AttributeDefinition[] getAttributeDefinitions()
Get the current list of attribute definition names and type in an array of AttributeDefinition

Returns:
the AttributeDefinitions, or null if there are no definitions

removeAttributeDefinition

public void removeAttributeDefinition(java.lang.String attrName)
Delete an Attribute Definition from the Catalog. This will also remove any attribute value with this definition from GUID and Physical FileName entries in the Catalog.

Parameters:
attrName - the name of the attribute definition to remove

attributeDefinitionExists

public boolean attributeDefinitionExists(java.lang.String attrName)
do we have an attribute definition for a given attribute name?

Parameters:
attrName - the name of attribute to check for
Returns:
true if the attribute name is there.

setPfnAttribute

public java.lang.String setPfnAttribute(java.lang.String pfnName,
                                        java.lang.String attrDefnName,
                                        java.lang.String attrValue)
Deprecated.  

Add an attribute value to a PFN attribute of type string. This is now deprecated : you should use setStringPfnAttribute, setIntPfnAttribute, setFloatPfnAttribute or setDatePfnAttribute depending on the attribute type.

Parameters:
pfnName - The PFN
attrDefnName - the name of attribute
attrValue - The attribute value we'll add.
Throws:
NoSuchPfnException - if the PFN does not exist in the Catalog
NoSuchAttributeDefinitionException - if the definition of the attribute does not exist in the Catalog.
UnappropriateAttributeTypeException - if the attribute is not of type string

setStringPfnAttribute

public java.lang.String setStringPfnAttribute(java.lang.String pfnName,
                                              java.lang.String attrDefnName,
                                              java.lang.String attrValue)
Add an attribute value to a PFN attribute of type string.

Parameters:
pfnName - The PFN
attrDefnName - the name of attribute
attrValue - The attribute value we'll add.
Throws:
NoSuchPfnException - if the PFN does not exist in the Catalog
NoSuchAttributeDefinitionException - if the definition of the attribute does not exist in the Catalog.
UnappropriateAttributeTypeException - if the attribute is not of type string

setIntPfnAttribute

public int setIntPfnAttribute(java.lang.String pfnName,
                              java.lang.String attrDefnName,
                              int attrValue)
Add an attribute value to a PFN attribute of type int.

Parameters:
pfnName - The PFN
attrDefnName - the name of attribute
attrValue - The attribute value we'll add.
Throws:
NoSuchPfnException - if the PFN does not exist in the Catalog
NoSuchAttributeDefinitionException - if the definition of the attribute does not exist in the Catalog.
UnappropriateAttributeTypeException - if the attribute is not of type int

setFloatPfnAttribute

public float setFloatPfnAttribute(java.lang.String pfnName,
                                  java.lang.String attrDefnName,
                                  float attrValue)
Add an attribute value to a PFN attribute of type float.

Parameters:
pfnName - The PFN
attrDefnName - the name of attribute
attrValue - The attribute value we'll add.
Throws:
NoSuchPfnException - if the PFN does not exist in the Catalog
NoSuchAttributeDefinitionException - if the definition of the attribute does not exist in the Catalog.
UnappropriateAttributeTypeException - if the attribute is not of type float

setDatePfnAttribute

public java.util.Date setDatePfnAttribute(java.lang.String pfnName,
                                          java.lang.String attrDefnName,
                                          java.util.Date attrValue)
Add an attribute value to a PFN attribute of type date.

Parameters:
pfnName - The PFN
attrDefnName - the name of attribute
attrValue - The attribute value we'll add.
Throws:
NoSuchPfnException - if the PFN does not exist in the Catalog
NoSuchAttributeDefinitionException - if the definition of the attribute does not exist in the Catalog.
UnappropriateAttributeTypeException - if the attribute is not of type date

getPfnAttribute

public java.lang.String getPfnAttribute(java.lang.String pfnName,
                                        java.lang.String attrDefnName)
Deprecated.  

return the value of a given string attribute for a PFN. This is now deprecated : you should use setStringPfnAttribute, setIntPfnAttribute, setFloatPfnAttribute or setDatePfnAttribute depending on the attribute type.

Parameters:
pfnName - the PFN
attrDefnName - the AttributeDefinition name to check for
Returns:
the attribute value
Throws:
NoSuchPfnException - if the PFN does not exist in the Catalog
NoSuchAttributeDefinitionException - if the AttributeDefintion does not exist in the catalog.

getStringPfnAttribute

public java.lang.String getStringPfnAttribute(java.lang.String pfnName,
                                              java.lang.String attrDefnName)
return the value of a given string attribute for a PFN.

Parameters:
pfnName - the PFN
attrDefnName - the AttributeDefinition name to check for
Returns:
the attribute value
Throws:
NoSuchPfnException - if the PFN does not exist in the Catalog
NoSuchAttributeDefinitionException - if the AttributeDefintion does not exist in the catalog.

getIntPfnAttribute

public int getIntPfnAttribute(java.lang.String pfnName,
                              java.lang.String attrDefnName)
return the value of a given int attribute for an PFN.

Parameters:
pfnName - the PFN
attrDefnName - the AttributeDefinition name to check for
Returns:
the attribute value
Throws:
NoSuchPfnException - if the PFN does not exist in the Catalog
NoSuchAttributeDefinitionException - if the AttributeDefintion does not exist in the catalog.

getFloatPfnAttribute

public float getFloatPfnAttribute(java.lang.String pfnName,
                                  java.lang.String attrDefnName)
return the value of a given float attribute for an PFN.

Parameters:
pfnName - the PFN
attrDefnName - the AttributeDefinition name to check for
Returns:
the attribute value
Throws:
NoSuchPfnException - if the PFN does not exist in the Catalog
NoSuchAttributeDefinitionException - if the AttributeDefintion does not exist in the catalog.

getDatePfnAttribute

public java.util.Date getDatePfnAttribute(java.lang.String pfnName,
                                          java.lang.String attrDefnName)
return the value of a given date attribute for an PFN.

Parameters:
pfnName - the PFN
attrDefnName - the AttributeDefinition name to check for
Returns:
the attribute value
Throws:
NoSuchPfnException - if the PFN does not exist in the Catalog
NoSuchAttributeDefinitionException - if the AttributeDefintion does not exist in the catalog.

removePfnAttribute

public void removePfnAttribute(java.lang.String pfnName,
                               java.lang.String attrDefnName)
remove the value of a given attribute for an PFN.

Parameters:
pfnName - the PFN
attrDefnName - the AttributeDefinition name to check for

setDefaultResultLength

public void setDefaultResultLength(int resultLength)
Deprecated.  

Set the number of mappings that will be displayed by default. (for the getMappingsByGuid and getMappingsByPfn methods)..

Parameters:
resultLength - the number of mappings that will be displayed by default

getDefaultResultLength

public int getDefaultResultLength()
Deprecated.  

Return the number of mappings that will be displayed by default. (for the getMappingsByGuid and getMappingsByPfn methods).

Returns:
the number of mappings displayed by default.

getColumnSizes

public ColumnSizes getColumnSizes()
Return the maximum number of characters for a GUID, a PFN and an attribute. (according to the schema : if guid_guid has been defined as VARCHAR(250), then the GUID cannot have more than 250 characters. So 250 will be returned.)

Returns:
the object containing the Column sizes

getMappingsWithAttributes

public org.edg.data.util.attribute.Mapping[] getMappingsWithAttributes(java.lang.String[] guids)
Return the mappings for a list of guids. If some of the guids do not exist, this is not a problem. If there are no results, an empty array is returned

Parameters:
guids - the list of guids, which may be empty, but may not be null

setMappingsWithAttributes

public void setMappingsWithAttributes(org.edg.data.util.attribute.Mapping[] mappings)
Add a set of guid to pfn mappings, with optional pfn attributes to the database. If any problem occurs when inserting entries or attributes (pfn already exists, inserting an attribute value for an attribute which doesn't exist, inserting the wrong type of attribute value) the entire transaction is rolled back, and a fault thrown

Parameters:
mappings - the list of mappings, which may be empty, but may not be null

getMappingsByGuid

public java.lang.String[] getMappingsByGuid(java.lang.String guidPattern)
Deprecated.  

Return the guid to physical filename mappings which contain a guid thay matches the given guidPattern. We assume unix regexp semantics. The result will be an empty set if no mapppings are found.

Parameters:
guidPattern - The GUID pattern we are searching for
Returns:
The mappings, as a String[]. This has an even number of entries in the for {guid, pfn, guid, pfn, ...}

getMappingsByGuid

public java.lang.String[] getMappingsByGuid(java.lang.String guidPattern,
                                            int resultLength)
Return the guid to physical filename mappings which contain a guid thay matches the given guidPattern. Return only the first mappings (no more than the resultLength parameter). We assume unix regexp semantics. The result will be an empty set if no mapppings are found.

Parameters:
guidPattern - The GUID pattern we are searching for
resultLength - The number of of mappings that will be displayed
Returns:
The mappings, as a String[]. This has an even number of entries in the for {guid, pfn, guid, pfn, ...}

getMappingsByGuid

public java.lang.String[] getMappingsByGuid(java.lang.String guidPattern,
                                            int resultLength,
                                            int resultStart)
Return the guid to physical filename mappings which contain a guid thay matches the given guidPattern. Return only a certain number of mappings. Return We assume unix regexp semantics. The result will be an empty set if no mapppings are found.

Parameters:
guidPattern - The GUID pattern we are searching for
resultLength - The number of of mappings that will be displayed
resultStart - The rank of the first mapping that will be displayed
Returns:
The mappings, as a String[]. This has an even number of entries in the for {guid, pfn, guid, pfn, ...}

getMappingsByPfn

public java.lang.String[] getMappingsByPfn(java.lang.String pfnPattern)
Deprecated.  

Return the guid to physical filename mappings which contain a physical filename thay matches the given pfnPattern. We assume unix regexp semantics. The result will be an empty set if no mapppings are found.

Parameters:
pfnPattern - The Physical FileName pattern we are searching for
Returns:
The mappings, as a String[]. This has an even number of entries in the for {guid, pfn, guid, pfn, ...}

getMappingsByPfn

public java.lang.String[] getMappingsByPfn(java.lang.String pfnPattern,
                                           int resultLength)
Return the guid to physical filename mappings which contain a pfn thay matches the given pfnPattern. Return only the first mappings (no more than the resultLength parameter). We assume unix regexp semantics. The result will be an empty set if no mapppings are found.

Parameters:
pfnPattern - The PFN pattern we are searching for
resultLength - The number of of mappings that will be displayed
Returns:
The mappings, as a String[]. This has an even number of entries in the for {guid, pfn, guid, pfn, ...}

getMappingsByPfn

public java.lang.String[] getMappingsByPfn(java.lang.String pfnPattern,
                                           int resultLength,
                                           int resultStart)
Return the guid to physical filename mappings which contain a pfn thay matches the given pfnPattern. Return only a certain number of mappings. Return We assume unix regexp semantics. The result will be an empty set if no mapppings are found.

Parameters:
pfnPattern - The PFN pattern we are searching for
resultLength - The number of of mappings that will be displayed
resultStart - The rank of the first mapping that will be displayed
Returns:
The mappings, as a String[]. This has an even number of entries in the for {guid, pfn, guid, pfn, ...}

getMappingsByAttribute

public java.lang.String[] getMappingsByAttribute(java.lang.String SQLQuery)
Deprecated.  

Return the guid to physical filename mappings which contain the PFNs corresponding to the given attributes conditions. We assume unix regexp semantics. The result will be an empty set if no mapppings are found.

Parameters:
SQLQuery - The attributes conditions
Returns:
The mappings, as a String[]. This has an even number of entries in the for {guid, pfn, guid, pfn, ...}

getMappingsByAttribute

public java.lang.String[] getMappingsByAttribute(java.lang.String SQLQuery,
                                                 int resultLength)
Return the guid to physical filename mappings which contain the PFNs corresponding to the given attributes conditions. Return only the first mappings (no more than the resultLength parameter). We assume unix regexp semantics. The result will be an empty set if no mapppings are found.

Parameters:
SQLQuery - The attributes conditions
resultLength - The number of of mappings that will be displayed
Returns:
The mappings, as a String[]. This has an even number of entries in the for {guid, pfn, guid, pfn, ...}

getMappingsByAttribute

public java.lang.String[] getMappingsByAttribute(java.lang.String SQLQuery,
                                                 int resultLength,
                                                 int resultStart)
Return the guid to physical filename mappings which the PFNs corresponding to the given attributes conditions. Return only a certain number of mappings. Return We assume unix regexp semantics. The result will be an empty set if no mapppings are found.

Parameters:
SQLQuery - The attributes conditions
resultLength - The number of of mappings that will be displayed
resultStart - The rank of the first mapping that will be displayed
Returns:
The mappings, as a String[]. This has an even number of entries in the for {guid, pfn, guid, pfn, ...}

getMappingsByPfnAttribute

public java.lang.String[] getMappingsByPfnAttribute(java.lang.String attrName,
                                                    java.lang.String attrPattern)
Deprecated.  


getMappingsByPfnAttribute

public java.lang.String[] getMappingsByPfnAttribute(java.lang.String attrName,
                                                    java.lang.String attrPattern,
                                                    int resultLength)
Deprecated.  


getMappingsByPfnAttribute

public java.lang.String[] getMappingsByPfnAttribute(java.lang.String attrName,
                                                    java.lang.String attrPattern,
                                                    int resultLength,
                                                    int resultStart)
Deprecated.  


addRLISubscription

public boolean addRLISubscription(java.lang.String lrcURL,
                                  java.lang.String rliURL)
Deprecated.  

Add an RLI URL to the list of RLI subscribers.

Parameters:
rliURL - The URL for the RLI subscriber

addRLISubscription

public boolean addRLISubscription(java.lang.String rliURL)
Add an RLI URL to the list of RLI subscribers.

Parameters:
rliURL - The URL for the RLI subscriber

removeRLISubscription

public boolean removeRLISubscription(java.lang.String rliURL)
Remove a RLI URL from the list of RLI subscribers.

Parameters:
rliURL - The URL for the RLI subscriber

getRLISubscriptions

public java.lang.String[] getRLISubscriptions()
Return the list of RLIs that currently subscribe to this LRC

Returns:
the current list of RLIs

forceRLIUpdate

public void forceRLIUpdate()
Force a bloom filter update to all the RLI subscribers


ping

public java.lang.String ping()
Is the server alive. It returns a stats string. If everythin is ok, this will start with OK else it will start with FAIL.

Returns:
the stats string

getVersion

public java.lang.String getVersion()

getInterfaceVersion

public java.lang.String getInterfaceVersion()

getSchemaVersion

public java.lang.String getSchemaVersion()

getMappingsWithAttributes

public org.edg.data.util.attribute.Mapping[] getMappingsWithAttributes(java.lang.String query,
                                                                       int resultLength)

getMappingsWithAttributes

public org.edg.data.util.attribute.Mapping[] getMappingsWithAttributes(java.lang.String query,
                                                                       int resultLength,
                                                                       int resultStart)

getMetadata

public Metadata getMetadata()