org.rhq.plugins.apache.util
Class HttpdAddressUtility.Address
java.lang.Object
org.rhq.plugins.apache.util.HttpdAddressUtility.Address
- Enclosing class:
- HttpdAddressUtility
public static class HttpdAddressUtility.Address
- extends Object
host
public String host
port
public int port
scheme
public String scheme
WILDCARD
public static final String WILDCARD
- See Also:
- Constant Field Values
DEFAULT_HOST
public static final String DEFAULT_HOST
- See Also:
- Constant Field Values
PORT_WILDCARD_VALUE
public static final int PORT_WILDCARD_VALUE
- See Also:
- Constant Field Values
NO_PORT_SPECIFIED_VALUE
public static final int NO_PORT_SPECIFIED_VALUE
- See Also:
- Constant Field Values
HttpdAddressUtility.Address
public HttpdAddressUtility.Address(String host,
int port)
HttpdAddressUtility.Address
public HttpdAddressUtility.Address(String scheme,
String host,
int port)
parse
public static HttpdAddressUtility.Address parse(String address)
- A simple parser of the provided address into host and port
sections.
This is equivalent to calling parse(String, String) with
the default scheme "http".
- Parameters:
address - the address to parse
- Returns:
- an instance of Address with host and port set accordingly
parse
public static HttpdAddressUtility.Address parse(String address,
String defaultScheme)
- Parses given address into an Address object and assigns a default scheme if none
is present in the address itself.
- Parameters:
address - the address to parsedefaultScheme - the default scheme to apply or null if no scheme is required by default
- Returns:
- the parsed address
isPortWildcard
public boolean isPortWildcard()
isPortDefined
public boolean isPortDefined()
isHostWildcard
public boolean isHostWildcard()
isHostDefault
public boolean isHostDefault()
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
equals
public boolean equals(Object other)
- Overrides:
equals in class Object
matches
public boolean matches(HttpdAddressUtility.Address other,
boolean matchSchemes)
- This differs from equals in the way that it considers wildcard values:
- wildcard host matches any host
- default host matches default host
- wildcard port matches any port
- undefined port matches undefined port
The addresses match if both address and port match.
- Parameters:
other - the address to matchwhether - to match the scheme as well
- Returns:
- true if the addresses match according to the rules described above, false otherwise
toString
public String toString()
- Overrides:
toString in class Object
toString
public String toString(boolean includeScheme,
boolean interpretWildcardPort)
Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.