diff options
Diffstat (limited to 'src/main/java/com/c2kernel/entity/agent/JobList.java')
| -rw-r--r-- | src/main/java/com/c2kernel/entity/agent/JobList.java | 21 |
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);
}
|
