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 aFirewallZone. 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-cmdjust stalled, not even responding toCtrl-C. We are implementing with a strict ASCII-compatible definition of "alphanumeric".- Author:
- AO Industries, Inc.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_LENGTHThe longest name allowed for aFirewallZone.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(FirewallZone.Name other)booleanequals(Object O)FirewallZoneNamegetDto()inthashCode()FirewallZone.Nameintern()Interns this name much in the same fashion asString.intern().StringtoString()static ValidationResultvalidate(String name)Validates aFirewallZonename.static FirewallZone.NamevalueOf(String name)
-
-
-
Field Detail
-
MAX_LENGTH
public static final int MAX_LENGTH
The longest name allowed for aFirewallZone.- See Also:
- Constant Field Values
-
-
Method Detail
-
validate
public static ValidationResult validate(String name)
Validates aFirewallZonename.
-
valueOf
public static FirewallZone.Name valueOf(String name) throws ValidationException
- Parameters:
name- whennull, returnsnull- Throws:
ValidationException
-
compareTo
public int compareTo(FirewallZone.Name other)
- Specified by:
compareToin interfaceComparable<FirewallZone.Name>
-
intern
public FirewallZone.Name intern()
Interns this name much in the same fashion asString.intern().- Specified by:
internin interfaceInternable<FirewallZone.Name>- See Also:
String.intern()
-
getDto
public FirewallZoneName getDto()
- Specified by:
getDtoin interfaceDtoFactory<FirewallZoneName>
-
-