wt.clients.beans
Class EffectivityTaskLogic

java.lang.Object
  extended bywt.clients.beans.EffectivityTaskLogic

public class EffectivityTaskLogic
extends Object

This class contains the logic to create, update, view, assign, and retrieve Effectivity. There are 3 major subclasses of Effectivity: WTDatedEffectivitiy, WTSerialNumberedEffectivity, and WTLotNumberEffectivity. This class encapsulates the method calls for the 3 classes. To use this class, instantiate it and set the mode, or call the constructor that takes the mode as a parameter. Use DATE_MODE, SERIAL_NUMBER_MODE, or LOT_NUMBER_MODE.

Supported API: true.

Extendable: true.


Field Summary
private static int DATE_MODE
           
private  Effectivity effectivity
           
private static int LOT_NUMBER_MODE
           
private  int mode
           
private  EffectivityManageable object
           
private  Effectivity oldEffectivity
           
private static int SERIAL_NUMBER_MODE
           
 
Constructor Summary
EffectivityTaskLogic()
          This is the no-arg constructor for the effectivityTaskLogic

Supported API: true.
EffectivityTaskLogic(EffectivityManageable object)
          This instantiates the EffectivityTaskLogic and sets the current EffectivityManageable object.
EffectivityTaskLogic(int mode)
          This instantiates the EffectivityTaskLogic and sets the mode of the Effectivity to DATE_MODE, SERIAL_NUMBER_MODE, or LOT_NUMBER_MODE.
 
Method Summary
 Effectivity assignValues(String config_item, String start, String end)
          This creates a new Effectivity object, sets the values as defined by the user, and assigns it to the current EffectivityManageable object.
 String dateString(Timestamp ts)
          Returns the value as a String representing a date with the format of MM/dd/yyyy.
 ConfigurationItem getConfigItem(String config_item)
          This returns the current ConfigurationItem for the Effectivity

Supported API: true.
 String getConfigItemName()
          This returns the String representing the current ConfigurationItem for the Effectivity

Supported API: true.
 Effectivity getEffectivity()
          This is the public getter for the Effectivity that is being created, updated, or viewed.
 EffectivityType getEffectivityType(ConfigurationItem config_item)
          This returns the EffectivityType of the ConfigurationItem passed in.
 String getEffectivityTypeDisplay()
          This returns the String representing the EffectivityType of the ConfigurationItem

Supported API: true.
 String getEffectivityTypeDisplay(ConfigurationItem config_item)
          This returns the String representing the EffectivityType of the ConfigurationItem passed in.
 String getEnd()
          This returns the String representing the current end date or number depending on the current mode.
 int getMode()
          This is the public getter for the mode variable.
 int getModeForType(EffectivityType type)
          This returns the EffectivityTaskLogic mode given an EffectivityType

Supported API: true.
 EffectivityManageable getObject()
          This is the public getter for the EffectivityManageable object.
 Effectivity getOldEffectivity()
          This is the public getter for the Effectivity that is deleted.
 String getStart()
          This returns the String representing the current start date or number depending on the current mode.
protected  Timestamp parseDate(String date_string)
          This converts a string to a timestamp using the dateHelperResource.
 void save()
          This saves the new effectivity as defined by the user and removes the previous one - if one existed.
 void save(Enumeration effectivities, Enumeration old_effectivities)
          This saves an Enumeration of new effectivities and removes the old effectivities.
 void setMode(EffectivityType type)
          This sets the mode of the EffectivityTaskLogic based on the EffectivityType.
 void setMode(int mode)
          This sets the mode of the Effectivity to DATE_MODE, SERIAL_NUMBER_MODE, or LOT_NUMBER_MODE.
 void setObject(EffectivityManageable object)
          This sets the EffectivityManageable object of the taskLogic and retrieves the Effectivity for that object.
 void setObject(EffectivityManageable object, Effectivity new_effectivity)
          This sets the EffectivityManageable object of the taskLogic and sets the Effectivity for that object to the passed in Effectivity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

object

private EffectivityManageable object

effectivity

private Effectivity effectivity

oldEffectivity

private Effectivity oldEffectivity

mode

private int mode

DATE_MODE

private static final int DATE_MODE
See Also:
Constant Field Values

SERIAL_NUMBER_MODE

private static final int SERIAL_NUMBER_MODE
See Also:
Constant Field Values

LOT_NUMBER_MODE

private static final int LOT_NUMBER_MODE
See Also:
Constant Field Values
Constructor Detail

EffectivityTaskLogic

public EffectivityTaskLogic()
This is the no-arg constructor for the effectivityTaskLogic

Supported API: true.


EffectivityTaskLogic

public EffectivityTaskLogic(int mode)
This instantiates the EffectivityTaskLogic and sets the mode of the Effectivity to DATE_MODE, SERIAL_NUMBER_MODE, or LOT_NUMBER_MODE.

Supported API: true.


EffectivityTaskLogic

public EffectivityTaskLogic(EffectivityManageable object)
This instantiates the EffectivityTaskLogic and sets the current EffectivityManageable object.

Supported API: true.

Method Detail

setMode

public void setMode(int mode)
This sets the mode of the Effectivity to DATE_MODE, SERIAL_NUMBER_MODE, or LOT_NUMBER_MODE.

Supported API: true.


setMode

public void setMode(EffectivityType type)
This sets the mode of the EffectivityTaskLogic based on the EffectivityType.

Supported API: true.


getMode

public int getMode()
This is the public getter for the mode variable.

Supported API: true.


getModeForType

public int getModeForType(EffectivityType type)
This returns the EffectivityTaskLogic mode given an EffectivityType

Supported API: true.


setObject

public void setObject(EffectivityManageable object)
               throws WTException
This sets the EffectivityManageable object of the taskLogic and retrieves the Effectivity for that object. It also sets the mode based on the retrieved Effectivity.

Supported API: true.

Throws:
WTException

setObject

public void setObject(EffectivityManageable object,
                      Effectivity new_effectivity)
               throws WTException
This sets the EffectivityManageable object of the taskLogic and sets the Effectivity for that object to the passed in Effectivity. It also sets the mode based on the passed in Effectivity.

Supported API: true.

Throws:
WTException

getObject

public EffectivityManageable getObject()
This is the public getter for the EffectivityManageable object.

Supported API: true.


getEffectivity

public Effectivity getEffectivity()
This is the public getter for the Effectivity that is being created, updated, or viewed.

Supported API: true.


getOldEffectivity

public Effectivity getOldEffectivity()
This is the public getter for the Effectivity that is deleted.

Supported API: true.


assignValues

public Effectivity assignValues(String config_item,
                                String start,
                                String end)
                         throws WTPropertyVetoException,
                                WTException
This creates a new Effectivity object, sets the values as defined by the user, and assigns it to the current EffectivityManageable object.

Supported API: true.

Throws:
WTPropertyVetoException
WTException

save

public void save(Enumeration effectivities,
                 Enumeration old_effectivities)
          throws WTException
This saves an Enumeration of new effectivities and removes the old effectivities.

Supported API: true.

Throws:
WTException

save

public void save()
          throws WTException
This saves the new effectivity as defined by the user and removes the previous one - if one existed. This must be done because the server supports multiple effectivities, but the client does not.

Supported API: true.

Throws:
WTException

parseDate

protected Timestamp parseDate(String date_string)
                       throws WTPropertyVetoException
This converts a string to a timestamp using the dateHelperResource.

Supported API: true.

Throws:
WTPropertyVetoException

dateString

public String dateString(Timestamp ts)
Returns the value as a String representing a date with the format of MM/dd/yyyy.

Supported API: true.


getEffectivityType

public EffectivityType getEffectivityType(ConfigurationItem config_item)
This returns the EffectivityType of the ConfigurationItem passed in.

Supported API: true.


getEffectivityTypeDisplay

public String getEffectivityTypeDisplay(ConfigurationItem config_item)
This returns the String representing the EffectivityType of the ConfigurationItem passed in.

Supported API: true.


getEffectivityTypeDisplay

public String getEffectivityTypeDisplay()
This returns the String representing the EffectivityType of the ConfigurationItem

Supported API: true.


getConfigItemName

public String getConfigItemName()
This returns the String representing the current ConfigurationItem for the Effectivity

Supported API: true.


getConfigItem

public ConfigurationItem getConfigItem(String config_item)
                                throws ConfigItemNotFoundException,
                                       WTException
This returns the current ConfigurationItem for the Effectivity

Supported API: true.

Throws:
ConfigItemNotFoundException
WTException

getStart

public String getStart()
This returns the String representing the current start date or number depending on the current mode.

Supported API: true.


getEnd

public String getEnd()
This returns the String representing the current end date or number depending on the current mode.

Supported API: true.