Class BEIDManager


public class BEIDManager extends InfranetCachedData
  • Field Details

  • Constructor Details

    • BEIDManager

      protected BEIDManager(PortalContext connection)
      Construct a BEID Manager object. Read the BEID table from Portal and construct a lookup table of BEID objects.
      Parameters:
      connection - An active connection to Portal.
  • Method Details

    • getInstance

      public static BEIDManager getInstance(PortalContext connection)
      Get the one and only instance of this class. If the instance has not been created then create one.
      Parameters:
      connection - An active connection to Portal.
      Returns:
      The one and only instance of this class.
    • getInstance

      public static BEIDManager getInstance(PortalContext connection, boolean rebuild)
      Get the one and only instance of this class. If the instance has not been created then create one.
      Parameters:
      connection - An active connection to Portal.
      rebuild - If this flag is TRUE then the reference to the existing instance will be set to null and a new instance will be created. This will cause the data to be refreshed.
      Returns:
      The one and only instance of this class.
    • getNumBEIDResources

      public int getNumBEIDResources()
      Return the number of BEID resources supported by Portal.
      Returns:
      The number of BEID resources supported by Portal (all of resources stored in the /config/BEID table)
    • getData

      public BEIDData getData(int resourceID)
      Return a "BEID data" object for the specified BEID resource ID.
      Parameters:
      resourceID - The resource ID to lookup.
      Returns:
      Return a "BEID data" object for the specified BEID resource ID if this is a BEID resource that is supported by Portal (i.e. there is an entry in the /config/BEID table), otherwise return null.
    • getData

      public BEIDData getData(Integer resourceID)
      Return a "BEID data" object for the specified BEID resource ID.
      Parameters:
      resourceID - The resource ID to lookup.
      Returns:
      Return a "BEID data" object for the specified BEID resource ID if this is a BEID resource that is supported by Portal (i.e. there is an entry in the /config/BEID table), otherwise return null.
    • getDescription

      public String getDescription(int resourceID)
      Convenience method to return the resource description (Free domestic minutes, US Dollar, Euro, etc.) for the specified resource ID.
      Parameters:
      resourceID - The resource ID to lookup.
      Returns:
      The resource description (Free domestic minutes, US Dollar, Euro, etc.) for the specified resource ID. If the resource is not supported by Portal then return a "blank string".
    • getSymbol

      public String getSymbol(int resourceID)
      Convenience method to return the resource symbol (Hrs, Min, $, FF, etc.) for the specified resource ID.
      Parameters:
      resourceID - The resource ID to lookup.
      Returns:
      The resource symbol (Hrs, Min, $, FF, etc.) for the specified resource ID. If the resource is not supported by Portal then return a "blank string".
    • getSupportedBEIDDataObjects

      public Enumeration getSupportedBEIDDataObjects()
      Return an enumeration for all of the BEID resources supported by Portal.
      Returns:
      An enumeration for all of the BEID resources supported by Portal. A BEIDData object will be enumerated for each resource.
    • getSupportedBEIDDataObjectsAsArray

      public BEIDData[] getSupportedBEIDDataObjectsAsArray()
      Return an array of all of the BEID resources supported by Portal.
      Returns:
      An array for all of the BEID resources supported by Portal.
    • isEMUCurrency

      public boolean isEMUCurrency(int currencyID)
      Is the specified currency ID an EMU (Euro member) currency?
      Returns:
      Return true if this is an EMU currency otherwise return false.
    • isEuro

      public static boolean isEuro(int currencyID)
      Is the specified currency ID the Euro currency?
      Returns:
      Return true if this is the Euro currency otherwise return false.
    • isCurrency

      public static boolean isCurrency(int currencyID)
      Is the currency ID a valid ISO currency ID that is recognized by Portal.
      Parameters:
      currencyID - The currency ID to evaluate.
      Returns:
      Return true if the ID is a valid ISO currency, otherwise return false.
    • BEIDRoundingModeToJavaRoudningMode

      public static int BEIDRoundingModeToJavaRoudningMode(int beidRoundingMode)
      Convert a BEID rounding mode to the appropriate Java rounding mode using the following rules:\n\n PortalEnums.BEID_ROUND_UP = BigDecimal.ROUND_UP\n PortalEnums.BEID_ROUND_DOWN = BigDecimal.ROUND_DOWN\n PortalEnums.BEID_ROUND_EVEN = BigDecimal.ROUND_HALF_EVEN\n PortalEnums.BEID_ROUND_NEAREST = BigDecimal.ROUND_HALF_UP\n
      Returns:
      Return the Java rounding mode for the specified BEID rounding mode.
    • getNumEMUCurrencies

      public int getNumEMUCurrencies()
      Return the number EMU currencies.
      Returns:
      The number of different EMU currencies. At present there are eleven EMU currencies.
    • getNumSupportedCurrencies

      public int getNumSupportedCurrencies()
      Return the number of currencies supported by Portal.
      Returns:
      The number of currencies supported by Portal (all of currency resources stored in the /config/BEID table)
    • getNumSupportedEMUCurrencies

      public int getNumSupportedEMUCurrencies()
      Return the number of EMU currencies supported by Portal.
      Returns:
      The number of EMU currencies supported by Portal (all of EMU currency resources stored in the /config/BEID table)
    • getCurrencyData

      public CurrencyData getCurrencyData(int currencyID)
      Return a CurrencyData object for the specified currency ID.
      Parameters:
      currencyID - The currency ID to lookup.
      Returns:
      Return a CurrencyData object for the specified currency ID if this is a currency that is supported by Portal (i.e. there is an entry in the /config/BEID table), otherwise return null.
    • getCurrencyData

      public CurrencyData getCurrencyData(Integer currencyID)
      Return a CurrencyData object for the specified currency ID.
      Parameters:
      currencyID - The currency ID to lookup.
      Returns:
      Return a CurrencyData object for the specified currency ID if this is a currency that is supported by Portal (i.e. there is an entry in the /config/BEID table), otherwise return null.
    • convertCurrency

      public BigDecimal convertCurrency(int srcCurrencyID, int destCurrencyID, Date transactionTime, BigDecimal amount) throws CurrencyRateException
      Convert an amount from one currency to another based on a point in time.
      Parameters:
      srcCurrencyID - The ID of the currency to convert from.
      destCurrencyID - The ID of the currency to convert to.
      transactionTime - The point in time that the amount was "realized" (time of billing, time of the adjustment was made, etc.)
      amount - The amount to convert.
      Returns:
      The amount that was converted from one currency to another based on a point in time.
      Throws:
      CurrencyRateException - is thrown if the specified rate was not found, corrupt data, etc.
    • getEMUCurrencyIDs

      public Enumeration getEMUCurrencyIDs()
      Return an enumeration for all of the EMU currency IDs.
      Returns:
      An enumeration of all of the EMU currency IDs. An Integer ID will be enumerated for each currency.
    • getEMUCurrencyIDsAsArray

      public Integer[] getEMUCurrencyIDsAsArray()
      Return an array for all of the EMU currency IDs.
      Returns:
      An array of all of the EMU currency IDs.
    • getSupportedCurrencyDataObjects

      public Enumeration getSupportedCurrencyDataObjects()
      Return an enumeration for all of the currencies supported by Portal.
      Returns:
      An enumeration for all of the currencies supported by Portal. A CurrencyData object will be enumerated for each currency.
    • getSupportedCurrencyDataObjectsAsArray

      public CurrencyData[] getSupportedCurrencyDataObjectsAsArray()
      Return an array of all of the currencies supported by Portal.
      Returns:
      An array for all of the currencies supported by Portal.
    • getSupportedEMUCurrencyDataObjects

      public Enumeration getSupportedEMUCurrencyDataObjects()
      Return an enumeration for all of the EMU currencies supported by Portal.
      Returns:
      An enumeration for all of the EMU currencies supported by Portal. A CurrencyData object will be enumerated for each currency.
    • getSupportedEMUCurrencyDataObjectsAsArray

      public CurrencyData[] getSupportedEMUCurrencyDataObjectsAsArray()
      Return an array of all of the EMU currencies supported by Portal.
      Returns:
      An array for all of the EMU currencies supported by Portal.
    • searchForConfigObject

      protected FList searchForConfigObject(Poid objPoid)
      Call Portal to search for the specified configuration object.
      Parameters:
      objPoid - - The poid of the configuration object to read.
      Returns:
      Return an FList containing the data for the specified configuration object if successful otherwise null.