com.ace.moab.api.request
Class CreateOneTimeRsvRequest

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

public class CreateOneTimeRsvRequest
extends CreateReservationRequest

This class represents a request to create a One Time Reservation. To use the request, the user must specify a reservation to create. Although most attributes may be null or empty for the reservation, a list of necessary reservation attributes can be viewed by examining verifyReservation(). These requirements will be checked if the user attempts to get moab commands using getMoabCommands().

The following is a list of reservation attributes that are currently implemented:

Author:
Scott Brown (Original functionality to create commands written by Nate Seeley)

Field Summary
 
Fields inherited from class com.ace.moab.api.request.CreateReservationRequest
logger, MOAB_RSV_DATE_FORMAT
 
Constructor Summary
CreateOneTimeRsvRequest(Reservation reservation)
          Default constructor, needs a valid Reservation as the object of this class is to create a Reservation based on the reservation object
 
Method Summary
 java.util.List<java.lang.String> getMoabCommands()
          Creates a list of moab commands needed to create this reservation This method performs checks on the internal reservation object as defined by verifyReservation() in this class
 Reservation getReservation()
          Return the current reservation object as defined in class javadocs
 boolean hasChanges()
          Returns true if changes exist for the request.
 void setReservation(Reservation reservation)
          Set's the reservation property.
 void verifyReservation()
          Verifies the reservation object is complete enough to create it in Moab.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreateOneTimeRsvRequest

public CreateOneTimeRsvRequest(Reservation reservation)
Default constructor, needs a valid Reservation as the object of this class is to create a Reservation based on the reservation object

Parameters:
reservation - Reservation that will be created within Moab
Method Detail

getReservation

public Reservation getReservation()
Return the current reservation object as defined in class javadocs

Returns:
the reservation

setReservation

public void setReservation(Reservation reservation)
Set's the reservation property. Cannot be set to null

Parameters:
reservation - the reservation to set

hasChanges

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

Returns:
true if changes exist for the request.

verifyReservation

public void verifyReservation()
                       throws com.moab.api.connect.exception.RequestException
Verifies the reservation object is complete enough to create it in Moab. Before calling getMoabCommands(), this method is used to make sure the reservation is complete to create a list of commands to create it.

Specifically, these values are checked:

NOTE: According to Dave Jackson as of 1/17/08, the reservation name is no longer a required field. Also, Reservations no longer need a start or end time

Throws:
com.moab.api.connect.exception.RequestException

getMoabCommands

public java.util.List<java.lang.String> getMoabCommands()
                                                 throws com.moab.api.connect.exception.RequestException
Creates a list of moab commands needed to create this reservation This method performs checks on the internal reservation object as defined by verifyReservation() in this class

Returns:
a list of Strings representing commands defining the request.
Throws:
com.moab.api.connect.exception.RequestException - Throws this exception if verifyReservation fails
See Also:
verifyReservation()


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