Top Description Inners Methods
org.eclipse.jetty.http

public Interface ComplianceViolation

Known Direct Implementers
org.eclipse.jetty.http.CookieCompliance.Violation, org.eclipse.jetty.http.HttpCompliance.Violation, org.eclipse.jetty.http.MultiPartCompliance.Violation, org.eclipse.jetty.http.UriCompliance.Violation
Imports
java.util.ArrayList, .List, .Set, org.eclipse.jetty.util.Attributes, org.slf4j.Logger, .LoggerFactory

A Compliance Violation represents a requirement of an RFC, specification or Jetty implementation that may be allowed to be violated if it is included in a ComplianceViolation.Mode. For example, supporting HTTP/0.9 is no longer a requirement of the current HTTP RFC, so by including the HttpCompliance.Violation#HTTP_0_9 in the HttpCompliance ComplianceViolation.Mode is interpreted as allowing HTTP/0.9 to be supported.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static record
public static interface
ComplianceViolation.Listener

A listener that can be notified of violations.

public static class
public static interface
ComplianceViolation.Mode

A Mode is a set of ComplianceViolations that are allowed.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

A short description of the violation.
getDescription
()

public String

Returns:

The name of the violation.
getName
()

public String

Returns:

A URL to the specification that provides more information regarding the requirement that may be violated.
getURL
()

public default boolean

Returns:

True iff this violations is allowed by the mode.
isAllowedBy
(ComplianceViolation.Mode
A ComplianceViolation.Mode to test against
mode
)

Method Detail

getDescriptionback to summary
public String getDescription()
Returns:String

A short description of the violation.

getNameback to summary
public String getName()
Returns:String

The name of the violation.

getURLback to summary
public String getURL()
Returns:String

A URL to the specification that provides more information regarding the requirement that may be violated.

isAllowedByback to summary
public default boolean isAllowedBy(ComplianceViolation.Mode mode)
Parameters
mode:ComplianceViolation.Mode

A ComplianceViolation.Mode to test against

Returns:boolean

True iff this violations is allowed by the mode.

org.eclipse.jetty.http back to summary

public Class ComplianceViolation.CapturingListener

extends Object
implements Listener
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.http.ComplianceViolation.Listener

Field Summary

Modifier and TypeField and Description
private final List<ComplianceViolation.Event>
public static final String

Constructor Summary

AccessConstructor and Description
public
private

Method Summary

Modifier and TypeMethod and Description
public ComplianceViolation.Listener
initialize()

Overrides default org.eclipse.jetty.http.ComplianceViolation.Listener.initialize.

Initialize the listener in preparation for a new request life cycle.
public void
onComplianceViolation(ComplianceViolation.Event
the compliance violation event
event
)

Overrides default org.eclipse.jetty.http.ComplianceViolation.Listener.onComplianceViolation.

The compliance violation event.
public void
onRequestBegin(Attributes
the request attributes, or null if the Request does not exist yet (eg: during parsing of HTTP/1.1 headers, before request is created)
request
)

Overrides default org.eclipse.jetty.http.ComplianceViolation.Listener.onRequestBegin.

A new Request has begun.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

eventsback to summary
private final List<ComplianceViolation.Event> events
VIOLATIONS_ATTR_KEYback to summary
public static final String VIOLATIONS_ATTR_KEY

Constructor Detail

CapturingListenerback to summary
public CapturingListener()
CapturingListenerback to summary
private CapturingListener(List<ComplianceViolation.Event> events)

Method Detail

initializeback to summary
public ComplianceViolation.Listener initialize()

Overrides default org.eclipse.jetty.http.ComplianceViolation.Listener.initialize.

Doc from org.eclipse.jetty.http.ComplianceViolation.Listener.initialize.

Initialize the listener in preparation for a new request life cycle.

Returns:ComplianceViolation.Listener

The Listener instance to use for the request life cycle.

Annotations
@Override
onComplianceViolationback to summary
public void onComplianceViolation(ComplianceViolation.Event event)

Overrides default org.eclipse.jetty.http.ComplianceViolation.Listener.onComplianceViolation.

Doc from org.eclipse.jetty.http.ComplianceViolation.Listener.onComplianceViolation.

The compliance violation event.

Parameters
event:ComplianceViolation.Event

the compliance violation event

Annotations
@Override
onRequestBeginback to summary
public void onRequestBegin(Attributes request)

Overrides default org.eclipse.jetty.http.ComplianceViolation.Listener.onRequestBegin.

Doc from org.eclipse.jetty.http.ComplianceViolation.Listener.onRequestBegin.

A new Request has begun.

Parameters
request:Attributes

the request attributes, or null if the Request does not exist yet (eg: during parsing of HTTP/1.1 headers, before request is created)

Annotations
@Override
org.eclipse.jetty.http back to summary

public final Record ComplianceViolation.Event

extends Record
Class Inheritance
Record Components
mode:ComplianceViolation.Mode 
violation:ComplianceViolation 
details:String 

Field Summary

Modifier and TypeField and Description
private final String
details

Record Component accessed by details().

private final ComplianceViolation.Mode
mode

Record Component accessed by mode().

private final ComplianceViolation
violation

Record Component accessed by violation().

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
details()

Record Component getter of details.

public final boolean
equals(Object
the reference object with which to compare.
o
)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.
public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.
public ComplianceViolation.Mode
mode()

Record Component getter of mode.

public String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.
public ComplianceViolation
violation()

Record Component getter of violation.

Field Detail

detailsback to summary
private final String details

Record Component accessed by details().

modeback to summary
private final ComplianceViolation.Mode mode

Record Component accessed by mode().

violationback to summary
private final ComplianceViolation violation

Record Component accessed by violation().

Constructor Detail

Eventback to summary
public Event(ComplianceViolation.Mode mode, ComplianceViolation violation, String details)

Method Detail

detailsback to summary
public String details()

Record Component getter of details.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this record is equal to the argument; false otherwise.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

Returns:int

a hash code value for this record.

modeback to summary
public ComplianceViolation.Mode mode()

Record Component getter of mode.

toStringback to summary
public String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

Returns:String

a string representation of the object.

Annotations
@Override
violationback to summary
public ComplianceViolation violation()

Record Component getter of violation.

org.eclipse.jetty.http back to summary

public Interface ComplianceViolation.Listener

Known Direct Implementers
org.eclipse.jetty.http.ComplianceViolation.LoggingListener, org.eclipse.jetty.http.ComplianceViolation.CapturingListener, org.eclipse.jetty.http.CookieCache

A listener that can be notified of violations.

Field Summary

Modifier and TypeField and Description
public static final ComplianceViolation.Listener

Method Summary

Modifier and TypeMethod and Description
public default ComplianceViolation.Listener

Returns:

The Listener instance to use for the request life cycle.
initialize
()

Initialize the listener in preparation for a new request life cycle.

public default void
onComplianceViolation(ComplianceViolation.Event
the compliance violation event
event
)

The compliance violation event.

public default void
onComplianceViolation(ComplianceViolation.Mode
the mode
mode
,
ComplianceViolation
the violation
violation
,
String
the details
details
)

Deprecated for removal since 12.0.6. use onComplianceViolation(Event) instead.
The compliance violation event.
public default void
onRequestBegin(Attributes
the request attributes, or null if the Request does not exist yet (eg: during parsing of HTTP/1.1 headers, before request is created)
request
)

A new Request has begun.

public default void
onRequestEnd(Attributes
the request attributes, or null if Request does not exist yet (eg: during handling of a BadMessageException)
request
)

A Request has ended.

Field Detail

NOOPback to summary
public static final ComplianceViolation.Listener NOOP

Method Detail

initializeback to summary
public default ComplianceViolation.Listener initialize()

Initialize the listener in preparation for a new request life cycle.

Returns:ComplianceViolation.Listener

The Listener instance to use for the request life cycle.

onComplianceViolationback to summary
public default void onComplianceViolation(ComplianceViolation.Event event)

The compliance violation event.

Parameters
event:ComplianceViolation.Event

the compliance violation event

onComplianceViolationback to summary
public default void onComplianceViolation(ComplianceViolation.Mode mode, ComplianceViolation violation, String details)

Deprecated

for removal since 12.0.6.

use onComplianceViolation(Event) instead. Will be removed in Jetty 12.1.0

The compliance violation event.

Parameters
mode:ComplianceViolation.Mode

the mode

violation:ComplianceViolation

the violation

details:String

the details

Annotations
@Deprecated
since:12.0.6
forRemoval:true
onRequestBeginback to summary
public default void onRequestBegin(Attributes request)

A new Request has begun.

Parameters
request:Attributes

the request attributes, or null if the Request does not exist yet (eg: during parsing of HTTP/1.1 headers, before request is created)

onRequestEndback to summary
public default void onRequestEnd(Attributes request)

A Request has ended.

Parameters
request:Attributes

the request attributes, or null if Request does not exist yet (eg: during handling of a BadMessageException)

org.eclipse.jetty.http back to summary

public Class ComplianceViolation.LoggingListener

extends Object
implements Listener
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.http.ComplianceViolation.Listener

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
onComplianceViolation(ComplianceViolation.Event
the compliance violation event
event
)

Overrides default org.eclipse.jetty.http.ComplianceViolation.Listener.onComplianceViolation.

The compliance violation event.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGback to summary
private static final Logger LOG

Constructor Detail

LoggingListenerback to summary
public LoggingListener()

Method Detail

onComplianceViolationback to summary
public void onComplianceViolation(ComplianceViolation.Event event)

Overrides default org.eclipse.jetty.http.ComplianceViolation.Listener.onComplianceViolation.

Doc from org.eclipse.jetty.http.ComplianceViolation.Listener.onComplianceViolation.

The compliance violation event.

Parameters
event:ComplianceViolation.Event

the compliance violation event

Annotations
@Override
org.eclipse.jetty.http back to summary

public Interface ComplianceViolation.Mode

Known Direct Implementers
org.eclipse.jetty.http.CookieCompliance, org.eclipse.jetty.http.HttpCompliance, org.eclipse.jetty.http.MultiPartCompliance, org.eclipse.jetty.http.UriCompliance

A Mode is a set of ComplianceViolations that are allowed.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true iff the violation is allowed by this mode.
allows
(ComplianceViolation violation)

public Set<? extends ComplianceViolation>

Returns:

The immutable set of violations allowed by this mode.
getAllowed
()

public Set<? extends ComplianceViolation>

Returns:

The immutable set of all known violations for this mode.
getKnown
()

public String

Returns:

The name of the compliance violation mode.
getName
()

Method Detail

allowsback to summary
public boolean allows(ComplianceViolation violation)
Parameters
violation:ComplianceViolation

The ComplianceViolation to test

Returns:boolean

true iff the violation is allowed by this mode.

getAllowedback to summary
public Set<? extends ComplianceViolation> getAllowed()
Returns:Set<? extends ComplianceViolation>

The immutable set of violations allowed by this mode.

getKnownback to summary
public Set<? extends ComplianceViolation> getKnown()
Returns:Set<? extends ComplianceViolation>

The immutable set of all known violations for this mode.

getNameback to summary
public String getName()
Returns:String

The name of the compliance violation mode.