org.kuali.student.r2.lum.lrc.service.impl
Class LrcServiceBusinessLogicImpl

java.lang.Object
  extended by org.kuali.student.r2.lum.lrc.service.impl.LrcServiceBusinessLogicImpl
All Implemented Interfaces:
LrcServiceBusinessLogic

public class LrcServiceBusinessLogicImpl
extends Object
implements LrcServiceBusinessLogic

Author:
nwright

Constructor Summary
LrcServiceBusinessLogicImpl()
           
 
Method Summary
protected  String calcCreditValueKey(String creditValue, String scaleKey)
          Calculate the fixed credit value key to use that matches the specified value
protected  List<String> calcCreditValueKeys(List<String> creditValues, String scaleKey)
          Calculate the value keys to use that matches the specified value
protected  String calcFixedCreditRvgKey(String creditValue, String scaleKey)
          Calculate the result values group key for the fixed credit value
protected  String calcFixedCreditRvgName(String value)
          Calculate the result values group key for the range credit value
protected  String calcMultipleCreditRvgDescr(List<String> values)
           
protected  String calcMultipleCreditRvgKey(List<String> values, String scaleKey)
          Calculate the result values group key for the range credit value
protected  String calcMultipleCreditRvgName(List<String> values)
          Calculate the result values group key for the range credit value
protected  String calcRangeCreditRvgKey(String creditValueMin, String creditValueMax, String creditValueIncrement, String scaleKey)
          Calculate the result values group key for the range credit value
protected  String calcRangeCreditRvgName(String creditValueMin, String creditValueMax, String creditValueIncrement)
          Calculate the result values group key for the range credit value
protected  List<String> calcRangeCreditValues(String creditValueMin, String creditValueMax, String creditValueIncrement)
          calculate all the values needed to create the range
protected  String calcResultValueKey(String resultValue, String scaleKey)
          Calculate key to use for the result value
 ResultValuesGroupInfo getCreateFixedCreditResultValuesGroup(String creditValue, String scaleKey, ContextInfo contextInfo)
           
 ResultValuesGroupInfo getCreateMultipleCreditResultValuesGroup(List<String> creditValues, String scaleKey, ContextInfo contextInfo)
           
 ResultValuesGroupInfo getCreateRangeCreditResultValuesGroup(String creditValueMin, String creditValueMax, String creditValueIncrement, String scaleKey, ContextInfo contextInfo)
           
 ResultValueInfo getCreateResultValueForScale(String resultValue, String scaleKey, ContextInfo contextInfo)
           
 LRCService getLrcService()
           
 void setLrcService(LRCService lrcService)
           
protected static boolean stringNumberEquals(String value1, String value2)
          This method converts the two input strings into floats and returns true if they're equal, false otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LrcServiceBusinessLogicImpl

public LrcServiceBusinessLogicImpl()
Method Detail

calcFixedCreditRvgKey

protected String calcFixedCreditRvgKey(String creditValue,
                                       String scaleKey)
                                throws InvalidParameterException
Calculate the result values group key for the fixed credit value

Parameters:
creditValue - value
scaleKey - key
Returns:
the calculated key
Throws:
InvalidParameterException

calcFixedCreditRvgName

protected String calcFixedCreditRvgName(String value)
                                 throws InvalidParameterException
Calculate the result values group key for the range credit value

Parameters:
value - value
Returns:
name of fixed RVG
Throws:
InvalidParameterException

calcCreditValueKey

protected String calcCreditValueKey(String creditValue,
                                    String scaleKey)
                             throws InvalidParameterException
Calculate the fixed credit value key to use that matches the specified value

Parameters:
creditValue - value
scaleKey - scale key
Returns:
fixed credit value key
Throws:
InvalidParameterException

getCreateFixedCreditResultValuesGroup

public ResultValuesGroupInfo getCreateFixedCreditResultValuesGroup(String creditValue,
                                                                   String scaleKey,
                                                                   ContextInfo contextInfo)
                                                            throws InvalidParameterException,
                                                                   MissingParameterException,
                                                                   OperationFailedException,
                                                                   PermissionDeniedException
Specified by:
getCreateFixedCreditResultValuesGroup in interface LrcServiceBusinessLogic
Throws:
InvalidParameterException
MissingParameterException
OperationFailedException
PermissionDeniedException

calcRangeCreditRvgKey

protected String calcRangeCreditRvgKey(String creditValueMin,
                                       String creditValueMax,
                                       String creditValueIncrement,
                                       String scaleKey)
                                throws InvalidParameterException
Calculate the result values group key for the range credit value

Parameters:
creditValueMin - min credit value of range
creditValueMax - max credit value of range
creditValueIncrement - increment of range
scaleKey - scale key
Returns:
result value group key
Throws:
InvalidParameterException

calcRangeCreditRvgName

protected String calcRangeCreditRvgName(String creditValueMin,
                                        String creditValueMax,
                                        String creditValueIncrement)
                                 throws InvalidParameterException
Calculate the result values group key for the range credit value

Parameters:
creditValueMin - min credit value of range
creditValueMax - max credit value of range
creditValueIncrement - increment of range
Returns:
result value group name
Throws:
InvalidParameterException

calcRangeCreditValues

protected List<String> calcRangeCreditValues(String creditValueMin,
                                             String creditValueMax,
                                             String creditValueIncrement)
                                      throws InvalidParameterException
calculate all the values needed to create the range

Parameters:
creditValueMin - min credit value of range
creditValueMax - max credit value of range
creditValueIncrement - increment of range
Returns:
a list of all the values in the range using the increment
Throws:
InvalidParameterException

getCreateRangeCreditResultValuesGroup

public ResultValuesGroupInfo getCreateRangeCreditResultValuesGroup(String creditValueMin,
                                                                   String creditValueMax,
                                                                   String creditValueIncrement,
                                                                   String scaleKey,
                                                                   ContextInfo contextInfo)
                                                            throws InvalidParameterException,
                                                                   MissingParameterException,
                                                                   OperationFailedException,
                                                                   PermissionDeniedException
Specified by:
getCreateRangeCreditResultValuesGroup in interface LrcServiceBusinessLogic
Throws:
InvalidParameterException
MissingParameterException
OperationFailedException
PermissionDeniedException

stringNumberEquals

protected static boolean stringNumberEquals(String value1,
                                            String value2)
This method converts the two input strings into floats and returns true if they're equal, false otherwise. This is needed because getCreateRangeCreditResultValuesGroup was throwing errors saying strings 1.0 != 1.

Parameters:
value1 - value 1
value2 - value 2
Returns:
value1.equals(value2)

calcMultipleCreditRvgKey

protected String calcMultipleCreditRvgKey(List<String> values,
                                          String scaleKey)
                                   throws InvalidParameterException
Calculate the result values group key for the range credit value

Parameters:
values - values
scaleKey - scale key
Returns:
a multiple credit RVG key
Throws:
InvalidParameterException

calcMultipleCreditRvgName

protected String calcMultipleCreditRvgName(List<String> values)
                                    throws InvalidParameterException
Calculate the result values group key for the range credit value

Parameters:
values - list of credit values
Returns:
readable name of multiple credits
Throws:
InvalidParameterException

calcMultipleCreditRvgDescr

protected String calcMultipleCreditRvgDescr(List<String> values)
                                     throws InvalidParameterException
Throws:
InvalidParameterException

calcCreditValueKeys

protected List<String> calcCreditValueKeys(List<String> creditValues,
                                           String scaleKey)
                                    throws InvalidParameterException
Calculate the value keys to use that matches the specified value

Parameters:
creditValues - list of credit values
scaleKey - scale key
Returns:
all value keys that match the values and scale
Throws:
InvalidParameterException

getCreateMultipleCreditResultValuesGroup

public ResultValuesGroupInfo getCreateMultipleCreditResultValuesGroup(List<String> creditValues,
                                                                      String scaleKey,
                                                                      ContextInfo contextInfo)
                                                               throws InvalidParameterException,
                                                                      MissingParameterException,
                                                                      OperationFailedException,
                                                                      PermissionDeniedException
Specified by:
getCreateMultipleCreditResultValuesGroup in interface LrcServiceBusinessLogic
Throws:
InvalidParameterException
MissingParameterException
OperationFailedException
PermissionDeniedException

calcResultValueKey

protected String calcResultValueKey(String resultValue,
                                    String scaleKey)
Calculate key to use for the result value

Parameters:
resultValue - the value of the result
scaleKey - key used for getting the proper scale.
Returns:
the calculated value

getCreateResultValueForScale

public ResultValueInfo getCreateResultValueForScale(String resultValue,
                                                    String scaleKey,
                                                    ContextInfo contextInfo)
                                             throws InvalidParameterException,
                                                    MissingParameterException,
                                                    OperationFailedException,
                                                    PermissionDeniedException
Specified by:
getCreateResultValueForScale in interface LrcServiceBusinessLogic
Throws:
InvalidParameterException
MissingParameterException
OperationFailedException
PermissionDeniedException

getLrcService

public LRCService getLrcService()

setLrcService

public void setLrcService(LRCService lrcService)


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