public interface EnforcerRule
Modifier and Type | Method and Description |
---|---|
void |
execute(EnforcerRuleHelper helper)
This is the interface into the rule.
|
String |
getCacheId()
If the rule is to be cached, this id is used as part of the key.
|
boolean |
isCacheable()
This method tells the enforcer if the rule results may be cached.
|
boolean |
isResultValid(EnforcerRule cachedRule)
If the rule is cacheable and the same id is found in the cache, the stored results are passed to this method to
allow double checking of the results.
|
void execute(@Nonnull EnforcerRuleHelper helper) throws EnforcerRuleException
helper
- The helper provides access to the log, MavenSession and has
helpers to get common components. It is also able to lookup components
by class name.EnforcerRuleException
- the enforcer rule exceptionboolean isCacheable()
true
if rule is cacheableboolean isResultValid(@Nonnull EnforcerRule cachedRule)
cachedRule
- the last cached instance of the rule. This is to be used by the rule to
potentially determine if the results are still valid (ie if the configuration has been overridden)true
if the stored results are valid for the same id.@Nullable String getCacheId()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.