com.konakart.bl
Class ConfigurationMgr

java.lang.Object
  extended by com.konakart.bl.BaseMgr
      extended by com.konakart.bl.ConfigurationMgr
All Implemented Interfaces:
ConfigurationMgrIf

public class ConfigurationMgr
extends BaseMgr
implements ConfigurationMgrIf

Manages all business logic relevant to the management of configurations within the system


Field Summary
protected static org.apache.commons.logging.Log log
          the log
 
Fields inherited from class com.konakart.bl.BaseMgr
templateBaseDir
 
Constructor Summary
ConfigurationMgr(KKEngIf eng)
          Constructor
 
Method Summary
 void editConfiguration(java.lang.String key, java.lang.String value)
          Sets a Configuration Value for the specified key
 KKConfiguration getConfiguration(java.lang.String key)
          Returns a Configuration object referenced by the key passed in as a parameter
 KKConfiguration[] getConfigurations()
          Returns an array of Configuration objects containing all configurations that have been defined in the system.
 java.lang.String getConfigurationValue(java.lang.String key)
          Returns a Configuration Value for the key passed in as a parameter
 java.math.BigDecimal getConfigurationValueAsBigDecimal(java.lang.String key)
          Returns a Configuration Value as a BigDecimal for the key passed in as a parameter
 java.math.BigDecimal getConfigurationValueAsBigDecimal(java.lang.String key, java.math.BigDecimal def)
          Returns a Configuration Value as a BigDecimal for the key passed in as a parameter
 java.lang.Boolean getConfigurationValueAsBool(java.lang.String key, java.lang.Boolean def)
          Returns a Configuration Value as a Boolean for the key passed in as a parameter
 int getConfigurationValueAsInt(java.lang.String key)
          Returns a Configuration Value as an integer for the key passed in as a parameter
 int getConfigurationValueAsInt(java.lang.String key, int def)
          Returns a Configuration Value as an integer for the key passed in as a parameter
 
Methods inherited from class com.konakart.bl.BaseMgr
addInsertAttr, addInsertAttr, checkRequired, getAdminEngMgr, getBasketMgr, getBillingMgr, getBookableProductMgr, getCatMgr, getConfigMgr, getCookieMgr, getCurrMgr, getCustMgr, getCustomerIdFromSession, getCustomerStatsMgr, getCustomerTagMgr, getEmailMgr, getEng, getLangMgr, getManuMgr, getMiscItemMgr, getMode, getModeString, getMqMgr, getMultiStoreMgr, getNewCriteria, getNewCriteria, getOrderMgr, getOrderTotalMgr, getPaymentMgr, getProdMgr, getPromMgr, getRewardPointMgr, getSecMgr, getShippingMgr, getSolrMgr, getStoreId, getTaxMgr, getTemplate, getTemplateRoot, getVelocityContextMgr, getWishListMgr, init, isEnterprise, isMultiStoreShareCustomers, isMultiStoreShareProducts
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
the log

Constructor Detail

ConfigurationMgr

public ConfigurationMgr(KKEngIf eng)
                 throws java.lang.Exception
Constructor

Parameters:
eng -
Throws:
java.lang.Exception
Method Detail

getConfigurations

public KKConfiguration[] getConfigurations()
                                    throws org.apache.torque.TorqueException,
                                           com.workingdogs.village.DataSetException
Returns an array of Configuration objects containing all configurations that have been defined in the system.

Specified by:
getConfigurations in interface ConfigurationMgrIf
Returns:
An array of Configuration objects.
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getConfiguration

public KKConfiguration getConfiguration(java.lang.String key)
                                 throws org.apache.torque.TorqueException,
                                        com.workingdogs.village.DataSetException,
                                        KKException
Returns a Configuration object referenced by the key passed in as a parameter

Specified by:
getConfiguration in interface ConfigurationMgrIf
Parameters:
key -
Returns:
A Configuration object
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKException

getConfigurationValue

public java.lang.String getConfigurationValue(java.lang.String key)
                                       throws KKException
Returns a Configuration Value for the key passed in as a parameter

Specified by:
getConfigurationValue in interface ConfigurationMgrIf
Parameters:
key - the Configuration Key
Returns:
A Configuration Value as a String or null if the key isn't found
Throws:
KKException

getConfigurationValueAsInt

public int getConfigurationValueAsInt(java.lang.String key)
                               throws KKException
Returns a Configuration Value as an integer for the key passed in as a parameter

Specified by:
getConfigurationValueAsInt in interface ConfigurationMgrIf
Parameters:
key - the Configuration Key
Returns:
A Configuration Value as an integer or KKConstants.NOT_SET if the key isn't found.
Throws:
KKException - if there is a problem converting the configuration value into an integer.

getConfigurationValueAsInt

public int getConfigurationValueAsInt(java.lang.String key,
                                      int def)
                               throws KKException
Returns a Configuration Value as an integer for the key passed in as a parameter

Specified by:
getConfigurationValueAsInt in interface ConfigurationMgrIf
Parameters:
key - the Configuration Key
def - default value to return if the key isn't found.
Returns:
A Configuration Value as an integer or the default value if the key isn't found.
Throws:
KKException - if there is a problem converting the configuration value into an integer.

getConfigurationValueAsBigDecimal

public java.math.BigDecimal getConfigurationValueAsBigDecimal(java.lang.String key)
                                                       throws KKException
Returns a Configuration Value as a BigDecimal for the key passed in as a parameter

Specified by:
getConfigurationValueAsBigDecimal in interface ConfigurationMgrIf
Parameters:
key - the Configuration Key
Returns:
A Configuration Value as a BigDecimal or null if the key isn't found.
Throws:
KKException - if there is a problem converting the configuration value into a BigDecimal.

getConfigurationValueAsBigDecimal

public java.math.BigDecimal getConfigurationValueAsBigDecimal(java.lang.String key,
                                                              java.math.BigDecimal def)
                                                       throws KKException
Returns a Configuration Value as a BigDecimal for the key passed in as a parameter

Specified by:
getConfigurationValueAsBigDecimal in interface ConfigurationMgrIf
Parameters:
key - the Configuration Key
def - default value to use if the key doesn't exist.
Returns:
A Configuration Value as a BigDecimal or the default value if the key isn't found.
Throws:
KKException - if there is a problem converting the configuration value into a BigDecimal.

getConfigurationValueAsBool

public java.lang.Boolean getConfigurationValueAsBool(java.lang.String key,
                                                     java.lang.Boolean def)
                                              throws KKException
Returns a Configuration Value as a Boolean for the key passed in as a parameter

Specified by:
getConfigurationValueAsBool in interface ConfigurationMgrIf
Parameters:
key - the Configuration Key
def - the default value to be returned if there's a problem
Returns:
A Configuration Value as a Boolean or the default value if the key isn't found.
Throws:
KKException

editConfiguration

public void editConfiguration(java.lang.String key,
                              java.lang.String value)
                       throws org.apache.torque.TorqueException,
                              com.workingdogs.village.DataSetException,
                              KKException
Sets a Configuration Value for the specified key

Specified by:
editConfiguration in interface ConfigurationMgrIf
Parameters:
key - key whose value will be set
value - value to set
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKException


Copyright © 2011 DS Data Systems UK Ltd.