org.jasig.cas.client.configuration
Class BaseConfigurationStrategy

java.lang.Object
  extended by org.jasig.cas.client.configuration.BaseConfigurationStrategy
All Implemented Interfaces:
ConfigurationStrategy
Direct Known Subclasses:
JndiConfigurationStrategyImpl, LegacyConfigurationStrategyImpl, PropertiesConfigurationStrategyImpl, SystemPropertiesConfigurationStrategyImpl, WebXmlConfigurationStrategyImpl

public abstract class BaseConfigurationStrategy
extends Object
implements ConfigurationStrategy

Base class to provide most of the boiler-plate code (i.e. checking for proper values, returning defaults, etc.

Since:
3.4.0
Author:
Scott Battaglia

Field Summary
protected  org.slf4j.Logger logger
           
 
Constructor Summary
BaseConfigurationStrategy()
           
 
Method Summary
protected abstract  String get(ConfigurationKey configurationKey)
          Retrieve the String value for this key.
 boolean getBoolean(ConfigurationKey<Boolean> configurationKey)
          Retrieves the value for the provided , falling back to the 's ConfigurationKey.getDefaultValue() if nothing can be found.
<T> Class<? extends T>
getClass(ConfigurationKey<Class<? extends T>> configurationKey)
          Retrieves the value for the provided , falling back to the 's ConfigurationKey.getDefaultValue() if nothing can be found.
 int getInt(ConfigurationKey<Integer> configurationKey)
          Retrieves the value for the provided , falling back to the 's ConfigurationKey.getDefaultValue() if nothing can be found.
 long getLong(ConfigurationKey<Long> configurationKey)
          Retrieves the value for the provided , falling back to the 's ConfigurationKey.getDefaultValue() if nothing can be found.
 String getString(ConfigurationKey<String> configurationKey)
          Retrieves the value for the provided , falling back to the 's ConfigurationKey.getDefaultValue() if nothing can be found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jasig.cas.client.configuration.ConfigurationStrategy
init
 

Field Detail

logger

protected final org.slf4j.Logger logger
Constructor Detail

BaseConfigurationStrategy

public BaseConfigurationStrategy()
Method Detail

getBoolean

public final boolean getBoolean(ConfigurationKey<Boolean> configurationKey)
Description copied from interface: ConfigurationStrategy
Retrieves the value for the provided , falling back to the 's ConfigurationKey.getDefaultValue() if nothing can be found.

Specified by:
getBoolean in interface ConfigurationStrategy
Parameters:
configurationKey - the configuration key. MUST NOT BE NULL.
Returns:
the configured value, or the default value.

getLong

public final long getLong(ConfigurationKey<Long> configurationKey)
Description copied from interface: ConfigurationStrategy
Retrieves the value for the provided , falling back to the 's ConfigurationKey.getDefaultValue() if nothing can be found.

Specified by:
getLong in interface ConfigurationStrategy
Parameters:
configurationKey - the configuration key. MUST NOT BE NULL.
Returns:
the configured value, or the default value.

getInt

public final int getInt(ConfigurationKey<Integer> configurationKey)
Description copied from interface: ConfigurationStrategy
Retrieves the value for the provided , falling back to the 's ConfigurationKey.getDefaultValue() if nothing can be found.

Specified by:
getInt in interface ConfigurationStrategy
Parameters:
configurationKey - the configuration key. MUST NOT BE NULL.
Returns:
the configured value, or the default value.

getString

public final String getString(ConfigurationKey<String> configurationKey)
Description copied from interface: ConfigurationStrategy
Retrieves the value for the provided , falling back to the 's ConfigurationKey.getDefaultValue() if nothing can be found.

Specified by:
getString in interface ConfigurationStrategy
Parameters:
configurationKey - the configuration key. MUST NOT BE NULL.
Returns:
the configured value, or the default value.

getClass

public <T> Class<? extends T> getClass(ConfigurationKey<Class<? extends T>> configurationKey)
Description copied from interface: ConfigurationStrategy
Retrieves the value for the provided , falling back to the 's ConfigurationKey.getDefaultValue() if nothing can be found.

Specified by:
getClass in interface ConfigurationStrategy
Parameters:
configurationKey - the configuration key. MUST NOT BE NULL.
Returns:
the configured value, or the default value.

get

protected abstract String get(ConfigurationKey configurationKey)
Retrieve the String value for this key. Returns null if there is no value.

Parameters:
configurationKey - the key to retrieve. MUST NOT BE NULL.
Returns:
the String if its found, null otherwise.


Copyright © 2006-2015 Jasig. All Rights Reserved.