Package com.portal.common
Class SystemDefaultsManager
java.lang.Object
com.portal.common.InfranetCachedData
com.portal.common.SystemDefaultsManager
SystemDefaultsManager.java
This utility class supports access to all of the system defaults
(payment methods, primary currency, etc.) for Portal accounts.
Since this is a relatively heavy weight object (calls to Portal to read
the BEID table) you must call the getInstance() method to get a global
copy of this object.
At present this class does not have a dynamic mechanism to refresh the
cache but the cache can be explicitly refreshed calling the getInstance()
method with rebuild set to "true".
-
Nested Class Summary
Nested classes/interfaces inherited from class com.portal.common.InfranetCachedData
InfranetCachedData.InstanceBuilder
-
Field Summary
Fields inherited from class com.portal.common.InfranetCachedData
m_Connection
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SystemDefaultsManager
(PortalContext connection) Constructs a "system defaults" Manager object. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the array of supported business types from the "/config/business_type" object.static SystemDefaultsManager
getInstance
(PortalContext connection) Get the one and only instance of this class.static SystemDefaultsManager
getInstance
(PortalContext connection, boolean rebuild) Get the one and only instance of this class.Return the array of "payment method" objects for all of the payment methods supported by Portal.int[]
Returns the array of indicies for the various "payment methods" supported by Portal.int
Methods inherited from class com.portal.common.InfranetCachedData
buildKey, buildKeySimple, createDataManagers, getInstanceImpl, getInstanceImplSimple
-
Constructor Details
-
SystemDefaultsManager
Constructs a "system defaults" Manager object. Reads all of the system defaults (primary currency, payment methods, business types, etc.) from Portal and stores them in a cache.- 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.
-
getPrimaryCurrency
public int getPrimaryCurrency() -
getPaymentMethodData
Return the array of "payment method" objects for all of the payment methods supported by Portal.- Returns:
- the array of "payment method" objects. An empty array will be returned if an error is encountered.
-
getPaymentMethodIndicies
public int[] getPaymentMethodIndicies()Returns the array of indicies for the various "payment methods" supported by Portal.- Returns:
- the array of indicies for the various "payment methods" supported by Portal.
-
getBusinessTypes
Retrieves the array of supported business types from the "/config/business_type" object.- Returns:
- List of supported business types. If no types are supported,
null
is returned.
-