Class EffectivityTaskLogic

java.lang.Object
wt.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.
  • Constructor Summary

    Constructors
    Constructor
    Description
    This is the no-arg constructor for the effectivityTaskLogic

    Supported API: true.
    This instantiates the EffectivityTaskLogic and sets the mode of the Effectivity to DATE_MODE, SERIAL_NUMBER_MODE, or LOT_NUMBER_MODE.
    EffectivityTaskLogic(wt.effectivity.EffectivityManageable object)
    This instantiates the EffectivityTaskLogic and sets the current EffectivityManageable object.
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    Returns the value as a String representing a date with the format of MM/dd/yyyy.
    getConfigItem(String config_item)
    This returns the current ConfigurationItem for the Effectivity

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

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

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

    Supported API: true.
    wt.effectivity.EffectivityManageable
    This is the public getter for the EffectivityManageable object.
    This is the public getter for the Effectivity that is deleted.
    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
    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(int mode)
    This sets the mode of the Effectivity to DATE_MODE, SERIAL_NUMBER_MODE, or LOT_NUMBER_MODE.
    void
    This sets the mode of the EffectivityTaskLogic based on the EffectivityType.
    void
    setObject(wt.effectivity.EffectivityManageable object)
    This sets the EffectivityManageable object of the taskLogic and retrieves the Effectivity for that object.
    void
    setObject(wt.effectivity.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
  • Constructor Details

    • 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(wt.effectivity.EffectivityManageable object)
      This instantiates the EffectivityTaskLogic and sets the current EffectivityManageable object.

      Supported API: true.
  • Method Details

    • 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(wt.effectivity.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(wt.effectivity.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 wt.effectivity.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.