Class ScoreOperationChainHandler
- java.lang.Object
- 
- uk.gov.gchq.gaffer.store.operation.handler.ScoreOperationChainHandler
 
- 
- All Implemented Interfaces:
- OperationHandler<ScoreOperationChain>,- OutputOperationHandler<ScoreOperationChain,Integer>
 
 public class ScoreOperationChainHandler extends Object implements OutputOperationHandler<ScoreOperationChain,Integer> Operation Handler for ScoreOperationChain
- 
- 
Constructor SummaryConstructors Constructor Description ScoreOperationChainHandler(String namedOperationCacheNameSuffix)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegerdoOperation(ScoreOperationChain operation, Context context, Store store)Returns the OperationChainLimiter score for the OperationChain provided.Map<String,Integer>getAuthScores()intgetChainScore(Operations<?> operations, User user)Map<Class<? extends Operation>,ScoreResolver>getDefaultScoreResolvers()intgetMaxUserAuthScore(Set<String> opAuths)Iterates through each of the users operation authorisations listed in the config file and returns the highest score associated with those auths.Map<Class<? extends Operation>,Integer>getOpScores()Map<String,Integer>getOpScoresAsStrings()Map<Class<? extends Operation>,ScoreResolver>getScoreResolvers()StringgetSuffixNamedOperationCacheName()voidsetAuthScores(Map<String,Integer> authScores)voidsetOpScores(Map<Class<? extends Operation>,Integer> opScores)voidsetOpScoresFromStrings(Map<String,Integer> opScores)voidsetScoreResolvers(Map<Class<? extends Operation>,ScoreResolver> resolvers)voidvalidateOpScores()
 
- 
- 
- 
Constructor Detail- 
ScoreOperationChainHandlerpublic ScoreOperationChainHandler(String namedOperationCacheNameSuffix) 
 
- 
 - 
Method Detail- 
getSuffixNamedOperationCacheNamepublic String getSuffixNamedOperationCacheName() 
 - 
doOperationpublic Integer doOperation(ScoreOperationChain operation, Context context, Store store) throws OperationException Returns the OperationChainLimiter score for the OperationChain provided.- Specified by:
- doOperationin interface- OperationHandler<ScoreOperationChain>
- Specified by:
- doOperationin interface- OutputOperationHandler<ScoreOperationChain,Integer>
- Parameters:
- operation- the- Operationto be executed
- context- the operation chain context, containing the user who executed the operation
- store- the- Storethe operation should be run on
- Returns:
- an Integer containing the score
- Throws:
- OperationException- thrown if the property keys have not been set
 
 - 
getChainScorepublic int getChainScore(Operations<?> operations, User user) 
 - 
getMaxUserAuthScorepublic int getMaxUserAuthScore(Set<String> opAuths) Iterates through each of the users operation authorisations listed in the config file and returns the highest score associated with those auths.Defaults to 0. - Parameters:
- opAuths- a set of operation authorisations
- Returns:
- maxUserScore the highest score associated with any of the supplied user auths
 
 - 
setOpScoresFromStringspublic void setOpScoresFromStrings(Map<String,Integer> opScores) throws ClassNotFoundException - Throws:
- ClassNotFoundException
 
 - 
getScoreResolverspublic Map<Class<? extends Operation>,ScoreResolver> getScoreResolvers() 
 - 
setScoreResolverspublic void setScoreResolvers(Map<Class<? extends Operation>,ScoreResolver> resolvers) 
 - 
validateOpScorespublic void validateOpScores() 
 - 
getDefaultScoreResolverspublic Map<Class<? extends Operation>,ScoreResolver> getDefaultScoreResolvers() 
 
- 
 
-