com.ecebs.rtd.enabler.types.request
Class DeleteProductRequest

java.lang.Object
  extended by com.ecebs.rtd.enabler.types.request.ModifyRequest
      extended by com.ecebs.rtd.enabler.types.request.DeleteProductRequest
All Implemented Interfaces:
Request, Serializable

public class DeleteProductRequest
extends ModifyRequest

Represents a request to delete a product on a CM

Author:
kyleb
See Also:
Serialized Form

Nested Class Summary
static class DeleteProductRequest.DeleteProductReason
          Used to define the reason for deleting the product
 
Constructor Summary
DeleteProductRequest()
          Create a request with no intialised parameters.
DeleteProductRequest(String cardId, CardType cardType, String productName)
          Sets all the required parameters with the provided values, except a product instance ID, which must be added by calling addProductInstanceId(String, String)
 
Method Summary
 DeleteProductRequest addParam(String key, Object value)
          Add a parameter to the request.
 DeleteProductRequest addProductInstanceId(IPEInstanceID instanceId)
          Set the details of the ISAM that created a product to be deleted.
 DeleteProductRequest addProductInstanceId(String isamId, String isamSeqNum)
          Set the details of the ISAM that created a product to be deleted
 DeleteProductRequest setCardId(String cardId)
          Set the ID of the card to modify
 DeleteProductRequest setCardType(CardType cardType)
          Set the type of the card to modify
 DeleteProductRequest setIsRefund(boolean refund)
          Deprecated. Replaced by DeleteProductRequest.DeleteProductReason. See setReason(DeleteProductReason)
 DeleteProductRequest setProductName(String productName)
          Set the name of the product to deduct journeys from
 DeleteProductRequest setReason(DeleteProductRequest.DeleteProductReason reason)
          Set the reason for deleting the product
 Outcome validate()
          Validate that the required fields have been set
 
Methods inherited from class com.ecebs.rtd.enabler.types.request.ModifyRequest
getCardId, getCardType, getRequestId, setRequestId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeleteProductRequest

public DeleteProductRequest()
Create a request with no intialised parameters. All of the required parameters must be set before using this request for an operation. Methods for setting required parameters start with "set"

See Also:
setCardId(String), setCardType(CardType), addProductInstanceId(String, String), setProductName(String)

DeleteProductRequest

public DeleteProductRequest(String cardId,
                            CardType cardType,
                            String productName)
Sets all the required parameters with the provided values, except a product instance ID, which must be added by calling addProductInstanceId(String, String)

Parameters:
cardId - ID of the card with the product that should be deleted
cardType - The type of the card
productName - The name of the product
Method Detail

setCardId

public DeleteProductRequest setCardId(String cardId)
Set the ID of the card to modify

Parameters:
cardId - ID of the card to modify
Returns:
This instance to allow for method chaining

setCardType

public DeleteProductRequest setCardType(CardType cardType)
Set the type of the card to modify

Parameters:
cardType - Type of the card to modify
Returns:
This instance to allow for method chaining

setProductName

public DeleteProductRequest setProductName(String productName)
Set the name of the product to deduct journeys from

Parameters:
productName - Name of the product to add journeys to
Returns:
This instance to allow for method chaining

addProductInstanceId

public DeleteProductRequest addProductInstanceId(IPEInstanceID instanceId)
Set the details of the ISAM that created a product to be deleted. Equivalent to calling addProductInstanceId(String, String) with InstanceID.getISAMID() and IPEInstanceID.getISAMSeqNum()

Parameters:
instanceId - ID containing the creating ISAM's ID and sequence number
Returns:
This instance to allow for method chaining

addProductInstanceId

public DeleteProductRequest addProductInstanceId(String isamId,
                                                 String isamSeqNum)
Set the details of the ISAM that created a product to be deleted

Parameters:
isamId - ID of the ISAM
isamSeqNum - Sequence number of the ISAM
Returns:
This instance to allow for method chaining

setIsRefund

public DeleteProductRequest setIsRefund(boolean refund)
Deprecated. Replaced by DeleteProductRequest.DeleteProductReason. See setReason(DeleteProductReason)

Set whether the product is being deleted as part of a refund

Parameters:
refund - Whether the product is being deleted as part of a refund
Returns:
This instance to allow for method chaining

setReason

public DeleteProductRequest setReason(DeleteProductRequest.DeleteProductReason reason)
Set the reason for deleting the product

Parameters:
reason - reason for deletion
Returns:
This instance to allow for method chaining

addParam

public DeleteProductRequest addParam(String key,
                                     Object value)
Description copied from class: ModifyRequest
Add a parameter to the request. These are optional fields and the required fields will be specific to each application. The provided value will be converted by calling Object.toString()

Specified by:
addParam in class ModifyRequest
Parameters:
key - The key for the parameter
value - The value of the parameter
Returns:
This instance to allow for method chaining

validate

public Outcome validate()
Description copied from interface: Request
Validate that the required fields have been set

Specified by:
validate in interface Request
Overrides:
validate in class ModifyRequest
Returns:
An outcome if the validation failed, else null


Copyright © 2013 Ecebs Ltd. All Rights Reserved.