Package com.germancoding.packetapi
Class DefaultPacketListener
- java.lang.Object
-
- com.germancoding.packetapi.DefaultPacketListener
-
- All Implemented Interfaces:
PacketListener
public class DefaultPacketListener extends java.lang.Object implements PacketListener
-
-
Constructor Summary
Constructors Constructor Description DefaultPacketListener(PacketHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
ignoreClosePackets()
boolean
ignoreHandshakePackets()
boolean
ignoreKeepAlivePackets()
void
onConnectionClosed(PacketHandler handler, java.lang.String message, boolean expected)
void
onConnectionFailed(PacketHandler handler, java.lang.Throwable exception)
void
onPacketReceived(PacketHandler handler, Packet packet)
void
onUnknownPacketReceived(PacketHandler handler, short id)
void
setIgnoreClosePackets(boolean ignoreClosePackets)
void
setIgnoreHandshakePackets(boolean ignoreHandshakePackets)
void
setIgnoreKeepAlivePackets(boolean ignoreKeepAlivePackets)
-
-
-
Constructor Detail
-
DefaultPacketListener
public DefaultPacketListener(PacketHandler handler)
-
-
Method Detail
-
onPacketReceived
public void onPacketReceived(PacketHandler handler, Packet packet)
- Specified by:
onPacketReceived
in interfacePacketListener
-
onConnectionClosed
public void onConnectionClosed(PacketHandler handler, java.lang.String message, boolean expected)
- Specified by:
onConnectionClosed
in interfacePacketListener
-
onUnknownPacketReceived
public void onUnknownPacketReceived(PacketHandler handler, short id)
- Specified by:
onUnknownPacketReceived
in interfacePacketListener
-
onConnectionFailed
public void onConnectionFailed(PacketHandler handler, java.lang.Throwable exception)
- Specified by:
onConnectionFailed
in interfacePacketListener
-
ignoreClosePackets
public boolean ignoreClosePackets()
-
setIgnoreClosePackets
public void setIgnoreClosePackets(boolean ignoreClosePackets)
-
ignoreHandshakePackets
public boolean ignoreHandshakePackets()
-
setIgnoreHandshakePackets
public void setIgnoreHandshakePackets(boolean ignoreHandshakePackets)
-
ignoreKeepAlivePackets
public boolean ignoreKeepAlivePackets()
-
setIgnoreKeepAlivePackets
public void setIgnoreKeepAlivePackets(boolean ignoreKeepAlivePackets)
-
-