summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/entity/agent/JobList.java
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2014-09-09 12:13:21 +0200
committerAndrew Branson <andrew.branson@cern.ch>2014-09-09 12:13:21 +0200
commitda731d2bb81666b9c697d9099da632e7dfcdc0f7 (patch)
tree567693c3c48f3d15ecbb2dac4f9db03bb6e58c72 /src/main/java/com/c2kernel/entity/agent/JobList.java
parentae1e79e33fd30e3d8bcedbef8891a14a048276d7 (diff)
Replaced int sysKey Item identifier with UUID, which is now portable.
ItemPath objects are now used to identify Items throughout the kernel, replacing ints and Integers.
Diffstat (limited to 'src/main/java/com/c2kernel/entity/agent/JobList.java')
-rw-r--r--src/main/java/com/c2kernel/entity/agent/JobList.java21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/main/java/com/c2kernel/entity/agent/JobList.java b/src/main/java/com/c2kernel/entity/agent/JobList.java
index 271decb..ac3b421 100644
--- a/src/main/java/com/c2kernel/entity/agent/JobList.java
+++ b/src/main/java/com/c2kernel/entity/agent/JobList.java
@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.Vector;
+import com.c2kernel.lookup.ItemPath;
import com.c2kernel.persistency.ClusterStorage;
import com.c2kernel.persistency.RemoteMap;
import com.c2kernel.utils.Logger;
@@ -20,9 +21,9 @@ public class JobList extends RemoteMap<Job>
/**************************************************************************
* Empty constructor for Castor
**************************************************************************/
- public JobList(int sysKey, Object locker)
+ public JobList(ItemPath itemPath, Object locker)
{
- super(sysKey, ClusterStorage.JOB, locker);
+ super(itemPath, ClusterStorage.JOB, locker);
}
@@ -55,7 +56,7 @@ public class JobList extends RemoteMap<Job>
/**
* @param job
*/
- public void removeJobsWithSysKey( int sysKey )
+ public void removeJobsForItem( ItemPath itemPath )
{
Iterator<Job> currentMembers = values().iterator();
Job j = null;
@@ -64,14 +65,14 @@ public class JobList extends RemoteMap<Job>
{
j = currentMembers.next();
- if( j.getItemSysKey() == sysKey )
+ if( j.getItemPath().equals(itemPath) )
remove( String.valueOf(j.getId()) );
}
- Logger.msg(5, "JobList::removeJobsWithSysKey() - " + sysKey + " DONE." );
+ Logger.msg(5, "JobList::removeJobsWithSysKey() - " + itemPath + " DONE." );
}
- public void removeJobsForStep( int sysKey, String stepPath )
+ public void removeJobsForStep( ItemPath itemPath, String stepPath )
{
ArrayList<String> staleJobs = new ArrayList<String>();
Iterator<String> jobIter = keySet().iterator();
@@ -79,7 +80,7 @@ public class JobList extends RemoteMap<Job>
{
String jid = jobIter.next();
Job j = get(jid);
- if( j.getItemSysKey() == sysKey && j.getStepPath().equals(stepPath))
+ if( j.getItemPath().equals(itemPath) && j.getStepPath().equals(stepPath))
staleJobs.add(jid);
}
@@ -88,14 +89,14 @@ public class JobList extends RemoteMap<Job>
for (String jid : staleJobs) {
remove(jid);
}
- Logger.msg(5, "JobList::removeJobsForStep() - " + sysKey + " DONE." );
+ Logger.msg(5, "JobList::removeJobsForStep() - " + itemPath + " DONE." );
}
/**
* @param itemKey
* @param string
* @return
*/
- public Vector<Job> getJobsOfSysKey(int sysKey)
+ public Vector<Job> getJobsOfItem( ItemPath itemPath )
{
Iterator<Job> currentMembers = values().iterator();
Job j = null;
@@ -105,7 +106,7 @@ public class JobList extends RemoteMap<Job>
{
j = currentMembers.next();
- if( j.getItemSysKey() == sysKey )
+ if( j.getItemPath().equals(itemPath) )
jobs.add(j);
}