Class SystemDefaultsManager

java.lang.Object
com.portal.common.InfranetCachedData
com.portal.common.SystemDefaultsManager

public class SystemDefaultsManager extends InfranetCachedData
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".
  • Constructor Details

    • SystemDefaultsManager

      protected SystemDefaultsManager(PortalContext connection)
      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

      public static SystemDefaultsManager 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 SystemDefaultsManager 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.
    • getPrimaryCurrency

      public int getPrimaryCurrency()
    • getPaymentMethodData

      public PaymentMethodData[] 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

      public BusinessTypeData[] 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.