org.kuali.rice.kns.service.impl
Class ParameterServiceProxyImpl

java.lang.Object
  extended by org.kuali.rice.kns.service.impl.ParameterServiceProxyImpl
All Implemented Interfaces:
ParameterService

public class ParameterServiceProxyImpl
extends java.lang.Object
implements ParameterService

ParameterServiceProxyImpl is an implementation of ParameterServiceProxy that performs simple proxying of storage/retrieval calls to a remoted ParameterService implementation. TODO this class needs improved caching!!!

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
static java.lang.String PARAMETER_CACHE_GROUP_NAME
           
static java.lang.String PARAMETER_CACHE_PREFIX
           
 
Constructor Summary
ParameterServiceProxyImpl()
           
 
Method Summary
 void clearCache()
          This method can be used to clear the parameter cache during unit testing.
protected  Parameter fetchFromCache(java.lang.String namespaceCode, java.lang.String detailTypeCode, java.lang.String name)
           
protected  void flushParameterFromCache(java.lang.String namespaceCode, java.lang.String detailTypeCode, java.lang.String name)
           
 java.lang.String getDetailType(java.lang.Class<? extends java.lang.Object> documentOrStepClass)
          This method can be used to change the value of a Parameter for unit testing purposes.
 boolean getIndicatorParameter(java.lang.Class<? extends java.lang.Object> componentClass, java.lang.String parameterName)
          This method provides a convenient way to access the a parameter that signifies true or false.
 boolean getIndicatorParameter(java.lang.String namespaceCode, java.lang.String detailTypeCode, java.lang.String parameterName)
          This method provides a convenient way to access the a parameter that signifies true or false.
 java.lang.String getNamespace(java.lang.Class<? extends java.lang.Object> documentOrStepClass)
          This method can be used to set a namespace.
protected  java.lang.String getParameterCacheKey(java.lang.String namespaceCode, java.lang.String detailTypeCode, java.lang.String name)
           
 org.kuali.rice.kns.service.ParameterEvaluator getParameterEvaluator(java.lang.Class<? extends java.lang.Object> componentClass, java.lang.String parameterName)
          This method will return an instance of a ParameterEvaluator implementation that will wrap a Parameter and provide convenient evaluation methods.
 org.kuali.rice.kns.service.ParameterEvaluator getParameterEvaluator(java.lang.Class<? extends java.lang.Object> componentClass, java.lang.String parameterName, java.lang.String constrainedValue)
          This method will return an instance of a ParameterEvaluator implementation that will wrap a Parameter and constrainedValue and provide convenient evaluation methods.
 org.kuali.rice.kns.service.ParameterEvaluator getParameterEvaluator(java.lang.Class<? extends java.lang.Object> componentClass, java.lang.String parameterName, java.lang.String constrainingValue, java.lang.String constrainedValue)
          This method will return an instance of a ParameterEvaluator implementation that will wrap a Parameter, constrainingValue, and constrainedValue and provide convenient evaluation methods.
 org.kuali.rice.kns.service.ParameterEvaluator getParameterEvaluator(java.lang.Class<? extends java.lang.Object> componentClass, java.lang.String allowParameterName, java.lang.String denyParameterName, java.lang.String constrainingValue, java.lang.String constrainedValue)
          This method will return an instance of a ParameterEvaluator implementation that will wrap an allow Parameter, a deny Parameter, constrainingValue, and constrainedValue and provide convenient evaluation methods.
 org.kuali.rice.kns.service.ParameterEvaluator getParameterEvaluator(java.lang.String namespaceCode, java.lang.String detailTypeCode, java.lang.String parameterName)
          This method will return an instance of a ParameterEvaluator implementation that will wrap a Parameter and provide convenient evaluation methods.
 org.kuali.rice.kns.service.ParameterEvaluator getParameterEvaluator(java.lang.String namespaceCode, java.lang.String detailTypeCode, java.lang.String parameterName, java.lang.String constrainedValue)
          This method will return an instance of a ParameterEvaluator implementation that will wrap a Parameter and constrainedValue and provide convenient evaluation methods.
 ParameterService getParameterService()
           
 java.lang.String getParameterValue(java.lang.Class<? extends java.lang.Object> componentClass, java.lang.String parameterName)
          This method returns the unprocessed text value of a parameter.
 java.lang.String getParameterValue(java.lang.Class<? extends java.lang.Object> componentClass, java.lang.String parameterName, java.lang.String constrainingValue)
          This method can be used to derive a value based on another value.
 java.lang.String getParameterValue(java.lang.String namespaceCode, java.lang.String detailTypeCode, java.lang.String parameterName)
          This method returns the value of the specified parameter
 java.util.List<java.lang.String> getParameterValues(java.lang.Class<? extends java.lang.Object> componentClass, java.lang.String parameterName)
          This method can be used to parse the value of a parameter.
 java.util.List<java.lang.String> getParameterValues(java.lang.Class<? extends java.lang.Object> componentClass, java.lang.String parameterName, java.lang.String constrainingValue)
          This method can be used to derive a set of values based on another value.
 java.util.List<java.lang.String> getParameterValues(java.lang.String namespaceCode, java.lang.String detailTypeCode, java.lang.String parameterName)
          This method returns a list of the parameter values split on implementation specific criteria.
protected  void insertIntoCache(Parameter parameter)
           
 boolean parameterExists(java.lang.Class<? extends java.lang.Object> componentClass, java.lang.String parameterName)
          This method provides an exception free way to ensure that a parameter exists.
 Parameter retrieveParameter(java.lang.String namespaceCode, java.lang.String detailTypeCode, java.lang.String parameterName)
          This method returns the actual BusinessObject instance of a parameter.
 java.util.List<Parameter> retrieveParametersGivenLookupCriteria(java.util.Map<java.lang.String,java.lang.String> fieldValues)
          This method can be used to retrieve a list of parameters that match the given fieldValues criteria.
 void setParameterForTesting(java.lang.Class componentClass, java.lang.String parameterName, java.lang.String parameterText)
          This method can be used to change the value of a Parameter for unit testing purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAMETER_CACHE_PREFIX

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

PARAMETER_CACHE_GROUP_NAME

public static final java.lang.String PARAMETER_CACHE_GROUP_NAME
See Also:
Constant Field Values
Constructor Detail

ParameterServiceProxyImpl

public ParameterServiceProxyImpl()
Method Detail

retrieveParameter

public Parameter retrieveParameter(java.lang.String namespaceCode,
                                   java.lang.String detailTypeCode,
                                   java.lang.String parameterName)
Description copied from interface: ParameterService
This method returns the actual BusinessObject instance of a parameter.

Specified by:
retrieveParameter in interface ParameterService
Returns:
The Parameter instance

setParameterForTesting

public void setParameterForTesting(java.lang.Class componentClass,
                                   java.lang.String parameterName,
                                   java.lang.String parameterText)
Description copied from interface: ParameterService
This method can be used to change the value of a Parameter for unit testing purposes.

Specified by:
setParameterForTesting in interface ParameterService

getDetailType

public java.lang.String getDetailType(java.lang.Class<? extends java.lang.Object> documentOrStepClass)
Description copied from interface: ParameterService
This method can be used to change the value of a Parameter for unit testing purposes.

Specified by:
getDetailType in interface ParameterService

getIndicatorParameter

public boolean getIndicatorParameter(java.lang.Class<? extends java.lang.Object> componentClass,
                                     java.lang.String parameterName)
Description copied from interface: ParameterService
This method provides a convenient way to access the a parameter that signifies true or false.

Specified by:
getIndicatorParameter in interface ParameterService
Returns:
boolean value of indicator parameter

getNamespace

public java.lang.String getNamespace(java.lang.Class<? extends java.lang.Object> documentOrStepClass)
Description copied from interface: ParameterService
This method can be used to set a namespace.

Specified by:
getNamespace in interface ParameterService

getParameterEvaluator

public org.kuali.rice.kns.service.ParameterEvaluator getParameterEvaluator(java.lang.Class<? extends java.lang.Object> componentClass,
                                                                           java.lang.String allowParameterName,
                                                                           java.lang.String denyParameterName,
                                                                           java.lang.String constrainingValue,
                                                                           java.lang.String constrainedValue)
Description copied from interface: ParameterService
This method will return an instance of a ParameterEvaluator implementation that will wrap an allow Parameter, a deny Parameter, constrainingValue, and constrainedValue and provide convenient evaluation methods.

Specified by:
getParameterEvaluator in interface ParameterService
Returns:
ParameterEvaluator

getParameterEvaluator

public org.kuali.rice.kns.service.ParameterEvaluator getParameterEvaluator(java.lang.Class<? extends java.lang.Object> componentClass,
                                                                           java.lang.String parameterName,
                                                                           java.lang.String constrainingValue,
                                                                           java.lang.String constrainedValue)
Description copied from interface: ParameterService
This method will return an instance of a ParameterEvaluator implementation that will wrap a Parameter, constrainingValue, and constrainedValue and provide convenient evaluation methods.

Specified by:
getParameterEvaluator in interface ParameterService
Returns:
ParameterEvaluator

getParameterEvaluator

public org.kuali.rice.kns.service.ParameterEvaluator getParameterEvaluator(java.lang.Class<? extends java.lang.Object> componentClass,
                                                                           java.lang.String parameterName,
                                                                           java.lang.String constrainedValue)
Description copied from interface: ParameterService
This method will return an instance of a ParameterEvaluator implementation that will wrap a Parameter and constrainedValue and provide convenient evaluation methods.

Specified by:
getParameterEvaluator in interface ParameterService
Returns:
ParameterEvaluator

getParameterEvaluator

public org.kuali.rice.kns.service.ParameterEvaluator getParameterEvaluator(java.lang.Class<? extends java.lang.Object> componentClass,
                                                                           java.lang.String parameterName)
Description copied from interface: ParameterService
This method will return an instance of a ParameterEvaluator implementation that will wrap a Parameter and provide convenient evaluation methods.

Specified by:
getParameterEvaluator in interface ParameterService
Returns:
ParameterEvaluator

getParameterValue

public java.lang.String getParameterValue(java.lang.Class<? extends java.lang.Object> componentClass,
                                          java.lang.String parameterName,
                                          java.lang.String constrainingValue)
Description copied from interface: ParameterService
This method can be used to derive a value based on another value.

Specified by:
getParameterValue in interface ParameterService
Returns:
derived value

getParameterValue

public java.lang.String getParameterValue(java.lang.Class<? extends java.lang.Object> componentClass,
                                          java.lang.String parameterName)
Description copied from interface: ParameterService
This method returns the unprocessed text value of a parameter.

Specified by:
getParameterValue in interface ParameterService
Returns:
unprocessed string value as a parameter

getParameterValues

public java.util.List<java.lang.String> getParameterValues(java.lang.Class<? extends java.lang.Object> componentClass,
                                                           java.lang.String parameterName,
                                                           java.lang.String constrainingValue)
Description copied from interface: ParameterService
This method can be used to derive a set of values based on another value.

Specified by:
getParameterValues in interface ParameterService
Returns:
derived values List

getParameterValues

public java.util.List<java.lang.String> getParameterValues(java.lang.Class<? extends java.lang.Object> componentClass,
                                                           java.lang.String parameterName)
Description copied from interface: ParameterService
This method can be used to parse the value of a parameter.

Specified by:
getParameterValues in interface ParameterService
Returns:
parsed List of String parameter values

parameterExists

public boolean parameterExists(java.lang.Class<? extends java.lang.Object> componentClass,
                               java.lang.String parameterName)
Description copied from interface: ParameterService
This method provides an exception free way to ensure that a parameter exists.

Specified by:
parameterExists in interface ParameterService
Returns:
boolean indicating whether or not the parameter exists

getParameterService

public ParameterService getParameterService()

retrieveParametersGivenLookupCriteria

public java.util.List<Parameter> retrieveParametersGivenLookupCriteria(java.util.Map<java.lang.String,java.lang.String> fieldValues)
Description copied from interface: ParameterService
This method can be used to retrieve a list of parameters that match the given fieldValues criteria. You could also specify the "like" criteria in the Map.

Specified by:
retrieveParametersGivenLookupCriteria in interface ParameterService
Parameters:
fieldValues - The Map containing the key value pairs to be used to build the criteria.
Returns:
List of Parameters that match the criteria.

getParameterValue

public java.lang.String getParameterValue(java.lang.String namespaceCode,
                                          java.lang.String detailTypeCode,
                                          java.lang.String parameterName)
Description copied from interface: ParameterService
This method returns the value of the specified parameter

Specified by:
getParameterValue in interface ParameterService

getParameterValues

public java.util.List<java.lang.String> getParameterValues(java.lang.String namespaceCode,
                                                           java.lang.String detailTypeCode,
                                                           java.lang.String parameterName)
Description copied from interface: ParameterService
This method returns a list of the parameter values split on implementation specific criteria. For the default KualiConfigurationServiceImpl, the split is on a semi-colon.

Specified by:
getParameterValues in interface ParameterService

getIndicatorParameter

public boolean getIndicatorParameter(java.lang.String namespaceCode,
                                     java.lang.String detailTypeCode,
                                     java.lang.String parameterName)
Description copied from interface: ParameterService
This method provides a convenient way to access the a parameter that signifies true or false.

Specified by:
getIndicatorParameter in interface ParameterService
Returns:
boolean value of indicator parameter

getParameterEvaluator

public org.kuali.rice.kns.service.ParameterEvaluator getParameterEvaluator(java.lang.String namespaceCode,
                                                                           java.lang.String detailTypeCode,
                                                                           java.lang.String parameterName)
Description copied from interface: ParameterService
This method will return an instance of a ParameterEvaluator implementation that will wrap a Parameter and provide convenient evaluation methods.

Specified by:
getParameterEvaluator in interface ParameterService
Returns:
ParameterEvaluator

getParameterEvaluator

public org.kuali.rice.kns.service.ParameterEvaluator getParameterEvaluator(java.lang.String namespaceCode,
                                                                           java.lang.String detailTypeCode,
                                                                           java.lang.String parameterName,
                                                                           java.lang.String constrainedValue)
Description copied from interface: ParameterService
This method will return an instance of a ParameterEvaluator implementation that will wrap a Parameter and constrainedValue and provide convenient evaluation methods.

Specified by:
getParameterEvaluator in interface ParameterService
Returns:
ParameterEvaluator

clearCache

public void clearCache()
Description copied from interface: ParameterService
This method can be used to clear the parameter cache during unit testing.

Specified by:
clearCache in interface ParameterService

fetchFromCache

protected Parameter fetchFromCache(java.lang.String namespaceCode,
                                   java.lang.String detailTypeCode,
                                   java.lang.String name)

insertIntoCache

protected void insertIntoCache(Parameter parameter)

flushParameterFromCache

protected void flushParameterFromCache(java.lang.String namespaceCode,
                                       java.lang.String detailTypeCode,
                                       java.lang.String name)

getParameterCacheKey

protected java.lang.String getParameterCacheKey(java.lang.String namespaceCode,
                                                java.lang.String detailTypeCode,
                                                java.lang.String name)


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.