com.altair.hwm.comm.loadsubmission.jobservices
Class HWMLocalJobManager

java.lang.Object
  extended by com.altair.hwm.comm.loadsubmission.jobservices.HWMLocalJobManager
All Implemented Interfaces:
IHWMJobManager

public class HWMLocalJobManager
extends java.lang.Object
implements IHWMJobManager

Title: HWMLocalJobManager Description: Represents a job manager for locally submitted jobs such as optistruct Manages a Vector of jobs submitted by the user Creates blank job if required Retrieves a persisted job object and its status from a binary file Submits job objects through a dialog interface Needs an entry shown below in the hdmconfig.xml to be invoked from tcl Company: Altair Engineering, Inc.


Constructor Summary
HWMLocalJobManager()
          Default Constructor Does nothing
 
Method Summary
 void AddJobListener(IHWMJobListener listener, IHWMJob hwmJob)
          This method adds the specified listener in order to get call back events from the specified job.
 void AddJobs(HWMOptistructJob job)
          Adds jobs to the job manager IMP : job must have a job ID
 IHWMJob CreateJobInstance()
          This method creates an instance of IHWMJob without a GUI This mode is primarily used for creating a default job in to which different parameters can be set through APIs available in IHWMJob.
 IHWMJob CreateJobInstance(java.lang.String strJobID)
          GetJobInstance - returns a job if existent based on ID
 IHWMJob CreateJobInstanceWithDialog()
          This method creates an instance of IHWMJob with parameters set in a GUI dialog.
 int DownloadResults(HWMOptistructJob job)
          DownloadResults - Actually gets a list of files ouput by the solver Looks for files in the ouput directory of the job
 void DownloadResults(java.lang.String strJobID, java.io.File fileDestDir)
          This method downloads the result files for the job identified by the specified JobID to the specified directory.
 IHWMJob GetJobInstance(java.lang.String strJobID)
          This method returns the IHWMJob instance held by IHWMJobManager against the specified JobID.
 IHWMJobStatus GetJobStatus(IHWMJob job)
          Gets the status of a job submitted This method iterates through the jobs vector to verify the status Additionally reads the status from a binary file if that is present in the job output directory
 IHWMJobStatus GetJobStatus(java.lang.String strJobStatus)
          This is a utility method to convert a String strJobStatus in to an instance of IHWMJobStatus.
 boolean LoginToJobSubmissionSystem()
          LoginToJobSubmissionSystem - dummy login function We may implement a realistic login in future
 boolean LoginToJobSubmissionSystem(java.lang.String strLoginName, java.lang.String strPasswd)
          Login into the job submission system using specified login name and passwd
 void RemoveListener(IHWMJobListener listener, IHWMJob hwmJob)
          This method removes the specified listener in order to stop getting call back events from the specified job.
 IHWMJob ShowJobSubmissionDialog(IHWMJob job)
          This method creates an instance of IHWMJob with parameters set in a GUI dialog.
 java.lang.String SubmitJob(IHWMJob job)
          SubmitJob - solve the deck file using the solver Add the submitted job to the job manager so that its status can be tracked.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HWMLocalJobManager

public HWMLocalJobManager()
Default Constructor Does nothing

Method Detail

AddJobs

public void AddJobs(HWMOptistructJob job)
Adds jobs to the job manager IMP : job must have a job ID

Parameters:
job -

LoginToJobSubmissionSystem

public boolean LoginToJobSubmissionSystem()
                                   throws java.lang.Exception
LoginToJobSubmissionSystem - dummy login function We may implement a realistic login in future

Specified by:
LoginToJobSubmissionSystem in interface IHWMJobManager
Returns:
- always true
Throws:
java.lang.Exception

SubmitJob

public java.lang.String SubmitJob(IHWMJob job)
                           throws java.lang.Exception
SubmitJob - solve the deck file using the solver Add the submitted job to the job manager so that its status can be tracked.

Specified by:
SubmitJob in interface IHWMJobManager
Parameters:
job - - Optistruct job
Returns:
Throws:
java.lang.Exception

CreateJobInstance

public IHWMJob CreateJobInstance()
                          throws java.lang.Exception
This method creates an instance of IHWMJob without a GUI This mode is primarily used for creating a default job in to which different parameters can be set through APIs available in IHWMJob.

Specified by:
CreateJobInstance in interface IHWMJobManager
Returns:
An default instance of IHWMJob.
Throws:
java.lang.Exception

ShowJobSubmissionDialog

public IHWMJob ShowJobSubmissionDialog(IHWMJob job)
                                throws java.lang.Exception
This method creates an instance of IHWMJob with parameters set in a GUI dialog. This mode is used when job parametes have to be set interactively.

Returns:
An instance of IHWMJob populated with parameters filled in the dialog.
Throws:
java.lang.Exception

CreateJobInstance

public IHWMJob CreateJobInstance(java.lang.String strJobID)
                          throws java.lang.Exception
GetJobInstance - returns a job if existent based on ID

Parameters:
strJobID -
Returns:
Throws:
java.lang.Exception

GetJobStatus

public IHWMJobStatus GetJobStatus(IHWMJob job)
Gets the status of a job submitted This method iterates through the jobs vector to verify the status Additionally reads the status from a binary file if that is present in the job output directory

Specified by:
GetJobStatus in interface IHWMJobManager
Parameters:
job -
Returns:

DownloadResults

public int DownloadResults(HWMOptistructJob job)
DownloadResults - Actually gets a list of files ouput by the solver Looks for files in the ouput directory of the job

Parameters:
job -
Returns:

CreateJobInstanceWithDialog

public IHWMJob CreateJobInstanceWithDialog()
                                    throws java.lang.Exception
Description copied from interface: IHWMJobManager
This method creates an instance of IHWMJob with parameters set in a GUI dialog. This mode is used when job parametes have to be set interactively.

Specified by:
CreateJobInstanceWithDialog in interface IHWMJobManager
Returns:
An instance of IHWMJob populated with parameters filled in the dialog.
Throws:
java.lang.Exception

GetJobInstance

public IHWMJob GetJobInstance(java.lang.String strJobID)
                       throws java.lang.Exception
Description copied from interface: IHWMJobManager
This method returns the IHWMJob instance held by IHWMJobManager against the specified JobID. Returns null if none found.

Specified by:
GetJobInstance in interface IHWMJobManager
Parameters:
strJobID - The JobID corresponding to which the IHWMJob instance is required.
Returns:
The IHWMJob instance for the specified JobID.
Throws:
java.lang.Exception

GetJobStatus

public IHWMJobStatus GetJobStatus(java.lang.String strJobStatus)
                           throws java.lang.Exception
Description copied from interface: IHWMJobManager
This is a utility method to convert a String strJobStatus in to an instance of IHWMJobStatus. It is to be noted that IHWMJobStatus does provide a toString() method so that an IHWMJobStatus instance can be obtained from a string and vice-versa.

Specified by:
GetJobStatus in interface IHWMJobManager
Parameters:
strJobStatus - A string representation of the jobstatus.
Returns:
An instance of IHWMJobStatus if strJobStatus is in proper format and null otherwise.
Throws:
java.lang.Exception

LoginToJobSubmissionSystem

public boolean LoginToJobSubmissionSystem(java.lang.String strLoginName,
                                          java.lang.String strPasswd)
                                   throws java.lang.Exception
Description copied from interface: IHWMJobManager
Login into the job submission system using specified login name and passwd

Specified by:
LoginToJobSubmissionSystem in interface IHWMJobManager
Parameters:
strLoginName - Thelogin name for job submission system
strPasswd - The password for job submission system.
Returns:
boolean value indicating whether login was successful or not. true=>successful false=>not successful.
Throws:
java.lang.Exception

AddJobListener

public void AddJobListener(IHWMJobListener listener,
                           IHWMJob hwmJob)
Description copied from interface: IHWMJobManager
This method adds the specified listener in order to get call back events from the specified job.

Specified by:
AddJobListener in interface IHWMJobManager
Parameters:
listener - The listener to be added.
hwmJob - The job instance whose event call backs have to be listened for.

RemoveListener

public void RemoveListener(IHWMJobListener listener,
                           IHWMJob hwmJob)
Description copied from interface: IHWMJobManager
This method removes the specified listener in order to stop getting call back events from the specified job.

Specified by:
RemoveListener in interface IHWMJobManager
Parameters:
listener - The listener to be removed.
hwmJob - The job instance whose event call backs have to be stopped being listened for.

DownloadResults

public void DownloadResults(java.lang.String strJobID,
                            java.io.File fileDestDir)
                     throws java.lang.Exception
Description copied from interface: IHWMJobManager
This method downloads the result files for the job identified by the specified JobID to the specified directory.

Specified by:
DownloadResults in interface IHWMJobManager
Parameters:
strJobID - The JOBID to identify the job whose results have to be retrieved.
fileDestDir - The destination directory to retrieve files.
Throws:
java.lang.Exception