Class DefaultInboundPacket

  • All Implemented Interfaces:
    InboundPacket

    public final class DefaultInboundPacket
    extends java.lang.Object
    implements InboundPacket
    Default implementation of an immutable inbound packet.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<java.lang.Long> cookie()
      Returns the cookie in the packet in message.
      boolean equals​(java.lang.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.
      java.lang.String toString()  
      java.nio.ByteBuffer unparsed()
      Unparsed packet data.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DefaultInboundPacket

        public DefaultInboundPacket​(ConnectPoint receivedFrom,
                                    Ethernet parsed,
                                    java.nio.ByteBuffer unparsed)
        Creates an immutable inbound packet.
        Parameters:
        receivedFrom - connection point where received
        parsed - parsed ethernet frame
        unparsed - unparsed raw bytes
      • DefaultInboundPacket

        public DefaultInboundPacket​(ConnectPoint receivedFrom,
                                    Ethernet parsed,
                                    java.nio.ByteBuffer unparsed,
                                    java.util.Optional<java.lang.Long> cookie)
        Creates an immutable inbound packet with cookie.
        Parameters:
        receivedFrom - connection point where received
        parsed - parsed ethernet frame
        unparsed - unparsed raw bytes
        cookie - cookie
    • Method Detail

      • receivedFrom

        public ConnectPoint receivedFrom()
        Description copied from interface: InboundPacket
        Returns the device and port from where the packet was received.
        Specified by:
        receivedFrom in interface InboundPacket
        Returns:
        connection point where received
      • parsed

        public Ethernet parsed()
        Description copied from interface: InboundPacket
        Returns the parsed form of the packet.
        Specified by:
        parsed in interface InboundPacket
        Returns:
        parsed Ethernet frame; null if the packet is not an Ethernet frame or one for which there is no parser
      • unparsed

        public java.nio.ByteBuffer unparsed()
        Description copied from interface: InboundPacket
        Unparsed packet data.
        Specified by:
        unparsed in interface InboundPacket
        Returns:
        raw packet bytes
      • cookie

        public java.util.Optional<java.lang.Long> cookie()
        Description copied from interface: InboundPacket
        Returns the cookie in the packet in message.
        Specified by:
        cookie in interface InboundPacket
        Returns:
        optional flow cookie
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object