Class GridTcpRestNioListener
- java.lang.Object
-
- org.apache.ignite.internal.util.nio.GridNioServerListenerAdapter<GridClientMessage>
-
- org.apache.ignite.internal.processors.rest.protocols.tcp.GridTcpRestNioListener
-
- All Implemented Interfaces:
EventListener,GridNioServerListener<GridClientMessage>
public class GridTcpRestNioListener extends GridNioServerListenerAdapter<GridClientMessage>
Listener for nio server that handles incoming tcp rest packets.
-
-
Constructor Summary
Constructors Constructor Description GridTcpRestNioListener(IgniteLogger log, GridTcpRestProtocol proto, GridRestProtocolHandler hnd, GridKernalContext ctx)Creates listener which will convert incoming tcp packets to rest requests and forward them to a given rest handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonConnected(GridNioSession ses)This method is called whenever a new client is connected and session is created.voidonDisconnected(GridNioSession ses, @Nullable Exception e)This method is called whenever client is disconnected due to correct connection close or due toIOExceptionduring network operations.voidonMessage(GridNioSession ses, GridClientMessage msg)This method is called whenever aGridNioParserreturns non-null value.voidonSessionClosed(GridNioSession ses)Close all future associated with given session.voidonSessionIdleTimeout(GridNioSession ses)Closes the session by timeout (i.e. inactivity within the configured period of time).-
Methods inherited from class org.apache.ignite.internal.util.nio.GridNioServerListenerAdapter
onFailure, onMessageSent, onSessionWriteTimeout
-
-
-
-
Constructor Detail
-
GridTcpRestNioListener
public GridTcpRestNioListener(IgniteLogger log, GridTcpRestProtocol proto, GridRestProtocolHandler hnd, GridKernalContext ctx)
Creates listener which will convert incoming tcp packets to rest requests and forward them to a given rest handler.- Parameters:
log- Logger to use.proto- Protocol.hnd- Rest handler.ctx- Context.
-
-
Method Detail
-
onConnected
public void onConnected(GridNioSession ses)
This method is called whenever a new client is connected and session is created.- Parameters:
ses- Newly created session for remote client.
-
onDisconnected
public void onDisconnected(GridNioSession ses, @Nullable @Nullable Exception e)
This method is called whenever client is disconnected due to correct connection close or due toIOExceptionduring network operations.- Parameters:
ses- Closed session.e- Exception occurred, if any.
-
onMessage
public void onMessage(GridNioSession ses, GridClientMessage msg)
This method is called whenever aGridNioParserreturns non-null value.- Parameters:
ses- Session on which message was received.msg- Parsed message.
-
onSessionClosed
public void onSessionClosed(GridNioSession ses)
Close all future associated with given session.- Parameters:
ses- Session.
-
onSessionIdleTimeout
public void onSessionIdleTimeout(GridNioSession ses)
Closes the session by timeout (i.e. inactivity within the configured period of time).- Specified by:
onSessionIdleTimeoutin interfaceGridNioServerListener<GridClientMessage>- Overrides:
onSessionIdleTimeoutin classGridNioServerListenerAdapter<GridClientMessage>- Parameters:
ses- Session, that was inactive.
-
-