Package org.apache.guacamole.properties
Class IPAddressListProperty
java.lang.Object
org.apache.guacamole.properties.IPAddressListProperty
- All Implemented Interfaces:
GuacamoleProperty<List<inet.ipaddr.IPAddress>>
public abstract class IPAddressListProperty
extends Object
implements GuacamoleProperty<List<inet.ipaddr.IPAddress>>
A GuacamoleProperty implementation that parses a String for a comma-separated
list of IP addresses and/or IP subnets, both IPv4 and IPv6, and returns the
list of those valid IP addresses/subnets.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
addressListContains
(List<inet.ipaddr.IPAddress> addrList, inet.ipaddr.IPAddress ipAddr) Return true if the provided address list contains the client address, or false if no match is found.List
<inet.ipaddr.IPAddress> parseValue
(String values) Parses the given string value into the type associated with this GuacamoleProperty.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.guacamole.properties.GuacamoleProperty
getName, parseValueCollection
-
Constructor Details
-
IPAddressListProperty
public IPAddressListProperty()
-
-
Method Details
-
parseValue
public List<inet.ipaddr.IPAddress> parseValue(String values) throws org.apache.guacamole.GuacamoleException Description copied from interface:GuacamoleProperty
Parses the given string value into the type associated with this GuacamoleProperty.- Specified by:
parseValue
in interfaceGuacamoleProperty<List<inet.ipaddr.IPAddress>>
- Parameters:
values
- The string value to parse.- Returns:
- The parsed value.
- Throws:
org.apache.guacamole.GuacamoleException
- If an error occurs while parsing the provided value.
-
addressListContains
public static boolean addressListContains(List<inet.ipaddr.IPAddress> addrList, inet.ipaddr.IPAddress ipAddr) Return true if the provided address list contains the client address, or false if no match is found.- Parameters:
addrList
- The address list to check for matches.ipAddr
- The client address to look for in the list.- Returns:
- True if the client address is in the provided list, otherwise false.
-