public final class DefaultInboundPacket extends Object implements InboundPacket
Constructor and Description |
---|
DefaultInboundPacket(ConnectPoint receivedFrom,
Ethernet parsed,
ByteBuffer unparsed)
Creates an immutable inbound packet.
|
DefaultInboundPacket(ConnectPoint receivedFrom,
Ethernet parsed,
ByteBuffer unparsed,
Optional<Long> cookie)
Creates an immutable inbound packet with cookie.
|
Modifier and Type | Method and Description |
---|---|
Optional<Long> |
cookie()
Returns the cookie in the packet in message.
|
boolean |
equals(Object obj) |
int |
hashCode() |
Ethernet |
parsed()
Returns the parsed form of the packet.
|
ConnectPoint |
receivedFrom()
Returns the device and port from where the packet was received.
|
String |
toString() |
ByteBuffer |
unparsed()
Unparsed packet data.
|
public DefaultInboundPacket(ConnectPoint receivedFrom, Ethernet parsed, ByteBuffer unparsed)
receivedFrom
- connection point where receivedparsed
- parsed ethernet frameunparsed
- unparsed raw bytespublic DefaultInboundPacket(ConnectPoint receivedFrom, Ethernet parsed, ByteBuffer unparsed, Optional<Long> cookie)
receivedFrom
- connection point where receivedparsed
- parsed ethernet frameunparsed
- unparsed raw bytescookie
- cookiepublic ConnectPoint receivedFrom()
InboundPacket
receivedFrom
in interface InboundPacket
public Ethernet parsed()
InboundPacket
parsed
in interface InboundPacket
public ByteBuffer unparsed()
InboundPacket
unparsed
in interface InboundPacket
public Optional<Long> cookie()
InboundPacket
cookie
in interface InboundPacket