Package com.portal.common
Class BEIDManager
java.lang.Object
com.portal.common.InfranetCachedData
com.portal.common.BEIDManager
-
Nested Class Summary
Nested classes/interfaces inherited from class com.portal.common.InfranetCachedData
InfranetCachedData.InstanceBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
String constants for the various configuration tables.static final String
static final String
Fields inherited from class com.portal.common.InfranetCachedData
m_Connection
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BEIDManager
(PortalContext connection) Construct a BEID Manager object. -
Method Summary
Modifier and TypeMethodDescriptionstatic 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\nconvertCurrency
(int srcCurrencyID, int destCurrencyID, Date transactionTime, BigDecimal amount) Convert an amount from one currency to another based on a point in time.getCurrencyData
(int currencyID) Return a CurrencyData object for the specified currency ID.getCurrencyData
(Integer currencyID) Return a CurrencyData object for the specified currency ID.getData
(int resourceID) Return a "BEID data" object for the specified BEID resource ID.Return a "BEID data" object for the specified BEID resource ID.getDescription
(int resourceID) Convenience method to return the resource description (Free domestic minutes, US Dollar, Euro, etc.) for the specified resource ID.Return an enumeration for all of the EMU currency IDs.Integer[]
Return an array for all of the EMU currency IDs.static BEIDManager
getInstance
(PortalContext connection) Get the one and only instance of this class.static BEIDManager
getInstance
(PortalContext connection, boolean rebuild) Get the one and only instance of this class.int
Return the number of BEID resources supported by Portal.int
Return the number EMU currencies.int
Return the number of currencies supported by Portal.int
Return the number of EMU currencies supported by Portal.Return an enumeration for all of the BEID resources supported by Portal.BEIDData[]
Return an array of all of the BEID resources supported by Portal.Return an enumeration for all of the currencies supported by Portal.Return an array of all of the currencies supported by Portal.Return an enumeration for all of the EMU currencies supported by Portal.Return an array of all of the EMU currencies supported by Portal.getSymbol
(int resourceID) Convenience method to return the resource symbol (Hrs, Min, $, FF, etc.) for the specified resource ID.static boolean
isCurrency
(int currencyID) Is the currency ID a valid ISO currency ID that is recognized by Portal.boolean
isEMUCurrency
(int currencyID) Is the specified currency ID an EMU (Euro member) currency?static boolean
isEuro
(int currencyID) Is the specified currency ID the Euro currency?protected FList
searchForConfigObject
(Poid objPoid) Call Portal to search for the specified configuration object.Methods inherited from class com.portal.common.InfranetCachedData
buildKey, buildKeySimple, createDataManagers, getInstanceImpl, getInstanceImplSimple
-
Field Details
-
PIN_STR_BEID_POID_TYPE
String constants for the various configuration tables.- See Also:
-
PIN_STR_SEARCH_POID_TYPE
- See Also:
-
PIN_STR_EMU_CURRENCY_POID_TYPE
- See Also:
-
-
Constructor Details
-
BEIDManager
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
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
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
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
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
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
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
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
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
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
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
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
Return an array for all of the EMU currency IDs.- Returns:
- An array of all of the EMU currency IDs.
-
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
Return an array of all of the currencies supported by Portal.- Returns:
- An array for all of the currencies supported by Portal.
-
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
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
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.
-