Package org.wildfly.security.auth.client
Class MatchRule
java.lang.Object
org.wildfly.security.auth.client.MatchRule
A rule used for deciding which authentication configuration to use.
- Author:
- David M. Lloyd
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanDetermine whether this rule is equal to another object.final booleanDetermine whether this rule is equal to another.Get the abstract type that this rule matches, ornullif this rule does not match by abstract type.Get the abstract type authority that this rule matches, ornullif this rule does not match by abstract type authority.Get the host name that this rule matches, ornullif this rule does not match by host.org.wildfly.common.net.CidrAddressGet the network that this rule matches, ornullif this rule does not match by network.Get the path name that this rule matches, ornullif this rule does not match by path.intGet the port number that this rule matches, or 0 if this rule does not match by port.Get the protocol (scheme) that this rule matches, ornullif this rule does not match by protocol.Get the URN name that this rule matches, ornullif this rule does not match by URN.Get the URI user info that this rule matches, ornullif this rule only matches empty URI user info.abstract inthashCode()Get the hash code of this rule.booleanDetermine whether this rule matches based on host name.booleanDetermine whether this rule matches based on network.booleanDetermine whether this rule matches based on path name.booleanDetermine whether this rule matches based on port.booleanDetermine whether this rule matches based on URI protocol (scheme).booleanDetermine whether this rule matches based on abstract type.booleanDetermine whether this rule matches based on abstract type.booleanDetermine whether this rule matches based on URN name.booleanDetermine whether this rule matches based on non-empty URI user info.final MatchRulematchAbstractType(String typeName, String authorityName) Create a new rule which is the same as this rule, but also matches the given abstract type and type authority.final MatchRulematchAddress(InetAddress inetAddress) Create a new rule which is the same as this rule, but also matches the given Internet address.final MatchRuleCreate a new rule which is the same as this rule, but matches URIs with or without user info.final booleanDetermine if this rule matches the given URI.booleanDetermine if this rule matches the given URI, and type.final MatchRuleCreate a new rule which is the same as this rule, but also matches the given host name.final MatchRuleCreate a new rule which is the same as this rule, but also matches the given security domain.final MatchRulematchNetwork(org.wildfly.common.net.CidrAddress cidrAddress) Create a new rule which is the same as this rule, but also matches the given Internet network address.final MatchRuleCreate a new rule which is the same as this rule, but only matches URIs with no user info.final MatchRuleCreate a new rule which is the same as this rule, but also matches the given path name.final MatchRulematchPort(int port) Create a new rule which is the same as this rule, but also matches the given port number.final MatchRulematchProtocol(String protoName) Create a new rule which is the same as this rule, but also matches the given protocol (scheme) name.final MatchRulematchUrnName(String name) Create a new rule which is the same as this rule, but also matches the given URN name.final MatchRuleCreate a new rule which is the same as this rule, but also matches the given URI user info.final StringtoString()Get the string representation of this rule.
-
Field Details
-
ALL
The root rule which matches all URIs.
-
-
Method Details
-
equals
Determine whether this rule is equal to another object. Two rules are equal if they match the same conditions. -
equals
Determine whether this rule is equal to another. Two rules are equal if they match the same conditions.- Parameters:
other- the other object- Returns:
trueif they are equal,falseotherwise
-
hashCode
public abstract int hashCode()Get the hash code of this rule. -
matches
Determine if this rule matches the given URI.- Parameters:
uri- the URI to test- Returns:
trueif the rule matches,falseotherwise
-
matches
Determine if this rule matches the given URI, and type.- Parameters:
uri- the URI to testabstractType- the abstract type of the connection (may benull)abstractTypeAuthority- the authority name of the abstract type (may benull)- Returns:
trueif the rule matches,falseotherwise
-
isProtocolMatched
public boolean isProtocolMatched()Determine whether this rule matches based on URI protocol (scheme).- Returns:
trueif the rule matches based on URI protocol,falseotherwise
-
getMatchProtocol
Get the protocol (scheme) that this rule matches, ornullif this rule does not match by protocol.- Returns:
- the protocol, or
nullif there is none
-
isTypeMatched
public boolean isTypeMatched()Determine whether this rule matches based on abstract type.- Returns:
trueif the rule matches based on type,falseotherwise
-
isTypeAuthorityMatched
public boolean isTypeAuthorityMatched()Determine whether this rule matches based on abstract type.- Returns:
trueif the rule matches based on type,falseotherwise
-
getMatchAbstractType
Get the abstract type that this rule matches, ornullif this rule does not match by abstract type.- Returns:
- the abstract type, or
nullif there is none
-
getMatchAbstractTypeAuthority
Get the abstract type authority that this rule matches, ornullif this rule does not match by abstract type authority.- Returns:
- the abstract type, or
nullif there is none
-
matchProtocol
Create a new rule which is the same as this rule, but also matches the given protocol (scheme) name.- Parameters:
protoName- the protocol name to match- Returns:
- the new rule
-
matchAbstractType
Create a new rule which is the same as this rule, but also matches the given abstract type and type authority.- Parameters:
typeName- the type to matchauthorityName- the type authority name to match- Returns:
- the new rule
-
isHostMatched
public boolean isHostMatched()Determine whether this rule matches based on host name.- Returns:
trueif the rule matches based on host name,falseotherwise
-
getMatchHost
Get the host name that this rule matches, ornullif this rule does not match by host.- Returns:
- the host name, or
nullif there is none
-
isNetworkMatched
public boolean isNetworkMatched()Determine whether this rule matches based on network.- Returns:
trueif the rule matches based on network,falseotherwise
-
getMatchNetwork
public org.wildfly.common.net.CidrAddress getMatchNetwork()Get the network that this rule matches, ornullif this rule does not match by network.- Returns:
- the network that this rule matches, or
nullif there is none
-
matchHost
Create a new rule which is the same as this rule, but also matches the given host name. If the given string appears to be an IP address or a CIDR network specification, then it is treated as such.- Parameters:
hostSpec- the host name to match- Returns:
- the new rule
-
matchAddress
Create a new rule which is the same as this rule, but also matches the given Internet address.- Parameters:
inetAddress- the address to match- Returns:
- the new rule
-
matchNetwork
Create a new rule which is the same as this rule, but also matches the given Internet network address.- Parameters:
cidrAddress- the network to match- Returns:
- the new rule
-
isPathMatched
public boolean isPathMatched()Determine whether this rule matches based on path name.- Returns:
trueif the rule matches based on path name,falseotherwise
-
getMatchPath
Get the path name that this rule matches, ornullif this rule does not match by path.- Returns:
- the path name, or
nullif there is none
-
matchPath
Create a new rule which is the same as this rule, but also matches the given path name.- Parameters:
pathSpec- the path name to match- Returns:
- the new rule
-
isPortMatched
public boolean isPortMatched()Determine whether this rule matches based on port.- Returns:
trueif the rule matches based on port,falseotherwise
-
getMatchPort
public int getMatchPort()Get the port number that this rule matches, or 0 if this rule does not match by port.- Returns:
- the port number, or 0 if there is none
-
matchPort
Create a new rule which is the same as this rule, but also matches the given port number. The port number must be between 1 and 65535 (inclusive).- Parameters:
port- the port to match- Returns:
- the new rule
-
isUserMatched
public boolean isUserMatched()Determine whether this rule matches based on non-empty URI user info.- Returns:
trueif the rule matches based on non-empty user info,falseotherwise
-
getMatchUser
Get the URI user info that this rule matches, ornullif this rule only matches empty URI user info.- Returns:
- the user info, or
nullif there is none
-
matchUser
Create a new rule which is the same as this rule, but also matches the given URI user info.- Parameters:
userSpec- the user info to match- Returns:
- the new rule
-
matchNoUser
Create a new rule which is the same as this rule, but only matches URIs with no user info.- Returns:
- the new rule
-
matchAnyUser
Create a new rule which is the same as this rule, but matches URIs with or without user info.- Returns:
- the new rule
-
isUrnNameMatched
public boolean isUrnNameMatched()Determine whether this rule matches based on URN name.- Returns:
trueif the rule matches based on URN name,falseotherwise
-
getMatchUrnName
Get the URN name that this rule matches, ornullif this rule does not match by URN.- Returns:
- the URN name, or
nullif there is none
-
matchUrnName
Create a new rule which is the same as this rule, but also matches the given URN name.- Parameters:
name- the URN name to match- Returns:
- the new rule
-
matchLocalSecurityDomain
Create a new rule which is the same as this rule, but also matches the given security domain.- Parameters:
name- the security domain name to match- Returns:
- the new rule
-
toString
Get the string representation of this rule.
-