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

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

public class HWMEComputeComm
extends java.lang.Object
implements HWMComm

Title: HWMEComputeComm

Description: This class handles the communication with E-Compute.

Company: Altair Engineering, Inc.


Field Summary
 boolean m_isAuthenticated
          whether the user name and password was authenticated during Ping
 
Constructor Summary
HWMEComputeComm(HWMCommMgr hwmCommMgr, java.lang.String strSessionName, java.lang.String strUserName, java.lang.String strPwd)
          Constructor
 
Method Summary
 HWMEComputeJobStatus CheckJobStatus(int nJobID)
          Check the job status.
 void Connect(java.lang.String strAddress, int nPort)
          Connect to ECompute
 javax.xml.soap.SOAPMessage CreateSOAPMessageForJobStatus(int nJobID)
          CreateSOAPMessageForJobStatus Creates a wrapper SOAP Message to get the job status from the E-Compute Server.
 void Disconnect()
          Disconnect from E-Compute
 HWMEComputeJobResInfo DownloadResults(int nJobID, java.io.File fileDestDir)
          This method will download the results as received from ECompute (i.e.
 java.util.Vector GetProfiles()
          Get the profiles present in e-Compute.
 int GetStatusForJob(javax.xml.soap.SOAPMessage soapMsg)
          Get the job status.
 void PingECompute()
          Send "Ping" command.
 int SubmitJob(int nProfileID, java.lang.String strProfile, java.util.Vector vectFiles)
          Submit a job.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_isAuthenticated

public boolean m_isAuthenticated
whether the user name and password was authenticated during Ping

Constructor Detail

HWMEComputeComm

public HWMEComputeComm(HWMCommMgr hwmCommMgr,
                       java.lang.String strSessionName,
                       java.lang.String strUserName,
                       java.lang.String strPwd)
Constructor

Parameters:
hwmCommMgr - A reference to comm mgr. This is needed when this class needs to inform the comm mgr that this session has ended
strSessionName - The name for this session with the server
strUserName - The user name to use for the session.
strPwd - The password to use for the session.
Method Detail

Connect

public void Connect(java.lang.String strAddress,
                    int nPort)
             throws java.lang.Exception
Connect to ECompute

Specified by:
Connect in interface HWMComm
Parameters:
strAddress - The URL to connect to. i.e. http://localhost:8080/ecompute
nPort - Not used
Throws:
java.lang.Exception

Disconnect

public void Disconnect()
Disconnect from E-Compute

Specified by:
Disconnect in interface HWMComm

PingECompute

public void PingECompute()
                  throws java.lang.Exception
Send "Ping" command. This is just to check if e-Compute is alive!

Throws:
java.lang.Exception

GetProfiles

public java.util.Vector GetProfiles()
                             throws java.lang.Exception
Get the profiles present in e-Compute. This will return a vector of HWMEComputeProfile

Parameters:
strUserName - The user name
Returns:
Vector
Throws:
java.lang.Exception

CheckJobStatus

public HWMEComputeJobStatus CheckJobStatus(int nJobID)
                                    throws java.lang.Exception
Check the job status. This will return the status of the job as an integer nJobID The job id whose status should be retrieved.

Returns:
HWMEComputeJobStatus The eCompute job status object.
Throws:
java.lang.Exception

SubmitJob

public int SubmitJob(int nProfileID,
                     java.lang.String strProfile,
                     java.util.Vector vectFiles)
              throws java.lang.Exception
Submit a job. Add the files as attachments and send it to ecompute.

Parameters:
nProfileID - The profile to use.
strProfile - The profile name to use.
vectFiles - The vector of files.
Returns:
int The new job ID.
Throws:
java.lang.Exception

DownloadResults

public HWMEComputeJobResInfo DownloadResults(int nJobID,
                                             java.io.File fileDestDir)
                                      throws java.lang.Exception
This method will download the results as received from ECompute (i.e. single zip file).

Parameters:
nJobID - The result of job to download.
fileDestDir - The directory where the compressed file should be placed.
Returns:
HWMEComputeJobResInfo The job result info which will contain information about all the files downloaded
Throws:
java.lang.Exception

CreateSOAPMessageForJobStatus

public javax.xml.soap.SOAPMessage CreateSOAPMessageForJobStatus(int nJobID)
                                                         throws java.lang.Exception
CreateSOAPMessageForJobStatus Creates a wrapper SOAP Message to get the job status from the E-Compute Server. Called By : HWMEComputeJobStatusTracker

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

GetStatusForJob

public int GetStatusForJob(javax.xml.soap.SOAPMessage soapMsg)
                    throws java.lang.Exception
Get the job status.

Parameters:
soapMsg - The soap message for getting job status.
int - The result of retrieving job
Throws:
java.lang.Exception