/*
* GSAItemVoidActionImpl
*
* 07/21/2003
*
* Copyright:
* Licensed Materials - Property of IBM
* "Restricted Materials of IBM"
* 5724-AEF
* (C) Copyright IBM Corp. 2003.
*
* %W% %E%
*/
package com.ibm.retail.AEF.action;
import com.ibm.retail.AEF.automation.*;
import com.ibm.retail.AEF.util.*;
import com.ibm.retail.si.util.*;
import com.ibm.retail.si.Copyright;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* GSAItemVoidActionImpl is a class which the POSAutomationProvider uses to
* void items in a transaction on the POS application.
*
*/
public class GSAItemVoidActionImpl extends GSAItemEntryActionImpl
{
static String copyright()
{ return com.ibm.retail.si.Copyright.IBM_COPYRIGHT_SHORT;}
/**
* Constructor
*
* @param request The ActionRequest which contains an ItemIdentifier.
* @exception com.ibm.retail.AEF.util.AEFException
* Among the possible AEFException error codes are:
*
AEFConst.CONFIG_ERROR, AEFConst.FACTORY_ERROR
*
Common Errors
*/
public GSAItemVoidActionImpl(ActionRequest request) throws AEFException
{
super(request);
if (log.isTraceEnabled())
{
tempAEFMessage.setMessage("+Enter GSAItemVoidActionImpl.GSAItemVoidActionImpl().");
log.trace(tempAEFMessage);
}
setVoidFlag(true);
if (log.isTraceEnabled())
{
tempAEFMessage.setMessage("-Exit GSAItemVoidActionImpl.GSAItemVoidActionImpl().");
log.trace(tempAEFMessage);
}
}
/**
* Perform the action represented by the ActionRequest and return an ActionResult.
*
*
* @return Object An ArrayList of the items.
* @exception com.ibm.retail.AEF.util.AEFException
* Among the possible AEFException error codes are:
*
AEFConst.APPLICATION_NOT_IN_PROPER_STATE
*
AEFConst.OPERATION_TIMEOUT
*
AEFConst.WAIT_INTERRUPTED
*
AEFConst.CONFIG_ERROR, AEFConst.INVALID_KEY_SEQUENCE
*
AEFConst.INVALID_ARGUMENT, AEFConst.INVALID_DEPARTMENT
*
AEFConst.INVALID_ARGUMENT, AEFConst.ITEM_CLASS_REQUIRED
*
AEFConst.INVALID_ARGUMENT, AEFConst.ITEM_STOCK_REQUIRED
*
AEFConst.INVALID_ARGUMENT, AEFConst.ITEM_DEPARTMENT_PROHIBITED
*
AEFConst.INVALID_ARGUMENT, AEFConst.ITEM_CLASS_PROHIBITED
*
AEFConst.INVALID_ARGUMENT, AEFConst.ITEM_DEPARTMENT_REQUIRED
*
AEFConst.INVALID_ARGUMENT, AEFConst.ITEM_STOCK_PROHIBITED
*
AEFConst.INVALID_ARGUMENT, AEFConst.ITEM_PRICE_REQUIRED
*
AEFConst.INVALID_ARGUMENT, AEFConst.ITEM_QUANTITY_REQUIRED
*
AEFConst.INVALID_ARGUMENT, AEFConst.DATA_OUT_OF_RANGE
*
AEFConst.INVALID_ARGUMENT, AEFConst.EXTENDED_PRICE_TOO_LARGE
*
AEFConst.ITEM_NOT_FOUND, AEFConst.NONE
*
AEFConst.ITEM_NOT_FOR_SALE, AEFConst.NONE
*
AEFConst.APPLICATION_LIMIT_EXCEEDED, AEFConst.ITEM_LIMIT
*
AEFConst.PROCEDURE_NOT_ALLOWED, AEFConst.NOT_AUTHORIZED
*
AEFConst.PRINTER_ERROR, AEFConst.NONE
*
AEFConst.PRINTER_ERROR, AEFConst.JOURNAL_ERROR
*
AEFConst.PRINTER_ERROR, AEFConst._BUFFER_FULL
*
AEFConst.PRINTER_ERROR, AEFConst.COVER_OPEN
*
AEFConst.ITEM_NOT_RETURNABLE
*
AEFConst.UNSUPPORTED_OPERATION
*
Common Errors
*/
public Object performAction() throws AEFException
{
if (log.isTraceEnabled())
{
tempAEFMessage.setMessage("+Enter GSAItemVoidActionImpl.performAction().");
log.trace(tempAEFMessage);
}
Object retVal = null;
if (log.isDebugEnabled())
{
tempAEFMessage.setMessage("GSAItemVoidActionImpl.performAction started for item: " + itemID);
log.debug(tempAEFMessage);
}
try
{
retVal = super.performAction(); // Call super to add the item as a void.
}
catch (AEFException e)
{
tempAEFMessage.setMessage("There was an AEF exception thrown in performAction of GSAItemVoidActionImpl.");
log.error(tempAEFMessage, e);
throw e;
}
if (log.isTraceEnabled())
{
tempAEFMessage.setMessage("-Exit GSAItemVoidActionImpl.performAction().");
log.trace(tempAEFMessage);
}
return retVal;
}
// Instance and Class Variables
private static Log log = LogFactory.getLog(GSAItemVoidActionImpl.class);
}