com.ace.moab.api.request
Class ModifyJobRequest

java.lang.Object
  extended by com.ace.moab.api.request.ModifyJobRequest
All Implemented Interfaces:
com.moab.api.commands.Request

public class ModifyJobRequest
extends java.lang.Object
implements com.moab.api.commands.Request

This class represents a request that is built to modify a job in Moab.

In order to use this, at least 1 MoabJob object must be created that describes the job modifications that the user wants to use when modifying a job.

The following is a list of supported attributes for the modify job request:


Constructor Summary
ModifyJobRequest(MoabJob oldJob, MoabJob newJob, ModifyJobType modifyType, IMoabConnection moabConnection)
          Constructor to create a modify job request.
ModifyJobRequest(MoabJob job, ModifyJobType modifyType, IMoabConnection moabConnection)
           
 
Method Summary
 java.lang.String getAccountCommand()
          Get the command to change the account
 java.util.List<java.lang.String> getHoldsCommands()
          match the hold on the new job
 java.lang.String getJobNameCommand()
           
 java.util.List<java.lang.String> getMessagesCommands()
          Using the information on the old and new versions of the job, we will send create message commands to Moab.
 java.util.List<java.lang.String> getMoabCommands()
          Returns a list of commands that define the request.
 java.lang.String getNodeCountRequestedCommand()
          Gets the node count command from the new moabJob object.
 java.util.List<java.lang.String> getPartitionAccessListCommands()
           
 java.lang.String getReservationRequestedCommand()
           
 java.lang.String getSystemPriorityCommand()
           
 java.util.List<java.lang.String> getVariablesCommands()
           
 java.lang.String getWallClockRequestedCommand()
           
 boolean hasChanges()
          Returns true if changes exist for the request.
 boolean isHoldsEquals()
          Check to see if the holds set on the old job match those set on the new job.
 boolean isPartitionAccessListEqual()
           
 boolean isVariablesEqual()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModifyJobRequest

public ModifyJobRequest(MoabJob oldJob,
                        MoabJob newJob,
                        ModifyJobType modifyType,
                        IMoabConnection moabConnection)
                 throws InvalidMoabArgumentException,
                        com.moab.api.connect.exception.RequestException
Constructor to create a modify job request.

Parameters:
oldJob - The job that will be modified (Optional)
newJob - The new job that will be created. The commands created will match the commands necessary to match this job.
modifyType - The modify type for the job.
moabConnection - The moab connection used to get the old job information if necessary.
Throws:
InvalidMoabArgumentException - If invalid arguments are passed into this method.
com.moab.api.connect.exception.RequestException - If the request fails.

ModifyJobRequest

public ModifyJobRequest(MoabJob job,
                        ModifyJobType modifyType,
                        IMoabConnection moabConnection)
                 throws InvalidMoabArgumentException,
                        com.moab.api.connect.exception.RequestException
Throws:
InvalidMoabArgumentException
com.moab.api.connect.exception.RequestException
Method Detail

getAccountCommand

public java.lang.String getAccountCommand()
Get the command to change the account

Returns:
the command used to change the account.

getHoldsCommands

public java.util.List<java.lang.String> getHoldsCommands()
match the hold on the new job


getJobNameCommand

public java.lang.String getJobNameCommand()

getMessagesCommands

public java.util.List<java.lang.String> getMessagesCommands()
Using the information on the old and new versions of the job, we will send create message commands to Moab. Any messages in the new version of the job that are not found in the old version of job will be sent across. NOTE: Old messages cannot be removed from a job.

Returns:
a List of commands to create new messages on the job.

getMoabCommands

public java.util.List<java.lang.String> getMoabCommands()
Description copied from interface: com.moab.api.commands.Request
Returns a list of commands that define the request. These commands are run on the server containing Moab. These will only be run if the Request.hasChanges() method returns true.

Specified by:
getMoabCommands in interface com.moab.api.commands.Request
Returns:
a list of Strings representing commands defining the request.

getNodeCountRequestedCommand

public java.lang.String getNodeCountRequestedCommand()
Gets the node count command from the new moabJob object.

Returns:
the command used to change the node count required for the new job.

getPartitionAccessListCommands

public java.util.List<java.lang.String> getPartitionAccessListCommands()

getReservationRequestedCommand

public java.lang.String getReservationRequestedCommand()

getSystemPriorityCommand

public java.lang.String getSystemPriorityCommand()

getVariablesCommands

public java.util.List<java.lang.String> getVariablesCommands()

getWallClockRequestedCommand

public java.lang.String getWallClockRequestedCommand()

hasChanges

public boolean hasChanges()
Description copied from interface: com.moab.api.commands.Request
Returns true if changes exist for the request.

Specified by:
hasChanges in interface com.moab.api.commands.Request
Returns:
true if changes exist for the request.

isHoldsEquals

public boolean isHoldsEquals()
Check to see if the holds set on the old job match those set on the new job.

Returns:
true if the holds match, false if there are any differences between the holds

isPartitionAccessListEqual

public boolean isPartitionAccessListEqual()

isVariablesEqual

public boolean isVariablesEqual()


Copyright © 2001-2009 Cluster Resources, Inc. All Rights Reserved.