com.altair.hwm.comm.loadsubmission.ecompute
Class HWMEComputeJobManager

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

public class HWMEComputeJobManager
extends java.lang.Object
implements IHWMJobManager

Title: HWMEComputeJobManager Description: This class gives a concrete implementation to the interface IHWMJobManager. The IHWMJobManager interface abstracts the operation of submitting CAE analysis jobs to a solver and managing the results. Company: Altair Engineering

Author:
: Shashi

Constructor Summary
HWMEComputeJobManager()
          Def Cons
 
Method Summary
 void AddJobListener(IHWMJobListener listener, IHWMJob hwmJob)
          AddJobListener - adds the run entity as a listener
 void AddJobs(HWMEComputeJob ecompJob)
          Adds jobs to the job manager IMP : job must have a job ID
 boolean AutoLoginToEcompute()
          AutoLogin into the job submission system using username and password stored in the job manager instance.
 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)
          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 CreateJobInstanceWithDialog()
          CreateJobInstanceWithDialog - creates a job instance using parameters from an interactive dialog.
 int DownloadResults(HWMEComputeJob job)
          This method downloads the result files for the job identified by the specified job instance
 void DownloadResults(java.lang.String strJobID, java.io.File fileDestDir)
          DownloadResults - downloads results from E-compute
 java.lang.String GetAuthenticatedUser()
          Gets the user name once it has been authenticated by the user.
 IHWMJob GetJobInstance(java.lang.String strJobID)
          This method returns the IHWMJob instance held by IHWMJobManager against the specified JobID.
 java.util.Vector GetJobs()
           
 IHWMJobStatus GetJobStatus(IHWMJob job)
          Gets the status of a job submitted to E-Compute This method contacts the E-compute server to verify the status
 IHWMJobStatus GetJobStatus(java.lang.String strJobStatus)
          Utility method to convert the a job status string to IHWMJobStatus
 java.lang.String GetName()
          Gets the name of the JobManger.
 java.util.Vector GetSolverProfiles()
          Gets the solver profiles from E-Compute
 java.lang.String GetTitle()
          Gets the Title of the JobManger.
 boolean LoginToJobSubmissionSystem()
          Login into the job submission system using no arguments In this case the login gui will pop up
 boolean LoginToJobSubmissionSystem(java.lang.String strLoginName, java.lang.String strPasswd)
          Login into the job submission system using specified login name and passwd
 void ReadServerInfo(org.jdom.Element elemServerInfo)
          This method reads the e-compute server specific information held in the ServerInfo block of the HDM config file(caedmconfig.xml) .
 void RemoveListener(IHWMJobListener listener, IHWMJob hwmJob)
          RemoveListener - removes the run entity that is a listener
 void SetName(java.lang.String strName)
          Sets the name of the JobManger.
 void SetTitle(java.lang.String strTitle)
          Sets the Title of the JobManger.
 IHWMJob ShowJobSubmissionDialog(IHWMJob job)
          This method creates an instance of IHWMJob with parameters set in a GUI dialog.
 void StartPollingForCompletion(java.lang.String strJobID)
          StartPollingForCompletion starts the E-Compute job poller starts the job status tracking thread if it had been stopped
 void StopPollingForCompletion()
          StopPollingForCompletion - Stops the job status tracker thread Sets the run flag on the thread object to false to stop its execution
 java.lang.String SubmitJob(IHWMJob job)
          SubmitJob - submits a job to E-Compute
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HWMEComputeJobManager

public HWMEComputeJobManager()
Def Cons

Method Detail

SetName

public void SetName(java.lang.String strName)
             throws java.lang.Exception
Sets the name of the JobManger.

Parameters:
strName - The name of the JobManger.
Throws:
java.lang.Exception

GetName

public java.lang.String GetName()
                         throws java.lang.Exception
Gets the name of the JobManger.

Returns:
A string representing the name of the JobManger
Throws:
java.lang.Exception

SetTitle

public void SetTitle(java.lang.String strTitle)
              throws java.lang.Exception
Sets the Title of the JobManger.

Parameters:
strName - The Title of the JobManger.
Throws:
java.lang.Exception

GetTitle

public java.lang.String GetTitle()
                          throws java.lang.Exception
Gets the Title of the JobManger.

Returns:
A string representing the Title of the JobManger
Throws:
java.lang.Exception

ReadServerInfo

public void ReadServerInfo(org.jdom.Element elemServerInfo)
                    throws java.lang.Exception
This method reads the e-compute server specific information held in the ServerInfo block of the HDM config file(caedmconfig.xml) .

Parameters:
elemSrvrInfo - The ServerInfo xml block of the HDM config file that encapsulates the e-compute server specific information.
Throws:
java.lang.Exception

LoginToJobSubmissionSystem

public boolean LoginToJobSubmissionSystem(java.lang.String strLoginName,
                                          java.lang.String strPasswd)
                                   throws java.lang.Exception
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

LoginToJobSubmissionSystem

public boolean LoginToJobSubmissionSystem()
                                   throws java.lang.Exception
Login into the job submission system using no arguments In this case the login gui will pop up

Specified by:
LoginToJobSubmissionSystem in interface IHWMJobManager
Returns:
boolean value indicating whether login was successful or not. true=>successful false=>not successful.
Throws:
java.lang.Exception

AutoLoginToEcompute

public boolean AutoLoginToEcompute()
                            throws java.lang.Exception
AutoLogin into the job submission system using username and password stored in the job manager instance.

Returns:
boolean value indicating whether login was successful or not.
Throws:
java.lang.Exception

SubmitJob

public java.lang.String SubmitJob(IHWMJob job)
SubmitJob - submits a job to E-Compute

Specified by:
SubmitJob in interface IHWMJobManager
Parameters:
job -
Returns:
String jobID

CreateJobInstanceWithDialog

public IHWMJob CreateJobInstanceWithDialog()
CreateJobInstanceWithDialog - creates a job instance using parameters from an interactive dialog.

Specified by:
CreateJobInstanceWithDialog in interface IHWMJobManager
Returns:
IHWMJob
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

CreateJobInstance

public IHWMJob CreateJobInstance(java.lang.String strJobID)
                          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.

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

GetJobInstance

public IHWMJob GetJobInstance(java.lang.String strJobID)
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 -
Returns:
Throws:
java.lang.Exception

RemoveListener

public void RemoveListener(IHWMJobListener listener,
                           IHWMJob hwmJob)
RemoveListener - removes the run entity that is a listener

Specified by:
RemoveListener in interface IHWMJobManager
Parameters:
listener -
hwmJob -

AddJobListener

public void AddJobListener(IHWMJobListener listener,
                           IHWMJob hwmJob)
AddJobListener - adds the run entity as a listener

Specified by:
AddJobListener in interface IHWMJobManager
Parameters:
listener -
hwmJob -

StartPollingForCompletion

public void StartPollingForCompletion(java.lang.String strJobID)
StartPollingForCompletion starts the E-Compute job poller starts the job status tracking thread if it had been stopped

Parameters:
strJobID - - job to be added for polling

StopPollingForCompletion

public void StopPollingForCompletion()
StopPollingForCompletion - Stops the job status tracker thread Sets the run flag on the thread object to false to stop its execution


DownloadResults

public void DownloadResults(java.lang.String strJobID,
                            java.io.File fileDestDir)
DownloadResults - downloads results from E-compute

Specified by:
DownloadResults in interface IHWMJobManager
Parameters:
strJobID -
fileDestDir -

DownloadResults

public int DownloadResults(HWMEComputeJob job)
                    throws java.lang.Exception
This method downloads the result files for the job identified by the specified job instance

Throws:
java.lang.Exception

GetAuthenticatedUser

public java.lang.String GetAuthenticatedUser()
Gets the user name once it has been authenticated by the user.

Returns:
string having loggen in user value or error

GetSolverProfiles

public java.util.Vector GetSolverProfiles()
Gets the solver profiles from E-Compute

Returns:
The vector of user profiles

GetJobs

public java.util.Vector GetJobs()

AddJobs

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

Parameters:
ecompJob -

GetJobStatus

public IHWMJobStatus GetJobStatus(IHWMJob job)
Gets the status of a job submitted to E-Compute This method contacts the E-compute server to verify the status

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

GetJobStatus

public IHWMJobStatus GetJobStatus(java.lang.String strJobStatus)
Utility method to convert the a job status string to IHWMJobStatus

Specified by:
GetJobStatus in interface IHWMJobManager
Parameters:
strJobStatus -
Returns:
Throws:
java.lang.Exception