public final class TransportPacketFactoryImpl extends java.lang.Object implements TransportPacketFactory
| Constructor and Description |
|---|
TransportPacketFactoryImpl(PacketFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
TransportPacket |
create(Protocol protocol,
byte[] srcAddress,
int srcPort,
byte[] destAddress,
int destPort,
Buffer payload)
Create a new
TransportPacket. |
TransportPacket |
create(Protocol protocol,
java.lang.String srcAddress,
int srcPort,
java.lang.String destAddress,
int destPort,
Buffer payload)
Create a new
TransportPacket. |
UDPPacket |
createUDP(Buffer payload) |
UDPPacket |
createUDP(long ts,
Buffer payload)
Create a
UDPPacket with the specified payload and with the
following default values:
MAC Src Address: 00:00:00:00:00:00
MAC Dst Address: 00:00:00:00:00:00
IP Src Address: 127.0.0.1
IP Dst Address: 127.0.0.1
UDP Src Port: 0
UDP Dst Port: 0
|
public TransportPacketFactoryImpl(PacketFactory factory)
public TransportPacket create(Protocol protocol, java.lang.String srcAddress, int srcPort, java.lang.String destAddress, int destPort, Buffer payload) throws java.lang.IllegalArgumentException, IllegalProtocolException
TransportPacket.create in interface TransportPacketFactoryprotocol - which protocol, currently only Protocol.UDP and
Protocol.TCP are supportedsrcAddress - the source address.srcPort - the source portdestAddress - the destination addressdestPort - the destination portpayload - the payload or null if noneTransportPacketjava.lang.IllegalArgumentExceptionIllegalProtocolExceptionpublic TransportPacket create(Protocol protocol, byte[] srcAddress, int srcPort, byte[] destAddress, int destPort, Buffer payload) throws java.lang.IllegalArgumentException, IllegalProtocolException
TransportPacketFactoryTransportPacket.create in interface TransportPacketFactoryprotocol - which protocol, currently only Protocol.UDP and
Protocol.TCP are supportedsrcAddress - the source address.srcPort - the source portdestAddress - the destination addressdestPort - the destination portpayload - the payload or null if noneTransportPacketjava.lang.IllegalArgumentExceptionIllegalProtocolExceptionpublic UDPPacket createUDP(long ts, Buffer payload) throws java.lang.IllegalArgumentException, IllegalProtocolException
TransportPacketFactoryUDPPacket with the specified payload and with the
following default values:
createUDP in interface TransportPacketFactoryjava.lang.IllegalArgumentExceptionIllegalProtocolExceptionpublic UDPPacket createUDP(Buffer payload) throws java.lang.IllegalArgumentException, IllegalProtocolException
createUDP in interface TransportPacketFactoryjava.lang.IllegalArgumentExceptionIllegalProtocolExceptionCopyright © 2018. All Rights Reserved.