public class PacketHandlerPipeline extends Object
PacketHandler to process incoming packets.| Constructor and Description |
|---|
PacketHandlerPipeline() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addHandler(PacketHandler handler)
Registers a new packet handler in the pipeline.
Cannot register same handler twice. |
boolean |
contains(PacketHandler handler)
Checks whether a certain handler is already registered in the pipeline.
|
int |
count()
Gets the number of handlers registered in the pipeline.
|
PacketHandler |
getHandler(byte[] packet)
Gets the protocol handler capable of processing the packet.
|
protected List<PacketHandler> |
getHandlers()
Gets a copy of the handlers registered in the pipeline.
|
boolean |
removeHandler(PacketHandler handler)
Removes an existing packet handler from the pipeline.
|
public boolean addHandler(PacketHandler handler)
handler - The handler to be registered.public boolean removeHandler(PacketHandler handler)
handler - The handler to be removedpublic int count()
public boolean contains(PacketHandler handler)
handler - The handler to look fortrue if the handler is registered. Returns false, otherwise.public PacketHandler getHandler(byte[] packet)
packet - The packet to be processedprotected List<PacketHandler> getHandlers()
Copyright © 2017 TeleStax, Inc.. All Rights Reserved.