| java.lang.Object org.griphyn.common.catalog.ReplicaCatalogEntry
ReplicaCatalogEntry | public class ReplicaCatalogEntry implements CatalogEntry(Code) | | 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.
author: Jens-S. Vöckler author: Karan Vahi version: $Revision: 50 $ |
Field Summary | |
final public static String | RESOURCE_HANDLE The (reserved) attribute name used for the resource handle. |
RESOURCE_HANDLE | final public static String RESOURCE_HANDLE(Code) | | The (reserved) attribute name used for the resource handle.
|
ReplicaCatalogEntry | public ReplicaCatalogEntry()(Code) | | Default constructor for arrays. The PFN is initialized to
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.
|
ReplicaCatalogEntry | public ReplicaCatalogEntry(String pfn)(Code) | | Convenience constructor initializes the PFN. The map of attributes
is initialized to be empty. Thus, no resource handle is avaiable.
Parameters: pfn - is the PFN to remember. |
ReplicaCatalogEntry | public ReplicaCatalogEntry(String pfn, String handle)(Code) | | Convenience constructor initializes the PFN and the resource
handle. The resource handle is stored as regular PFN attribute.
Parameters: pfn - is the PFN to remember. Parameters: handle - is the resource handle to remember. |
ReplicaCatalogEntry | public ReplicaCatalogEntry(String pfn, Map attributes)(Code) | | Standard constructor initializes the PFN and arbitrary attributes.
Parameters: pfn - is the PFN to remember. Parameters: attributes - is a map of arbitrary attributes related to thePFN. |
equals | public boolean equals(Object obj)(Code) | | Matches two ReplicaCatalogEntry objects. The primary key in this case is
the pfn and all the attributes.
true if the pfn and all the attributes match, false otherwise. |
getAttribute | public Object getAttribute(String key)(Code) | | Obtains the attribute value for a given key.
Parameters: key - is the key to look up the object stored as value, may be null. See Also: java.util.Map.get(Object) |
getAttributeCount | public int getAttributeCount()(Code) | | Counts the number of attributes known for the PFN.
number of attributes, may be zero. See Also: java.util.Map.size |
getAttributeIterator | public Iterator getAttributeIterator()(Code) | | Provides an iterator to traverse the attributes by their keys.
an iterator over the keys to walk the attribute list. |
getResourceHandle | public String getResourceHandle()(Code) | | Obtains the resource handle from the attributes map. This is a
convenience method. Internally, the PFN attribute map is queried
for the value of the resource handle.
the resource handle, or null if unset. See Also: ReplicaCatalogEntry.setResourceHandle(String) |
hasAttribute | public boolean hasAttribute(String key)(Code) | | Checks for the existence of an attribute key.
Parameters: key - is the key to look up true if the key is known, false otherwise. |
merge | public static ReplicaCatalogEntry merge(ReplicaCatalogEntry a, ReplicaCatalogEntry b, boolean overwrite)(Code) | | Merges the attribute maps of two entries in a controlled fashion.
Entries are only merged with another entry, if the physical
filenames match.
Parameters: a - is one replica catalog entry to merge. Parameters: b - is the other replica catalog entry to merge. Parameters: overwrite - resolves intersections. If true, uses rce'sattribute to remain, if false, the original attribute remains. the merged entry, if the PFNs matched, or null if the PFN mismatched. |
merge | public boolean merge(ReplicaCatalogEntry rce, boolean overwrite)(Code) | | Merges the attribute maps in a controlled fashion. An entry is only
merged with another entry, if the physical filenames match.
Parameters: rce - is another replica catalog entry to merge with. Parameters: overwrite - resolves intersections. If true, uses rce'sattribute to remain, if false, the original attribute remains. true if a merge was attempted, false if the PFNs did notmatch. |
setAttribute | public void setAttribute(String key, Object value)(Code) | | Adds a new or overwrites an existing attribute. Note, this is
identical to the
ReplicaCatalogEntry.addAttribute(String,Object) method of
the same signature.
Parameters: key - is the name of the attribute Parameters: value - is the value object associated with the attribute. |
setAttribute | public void setAttribute(Map attributes)(Code) | | Replaces all existing attributes with new attributes. Existing
attributes are removed before attempting a shallow copy of the new
attributes.
Parameters: attributes - is the map of new attributes to remember. See Also: ReplicaCatalogEntry.addAttribute(Map) |
setResourceHandle | public void setResourceHandle(String handle)(Code) | | Sets a new resource handle to remember as PFN attribute. This is a
convenience method. Internally, the PFN attribute map is changed
to remember the new resource handle.
Parameters: handle - is the new resource handle. See Also: ReplicaCatalogEntry.getResourceHandle() |
toString | public String toString()(Code) | | Converts the contents into a string.
a textual representation of the item content. |
|
|