Class ReasonCodeManager

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

public class ReasonCodeManager extends InfranetCachedData
This utility class supports access of "reason code" data. At present this table is "hard-coded" in a properties file but eventually it will be read from a storable class residing in the Portal database. Since this is a relatively heavy weight object (makes calls to Portal to read the Storable class) 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

    • ReasonCodeManager

      protected ReasonCodeManager(PortalContext connection)
      Construct an Portal Reason Code Manager object. Read all of the reason codes for all of domains Locale table from Portal and construct a lookup table of Portal Locale data objects.
      Parameters:
      connection - An active connection to Portal.
  • Method Details

    • getInstance

      public static ReasonCodeManager 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 ReasonCodeManager 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.
    • getReasonData

      public Vector getReasonData(int reasonType, String infranetLocale, int matchType)
      Return the vector of "reason code data" classes for the specified reason type (credit, debit, etc.) Return the reason description text in the specified locale.
      Parameters:
      reasonType - The type of "reason data" (credit, debit, etc.) to return.
      infranetLocale - The Portal locale to return the "reason" description strings in (English, French, etc.)
      matchType - Using the specified locale do an exact match, a match by language only, or an exact match followed by a match by language only. Can be one of the following constants: InfranetLocaleManager.LocaleExactMatch, InfranetLocaleManager.LocaleLangMatch, InfranetLocaleManager.LocaleExactMatchThenLangMatch.
      Returns:
      The list of "reason code data" classes for the specified reason type (credit, debit, etc.) A null pointer will be returned if the "reason type" does not exist or the text cannot be returned in the specified display locale.
    • getReasonData

      public Vector getReasonData(int reasonType, Locale javaLocale, int matchType)
      Return the vector of "reason code data" classes for the specified reason type (credit, debit, etc.) Return the reason description text in the specified Java locale.
      Parameters:
      reasonType - The type of "reason data" (credit, debit, etc.) to return.
      javaLocale - The Java locale to return the "reason" description strings in (English, French, etc.)
      matchType - Using the specified locale do an exact match, a match by language only, or an exact match followed by a match by language only. Can be one of the following constants: InfranetLocaleManager.LocaleExactMatch, InfranetLocaleManager.LocaleLangMatch, InfranetLocaleManager.LocaleExactMatchThenLangMatch.
      Returns:
      The list of "reason code data" classes for the specified reason type (credit, debit, etc.) A null pointer will be returned if the "reason type" does not exist or the text cannot be returned in the specified display locale.
    • getReasonDataAsArray

      public ReasonCodeData[] getReasonDataAsArray(int reasonType, String infranetLocale, int matchType)
      Return the array of "reason code data" classes for the specified reason type (credit, debit, etc.) Return the reason description text in the specified locale.
      Parameters:
      reasonType - The type of "reason data" (credit, debit, etc.) to return.
      infranetLocale - The Portal locale to return the "reason" description strings in (English, French, etc.)
      matchType - Using the specified locale do an exact match, a match by language only, or an exact match followed by a match by language only. Can be one of the following constants: InfranetLocaleManager.LocaleExactMatch, InfranetLocaleManager.LocaleLangMatch, InfranetLocaleManager.LocaleExactMatchThenLangMatch.
      Returns:
      The array of "reason code data" classes for the specified reason type (credit, debit, etc.) A NULL pointer will be returned if the "reason type" does not exist or the text cannot be returned in the specified display locale.
    • getReasonDataAsArray

      public ReasonCodeData[] getReasonDataAsArray(int reasonType, Locale javaLocale, int matchType)
      Return the array of "reason code data" classes for the specified reason type (credit, debit, etc.) Return the reason description text in the specified Java locale.
      Parameters:
      reasonType - The type of "reason data" (credit, debit, etc.) to return.
      javaLocale - The Java locale to return the "reason" description strings in (English, French, etc.)
      matchType - Using the specified locale do an exact match, a match by language only, or an exact match followed by a match by language only. Can be one of the following constants: InfranetLocaleManager.LocaleExactMatch, InfranetLocaleManager.LocaleLangMatch, InfranetLocaleManager.LocaleExactMatchThenLangMatch.
      Returns:
      The array of "reason code data" classes for the specified reason type (credit, debit, etc.) A null pointer will be returned if the "reason type" does not exist or the text cannot be returned in the specified display locale.