- java.lang.Object
-
- org.eclipse.jetty.http.CookieCompliance
-
- All Implemented Interfaces:
ComplianceViolation.Mode
public class CookieCompliance extends java.lang.Object implements ComplianceViolation.Mode
The compliance mode for Cookie handling.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCookieCompliance.Violation
-
Field Summary
Fields Modifier and Type Field Description static CookieComplianceRFC2965A CookieCompliance mode that allows RFC 2965 compliance.static CookieComplianceRFC6265A CookieCompliance mode that enforces RFC 6265 compliance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallows(ComplianceViolation violation)static CookieCompliancefrom(java.lang.String spec)Create compliance set from string.java.util.Set<CookieCompliance.Violation>getAllowed()java.util.Set<CookieCompliance.Violation>getKnown()java.lang.StringgetName()static CookieCompliancevalueOf(java.lang.String name)
-
-
-
Field Detail
-
RFC6265
public static final CookieCompliance RFC6265
A CookieCompliance mode that enforces RFC 6265 compliance.
-
RFC2965
public static final CookieCompliance RFC2965
A CookieCompliance mode that allows RFC 2965 compliance.
-
-
Method Detail
-
valueOf
public static CookieCompliance valueOf(java.lang.String name)
-
from
public static CookieCompliance from(java.lang.String spec)
Create compliance set from string.Format: <BASE>[,[-]<violation>]...
BASE is one of:
- 0
- No
CookieCompliance.Violations - *
- All
CookieCompliance.Violations - <name>
- The name of a static instance of CookieCompliance (e.g.
RFC6265).
The remainder of the list can contain then names of
CookieCompliance.Violations to include them in the mode, or prefixed with a '-' to exclude them from the mode. Examples are:0,RESERVED_NAMES_NOT_DOLLAR_PREFIXED- Only allow
CookieCompliance.Violation.RESERVED_NAMES_NOT_DOLLAR_PREFIXED *,-RESERVED_NAMES_NOT_DOLLAR_PREFIXED- Allow all violations, except
CookieCompliance.Violation.RESERVED_NAMES_NOT_DOLLAR_PREFIXED RFC2965,RESERVED_NAMES_NOT_DOLLAR_PREFIXED- Same as RFC2965, but allows
CookieCompliance.Violation.RESERVED_NAMES_NOT_DOLLAR_PREFIXED
- Parameters:
spec- A string describing the compliance- Returns:
- the compliance from the string spec
-
allows
public boolean allows(ComplianceViolation violation)
- Specified by:
allowsin interfaceComplianceViolation.Mode- Parameters:
violation- TheComplianceViolationto test- Returns:
- true iff the violation is allowed by this mode.
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceComplianceViolation.Mode- Returns:
- The name of the compliance violation mode.
-
getKnown
public java.util.Set<CookieCompliance.Violation> getKnown()
- Specified by:
getKnownin interfaceComplianceViolation.Mode- Returns:
- The immutable set of all known violations for this mode.
-
getAllowed
public java.util.Set<CookieCompliance.Violation> getAllowed()
- Specified by:
getAllowedin interfaceComplianceViolation.Mode- Returns:
- The immutable set of violations allowed by this mode.
-
-