com.partnersoft.core
Enum ConfigLevel

java.lang.Object
  extended by java.lang.Enum<ConfigLevel>
      extended by com.partnersoft.core.ConfigLevel
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ConfigLevel>

public enum ConfigLevel
extends java.lang.Enum<ConfigLevel>

Level of control for a configuration file or subsystem.

The Partner system is designed to be maintained at different administrative levels, with more specific levels allowed to override configuration from more generic levels.

The update system enforces these rules; an installation is set to be at a specific configuration level, and therefore controls configuration at its level and every level beneath it (as distributed to sub-installs, if any). Likewise, more generic configuration and data is received directly from more generic installations above the given level.

Configuration loading generally looks at the most specific level (preferences or seat) for a configuration, then proceeds upwards in generality until it finds the desired config. Another way to look at this process is to start at the most general config but allow overrides as you move towards more specific config levels.

The ordering of ConfigLevel.values() is from most general to most specific.

Copyright 2006 Partner Software, Inc.

Version:
$Id: ConfigLevel.java 1089 2008-01-08 17:36:05Z paul $
Author:
Paul Reavis, Russell Cagle

Enum Constant Summary
CUSTOMER
           
HUB
           
PREFERENCES
           
PROVIDER
           
SEAT
           
SITE
           
SYSTEM
           
 
Method Summary
static ConfigLevel forName(java.lang.String name)
          Returns the instance of ConfigLevel matching the given name.
static ConfigLevel[] generalToSpecific()
          Returns an array of the config levels in order from most generic (SYSTEM) to most specific (PREFERENCES).
 java.lang.String getName()
          Name of the configuration level.
 java.lang.String getPath()
          Standard path in the filesystem to the configuration level's files.
static ConfigLevel[] specificToGeneral()
          Returns an array of the config levels in order from most specific (PREFERENCES) to most generic (SYSTEM).
static ConfigLevel valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ConfigLevel[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SYSTEM

public static final ConfigLevel SYSTEM

PROVIDER

public static final ConfigLevel PROVIDER

HUB

public static final ConfigLevel HUB

CUSTOMER

public static final ConfigLevel CUSTOMER

SITE

public static final ConfigLevel SITE

SEAT

public static final ConfigLevel SEAT

PREFERENCES

public static final ConfigLevel PREFERENCES
Method Detail

values

public static ConfigLevel[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ConfigLevel c : ConfigLevel.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ConfigLevel valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

generalToSpecific

public static ConfigLevel[] generalToSpecific()
Returns an array of the config levels in order from most generic (SYSTEM) to most specific (PREFERENCES).

Returns:
array of config levels in ascending order of specificity

specificToGeneral

public static ConfigLevel[] specificToGeneral()
Returns an array of the config levels in order from most specific (PREFERENCES) to most generic (SYSTEM).

Returns:
array of config levels in ascending order of generality

forName

public static ConfigLevel forName(java.lang.String name)
Returns the instance of ConfigLevel matching the given name. Returns null if no match is available.


getName

public java.lang.String getName()
Name of the configuration level.

Returns:
name of level

getPath

public java.lang.String getPath()
Standard path in the filesystem to the configuration level's files.

Returns:
path to config files