org.jaffa.components.voucher
Interface IVoucherGenerator

All Known Implementing Classes:
AbstractVoucherGenerator

public interface IVoucherGenerator

This is the interface for a class generating vouchers. A client will typically create an instance of a VoucherGenerator. It will then invoke the init() method, all the setters, the generate() method and finally the cleanup() method.


Method Summary
 void cleanup()
          This method should be invoked by a client after the generate is completed.
 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.
 

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.


cleanup

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


generate

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

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.

Returns:
Value of property uow.

setUow

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

Parameters:
uow - New value of property uow.

getLabelToken

public String getLabelToken()
Getter for the property labelToken.

Returns:
Value of property labelToken.

setLabelToken

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

Parameters:
labelToken - New value of property labelToken.

getPrefix

public String getPrefix()
Getter for the property prefix.

Returns:
Value of property prefix.

setPrefix

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

Parameters:
prefix - New value of property prefix.

getLength

public String getLength()
Getter for the property length.

Returns:
Value of property length.

setLength

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

Parameters:
length - New value of property length.


Copyright © 2002-2004 JAFFA Project.