/*
* GSAClearActionImpl
* 07/24/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.si.util.*;
import com.ibm.retail.si.Copyright;
import java.util.*;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* GSAClearActionImpl is a class which the POSAutomationProvider uses to clear the input
* sequence, usually after an error has ocurred.
*
*/
public class GSAClearActionImpl extends GSAActionImpl
{
static String copyright()
{ return com.ibm.retail.si.Copyright.IBM_COPYRIGHT_SHORT; }
/**
* Constructor
*
* @param request The ActionRequest which contains a HashMap of arguments.
* @exception com.ibm.retail.AEF.util.AEFException
* Among the possible AEFException error codes are:
*
AEFConst.CONFIG_ERROR, AEFConst.FACTORY_ERROR
*
Common Errors
*/
public GSAClearActionImpl(ActionRequest request) throws AEFException
{
super(request);
if (log.isTraceEnabled())
{
tempAEFMessage.setMessage("+Enter and -Exit GSAClearActionImpl.GSAClearActionImpl().");
log.trace(tempAEFMessage);
}
}
/**
* Perform the action represented by the ActionRequest and return an ActionResult.
*
* @return Object Returns null.
* @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
*
Common Errors
*/
public Object performAction() throws AEFException
{
if (log.isTraceEnabled())
{
tempAEFMessage.setMessage("+Enter GSAClearActionImpl.performAction().");
log.trace(tempAEFMessage);
}
sendClearSequence();
if (log.isTraceEnabled())
{
tempAEFMessage.setMessage("-Exit GSAClearActionImpl.performAction().");
log.trace(tempAEFMessage);
}
return null;
}
/**
* Creates and sends the key sequence which should clear an error.
*
* @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
*
Common Errors
*/
public void sendClearSequence() throws AEFException
{
if (log.isTraceEnabled())
{
tempAEFMessage.setMessage("+Enter GSAClearActionImpl.sendClearSequence().");
log.trace(tempAEFMessage);
}
args.clear();
args.put("SEQUENCE_ID", "clear-error");
AEFAction keySequenceAction = (AEFAction)(actionFactory.makeAction(new ActionRequest("SimpleKeySequenceAction", args)));
keySequenceAction.performAction();
if (log.isTraceEnabled())
{
tempAEFMessage.setMessage("-Exit GSAClearActionImpl.sendClearSequence().");
log.trace(tempAEFMessage);
}
}
/* Instance and Class Variables */
private static Log log = LogFactory.getLog(GSAClearActionImpl.class);
}