T - public class NettyTupleImpl<T> extends Object implements INettyTuple<T>
| Constructor and Description |
|---|
NettyTupleImpl(T data,
InetSocketAddress local,
InetSocketAddress remote)
Create a NettyTuple to be notified to a receiver.
|
| Modifier and Type | Method and Description |
|---|---|
void |
ack()
Acknowledge that NettyData.
|
void |
fail()
Signal the peer about the failure to process that NettyData.
|
T |
getData()
The general case is to receive a Json document (as is, or lumberjack encoded),
made of key value pairs.
|
int |
getDataLength() |
InetSocketAddress |
getLocalAddress()
Get the local (i.e.
|
InetSocketAddress |
getRemoteAddress()
Get the remote (i.e.
|
String |
toString() |
public NettyTupleImpl(T data, InetSocketAddress local, InetSocketAddress remote)
data - the datalocal - the receiving addressremote - the remote peer addresspublic InetSocketAddress getLocalAddress()
INettyTuplegetLocalAddress in interface INettyTuple<T>public InetSocketAddress getRemoteAddress()
INettyTuplegetRemoteAddress in interface INettyTuple<T>public T getData()
INettyTupleIf however a single String is received, for instance from a syslog plain client, then you will find a single entry. To avoid the burden and the performance penalty to always retrieve it from a map, you can use the getSingleData method.
getData in interface INettyTuple<T>public void fail()
INettyTupleWhat action will be taken is up to the underlying connector. It will be a no-operation if the connector does not support an acknowledged mode.
fail in interface INettyTuple<T>public void ack()
INettyTupleWhat happens is up to the underlying connector. It will be a no-operation if the connector does not support an acknowledged mode.
ack in interface INettyTuple<T>public int getDataLength()
getDataLength in interface INettyTuple<T>Copyright © 2023. All rights reserved.