TC
- V
- public class DefaultRestrictionStrategy<TC extends TrackCycle,V extends Number> extends Object implements RestrictionStrategy<TC,V>
LimitApproachingException
, LimitExceededException
and SecurityException
for the updating TrackCycle
RestrictionStrategy.RestrictionLevel
Constructor and Description |
---|
DefaultRestrictionStrategy() |
Modifier and Type | Method and Description |
---|---|
int |
getNumOfWarningsAllowed() |
RestrictionStrategy.RestrictionLevel |
getRestrictionLevel()
LINIENT - only warns when limit is approaching
STANDARD - does not break when value is compromised, but throws
LimitExceededException when over limit
STRICT - throws SecurityException when value is compromised and LimitExceededException when over limit |
double |
getWarningThresholdPct() |
boolean |
ignoreConnectionExceptions() |
boolean |
isDataSecure(TrackCycle trackCycle,
String encrytedValue)
Check that encrypted for of the value matches the hash value and throw
SecurityException accordingly |
boolean |
isIgnoreConnectionExceptions() |
void |
setIgnoreConnectionExceptions(boolean ignoreConnectionExceptions) |
void |
setNumOfWarningsAllowed(int numOfWarningsAllowed) |
void |
setRestrictionLevel(RestrictionStrategy.RestrictionLevel restrictionLevel)
LINIENT - only warns when limit is approaching
STANDARD - does not break when value is compromised, but throws
LimitExceededException when over limit
STRICT - throws SecurityException when value is compromised and LimitExceededException when over limit |
void |
setWarningThresholdPct(double warningThresholdPct) |
boolean |
willBeOverThreshold(TrackCycle trackCycle,
Feature feature)
|
public boolean isDataSecure(TrackCycle trackCycle, String encrytedValue) throws SecurityException
RestrictionStrategy
SecurityException
accordinglyisDataSecure
in interface RestrictionStrategy<TC extends TrackCycle,V extends Number>
TrackCycle
can be updatedSecurityException
public boolean willBeOverThreshold(TrackCycle trackCycle, Feature feature) throws LimitExceededException, LimitApproachingException
RestrictionStrategy
TrackCycle
is over Restriction.getLimit()
then throw LimitExceededException
.
If it is near the limit throw LimitApproachingException
.willBeOverThreshold
in interface RestrictionStrategy<TC extends TrackCycle,V extends Number>
trackCycle
- - TrackCycle
with the value updated to what it will stored asfeature
- - Feature
with the Restriction
for the TrackCycle
TrackCycle
is Override
limit.LimitExceededException
LimitApproachingException
public boolean ignoreConnectionExceptions()
ignoreConnectionExceptions
in interface RestrictionStrategy<TC extends TrackCycle,V extends Number>
public boolean isIgnoreConnectionExceptions()
public void setIgnoreConnectionExceptions(boolean ignoreConnectionExceptions)
ignoreConnectionExceptions
- - if true, any errors occurring while trying to push to central will be ignoredpublic double getWarningThresholdPct()
LimitApproachingException
are thrown
default value is 0.90 (90%), value should be between 0.00 and 1.00public void setWarningThresholdPct(double warningThresholdPct)
warningThresholdPct
- - percentage of limit at which LimitApproachingException
are thrown
default value is 0.90 (90%), value should be between 0.00 and 1.00public int getNumOfWarningsAllowed()
LimitApproachingException
thrownpublic void setNumOfWarningsAllowed(int numOfWarningsAllowed)
numOfWarningsAllowed
- - number of LimitApproachingException
thrownpublic RestrictionStrategy.RestrictionLevel getRestrictionLevel()
LimitExceededException
when over limit
STRICT - throws SecurityException
when value is compromised and LimitExceededException
when over limitpublic void setRestrictionLevel(RestrictionStrategy.RestrictionLevel restrictionLevel)
LimitExceededException
when over limit
STRICT - throws SecurityException
when value is compromised and LimitExceededException
when over limitCopyright © 2018. All rights reserved.