public class SshEngine extends Object
Modifier and Type | Field and Description |
---|---|
protected static char[] |
hexArray |
Constructor and Description |
---|
SshEngine()
Constructs the Daemon.
|
Modifier and Type | Method and Description |
---|---|
void |
addShutdownHook(Runnable r) |
<K extends ProtocolContext> |
connect(String hostToConnect,
int portToConnect,
ProtocolContextFactory<K> contextFactory) |
SshEngineContext |
getContext()
Get the context for this Daemon.
|
static Date |
getReleaseDate()
Returns the release date of the current version.
|
static String |
getVersion()
Returns the current version of the API.
|
boolean |
isStarted()
Get whether the daemon is currently started
|
boolean |
isStarting() |
protected SocketChannel |
processOpenSocket(SocketChannel socketChannel) |
void |
registerAcceptor(ClientAcceptor acceptor,
ServerSocketChannel socketChannel)
Register a client acceptor with the daemon.
|
void |
registerConnector(ClientConnector connector,
SocketChannel socketChannel)
Register a client connector with the daemon.
|
void |
registerHandler(SocketHandler handler,
SelectableChannel channel)
Register a socket handler with the daemon.
|
void |
registerHandler(SocketHandler handler,
SelectableChannel channel,
SelectorThread thread)
Register a socket handler with the daemon.
|
void |
removeAcceptor(ListeningInterface li) |
void |
restart() |
void |
restart(boolean graceful,
long forceAfterMs) |
void |
shutdownAsync(boolean graceful,
long forceAfterMs)
Shutdown the server.
|
void |
shutdownNow(boolean graceful,
long forceAfterMs)
This method should be used to shutdown the server from your main thread.
|
protected boolean |
startListeningInterface(ListeningInterface li) |
boolean |
startup()
Starts the daemon, first calling the
#configure(ConfigurationContext) method to allow your server to
configure itself. |
public SshEngineContext getContext()
public static String getVersion()
public static Date getReleaseDate()
public boolean isStarting()
public void addShutdownHook(Runnable r)
public boolean startup() throws IOException
#configure(ConfigurationContext)
method to allow your server to
configure itself.IOException
protected boolean startListeningInterface(ListeningInterface li) throws IOException
IOException
public void removeAcceptor(ListeningInterface li)
public boolean isStarted()
public void shutdownAsync(boolean graceful, long forceAfterMs)
public void shutdownNow(boolean graceful, long forceAfterMs)
shutdownAsync().
public void restart() throws IOException
IOException
public void restart(boolean graceful, long forceAfterMs) throws IOException
IOException
public <K extends ProtocolContext> void connect(String hostToConnect, int portToConnect, ProtocolContextFactory<K> contextFactory) throws SshException, IOException
SshException
IOException
protected SocketChannel processOpenSocket(SocketChannel socketChannel)
public void registerConnector(ClientConnector connector, SocketChannel socketChannel) throws IOException
connector
- ClientConnectorsocketChannel
- SocketChannelIOException
public void registerAcceptor(ClientAcceptor acceptor, ServerSocketChannel socketChannel) throws IOException
acceptor
- ClientAcceptorsocketChannel
- ServerSocketChannelIOException
public void registerHandler(SocketHandler handler, SelectableChannel channel) throws IOException
handler
- SocketHandlerchannel
- SelectableChannelIOException
public void registerHandler(SocketHandler handler, SelectableChannel channel, SelectorThread thread) throws IOException
handler
- SocketHandlerchannel
- SelectableChannelthread
- SelectorThreadIOException
Copyright © 2016. All rights reserved.