Package com.portal.common
Class BusinessParams
java.lang.Object
com.portal.common.InfranetCachedData
com.portal.common.BusinessParams
This utility class supports access to information for all of the business
logic parameters stored in the /config/business_params configuration
object.
Since this is a relatively heavy weight object (calls Portal to read
the configuration objects) 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".
- Version:
- $Id: BusinessParams.java /cgbubrm_main.clients/1 2011/06/13 07:49:45 mchellam Exp $
- Author:
- Jon Sorensen
-
Nested Class Summary
Nested classes/interfaces inherited from class com.portal.common.InfranetCachedData
InfranetCachedData.InstanceBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
Fields inherited from class com.portal.common.InfranetCachedData
m_Connection
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BusinessParams
(PortalContext connection) Construct a "business parameters" object. -
Method Summary
Modifier and TypeMethodDescriptionboolean
doesParamExist
(String groupName, String paramName) Determine if the specified parameter exists.long
Hack method used to support a JavaServerConnection.getDecimal
(String groupName, String paramName) Get the specified parameter as a "big decimal" value from a "global" configuration object.static BusinessParams
getInstance
(PortalContext connection) Get the one and only instance of this class.static BusinessParams
getInstance
(PortalContext connection, boolean rebuild) Get the one and only instance of this class.Get the specified parameter as an integer value from a "global" configuration object.Get the specified parameter as a string value from a "global" configuration object.protected FList
Hack method used to support a JavaServerConnection.Adjust the time value to 12 AM and then apply the billing cycle offset (which is in hours).protected FList
Call Portal to search for the specified configuration objects.Methods inherited from class com.portal.common.InfranetCachedData
buildKey, buildKeySimple, createDataManagers, getInstanceImpl, getInstanceImplSimple
-
Field Details
-
PIN_OBJ_TYPE_BUS_PARAMS
- See Also:
-
BILLING_PARAMS
- See Also:
-
BILLING_CYCLE_OFFSET
- See Also:
-
BDOM_BILLING_DIR
- See Also:
-
ENABLE_CORRECTIVE_INVOICES
- See Also:
-
-
Constructor Details
-
BusinessParams
Construct a "business parameters" object. Read the business parameters for all of the "parameter groups" from Portal and construct the appropreiate lookup tables.- 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.
-
doesParamExist
Determine if the specified parameter exists. Parameters:- Parameters:
groupName
- The name of the group ("billing", "rating", "vse_ipt", etc.) to retrieve the parameter from.paramName
- The name of the configuration parameter to retrieve the value for.- Returns:
- Return true if the parameter exists, otherwise return false.
-
getInt
Get the specified parameter as an integer value from a "global" configuration object. Parameters:- Parameters:
groupName
- The name of the group ("billing", "rating", "vse_ipt", etc.) to retrieve the parameter from.paramName
- The name of the configuration parameter to retrieve the value for.- Returns:
- The integer representation of the value associated with the specified parameter.
- Throws:
BusParamException
-
getString
Get the specified parameter as a string value from a "global" configuration object. Parameters:- Parameters:
groupName
- The name of the group ("billing", "rating", "vse_ipt", etc.) to retrieve the parameter from.paramName
- The name of the configuration parameter to retrieve the value for.- Returns:
- The integer representation of the value associated with the specified parameter.
- Throws:
BusParamException
-
getDecimal
Get the specified parameter as a "big decimal" value from a "global" configuration object. Parameters:- Parameters:
groupName
- The name of the group ("billing", "rating", "vse_ipt", etc.) to retrieve the parameter from.paramName
- The name of the configuration parameter to retrieve the value for.- Returns:
- The integer representation of the value associated with the specified parameter.
- Throws:
BusParamException
-
roundTo12AMApplyHourOffset
Adjust the time value to 12 AM and then apply the billing cycle offset (which is in hours). If the billing cycle offset is greater than the hour in the specified time then roll back to the previous day.- Parameters:
time
- the time value to adjust- Returns:
- the specified time with the hour offset applied to it.
Here are some examples:
- time = 01/05/2001;9:59:67, hourOffset = 10, return 01/04/2001;10:00:00
- time = 01/05/2001;10:59:21, hourOffset = 10, return 01/05/2001;10:00:00
-
searchForConfigObjects
Call Portal to search for the specified configuration objects.- Returns:
- Return an FList containing the data for the specified configuration object if successful otherwise null.
-
opcode
Hack method used to support a JavaServerConnection. This is a hack because the JavaCommon package does not know anything about a Java Server connection. This method is used to execute an op-code. The default implementation will use a Portal Context.- Parameters:
op
- Opcode to perform.flags
- Control Flags for opcode.in
- Opcode parameter FList.- Returns:
- Return the FList returned from the op-code that was executed.
- Throws:
EBufException
- is trhown if an error occurs.
-
getCurrentDB
public long getCurrentDB()Hack method used to support a JavaServerConnection. This is a hack because the JavaCommon package does not know anything about a Java Server connection. This method is used to return the database number for the connection affiliated with an instance of this class. The default implementation will use a Portal Context.- Returns:
- The database number currently connected to.
-