public class RequireOS extends AbstractStandardEnforcerRule
Constructor and Description |
---|
RequireOS()
Instantiates a new RequireOS.
|
Modifier and Type | Method and Description |
---|---|
boolean |
allParamsEmpty()
Helper method to check that at least one of family, name, version or arch is set.
|
void |
displayOSInfo(Log log,
boolean info)
Log the current OS information.
|
void |
execute(EnforcerRuleHelper helper) |
String |
getArch()
Gets the arch.
|
String |
getCacheId() |
String |
getFamily()
Gets the family.
|
String |
getName()
Gets the name.
|
String |
getVersion()
Gets the version.
|
boolean |
isAllowed()
Helper method to determine if the current OS is allowed based on the injected values for family, name, version
and arch.
|
boolean |
isCacheable() |
boolean |
isDisplay() |
boolean |
isResultValid(EnforcerRule theCachedRule) |
boolean |
isValidFamily(String theFamily)
Helper method to check if the given family is in the following list:
dos
mac
netware
os/2
tandem
unix
windows
win9x
z/os
os/400
Note: '!'
|
void |
setArch(String theArch)
Sets the arch.
|
void |
setDisplay(boolean display) |
void |
setFamily(String theFamily)
Sets the family.
|
void |
setName(String theName)
Sets the name.
|
void |
setVersion(String theVersion)
Sets the version.
|
getLevel, getMessage, setLevel, setMessage
public RequireOS()
public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException
EnforcerRuleException
public void displayOSInfo(Log log, boolean info)
log
- the loginfo
- the infopublic boolean isAllowed()
public boolean allParamsEmpty()
public boolean isValidFamily(String theFamily)
theFamily
- the family to check.public void setFamily(String theFamily)
theFamily
- the family to setpublic String getVersion()
public void setVersion(String theVersion)
theVersion
- the version to setpublic final void setDisplay(boolean display)
display
- The value for the display.public final boolean isDisplay()
public String getCacheId()
public boolean isCacheable()
public boolean isResultValid(EnforcerRule theCachedRule)
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.