Class TcpHandler
- java.lang.Object
- 
- org.opendaylight.openflowjava.protocol.impl.core.TcpHandler
 
- 
- All Implemented Interfaces:
- Runnable,- OnlineProvider,- ServerFacade,- ShutdownProvider
 
 public class TcpHandler extends Object implements ServerFacade Class implementing server over TCP / TLS for handling incoming connections.- Author:
- michal.polkorab
 
- 
- 
Constructor SummaryConstructors Constructor Description TcpHandler(int port, Runnable readyRunnable)Constructor of TCPHandler that listens on selected port.TcpHandler(InetAddress address, int port, Runnable readyRunnable)Constructor of TCPHandler that listens on selected address and port.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAddress()com.google.common.util.concurrent.ListenableFuture<Boolean>getIsOnlineFuture()intgetNumberOfConnections()Returns the number of connected clients / channels.intgetPort()io.netty.channel.EventLoopGroupgetWorkerGroup()protected voidinitiateEpollEventLoopGroups(ThreadConfiguration threadConfiguration)Initiate Epoll event loop groups with Nio as fall back.voidinitiateEventLoopGroups(ThreadConfiguration threadConfiguration, boolean isEpollEnabled)Initiate event loop groups.voidinitiateNioEventLoopGroups(ThreadConfiguration threadConfiguration)Initiate Nio event loop groups.voidrun()Starts server on selected port.voidsetChannelInitializer(TcpChannelInitializer channelInitializer)voidsetThreadConfig(ThreadConfiguration threadConfig)Sets thread configuration.com.google.common.util.concurrent.ListenableFuture<Boolean>shutdown()Shuts downTcpHandler}.
 
- 
- 
- 
Constructor Detail- 
TcpHandlerpublic TcpHandler(int port, Runnable readyRunnable)Constructor of TCPHandler that listens on selected port.- Parameters:
- port- listening port of TCPHandler server
 
 - 
TcpHandlerpublic TcpHandler(InetAddress address, int port, Runnable readyRunnable) Constructor of TCPHandler that listens on selected address and port.- Parameters:
- address- listening address of TCPHandler server
- port- listening port of TCPHandler server
 
 
- 
 - 
Method Detail- 
shutdownpublic com.google.common.util.concurrent.ListenableFuture<Boolean> shutdown() Shuts downTcpHandler}.- Specified by:
- shutdownin interface- ShutdownProvider
 
 - 
getNumberOfConnectionspublic int getNumberOfConnections() Returns the number of connected clients / channels.- Returns:
- number of connected clients / channels
 
 - 
getIsOnlineFuturepublic com.google.common.util.concurrent.ListenableFuture<Boolean> getIsOnlineFuture() - Specified by:
- getIsOnlineFuturein interface- OnlineProvider
 
 - 
getPortpublic int getPort() 
 - 
getAddresspublic String getAddress() 
 - 
setChannelInitializerpublic void setChannelInitializer(TcpChannelInitializer channelInitializer) 
 - 
setThreadConfigpublic void setThreadConfig(ThreadConfiguration threadConfig) Description copied from interface:ServerFacadeSets thread configuration.- Specified by:
- setThreadConfigin interface- ServerFacade
- Parameters:
- threadConfig- desired thread configuration
 
 - 
initiateEventLoopGroupspublic void initiateEventLoopGroups(ThreadConfiguration threadConfiguration, boolean isEpollEnabled) Initiate event loop groups.- Parameters:
- threadConfiguration- number of threads to be created, if not specified in threadConfig
 
 - 
initiateNioEventLoopGroupspublic void initiateNioEventLoopGroups(ThreadConfiguration threadConfiguration) Initiate Nio event loop groups.- Parameters:
- threadConfiguration- number of threads to be created, if not specified in threadConfig
 
 - 
initiateEpollEventLoopGroupsprotected void initiateEpollEventLoopGroups(ThreadConfiguration threadConfiguration) Initiate Epoll event loop groups with Nio as fall back.- Parameters:
- threadConfiguration- the ThreadConfiguration
 
 - 
getWorkerGrouppublic io.netty.channel.EventLoopGroup getWorkerGroup() 
 
- 
 
-