Package org.eclipse.jetty.http
Class CookieCompliance
- 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 class
CookieCompliance.Violation
-
Field Summary
Fields Modifier and Type Field Description static CookieCompliance
RFC2965
A CookieCompliance mode that allows RFC 2965 compliance.static CookieCompliance
RFC6265
A CookieCompliance mode that enforces RFC 6265 compliance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allows(ComplianceViolation violation)
static CookieCompliance
from(java.lang.String spec)
Create compliance set from string.java.util.Set<CookieCompliance.Violation>
getAllowed()
java.util.Set<CookieCompliance.Violation>
getKnown()
java.lang.String
getName()
static CookieCompliance
valueOf(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.Violation
s - *
- All
CookieCompliance.Violation
s - <name>
- The name of a static instance of CookieCompliance (e.g.
RFC6265
).
The remainder of the list can contain then names of
CookieCompliance.Violation
s 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:
allows
in interfaceComplianceViolation.Mode
- Parameters:
violation
- TheComplianceViolation
to test- Returns:
- true iff the violation is allowed by this mode.
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceComplianceViolation.Mode
- Returns:
- The name of the compliance violation mode.
-
getKnown
public java.util.Set<CookieCompliance.Violation> getKnown()
- Specified by:
getKnown
in interfaceComplianceViolation.Mode
- Returns:
- The immutable set of all known violations for this mode.
-
getAllowed
public java.util.Set<CookieCompliance.Violation> getAllowed()
- Specified by:
getAllowed
in interfaceComplianceViolation.Mode
- Returns:
- The immutable set of violations allowed by this mode.
-
-