diff options
| author | Andrew Branson <andrew@andrewbranson.net> | 2011-06-21 15:46:02 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew@andrewbranson.net> | 2011-06-21 15:46:02 +0200 |
| commit | 254ee6f47eebfc00462c10756a92066e82cc1a96 (patch) | |
| tree | 8273ff95c704e6faa3f92b4711253427b9ba0481 /source/com/c2kernel/entity/agent | |
Initial commit2.2
Diffstat (limited to 'source/com/c2kernel/entity/agent')
| -rwxr-xr-x | source/com/c2kernel/entity/agent/ActiveEntity.java | 281 | ||||
| -rwxr-xr-x | source/com/c2kernel/entity/agent/ActiveLocator.java | 87 | ||||
| -rwxr-xr-x | source/com/c2kernel/entity/agent/Job.java | 343 | ||||
| -rwxr-xr-x | source/com/c2kernel/entity/agent/JobArrayList.java | 30 | ||||
| -rwxr-xr-x | source/com/c2kernel/entity/agent/JobList.java | 125 |
5 files changed, 866 insertions, 0 deletions
diff --git a/source/com/c2kernel/entity/agent/ActiveEntity.java b/source/com/c2kernel/entity/agent/ActiveEntity.java new file mode 100755 index 0000000..cb77bbb --- /dev/null +++ b/source/com/c2kernel/entity/agent/ActiveEntity.java @@ -0,0 +1,281 @@ +/**************************************************************************
+ * BasicAgent.java
+ *
+ * $Revision: 1.39 $
+ * $Date: 2005/04/26 06:48:12 $
+ *
+ * Copyright (C) 2001-2003 CERN - European Organization for Nuclear Research
+ * All rights reserved.
+ **************************************************************************/
+
+package com.c2kernel.entity.agent;
+
+import java.util.Iterator;
+
+import com.c2kernel.common.*;
+import com.c2kernel.entity.AgentPOA;
+import com.c2kernel.entity.C2KLocalObject;
+import com.c2kernel.lookup.AgentPath;
+import com.c2kernel.lookup.InvalidEntityPathException;
+import com.c2kernel.lookup.RolePath;
+import com.c2kernel.persistency.ClusterStorageException;
+import com.c2kernel.persistency.TransactionManager;
+import com.c2kernel.process.Gateway;
+import com.c2kernel.property.PropertyArrayList;
+import com.c2kernel.utils.CastorXMLUtility;
+import com.c2kernel.utils.Logger;
+
+/**************************************************************************
+ * ActiveEntity
+ *
+ * @author $Author: abranson $ $Date: 2005/04/26 06:48:12 $
+ * @version $Revision: 1.39 $
+ **************************************************************************/
+public class ActiveEntity extends AgentPOA
+{
+
+ /**************************************************************************
+ * The CORBA Portable Object Adapter which holds the Agent
+ **************************************************************************/
+ private org.omg.PortableServer.POA mPOA = null;
+
+ /**************************************************************************
+ * The C2Kernel system key of the Agent
+ **************************************************************************/
+ private int mSystemKey = -1;
+
+ /**************************************************************************
+ * Connection to the persistency backeng
+ **************************************************************************/
+ private TransactionManager mDatabase = null;
+
+ /**************************************************************************
+ * The agent's joblist
+ **************************************************************************/
+ private JobList currentJobs;
+ /**
+ *
+ * @param key
+ * @param poa
+ */
+ public ActiveEntity( int key,
+ org.omg.PortableServer.POA poa )
+ {
+ Logger.msg(5, "ActiveEntity::constructor() - SystemKey:" + key );
+
+ mSystemKey = key;
+ mPOA = poa;
+ mDatabase = Gateway.getStorage();
+
+ Logger.msg(5, "ActiveEntity::constructor - completed.");
+ }
+
+ /**
+ * initialise cristal2 properties & collector
+ */
+ public void initialise( String agentProps )
+ throws AccessRightsException,
+ InvalidDataException,
+ PersistencyException
+ {
+ PropertyArrayList props = null;
+ Logger.msg(1, "ActiveEntity::initialise("+mSystemKey+")");
+ //initialise cristal2 properties & collector
+ try
+ {
+ props = initProps( agentProps );
+ mDatabase.commit( props );
+ }
+ catch( ClusterStorageException ex )
+ {
+ Logger.error("ActiveEntity::init() - Failed to init props/collector, aborting!");
+ Logger.error(ex);
+
+ mDatabase.abort( props );
+ throw new PersistencyException("Failed to init props => transaction aborted!");
+ }
+
+ Logger.msg(5, "ActiveEntity::init() - completed.");
+ }
+
+ /**
+ *
+ * @param propsString
+ * @return Properties
+ * @throws InvalidDataException Properties cannot be unmarshalled
+ * @throws ClusterStorageException
+ */
+ private PropertyArrayList initProps( String propsString )
+ throws InvalidDataException,
+ ClusterStorageException
+ {
+ PropertyArrayList props = null;
+
+ // create properties
+ if( !propsString.equals("") && propsString != null )
+ {
+ try
+ {
+ props = (PropertyArrayList)CastorXMLUtility.unmarshall(propsString);
+ }
+ catch( Exception ex )
+ {
+ //any exception during unmarshall indicates that data was
+ //incorrect or the castor mapping was not set up
+ Logger.error(ex);
+ throw new InvalidDataException(ex.toString(), null);
+ }
+
+ Iterator iter = props.list.iterator();
+
+ while( iter.hasNext() )
+ mDatabase.put( mSystemKey, (C2KLocalObject)iter.next(), props );
+ }
+ else
+ {
+ Logger.warning("ActiveEntity::initProps() - NO Properties!");
+ }
+
+ return props;
+ }
+
+ /**************************************************************************
+ *
+ *
+ **************************************************************************/
+ public org.omg.PortableServer.POA _default_POA()
+ {
+ if(mPOA != null)
+ return mPOA;
+ else
+ return super._default_POA();
+ }
+
+
+ /**************************************************************************
+ *
+ *
+ **************************************************************************/
+ public int getSystemKey()
+ {
+ return mSystemKey;
+ }
+
+
+ /**************************************************************************
+ *
+ *
+ **************************************************************************/
+ public String queryData(String xpath)
+ throws AccessRightsException,
+ ObjectNotFoundException,
+ PersistencyException
+ {
+ String result = "";
+ int allPos = -1;
+
+ Logger.msg(1, "ActiveEntity::queryData("+mSystemKey+") - " + xpath );
+
+ try
+ {
+ if( (allPos=xpath.indexOf("all")) != -1 )
+ {
+ String query = xpath.substring(0,allPos);
+ String[] ids = mDatabase.getClusterContents( mSystemKey, query );
+
+ for( int i=0; i<ids.length; i++ )
+ {
+
+ result += ids[i];
+
+ if( i != ids.length-1 )
+ result += ",";
+ }
+ }
+ //****************************************************************
+ else
+ {
+ C2KLocalObject obj = mDatabase.get( mSystemKey, xpath, null );
+
+ result = CastorXMLUtility.marshall(obj);
+ }
+
+ }
+ catch (ObjectNotFoundException ex) {
+ throw ex;
+ }
+ catch(Throwable ex)
+ {
+ Logger.error("ActiveEntity::queryData("+mSystemKey+") - " +
+ xpath + " FAILED");
+ Logger.error(ex);
+ result = "<ERROR/>";
+ }
+
+ Logger.msg(7, "ActiveEntity::queryData("+mSystemKey+") - result:" + result );
+
+ return result;
+ }
+
+
+
+ /**
+ * Called by an activity when it reckons we need to update our joblist for it
+ */
+
+ public synchronized void refreshJobList(int sysKey, String stepPath, String newJobs) {
+ try {
+ JobArrayList newJobList = (JobArrayList)CastorXMLUtility.unmarshall(newJobs);
+
+ // get our joblist
+ if (currentJobs == null)
+ currentJobs = new JobList( mSystemKey, null);
+
+ // remove old jobs for this item
+ currentJobs.removeJobsForStep( sysKey, stepPath );
+
+ // merge new jobs in
+ for (Iterator iter = newJobList.list.iterator(); iter.hasNext();) {
+ Job newJob = (Job)iter.next();
+ Logger.msg(6, "Adding job for "+newJob.getItemSysKey()+"/"+newJob.getStepPath()+":"+newJob.getPossibleTransition());
+ currentJobs.addJob(newJob);
+ }
+
+ } catch (Throwable ex) {
+ Logger.error("Could not refresh job list.");
+ Logger.error(ex);
+ }
+
+ }
+
+ public void addRole(String roleName) throws CannotManageException, ObjectNotFoundException {
+ RolePath newRole = Gateway.getLDAPLookup().getRoleManager().getRolePath(roleName);
+ try {
+ newRole.addAgent(new AgentPath(mSystemKey));
+ } catch (InvalidEntityPathException ex) {
+ throw new CannotManageException("Invalid syskey for agent: "+mSystemKey, "");
+ } catch (ObjectCannotBeUpdated ex) {
+ throw new CannotManageException("Could not update role");
+ }
+ }
+
+ public void removeRole(String roleName) throws CannotManageException, ObjectNotFoundException {
+ RolePath rolePath = Gateway.getLDAPLookup().getRoleManager().getRolePath(roleName);
+ try {
+ rolePath.removeAgent(new AgentPath(mSystemKey));
+ } catch (InvalidEntityPathException e) {
+ throw new CannotManageException("Invalid syskey for agent: "+mSystemKey, "");
+ } catch (ObjectCannotBeUpdated ex) {
+ throw new CannotManageException("Could not update role");
+ }
+ }
+ /**
+ *
+ */
+ protected void finalize() throws Throwable {
+ Logger.msg(7, "Agent "+mSystemKey+" reaped");
+ Gateway.getStorage().clearCache(mSystemKey, null);
+ super.finalize();
+ }
+
+}
diff --git a/source/com/c2kernel/entity/agent/ActiveLocator.java b/source/com/c2kernel/entity/agent/ActiveLocator.java new file mode 100755 index 0000000..25324ee --- /dev/null +++ b/source/com/c2kernel/entity/agent/ActiveLocator.java @@ -0,0 +1,87 @@ +/**************************************************************************
+ * TraceableLocator
+ *
+ * $Workfile$
+ * $Revision: 1.9 $
+ * $Date: 2005/10/05 07:39:36 $
+ *
+ * Copyright (C) 2001 CERN - European Organization for Nuclear Research
+ * All rights reserved.
+ **************************************************************************/
+
+package com.c2kernel.entity.agent;
+
+
+import java.sql.Timestamp;
+
+import com.c2kernel.common.ObjectNotFoundException;
+import com.c2kernel.process.Gateway;
+import com.c2kernel.utils.Logger;
+
+
+/**************************************************************************
+ *
+ * @author $Author: abranson $ $Date: 2005/10/05 07:39:36 $
+ * @version $Revision: 1.9 $
+ **************************************************************************/
+public class ActiveLocator extends org.omg.PortableServer.ServantLocatorPOA
+{
+
+ /**************************************************************************
+ *
+ **************************************************************************/
+ private org.omg.PortableServer.POA mParentPoa;
+
+
+ /**************************************************************************
+ *
+ **************************************************************************/
+ public ActiveLocator( org.omg.PortableServer.POA poa )
+ {
+ mParentPoa = poa;
+ }
+
+
+ /**************************************************************************
+ *
+ **************************************************************************/
+ public org.omg.PortableServer.Servant preinvoke(
+ byte[] oid,
+ org.omg.PortableServer.POA poa,
+ String operation,
+ org.omg.PortableServer.ServantLocatorPackage.CookieHolder cookie )
+ {
+
+ try
+ {
+ int syskey = Integer.parseInt(new String(oid));
+
+ org.omg.PortableServer.Servant servant;
+
+ Logger.msg(1,"===========================================================");
+ Logger.msg(1,"Agent called at "+new Timestamp( System.currentTimeMillis()) +": " + operation +
+ "(" + syskey + ")." );
+
+ return Gateway.getCorbaServer().getAgent(syskey, mParentPoa);
+
+ }
+ catch (ObjectNotFoundException ex)
+ {
+ Logger.error("ObjectNotFoundException::ActiveLocator::preinvoke() "+ex.toString());
+ throw new org.omg.CORBA.OBJECT_NOT_EXIST();
+ }
+ }
+
+
+ /**************************************************************************
+ *
+ **************************************************************************/
+ public void postinvoke(
+ byte[] oid,
+ org.omg.PortableServer.POA poa,
+ String operation,
+ java.lang.Object the_cookie,
+ org.omg.PortableServer.Servant the_servant )
+ {
+ }
+}
diff --git a/source/com/c2kernel/entity/agent/Job.java b/source/com/c2kernel/entity/agent/Job.java new file mode 100755 index 0000000..12423d6 --- /dev/null +++ b/source/com/c2kernel/entity/agent/Job.java @@ -0,0 +1,343 @@ +package com.c2kernel.entity.agent;
+
+import com.c2kernel.common.ObjectNotFoundException;
+import com.c2kernel.entity.C2KLocalObject;
+import com.c2kernel.entity.proxy.AgentProxy;
+import com.c2kernel.entity.proxy.ItemProxy;
+import com.c2kernel.lifecycle.instance.stateMachine.Transitions;
+import com.c2kernel.lookup.EntityPath;
+import com.c2kernel.lookup.InvalidEntityPathException;
+import com.c2kernel.persistency.ClusterStorage;
+import com.c2kernel.persistency.outcome.Outcome;
+import com.c2kernel.persistency.outcome.Viewpoint;
+import com.c2kernel.process.Gateway;
+import com.c2kernel.utils.CastorHashMap;
+import com.c2kernel.utils.KeyValuePair;
+import com.c2kernel.utils.Logger;
+
+/*******************************************************************************
+ * @author $Author: abranson $ $Date: 2005/05/20 13:07:49 $
+ * @version $Revision: 1.62 $
+ ******************************************************************************/
+public class Job implements C2KLocalObject
+{
+ private int mID;
+
+ private String mName;
+
+ private int mItemSysKey;
+
+ private String mStepPath;
+
+ private int mPossibleTransition;
+
+ private int mCurrentState;
+
+ private int mTargetState;
+
+ private String mStepName;
+
+ private int mAgentId = -1;
+
+ private String mAgentName;
+
+ private String mAgentRole;
+
+ private CastorHashMap mActProps = new CastorHashMap();
+
+ private String mOutcome;
+
+ private String mStepType;
+
+ private ItemProxy item = null;
+
+ private AgentProxy agent = null;
+
+ /***************************************************************************
+ * Empty constructor for Castor
+ **************************************************************************/
+ public Job()
+ {
+ }
+
+ /***************************************************************************
+ *
+ **************************************************************************/
+ public Job(int sysKey, String path, int transition, int currState, int targState, String stepName, CastorHashMap actProps, String stepType, String agentName)
+ {
+ setItemSysKey(sysKey);
+ setStepPath(path);
+ setPossibleTransition(transition);
+ setCurrentState(currState);
+ setTargetState(targState);
+ setStepName(stepName);
+ setActProps(actProps);
+ setStepType(stepType);
+ setAgentName(agentName);
+ }
+
+ public int getItemSysKey()
+ {
+ return mItemSysKey;
+ }
+
+ public ItemProxy getItemProxy() throws ObjectNotFoundException, InvalidEntityPathException
+ {
+ if (item == null)
+ item = (ItemProxy) Gateway.getProxyManager().getProxy(new EntityPath(mItemSysKey));
+ return item;
+ }
+
+ public AgentProxy getAgentProxy() throws ObjectNotFoundException, InvalidEntityPathException
+ {
+ if (agent == null)
+ agent = (AgentProxy) Gateway.getProxyManager().getProxy(new EntityPath(getAgentId()));
+ return agent;
+ }
+
+ public String getDescription()
+ {
+ String desc = (String) mActProps.get("Description");
+ if (desc == null)
+ desc = "No Description";
+ return desc;
+ }
+
+ public String getSchemaType()
+ {
+ return (String) mActProps.get("SchemaType");
+ }
+
+ public int getSchemaVersion()
+ {
+ try
+ {
+ return Integer.parseInt((String) mActProps.get("SchemaVersion"));
+ } catch (NumberFormatException ex)
+ {
+ return -1;
+ }
+ }
+
+ public void setOutcome(String outcome)
+ {
+ mOutcome = outcome;
+ }
+
+ public String getOutcomeString()
+ {
+ Logger.debug(8, "getOutcomeString() " + (mOutcome == null && isOutcomeUsed()));
+ if (mOutcome == null && isOutcomeUsed())
+ {
+ String viewName = (String) getActProp("Viewpoint");
+ mOutcome = null;
+ if (viewName.length() > 0)
+ try
+ {
+ Viewpoint view = (Viewpoint) Gateway.getStorage().get(getItemSysKey(), ClusterStorage.VIEWPOINT + "/" + getSchemaType() + "/" + viewName, null);
+ mOutcome = view.getOutcome().getData();
+ } catch (Exception ex)
+ { // not found, return null
+ }
+ }
+ return mOutcome;
+ }
+
+ public Outcome getOutcome()
+ {
+ Logger.msg(1, "Get outcome");
+ return new Outcome(-1, getOutcomeString(), getSchemaType(), getSchemaVersion());
+ }
+
+ public int getAgentId() throws ObjectNotFoundException
+ {
+ if (mAgentId == -1)
+ mAgentId = Gateway.getLDAPLookup().getRoleManager().getAgentPath(getAgentName()).getSysKey();
+ return mAgentId;
+ }
+
+ public void setAgentId(int id)
+ {
+ mAgentId = id;
+ agent = null;
+ }
+
+ public String getAgentName()
+ {
+ if (mAgentName == null)
+ mAgentName = (String) mActProps.get("AgentName");
+ return mAgentName;
+ }
+
+ public void setAgentName(String agentName)
+ {
+ mAgentName = agentName;
+ }
+
+ public String getAgentRole()
+ {
+ if (mAgentRole == null)
+ mAgentRole = (String) mActProps.get("Agent Role");
+ return mAgentRole;
+ }
+
+ public void setAgentRole(String role)
+ {
+ mAgentRole = role;
+ }
+
+ public boolean isOutcomeUsed()
+ {
+ String schemaType = getSchemaType();
+ return (Boolean.TRUE.equals(getActProp("AlwaysUseOutcome")) || mPossibleTransition == Transitions.DONE || mPossibleTransition == Transitions.COMPLETE) && !(schemaType == null || schemaType.equals(""));
+ }
+
+ public int getID()
+ {
+ return mID;
+ }
+
+ public String getName()
+ {
+ return mName;
+ }
+
+ public void setID(int id)
+ {
+ mID = id;
+ mName = String.valueOf(id);
+ }
+
+ public void setName(String name)
+ {
+ mName = name;
+ try
+ {
+ mID = Integer.parseInt(name);
+ } catch (NumberFormatException ex)
+ {
+ mID = -1;
+ }
+ }
+
+ public void setItemSysKey(int sysKey)
+ {
+ mItemSysKey = sysKey;
+ item = null;
+ }
+
+ public String getClusterType()
+ {
+ return ClusterStorage.JOB;
+ }
+
+ public boolean equals(Job job)
+ {
+ return (getItemSysKey() == job.getItemSysKey()) && this.mStepPath.equals(job.mStepPath) && this.mPossibleTransition == job.mPossibleTransition;
+ }
+
+ public Object getActProp(String name)
+ {
+ return mActProps.get(name);
+ }
+
+ public String getActPropString(String name)
+ {
+ try
+ {
+ return mActProps.get(name).toString();
+ } catch (NullPointerException ex)
+ {
+ return null;
+ }
+ }
+
+ public String getStepName()
+ {
+ return mStepName;
+ }
+
+ public void setStepName(String string)
+ {
+ mStepName = string;
+ }
+
+ public String getStepPath()
+ {
+ return mStepPath;
+ }
+
+ public void setStepPath(String string)
+ {
+ mStepPath = string;
+ }
+
+ public int getPossibleTransition()
+ {
+ return mPossibleTransition;
+ }
+
+ public void setPossibleTransition(int lint)
+ {
+ mPossibleTransition = lint;
+ }
+
+ public CastorHashMap getActProps()
+ {
+ return mActProps;
+ }
+
+ public void setActProps(CastorHashMap map)
+ {
+ mActProps = map;
+ }
+
+ public KeyValuePair[] getKeyValuePairs()
+ {
+ return mActProps.getKeyValuePairs();
+ }
+
+ public void setKeyValuePairs(KeyValuePair[] pairs)
+ {
+ mActProps.setKeyValuePairs(pairs);
+ }
+
+ public int getCurrentState()
+ {
+ return mCurrentState;
+ }
+
+ public void setCurrentState(int string)
+ {
+ mCurrentState = string;
+ }
+
+ public int getTargetState() {
+ return mTargetState;
+ }
+
+ public void setTargetState(int mTargetState) {
+ this.mTargetState = mTargetState;
+ }
+
+ /**
+ * Returns the actType.
+ *
+ * @return String
+ */
+ public String getStepType()
+ {
+ return mStepType;
+ }
+
+ /**
+ * Sets the actType.
+ *
+ * @param actType
+ * The actType to set
+ */
+ public void setStepType(String actType)
+ {
+ mStepType = actType;
+ }
+}
\ No newline at end of file diff --git a/source/com/c2kernel/entity/agent/JobArrayList.java b/source/com/c2kernel/entity/agent/JobArrayList.java new file mode 100755 index 0000000..b6eb2c2 --- /dev/null +++ b/source/com/c2kernel/entity/agent/JobArrayList.java @@ -0,0 +1,30 @@ +/**************************************************************************
+ *
+ * $Revision: 1.2 $
+ * $Date: 2003/06/20 11:44:30 $
+ *
+ * Copyright (C) 2001 CERN - European Organization for Nuclear Research
+ * All rights reserved.
+ **************************************************************************/
+
+package com.c2kernel.entity.agent;
+
+import java.util.ArrayList;
+
+import com.c2kernel.utils.CastorArrayList;
+
+public class JobArrayList extends CastorArrayList
+{
+
+ public JobArrayList()
+ {
+ super();
+ }
+
+ public JobArrayList(ArrayList aList)
+ {
+ super(aList);
+ }
+
+
+}
diff --git a/source/com/c2kernel/entity/agent/JobList.java b/source/com/c2kernel/entity/agent/JobList.java new file mode 100755 index 0000000..d0d05d5 --- /dev/null +++ b/source/com/c2kernel/entity/agent/JobList.java @@ -0,0 +1,125 @@ +package com.c2kernel.entity.agent;
+
+import java.util.Iterator;
+import java.util.Vector;
+
+import com.c2kernel.common.ObjectNotFoundException;
+import com.c2kernel.lookup.InvalidEntityPathException;
+import com.c2kernel.persistency.ClusterStorage;
+import com.c2kernel.persistency.RemoteMap;
+import com.c2kernel.utils.Logger;
+
+
+/**************************************************************************
+*
+* @author $Author: abranson $ $Date: 2006/03/03 13:52:21 $
+* @version $Revision: 1.15 $
+***************************************************************************/
+public class JobList extends RemoteMap
+{
+
+ /**************************************************************************
+ * Empty constructor for Castor
+ **************************************************************************/
+ public JobList(int sysKey, Object locker)
+ throws ObjectNotFoundException, InvalidEntityPathException
+ {
+ super(sysKey, ClusterStorage.JOB, locker);
+ }
+
+
+ /**************************************************************************
+ *
+ **************************************************************************/
+ public void addJob( Job job )
+ {
+ synchronized(this) {
+ int jobId = getLastId()+1;
+ job.setID(jobId);
+ put(String.valueOf(jobId), job);
+ }
+ }
+
+ /**
+ * Cannot be stored
+ */
+ public String getClusterType() {
+ return null;
+ }
+
+ public int containsJob( Job job )
+ {
+ Iterator actMembers = keySet().iterator();
+ Job j = null;
+
+ while( actMembers.hasNext() )
+ {
+ j = (Job)actMembers.next();
+
+ if( j.equals(job) )
+ return j.getID();
+ }
+
+ return -1;
+ }
+
+ public Job getJob(int id) {
+ return (Job)get(String.valueOf(id));
+ }
+
+
+ /**
+ * @param job
+ */
+ public void removeJobsWithSysKey( int sysKey )
+ {
+ Iterator currentMembers = values().iterator();
+ Job j = null;
+
+ while( currentMembers.hasNext() )
+ {
+ j = (Job)currentMembers.next();
+
+ if( j.getItemSysKey() == sysKey )
+ remove( String.valueOf(j.getID()) );
+ }
+
+ Logger.msg(5, "JobList::removeJobsWithSysKey() - " + sysKey + " DONE." );
+ }
+
+ public void removeJobsForStep( int sysKey, String stepPath )
+ {
+ Iterator currentMembers = values().iterator();
+ while( currentMembers.hasNext() )
+ {
+ Job j = (Job)currentMembers.next();
+ if( j.getItemSysKey() == sysKey && j.getStepPath().equals(stepPath))
+ remove( String.valueOf(j.getID()) );
+ }
+
+ Logger.msg(5, "JobList::removeJobsForStep() - " + sysKey + " DONE." );
+ }
+ /**
+ * @param itemKey
+ * @param string
+ * @return
+ */
+ public Vector getJobsOfSysKey(int sysKey)
+ {
+ Iterator currentMembers = values().iterator();
+ Job j = null;
+ Vector jobs = new Vector();
+
+ while( currentMembers.hasNext() )
+ {
+ j = (Job)currentMembers.next();
+
+ if( j.getItemSysKey() == sysKey )
+ jobs.add(j);
+ }
+
+ Logger.msg(5, "JobList::getJobsOfSysKey() - returning " + jobs.size() + " Jobs." );
+
+ return jobs;
+ }
+}
\ No newline at end of file |
