org.jaffa.components.voucher
Class AbstractVoucherGenerator

java.lang.Object
  extended byorg.jaffa.components.voucher.AbstractVoucherGenerator
All Implemented Interfaces:
IVoucherGenerator
Direct Known Subclasses:
SimpleVoucherGenerator

public abstract class AbstractVoucherGenerator
extends Object
implements IVoucherGenerator

This is an abstract implementation of the IVoucherGenerator interface.

Author:
GautamJ

Constructor Summary
AbstractVoucherGenerator()
           
 
Method Summary
 void cleanup()
          This method should be invoked by a client after the generate is completed.
abstract  String generate()
          The client will invoke this method to generate a voucher.
 String getLabelToken()
          Getter for the property labelToken.
 String getLength()
          Getter for the property length.
 String getPrefix()
          Getter for the property prefix.
 UOW getUow()
          Getter for the property uow.
 void init()
          This method should be invoked by a client before all the setters are invoked.
 void setLabelToken(String labelToken)
          Setter for property labelToken.
 void setLength(String length)
          Setter for property length.
 void setPrefix(String prefix)
          Setter for property prefix.
 void setUow(UOW uow)
          Setter for property uow.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractVoucherGenerator

public AbstractVoucherGenerator()
Method Detail

init

public void init()
This method should be invoked by a client before all the setters are invoked. Use this to perform initializations.

Specified by:
init in interface IVoucherGenerator

cleanup

public void cleanup()
This method should be invoked by a client after the generate is completed. Use this to perform cleanup operations.

Specified by:
cleanup in interface IVoucherGenerator

generate

public abstract String generate()
                         throws FrameworkException,
                                ApplicationExceptions
The client will invoke this method to generate a voucher.

Specified by:
generate in interface IVoucherGenerator
Returns:
a unique voucher.
Throws:
FrameworkException - if any framework error occurs.
ApplicationExceptions - if any application error occurs.

getUow

public UOW getUow()
Getter for the property uow.

Specified by:
getUow in interface IVoucherGenerator
Returns:
Value of property uow.

setUow

public void setUow(UOW uow)
Setter for property uow.

Specified by:
setUow in interface IVoucherGenerator
Parameters:
uow - New value of property uow.

getLabelToken

public String getLabelToken()
Getter for the property labelToken.

Specified by:
getLabelToken in interface IVoucherGenerator
Returns:
Value of property labelToken.

setLabelToken

public void setLabelToken(String labelToken)
Setter for property labelToken.

Specified by:
setLabelToken in interface IVoucherGenerator
Parameters:
labelToken - New value of property labelToken.

getPrefix

public String getPrefix()
Getter for the property prefix.

Specified by:
getPrefix in interface IVoucherGenerator
Returns:
Value of property prefix.

setPrefix

public void setPrefix(String prefix)
Setter for property prefix.

Specified by:
setPrefix in interface IVoucherGenerator
Parameters:
prefix - New value of property prefix.

getLength

public String getLength()
Getter for the property length.

Specified by:
getLength in interface IVoucherGenerator
Returns:
Value of property length.

setLength

public void setLength(String length)
Setter for property length.

Specified by:
setLength in interface IVoucherGenerator
Parameters:
length - New value of property length.


Copyright © 2002-2004 JAFFA Project.