Package edu.isi.pegasus.planner.classes
Class ReplicaLocation
- java.lang.Object
-
- edu.isi.pegasus.planner.classes.Data
-
- edu.isi.pegasus.planner.classes.ReplicaLocation
-
- All Implemented Interfaces:
java.lang.Cloneable
public class ReplicaLocation extends Data implements java.lang.Cloneable
A Data Class that associates a LFN with the PFN's. Attributes associated with the LFN go here.- Version:
- $Revision$
- Author:
- Karan Vahi, Gaurang Mehta
- See Also:
org.griphyn.common.catalog.ReplicaCatalogEntry
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringmLFNThe LFN associated with the entry.private java.util.ListmPFNListA list ofReplicaCatalogEntryobjects containing the PFN's and associated attributes.static java.lang.StringUNDEFINED_SITE_NAMEThe site name that is associated in the case the resource handle is not specified with the PFN.
-
Constructor Summary
Constructors Constructor Description ReplicaLocation()Default constructor.ReplicaLocation(java.lang.String lfn, java.util.Collection pfns)Overloaded constructor.ReplicaLocation(java.lang.String lfn, java.util.List pfns)Overloaded constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPFN(ReplicaCatalogEntry tuple)Add a PFN and it's attributes.voidaddPFN(PFN pfn)Adds a PFN specified in the DAX to the objectprotected voidaddPFNs(java.util.List tuples)Add a PFN and it's attributes.java.lang.Objectclone()Returns the clone of the object.java.lang.StringgetLFN()Returns the associated LFN.ReplicaCatalogEntrygetPFN(int index)Return a PFN as aReplicaCatalogEntryintgetPFNCount()Returns the number of pfn's associated with the lfn.java.util.ListgetPFNList()Returns the list of pfn's asReplicaCatalogEntryobjects.booleanmerge(ReplicaLocation location)Merges theReplicaLocationobject to the existing one, only if the logical filenames match.java.util.IteratorpfnIterator()Returns an iterator to the list ofReplicaCatalogEntryobjects.private voidsanitize(ReplicaCatalogEntry tuple)Sanitizes a tuple .private voidsanitize(java.util.List tuples)Sanitizes a tuple list .voidsetLFN(java.lang.String lfn)Sets the LFN.java.lang.StringtoString()Returns the textual description of the data class.-
Methods inherited from class edu.isi.pegasus.planner.classes.Data
setToString, vectorToString
-
-
-
-
Field Detail
-
UNDEFINED_SITE_NAME
public static final java.lang.String UNDEFINED_SITE_NAME
The site name that is associated in the case the resource handle is not specified with the PFN.- See Also:
- Constant Field Values
-
mLFN
private java.lang.String mLFN
The LFN associated with the entry.
-
mPFNList
private java.util.List mPFNList
A list ofReplicaCatalogEntryobjects containing the PFN's and associated attributes.
-
-
Constructor Detail
-
ReplicaLocation
public ReplicaLocation()
Default constructor.
-
ReplicaLocation
public ReplicaLocation(java.lang.String lfn, java.util.List pfns)Overloaded constructor. Intializes the member variables to the values passed.- Parameters:
lfn- the logical filename.pfns- the list ofReplicaCatalogEntryobjects.
-
ReplicaLocation
public ReplicaLocation(java.lang.String lfn, java.util.Collection pfns)Overloaded constructor. Intializes the member variables to the values passed.- Parameters:
lfn- the logical filename.pfns- the list ofReplicaCatalogEntryobjects.
-
-
Method Detail
-
addPFN
public void addPFN(PFN pfn)
Adds a PFN specified in the DAX to the object- Parameters:
pfn- the PFN
-
addPFN
public void addPFN(ReplicaCatalogEntry tuple)
Add a PFN and it's attributes. Any existing mapping with the same PFN will be replaced, including all its attributes.- Parameters:
tuple- theReplicaCatalogEntryobject containing the PFN and the attributes.
-
addPFNs
protected void addPFNs(java.util.List tuples)
Add a PFN and it's attributes.- Parameters:
tuples- theListobject ofReplicaCatalogEntryobjects, each containing the PFN and the attributes.
-
setLFN
public void setLFN(java.lang.String lfn)
Sets the LFN.- Parameters:
lfn- the lfn.
-
getLFN
public java.lang.String getLFN()
Returns the associated LFN.- Returns:
- lfn
-
getPFN
public ReplicaCatalogEntry getPFN(int index)
Return a PFN as aReplicaCatalogEntry- Parameters:
index- the pfn location.- Returns:
- the element at the specified position in this list.
- Throws:
java.lang.IndexOutOfBoundsException- - if the index is out of range (index < 0 || index >= size()).
-
getPFNList
public java.util.List getPFNList()
Returns the list of pfn's asReplicaCatalogEntryobjects.- Returns:
- List
-
pfnIterator
public java.util.Iterator pfnIterator()
Returns an iterator to the list ofReplicaCatalogEntryobjects.- Returns:
- Iterator.
-
getPFNCount
public int getPFNCount()
Returns the number of pfn's associated with the lfn.- Returns:
- int
-
clone
public java.lang.Object clone()
Returns the clone of the object.- Overrides:
clonein classjava.lang.Object- Returns:
- the clone
-
merge
public boolean merge(ReplicaLocation location)
Merges theReplicaLocationobject to the existing one, only if the logical filenames match.- Parameters:
location- is anotherReplicaLocationsto merge with.- Returns:
- true if a merge was successful, false if the LFNs did not match.
-
toString
public java.lang.String toString()
Returns the textual description of the data class.
-
sanitize
private void sanitize(java.util.List tuples)
Sanitizes a tuple list . Sets the resource handle to a default value if not specified.- Parameters:
tuples- the tuple to be sanitized.
-
sanitize
private void sanitize(ReplicaCatalogEntry tuple)
Sanitizes a tuple . Sets the resource handle to a default value if not specified.- Parameters:
tuple- the tuple to be sanitized.
-
-