PTP
Release 5.0

org.eclipse.ptp.ui.managers
Class JobManager

java.lang.Object
  extended by org.eclipse.ptp.ui.managers.AbstractElementManager
      extended by org.eclipse.ptp.ui.managers.JobManager
All Implemented Interfaces:
IElementManager, IJobManager
Direct Known Subclasses:
UIDebugManager

public class JobManager
extends AbstractElementManager
implements IJobManager

Since:
4.0

Field Summary
protected  org.eclipse.ptp.core.elements.IPJob cur_job
           
protected  org.eclipse.ptp.core.elements.IPQueue cur_queue
           
protected  java.lang.String DEFAULT_TITLE
           
protected  java.util.Map<java.lang.String,org.eclipse.ptp.core.elements.IPJob> jobList
           
 
Fields inherited from class org.eclipse.ptp.ui.managers.AbstractElementManager
cur_set_id, elementHandlers, jListeners, modelPresentation, setListeners
 
Fields inherited from interface org.eclipse.ptp.ui.IElementManager
ADD_ELEMENT_TYPE, CHANGE_SET_TYPE, CREATE_SET_TYPE, DELETE_SET_TYPE, EMPTY_ID, REMOVE_ELEMENT_TYPE
 
Constructor Summary
JobManager()
           
 
Method Summary
 void addJob(org.eclipse.ptp.core.elements.IPJob job)
          Add a new job to jobList.
 void addProcess(org.eclipse.ptp.core.elements.IPJob job, int procJobRank)
          Add a process to the view.
 void clear()
          clean all setting
 IElementHandler createElementHandler(org.eclipse.ptp.core.elements.IPJob job)
          Create an element handler for the job
protected  IElement createProcessElement(IElementSet set, java.lang.String key, org.eclipse.ptp.core.elements.IPJob job, int processJobRank)
           
 org.eclipse.ptp.core.elements.IPJob findJobById(java.lang.String job_id)
          Find a job give its ID.
 java.lang.String getFullyQualifiedName(java.lang.String id)
          Get fully qualified name of element
 org.eclipse.swt.graphics.Image getImage(IElement element)
          Get element image
 org.eclipse.ptp.core.elements.IPJob getJob()
          Get the currently selected job.
 org.eclipse.ptp.core.elements.IPJob[] getJobs()
          Get Jobs that we know about.
 java.lang.String getName(java.lang.String id)
          Get name of element
 java.lang.String getProcessStatusText(org.eclipse.ptp.internal.ui.model.PProcessUI proc)
          Get process status text
 org.eclipse.ptp.core.elements.IPQueue getQueue()
          Get the currently selected queue.
 org.eclipse.ptp.core.elements.IPQueue[] getQueues()
           
 java.lang.String[] getSets(java.lang.String jid)
          Return set id
 boolean hasStoppedJob()
          Test if there is at least one completed job.
 org.eclipse.ptp.core.elements.IPElement initial(org.eclipse.ptp.core.elements.IPUniverse universe)
          initial elements
 boolean isCurrentSetContainProcess(java.lang.String jid, java.lang.String processID)
          Is current set contain process
 boolean isJobStop(java.lang.String job_id)
           
 boolean isNoJob(java.lang.String jid)
           
 void removeAllStoppedJobs()
          Remove all jobs that have completed from the view
 void removeJob(org.eclipse.ptp.core.elements.IPJob job)
          Remove job from view.
 void removeProcess(org.eclipse.ptp.core.elements.IPJob job, int procJobRank)
          Remove a process from the view.
 void setCurrentSetId(java.lang.String set_id)
          set current set ID
 void setJob(org.eclipse.ptp.core.elements.IPJob job)
          Set the current job
 void setQueue(org.eclipse.ptp.core.elements.IPQueue queue)
           
 void shutdown()
          Shutdown the manager
 int size()
          Get element size
 void terminateJob()
          terminate action
 
Methods inherited from class org.eclipse.ptp.ui.managers.AbstractElementManager
addJobChangedListener, addSetListener, addToSet, addToSet, createSet, fireJobChangedEvent, fireSetEvent, getCurrentSetId, getElementHandler, removeElementHandler, removeFromSet, removeJobChangedListener, removeSet, removeSetListener, setElementHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ptp.ui.IJobManager
addJobChangedListener, fireJobChangedEvent, removeJobChangedListener
 
Methods inherited from interface org.eclipse.ptp.ui.IElementManager
addSetListener, addToSet, addToSet, createSet, fireSetEvent, getCurrentSetId, getElementHandler, removeElementHandler, removeFromSet, removeSet, removeSetListener, setElementHandler
 

Field Detail

jobList

protected java.util.Map<java.lang.String,org.eclipse.ptp.core.elements.IPJob> jobList

cur_job

protected org.eclipse.ptp.core.elements.IPJob cur_job

cur_queue

protected org.eclipse.ptp.core.elements.IPQueue cur_queue

DEFAULT_TITLE

protected final java.lang.String DEFAULT_TITLE
Constructor Detail

JobManager

public JobManager()
Method Detail

addJob

public void addJob(org.eclipse.ptp.core.elements.IPJob job)
Add a new job to jobList. Check for any new processes and add these to the element handler for the job.

Parameters:
job -

addProcess

public void addProcess(org.eclipse.ptp.core.elements.IPJob job,
                       int procJobRank)
Description copied from interface: IJobManager
Add a process to the view.

Specified by:
addProcess in interface IJobManager
Since:
4.0

clear

public void clear()
Description copied from interface: IElementManager
clean all setting

Specified by:
clear in interface IElementManager
Overrides:
clear in class AbstractElementManager

createElementHandler

public IElementHandler createElementHandler(org.eclipse.ptp.core.elements.IPJob job)
Description copied from interface: IJobManager
Create an element handler for the job

Specified by:
createElementHandler in interface IJobManager
Parameters:
job - job
Returns:
element handler for the job

findJobById

public org.eclipse.ptp.core.elements.IPJob findJobById(java.lang.String job_id)
Description copied from interface: IJobManager
Find a job give its ID.

Specified by:
findJobById in interface IJobManager
Parameters:
job_id - ID of job to find
Returns:
job with corresponding ID

getFullyQualifiedName

public java.lang.String getFullyQualifiedName(java.lang.String id)
Description copied from interface: IElementManager
Get fully qualified name of element

Specified by:
getFullyQualifiedName in interface IElementManager
Parameters:
id - element ID
Returns:
fully quallified name of element

getJob

public org.eclipse.ptp.core.elements.IPJob getJob()
Description copied from interface: IJobManager
Get the currently selected job.

Specified by:
getJob in interface IJobManager
Returns:
currently selected job

getJobs

public org.eclipse.ptp.core.elements.IPJob[] getJobs()
Description copied from interface: IJobManager
Get Jobs that we know about.

Specified by:
getJobs in interface IJobManager
Returns:
jobs

getName

public java.lang.String getName(java.lang.String id)
Description copied from interface: IElementManager
Get name of element

Specified by:
getName in interface IElementManager
Parameters:
id - element ID
Returns:
name of element

getProcessStatusText

public java.lang.String getProcessStatusText(org.eclipse.ptp.internal.ui.model.PProcessUI proc)
Get process status text

Parameters:
proc - process (PProcessUI goes away when we address UI scalability. See Bug 311057)
Returns:
status
Since:
4.0

getQueue

public org.eclipse.ptp.core.elements.IPQueue getQueue()
Description copied from interface: IJobManager
Get the currently selected queue.

Specified by:
getQueue in interface IJobManager
Returns:
currently selected queue

getQueues

public org.eclipse.ptp.core.elements.IPQueue[] getQueues()
Returns:

getSets

public java.lang.String[] getSets(java.lang.String jid)
Return set id

Parameters:
jid -
Returns:

getImage

public org.eclipse.swt.graphics.Image getImage(IElement element)
Description copied from interface: IElementManager
Get element image

Specified by:
getImage in interface IElementManager
Specified by:
getImage in class AbstractElementManager
Parameters:
element - IElement
Returns:
element image

hasStoppedJob

public boolean hasStoppedJob()
Description copied from interface: IJobManager
Test if there is at least one completed job.

Specified by:
hasStoppedJob in interface IJobManager
Returns:
true if there is a completed job

initial

public org.eclipse.ptp.core.elements.IPElement initial(org.eclipse.ptp.core.elements.IPUniverse universe)
Description copied from interface: IElementManager
initial elements

Specified by:
initial in interface IElementManager
Returns:
first element name

isCurrentSetContainProcess

public boolean isCurrentSetContainProcess(java.lang.String jid,
                                          java.lang.String processID)
Is current set contain process

Parameters:
jid - job ID
processID - process ID
Returns:
true if job contains process

isJobStop

public boolean isJobStop(java.lang.String job_id)

isNoJob

public boolean isNoJob(java.lang.String jid)

removeAllStoppedJobs

public void removeAllStoppedJobs()
Description copied from interface: IJobManager
Remove all jobs that have completed from the view

Specified by:
removeAllStoppedJobs in interface IJobManager

removeJob

public void removeJob(org.eclipse.ptp.core.elements.IPJob job)
Description copied from interface: IJobManager
Remove job from view.

Specified by:
removeJob in interface IJobManager

removeProcess

public void removeProcess(org.eclipse.ptp.core.elements.IPJob job,
                          int procJobRank)
Description copied from interface: IJobManager
Remove a process from the view.

Specified by:
removeProcess in interface IJobManager
Since:
4.0

setCurrentSetId

public void setCurrentSetId(java.lang.String set_id)
Description copied from interface: IElementManager
set current set ID

Specified by:
setCurrentSetId in interface IElementManager
Parameters:
set_id - set ID

setJob

public void setJob(org.eclipse.ptp.core.elements.IPJob job)
Description copied from interface: IJobManager
Set the current job

Specified by:
setJob in interface IJobManager
Parameters:
job - the current job to set

setQueue

public void setQueue(org.eclipse.ptp.core.elements.IPQueue queue)
Parameters:
queue -

shutdown

public void shutdown()
Description copied from interface: IElementManager
Shutdown the manager

Specified by:
shutdown in interface IElementManager
Overrides:
shutdown in class AbstractElementManager

size

public int size()
Description copied from interface: IElementManager
Get element size

Specified by:
size in interface IElementManager
Returns:
size of element

terminateJob

public void terminateJob()
                  throws org.eclipse.core.runtime.CoreException
terminate action

Specified by:
terminateJob in interface IJobManager
Throws:
org.eclipse.core.runtime.CoreException

createProcessElement

protected IElement createProcessElement(IElementSet set,
                                        java.lang.String key,
                                        org.eclipse.ptp.core.elements.IPJob job,
                                        int processJobRank)
Parameters:
set -
key -
job -
processJobRank -
Returns:
Since:
4.0

PTP
Release 5.0

Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.