public class SshEngine
extends java.lang.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 |
addListener(SshEngineListener listener) |
void |
addShutdownHook(java.lang.Runnable r) |
<K extends ProtocolContext> |
connect(java.lang.String hostToConnect,
int portToConnect,
K protocolContext) |
protected boolean |
getBooleanValue(java.util.Properties properties,
java.lang.String overrideKey,
boolean defaultValue) |
SshEngineContext |
getContext()
Get the context for this Daemon.
|
static SshEngine |
getDefaultInstance() |
protected int |
getIntValue(java.util.Properties properties,
java.lang.String overrideKey,
int defaultValue) |
java.lang.Throwable |
getLastError() |
protected long |
getLongValue(java.util.Properties properties,
java.lang.String overrideKey,
long defaultValue) |
static java.util.Date |
getReleaseDate()
Returns the release date of the current version.
|
AbstractRequestFuture |
getShutdownFuture() |
static java.lang.String |
getVersion()
Returns the current version of the API.
|
boolean |
isStarted()
Get whether the daemon is currently started
|
boolean |
isStarting() |
boolean |
isStartupRequiresListeningInterfaces() |
protected java.nio.channels.SocketChannel |
processOpenSocket(java.nio.channels.SocketChannel socketChannel) |
void |
registerAcceptor(ClientAcceptor acceptor,
java.nio.channels.ServerSocketChannel socketChannel)
Register a client acceptor with the daemon.
|
void |
registerConnector(ClientConnector connector,
java.nio.channels.SocketChannel socketChannel)
Register a client connector with the daemon.
|
void |
registerHandler(SocketHandler handler,
java.nio.channels.SelectableChannel channel)
Register a socket handler with the daemon.
|
void |
registerHandler(SocketHandler handler,
java.nio.channels.SelectableChannel channel,
SelectorThread thread)
Register a socket handler with the daemon.
|
void |
removeAcceptor(ListeningInterface li) |
void |
removeListener(SshEngineListener listener) |
void |
restart() |
void |
restart(boolean graceful,
long forceAfterMs) |
void |
setStartupRequiresListeningInterfaces(boolean startupRequiresListeningInterfaces) |
void |
shutdownAndExit() |
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. |
boolean |
startup(java.util.Properties properties) |
public SshEngineContext getContext()
public java.lang.Throwable getLastError()
public void addListener(SshEngineListener listener)
public void removeListener(SshEngineListener listener)
public static java.lang.String getVersion()
public static java.util.Date getReleaseDate()
public boolean isStarting()
public void addShutdownHook(java.lang.Runnable r)
protected int getIntValue(java.util.Properties properties,
java.lang.String overrideKey,
int defaultValue)
protected boolean getBooleanValue(java.util.Properties properties,
java.lang.String overrideKey,
boolean defaultValue)
protected long getLongValue(java.util.Properties properties,
java.lang.String overrideKey,
long defaultValue)
public boolean startup()
throws java.io.IOException
#configure(ConfigurationContext) method to allow your server to
configure itself.java.io.IOExceptionpublic boolean startup(java.util.Properties properties)
throws java.io.IOException
java.io.IOExceptionprotected boolean startListeningInterface(ListeningInterface li)
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 shutdownAndExit()
public void restart()
throws java.io.IOException
java.io.IOExceptionpublic void restart(boolean graceful,
long forceAfterMs)
throws java.io.IOException
java.io.IOExceptionpublic <K extends ProtocolContext> ConnectRequestFuture connect(java.lang.String hostToConnect, int portToConnect, K protocolContext) throws SshException, java.io.IOException
SshExceptionjava.io.IOExceptionprotected java.nio.channels.SocketChannel processOpenSocket(java.nio.channels.SocketChannel socketChannel)
public boolean isStartupRequiresListeningInterfaces()
public void setStartupRequiresListeningInterfaces(boolean startupRequiresListeningInterfaces)
public void registerConnector(ClientConnector connector, java.nio.channels.SocketChannel socketChannel) throws java.io.IOException
connector - ClientConnectorsocketChannel - SocketChanneljava.io.IOExceptionpublic void registerAcceptor(ClientAcceptor acceptor, java.nio.channels.ServerSocketChannel socketChannel) throws java.io.IOException
acceptor - ClientAcceptorsocketChannel - ServerSocketChanneljava.io.IOExceptionpublic void registerHandler(SocketHandler handler, java.nio.channels.SelectableChannel channel) throws java.io.IOException
handler - SocketHandlerchannel - SelectableChanneljava.io.IOExceptionpublic void registerHandler(SocketHandler handler, java.nio.channels.SelectableChannel channel, SelectorThread thread) throws java.io.IOException
handler - SocketHandlerchannel - SelectableChannelthread - SelectorThreadjava.io.IOExceptionpublic static SshEngine getDefaultInstance() throws java.io.IOException
java.io.IOExceptionpublic AbstractRequestFuture getShutdownFuture()
Copyright © 2021. All rights reserved.