- java.lang.Object
-
- org.eclipse.jetty.http.HttpCompliance
-
- All Implemented Interfaces:
ComplianceViolation.Mode
public final class HttpCompliance extends java.lang.Object implements ComplianceViolation.Mode
HTTP compliance modes for Jetty HTTP parsing and handling. A Compliance mode consists of a set ofHttpCompliance.Violations which are applied when the mode is enabled.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHttpCompliance.Violation
-
Field Summary
Fields Modifier and Type Field Description static HttpComplianceLEGACYstatic HttpComplianceRFC2616static HttpComplianceRFC2616_LEGACYstatic HttpComplianceRFC7230static HttpComplianceRFC7230_LEGACYstatic java.lang.StringVIOLATIONS_ATTR
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallows(ComplianceViolation violation)static HttpCompliancefrom(java.lang.String spec)Create compliance set from string.java.util.Set<HttpCompliance.Violation>getAllowed()Get the set ofHttpCompliance.Violations allowed by this compliance mode.java.util.Set<HttpCompliance.Violation>getKnown()java.lang.StringgetName()java.lang.StringtoString()static HttpCompliancevalueOf(java.lang.String name)HttpCompliancewith(java.lang.String name, HttpCompliance.Violation... violations)Create a new HttpCompliance mode that includes the passedHttpCompliance.Violations.HttpCompliancewithout(java.lang.String name, HttpCompliance.Violation... violations)Create a new HttpCompliance mode that excludes the passedHttpCompliance.Violations.
-
-
-
Field Detail
-
VIOLATIONS_ATTR
public static final java.lang.String VIOLATIONS_ATTR
- See Also:
- Constant Field Values
-
RFC7230
public static final HttpCompliance RFC7230
-
RFC2616
public static final HttpCompliance RFC2616
-
LEGACY
public static final HttpCompliance LEGACY
-
RFC2616_LEGACY
public static final HttpCompliance RFC2616_LEGACY
-
RFC7230_LEGACY
public static final HttpCompliance RFC7230_LEGACY
-
-
Method Detail
-
valueOf
public static HttpCompliance valueOf(java.lang.String name)
-
from
public static HttpCompliance from(java.lang.String spec)
Create compliance set from string.Format:
- 0
- No
HttpCompliance.Violations - *
- All
HttpCompliance.Violations - RFC2616
- The set of
HttpCompliance.Violations application to https://tools.ietf.org/html/rfc2616, but not https://tools.ietf.org/html/rfc7230 - RFC7230
- The set of
HttpCompliance.Violations application to https://tools.ietf.org/html/rfc7230 - name
- Any of the known modes defined in
KNOWN_MODES
The remainder of the list can contain then names of
HttpCompliance.Violations to include them in the mode, or prefixed with a '-' to exclude thm from the mode.- Parameters:
spec- A string in the format of a comma separated list starting with one of the following strings:- Returns:
- the compliance from the string spec
-
allows
public boolean allows(ComplianceViolation violation)
- Specified by:
allowsin interfaceComplianceViolation.Mode
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceComplianceViolation.Mode
-
getAllowed
public java.util.Set<HttpCompliance.Violation> getAllowed()
Get the set ofHttpCompliance.Violations allowed by this compliance mode.- Specified by:
getAllowedin interfaceComplianceViolation.Mode- Returns:
- The immutable set of
HttpCompliance.Violations allowed by this compliance mode.
-
getKnown
public java.util.Set<HttpCompliance.Violation> getKnown()
- Specified by:
getKnownin interfaceComplianceViolation.Mode
-
with
public HttpCompliance with(java.lang.String name, HttpCompliance.Violation... violations)
Create a new HttpCompliance mode that includes the passedHttpCompliance.Violations.- Parameters:
name- The name of the new modeviolations- The violations to include- Returns:
- A new
HttpCompliancemode.
-
without
public HttpCompliance without(java.lang.String name, HttpCompliance.Violation... violations)
Create a new HttpCompliance mode that excludes the passedHttpCompliance.Violations.- Parameters:
name- The name of the new modeviolations- The violations to exclude- Returns:
- A new
HttpCompliancemode.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-