Class ProxyProtocolClientConnectionFactory.V2.Tag
- All Implemented Interfaces:
ClientConnectionFactory.Decorator
- Enclosing class:
- ProxyProtocolClientConnectionFactory.V2
PROXY protocol version 2 metadata holder to be used in conjunction
with Request.tag(Object).
Instances of this class are associated to a destination so that all connections of that destination will initiate the communication with the PROXY protocol version 2 bytes specified by this metadata.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enumstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ProxyProtocolClientConnectionFactory.V2.TagThe PROXY V2 Tag typically used to "ping" the server.Fields inherited from interface org.eclipse.jetty.io.ClientConnectionFactory.Decorator
CONTEXT_KEY -
Constructor Summary
ConstructorsConstructorDescriptionTag()Creates a Tag whose metadata will be derived from the underlying EndPoint.Creates a Tag with the given source metadata.Tag(String srcIP, int srcPort, List<ProxyProtocolClientConnectionFactory.V2.Tag.TLV> tlvs) Creates a Tag with the given source metadata and Type-Length-Value (TLV) objects.Tag(ProxyProtocolClientConnectionFactory.V2.Tag.Command command, ProxyProtocolClientConnectionFactory.V2.Tag.Family family, ProxyProtocolClientConnectionFactory.V2.Tag.Protocol protocol, String srcIP, int srcPort, String dstIP, int dstPort, List<ProxyProtocolClientConnectionFactory.V2.Tag.TLV> tlvs) Creates a Tag with the given metadata. -
Method Summary
Modifier and TypeMethodDescriptionapply(ClientConnectionFactory factory) Wraps the givenfactory.booleanCreates aTagfrom the givenEndPoint.intintgetTLVs()inthashCode()
-
Field Details
-
LOCAL
The PROXY V2 Tag typically used to "ping" the server.
-
-
Constructor Details
-
Tag
public Tag()Creates a Tag whose metadata will be derived from the underlying EndPoint.
-
Tag
Creates a Tag with the given source metadata.
The destination metadata will be derived from the underlying EndPoint.
- Parameters:
srcIP- the source IP addresssrcPort- the source port
-
Tag
Creates a Tag with the given source metadata and Type-Length-Value (TLV) objects.
The destination metadata will be derived from the underlying EndPoint.
- Parameters:
srcIP- the source IP addresssrcPort- the source porttlvs- the TLV objects
-
Tag
public Tag(ProxyProtocolClientConnectionFactory.V2.Tag.Command command, ProxyProtocolClientConnectionFactory.V2.Tag.Family family, ProxyProtocolClientConnectionFactory.V2.Tag.Protocol protocol, String srcIP, int srcPort, String dstIP, int dstPort, List<ProxyProtocolClientConnectionFactory.V2.Tag.TLV> tlvs) Creates a Tag with the given metadata.
Missing metadata will be derived from the underlying EndPoint.
- Parameters:
command- the LOCAL or PROXY commandfamily- the protocol familyprotocol- the protocol typesrcIP- the source IP addresssrcPort- the source portdstIP- the destination IP addressdstPort- the destination porttlvs- the TLV objects
-
-
Method Details
-
from
Creates a
Tagfrom the givenEndPoint.The
sourceparameter indicates whether theEndPointis the localEndPoint(typical for clients), or the remoteEndPoint(typical for proxies). In the latter case, the proxy wants to forward to the server the information about the remote client so theEndPointmust be that connected to the remote client (not to the server).- Parameters:
endPoint- theEndPointto create theTagfromlocal- whether theEndPointis local or remote- Returns:
- a new
Tagfrom the givenEndPoint
-
getCommand
-
getFamily
-
getProtocol
-
getSourceAddress
-
getSourcePort
public int getSourcePort() -
getDestinationAddress
-
getDestinationPort
public int getDestinationPort() -
getTLVs
-
apply
Description copied from interface:ClientConnectionFactory.DecoratorWraps the given
factory.- Specified by:
applyin interfaceClientConnectionFactory.Decorator- Parameters:
factory- the ClientConnectionFactory to wrap- Returns:
- the wrapping ClientConnectionFactory
-
equals
-
hashCode
public int hashCode()
-