org.kuali.rice.coreservice.api.parameter
Interface ParameterRepositoryService

All Known Implementing Classes:
ParameterRepositoryServiceImpl

public interface ParameterRepositoryService

Service for interacting with Parameters.


Method Summary
 Parameter createParameter(Parameter parameter)
          This will create a Parameter exactly like the parameter passed in.
 ParameterQueryResults findParameters(QueryByCriteria queryByCriteria)
           
 Parameter getParameter(ParameterKey key)
          Gets a Parameter from a ParameterKey.
 Boolean getParameterValueAsBoolean(ParameterKey key)
          Gets a ParameterContract.getValue() as a Boolean from a ParameterKey.
 String getParameterValueAsString(ParameterKey key)
          Gets a ParameterContract.getValue() from a ParameterKey.
 Collection<String> getParameterValuesAsString(ParameterKey key)
          Gets a ParameterContract.getValue() from a ParameterKey where the value is split on a semi-colon delimeter and each token is trimmed of white space.
 String getSubParameterValueAsString(ParameterKey key, String subParameterName)
          Gets a ParameterContract.getValue() from a ParameterKey where the value is split on a semi-colon delimeter and each token is trimmed of white space.
 Collection<String> getSubParameterValuesAsString(ParameterKey key, String subParameterName)
          Gets a ParameterContract.getValue() from a ParameterKey where the value is split on a semi-colon delimeter and each token is trimmed of white space.
 Parameter updateParameter(Parameter parameter)
          This will update a Parameter.
 

Method Detail

createParameter

@CacheEvict(value="http://rice.kuali.org/core/v2_0/ParameterType",
            allEntries=true)
Parameter createParameter(Parameter parameter)
                          throws RiceIllegalArgumentException,
                                 RiceIllegalStateException
This will create a Parameter exactly like the parameter passed in.

Parameters:
parameter - the parameter to create
Returns:
the parameter that was created
Throws:
RiceIllegalArgumentException - if the parameter is null
RiceIllegalStateException - if the parameter is already existing in the system

updateParameter

@CacheEvict(value="http://rice.kuali.org/core/v2_0/ParameterType",
            allEntries=true)
Parameter updateParameter(Parameter parameter)
                          throws RiceIllegalArgumentException,
                                 RiceIllegalStateException
This will update a Parameter.

If the parameter does not exist under the application code passed, then this method will check if the parameter exists under the default rice application id and will update that parameter.

Parameters:
parameter - the parameter to update
Returns:
the parameter that was updated
Throws:
RiceIllegalArgumentException - if the parameter is null
RiceIllegalStateException - if the parameter does not exist in the system under the specific application id or default rice application id

getParameter

@Cacheable(value="http://rice.kuali.org/core/v2_0/ParameterType",
           key="\'key=\' + #p0.getCacheKey()")
Parameter getParameter(ParameterKey key)
                       throws RiceIllegalArgumentException
Gets a Parameter from a ParameterKey.

If the parameter does not exist under the application code passed, then this method will check if the parameter exists under the default rice application id and will return that parameter.

This method will return null if the parameter does not exist.

Parameters:
key - the key to retrieve the parameter by. cannot be null.
Returns:
a Parameter or null
Throws:
RiceIllegalArgumentException - if the key is null

getParameterValueAsString

@Cacheable(value="http://rice.kuali.org/core/v2_0/ParameterType",
           key="\'{getParameterValueAsString}\' + \'key=\' + #p0.getCacheKey()")
String getParameterValueAsString(ParameterKey key)
                                 throws RiceIllegalArgumentException
Gets a ParameterContract.getValue() from a ParameterKey.

If the parameter does not exist under the application code passed, then this method will check if the parameter exists under the default rice application id and will return that parameter.

This method will return null if the parameter does not exist.

Parameters:
key - the key to retrieve the parameter by. cannot be null.
Returns:
a string value or null
Throws:
RiceIllegalArgumentException - if the key is null

getParameterValueAsBoolean

@Cacheable(value="http://rice.kuali.org/core/v2_0/ParameterType",
           key="\'{getParameterValueAsBoolean}\' + \'key=\' + #p0.getCacheKey()")
Boolean getParameterValueAsBoolean(ParameterKey key)
                                   throws RiceIllegalArgumentException
Gets a ParameterContract.getValue() as a Boolean from a ParameterKey.

If the parameter does not exist under the application code passed, then this method will check if the parameter exists under the default rice application id and will return that parameter.

This method will return null if the parameter does not exist or is not a valid truth value.

valid true values (case insensitive): valid false values (case insensitive):

Parameters:
key - the key to retrieve the parameter by. cannot be null.
Returns:
a boolean value or null
Throws:
RiceIllegalArgumentException - if the key is null

getParameterValuesAsString

@Cacheable(value="http://rice.kuali.org/core/v2_0/ParameterType",
           key="\'{getParameterValuesAsString}\' + \'key=\' + #p0.getCacheKey()")
Collection<String> getParameterValuesAsString(ParameterKey key)
                                              throws RiceIllegalArgumentException
Gets a ParameterContract.getValue() from a ParameterKey where the value is split on a semi-colon delimeter and each token is trimmed of white space. for example: param_name=foo; bar; baz will yield a collection containing foo, bar, baz

If the parameter does not exist under the application code passed, then this method will check if the parameter exists under the default rice application id and will return that parameter.

This method will always return an immutable Collection even when no values exist.

Parameters:
key - the key to retrieve the parameter by. cannot be null.
Returns:
an immutable collection of strings
Throws:
RiceIllegalArgumentException - if the key is null

getSubParameterValueAsString

String getSubParameterValueAsString(ParameterKey key,
                                    String subParameterName)
                                    throws RiceIllegalArgumentException
Gets a ParameterContract.getValue() from a ParameterKey where the value is split on a semi-colon delimeter and each token is trimmed of white space. Those values are themselves keyvalue pairs which are searched for the sub parameter name. for example: param_name=foo=f1; bar=b1; baz=z1 subParameterName=bar will yield b1

if multiple subparameters are contained in the parameter value the first one is returned

If the parameter does not exist under the application code passed, then this method will check if the parameter exists under the default rice application id and will return that parameter.

This method will always return null when the subparameter does not exist or if the parameter value does not conform to the following format(s):

  1. subparameter_name=subparameter_value;

Parameters:
key - the key to retrieve the parameter by. cannot be null.
subParameterName - the sub parameter to search for
Returns:
a string value or null
Throws:
RiceIllegalArgumentException - if the key is null or if the subParameterName is blank

getSubParameterValuesAsString

Collection<String> getSubParameterValuesAsString(ParameterKey key,
                                                 String subParameterName)
                                                 throws RiceIllegalArgumentException
Gets a ParameterContract.getValue() from a ParameterKey where the value is split on a semi-colon delimeter and each token is trimmed of white space. Those values are themselves keyvalue pairs which are searched for the sub parameter name. After the sub parameter is found it is split on a comma and trimmed or whitespace before adding it to the final collection for return. for example: param_name=foo=f1,f2,f3; bar=b1,b2; baz=z1 subParameterName=bar will yield a collection containing b1, b2

if multiple subparameters are contained in the parameter value the first one is returned

If the parameter does not exist under the application code passed, then this method will check if the parameter exists under the default rice application id and will return that parameter.

This method will always return an immutable Collection even when no values exist.

This method will always return an empty immutable Collection when the subparameter does not exist or if the parameter value does not conform to the following format(s):

  1. subparameter_name=subparameter_value;
  2. subparameter_name=subparameter_value1, subparameter_value2;
  3. subparameter_name=subparameter_value1, subparameter_value2,;

Parameters:
key - the key to retrieve the parameter by. cannot be null.
subParameterName - the sub parameter to search for
Returns:
an immutable collection of strings
Throws:
RiceIllegalArgumentException - if the key is null or if the subParameterName is blank

findParameters

ParameterQueryResults findParameters(QueryByCriteria queryByCriteria)
                                     throws RiceIllegalArgumentException
Throws:
RiceIllegalArgumentException


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.