Class FirewallZone.Name
java.lang.Object
com.aoindustries.aoserv.client.net.FirewallZone.Name
- All Implemented Interfaces:
DtoFactory<FirewallZoneName>
,Internable<FirewallZone.Name>
,Serializable
,Comparable<FirewallZone.Name>
- Enclosing class:
FirewallZone
public static final class FirewallZone.Name
extends Object
implements Comparable<FirewallZone.Name>, Serializable, DtoFactory<FirewallZoneName>, Internable<FirewallZone.Name>
Represents a name that may be used for a
FirewallZone
. Zones names must:
- Be non-null
- Be non-empty
- Be between 1 and 17 characters
- Contain the characters [a-z], [A-Z], [0-9], underscore (_), hyphen (-), and slash (/)
- Not begin with a slash (/)
- Not end with a slash (/)
- Not contain more than one slash (/)
We're unable to find well-defined rules for valid zone names. The rules above are based on the source code for firewalld included with CentOS 7.
- See
/usr/lib/python2.7/site-packages/firewall/core/io/zone.py
,check_name
. - See
/usr/lib/python2.7/site-packages/firewall/core/io/io_object.py
,check_name
. - See
/usr/lib/python2.7/site-packages/firewall/functions.py
,max_zone_name_len
.
Additionally, we tried creating a new zone with some UTF-8 characters, specifically Japanese,
and firewalld-cmd
just stalled, not even responding to Ctrl-C
. We are implementing with a
strict ASCII-compatible definition of "alphanumeric".
- Author:
- AO Industries, Inc.
- See Also:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(FirewallZone.Name other) boolean
getDto()
int
hashCode()
intern()
Interns this name much in the same fashion asString.intern()
.toString()
static ValidationResult
Validates aFirewallZone
name.static FirewallZone.Name
-
Field Details
-
MAX_LENGTH
public static final int MAX_LENGTHThe longest name allowed for aFirewallZone
.- See Also:
-
-
Method Details
-
validate
Validates aFirewallZone
name. -
valueOf
- Parameters:
name
- whennull
, returnsnull
- Throws:
ValidationException
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<FirewallZone.Name>
-
toString
-
intern
Interns this name much in the same fashion asString.intern()
.- Specified by:
intern
in interfaceInternable<FirewallZone.Name>
- See Also:
-
getDto
- Specified by:
getDto
in interfaceDtoFactory<FirewallZoneName>
-