|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.griphyn.common.catalog.ReplicaCatalogEntry
public class ReplicaCatalogEntry
The entry is a high-level logical structure representing the physical filename, the site handle, and optional attributes related to the PFN as one entity.
The resource handle is the most frequently used attribute. In reality, the resource handle may be a relational attribute of the mapping relation between an LFN and a PFN - there is disagreement among the developers on this issue. For simplicity purposes, it appears to be sufficient to make the resource handle a regular PFN attribute.
| Field Summary | |
|---|---|
private Map |
m_attributeMap
Any optional attributes associated with the PFN. |
private String |
m_pfn
The physical filename. |
static String |
RESOURCE_HANDLE
The (reserved) attribute name used for the resource handle. |
| Constructor Summary | |
|---|---|
ReplicaCatalogEntry()
Default constructor for arrays. |
|
ReplicaCatalogEntry(String pfn)
Convenience constructor initializes the PFN. |
|
ReplicaCatalogEntry(String pfn,
Map attributes)
Standard constructor initializes the PFN and arbitrary attributes. |
|
ReplicaCatalogEntry(String pfn,
String handle)
Convenience constructor initializes the PFN and the resource handle. |
|
| Method Summary | |
|---|---|
void |
addAttribute(Map attributes)
Adds attributes to the existing attributes. |
void |
addAttribute(String key,
Object value)
Adds an attribute to the set of attributes. |
boolean |
equals(Object obj)
Matches two ReplicaCatalogEntry objects. |
Object |
getAttribute(String key)
Obtains the attribute value for a given key. |
int |
getAttributeCount()
Counts the number of attributes known for the PFN. |
Iterator |
getAttributeIterator()
Provides an iterator to traverse the attributes by their keys. |
String |
getPFN()
Accessor: Obtains the PFN portion from this entry. |
String |
getResourceHandle()
Obtains the resource handle from the attributes map. |
boolean |
hasAttribute(String key)
Checks for the existence of an attribute key. |
boolean |
merge(ReplicaCatalogEntry rce,
boolean overwrite)
Merges the attribute maps in a controlled fashion. |
static ReplicaCatalogEntry |
merge(ReplicaCatalogEntry a,
ReplicaCatalogEntry b,
boolean overwrite)
Merges the attribute maps of two entries in a controlled fashion. |
void |
removeAllAttribute()
Removes all attributes associated with a PFN. |
Object |
removeAttribute(String name)
Removes a specific attribute. |
void |
setAttribute(Map attributes)
Replaces all existing attributes with new attributes. |
void |
setAttribute(String key,
Object value)
Adds a new or overwrites an existing attribute. |
void |
setPFN(String pfn)
Accessor: Sets a new PFN to remember. |
void |
setResourceHandle(String handle)
Sets a new resource handle to remember as PFN attribute. |
String |
toString()
Converts the contents into a string. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String RESOURCE_HANDLE
private String m_pfn
private Map m_attributeMap
| Constructor Detail |
|---|
public ReplicaCatalogEntry()
null, and thus must be explicitly set later. The map
of attributes associated with the PFN is initialized to be empty.
Thus, no resource handle is available.
public ReplicaCatalogEntry(String pfn)
pfn - is the PFN to remember.
public ReplicaCatalogEntry(String pfn,
String handle)
pfn - is the PFN to remember.handle - is the resource handle to remember.
public ReplicaCatalogEntry(String pfn,
Map attributes)
pfn - is the PFN to remember.attributes - is a map of arbitrary attributes related to the
PFN.| Method Detail |
|---|
public void addAttribute(String key,
Object value)
setAttribute( String, Object ) method of the same
signature.
key - is the key denoting an attribute.value - is a value object to store.public void addAttribute(Map attributes)
attributes - is a map of attributes to add.setAttribute(Map),
Map.putAll( Map )public Object getAttribute(String key)
key - is the key to look up
Map.get( Object )public boolean hasAttribute(String key)
key - is the key to look up
public int getAttributeCount()
Map.size()public Iterator getAttributeIterator()
public static ReplicaCatalogEntry merge(ReplicaCatalogEntry a,
ReplicaCatalogEntry b,
boolean overwrite)
a - is one replica catalog entry to merge.b - is the other replica catalog entry to merge.overwrite - resolves intersections. If true, uses rce's
attribute to remain, if false, the original attribute remains.
null
if the PFN mismatched.
public boolean merge(ReplicaCatalogEntry rce,
boolean overwrite)
rce - is another replica catalog entry to merge with.overwrite - resolves intersections. If true, uses rce's
attribute to remain, if false, the original attribute remains.
public void removeAllAttribute()
removeAttribute( String )public Object removeAttribute(String name)
name - is the name of the attribute to remove.
null,
if the key was not in the map.removeAllAttribute()
public void setAttribute(String key,
Object value)
addAttribute( String, Object) method of
the same signature.
key - is the name of the attributevalue - is the value object associated with the attribute.public void setAttribute(Map attributes)
attributes - is the map of new attributes to remember.addAttribute(Map)public String getResourceHandle()
null if unset.setResourceHandle( String )public void setResourceHandle(String handle)
handle - is the new resource handle.getResourceHandle()public String getPFN()
null if unset.setPFN( String )public void setPFN(String pfn)
pfn - is a new physical filename.getPFN()public String toString()
toString in class Objectpublic boolean equals(Object obj)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||