com.pega.pegarules.pub.util
Interface PRSystemSettings


public interface PRSystemSettings

Makes settings visible for generated java.

Dynamic System Settings

Dynamic values specific to this executing PRPC system that can be modified by configuration.

The ruleset name that 'owns' the setting is present to avoid name space conflicts in a multiple system environment. This name *should be set* to the name of the ruleset that contains the rule that creates/manages the setting.

These values are persisted in Data-Admin-System-Settings. the set() methods add an instance to this table. The remove() method deletes the named instance.

System Settings

System values specific to the server's 'production level' that are shipped as part of configuration.

These values are persisted in Rule-Admin-System-Settings, the key values in the database have one additional part in their keys which cannot be set in the request. That part in the name is the number of the production level that this value is visible for.

A request for "system/printer/postscript" would access the Rule record. The Rule record has an array of 5 entries representing each of the five "production levels" of the system. The appropriate one would be returned based on the production level of the system making the request:

The production level is set by the system name and the setting in Data-Admin-System for that system name. The set and remove methods cannot affect settings with the system/ top level node name.

Author:
clinb

Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String VERSION
           
 
Method Summary
 java.lang.String get(java.lang.String aOwningRuleset, java.lang.String aKey)
          returns a system setting's value, appropriate for the server's production level, by key.
 java.lang.String getDynamic(java.lang.String aOwningRuleset, java.lang.String aKey)
          returns a dynamic setting's value by key.
 java.lang.String getFSSetting(java.lang.String aName, java.lang.String aDefault, boolean aCheckIsDir, boolean aCheckIsFile)
          Get a (real) File System reference, using first a JNDI url lookup and then using the value supplied in the configuration.
 java.lang.String normalizeDBSettingKey(java.lang.String aDBSettingKey)
          Normalizes a key of the form 'prefix/<setting>/classification' by lower-casing the prefix and suffix and, for 'prconfig' settings, normalizing the setting value according to the rules for prconfig settings.
 boolean setDynamic(java.lang.String aOwningRuleset, java.lang.String aKey, java.lang.String aValue)
          registers / replaces a dynamic setting key and its value.
 

Field Detail

COPYRIGHT

static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

VERSION

static final java.lang.String VERSION
See Also:
Constant Field Values
Method Detail

get

java.lang.String get(java.lang.String aOwningRuleset,
                     java.lang.String aKey)
returns a system setting's value, appropriate for the server's production level, by key.

Parameters:
aOwningRuleset - name of the ruleset which 'owns' this key
aKey - slash-separated path name similar to those specified in the prconfig.xml file.
Returns:
value represented by the given key or null if not found
Throws:
InvalidParameterException - if the parameters are null or zero length

getDynamic

java.lang.String getDynamic(java.lang.String aOwningRuleset,
                            java.lang.String aKey)
returns a dynamic setting's value by key.

Parameters:
aOwningRuleset - name of the ruleset which 'owns' this key
aKey - slash-separated path name similar to those specified in the prconfig.xml file.
Returns:
value represented by the given key or null if not found
Throws:
InvalidParameterException - if the parameters are null or zero length

setDynamic

boolean setDynamic(java.lang.String aOwningRuleset,
                   java.lang.String aKey,
                   java.lang.String aValue)
registers / replaces a dynamic setting key and its value.

Parameters:
aOwningRuleset - name of the ruleset which 'owns' this key
aKey - slash-separated path name similar to those specified in the prconfig.xml file.
aValue - the value to associate with this key
Returns:
true if successful, false otherwise
Throws:
InvalidParameterException - if the parameters are null or zero length

normalizeDBSettingKey

java.lang.String normalizeDBSettingKey(java.lang.String aDBSettingKey)
                                       throws java.lang.IllegalArgumentException
Normalizes a key of the form 'prefix/<setting>/classification' by lower-casing the prefix and suffix and, for 'prconfig' settings, normalizing the setting value according to the rules for prconfig settings.

Parameters:
aDBSettingKey - A settings key of the form 'prefix/<setting>/classification'.
Returns:
A normalized key, ready for use in the database.
Throws:
java.lang.IllegalArgumentException - If the provided key is null or not of the format 'prefix/<setting>/classification'.

getFSSetting

java.lang.String getFSSetting(java.lang.String aName,
                              java.lang.String aDefault,
                              boolean aCheckIsDir,
                              boolean aCheckIsFile)
Get a (real) File System reference, using first a JNDI url lookup and then using the value supplied in the configuration. If the setting is not found, or is not accessible due to security constraints, return the supplied default value. At most one of aCheckIsDir or aCheckIsFile should be set to true, in which case the directory or file must exist prior to calling this method.

Parameters:
aName - Name of the field to lookup
aDefault - default value to return if a value cannot be obtained
aCheckIsDir - true if the value must reference an existing directory
aCheckIsFile - true if the value must reference an existing file
Returns:
Stirng value of specified setting


Copyright © 2012 Pegasystems Inc. All Rights Reserved.