Package com.consol.citrus.ssh.server
Class SshServer
- java.lang.Object
-
- com.consol.citrus.endpoint.AbstractEndpoint
-
- com.consol.citrus.server.AbstractServer
-
- com.consol.citrus.ssh.server.SshServer
-
- All Implemented Interfaces:
InitializingPhase,Named,ShutdownPhase,Endpoint,Server,com.consol.citrus.spi.ReferenceResolverAware,Runnable
public class SshServer extends AbstractServer
SSH Server implemented with Apache SSHD (http://mina.apache.org/sshd/). It uses the same semantic as the Jetty Servers for HTTP and WS mocks and translates an incoming request into a message, for which a reply message gets translates to the SSH return value. The incoming message generated has the following format: The reply message to be generated by a handler should have the following formatcat - This is the standard input sent 0 This is the standard input sent warning: no tty - Since:
- 04.09.12
- Author:
- Roland Huss
-
-
Field Summary
-
Fields inherited from class com.consol.citrus.server.AbstractServer
DEFAULT_CHANNEL_ID_SUFFIX
-
-
Constructor Summary
Constructors Constructor Description SshServer()Default constructor using default endpoint configuration.SshServer(SshEndpointConfiguration endpointConfiguration)Constructor using endpoint configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAllowedKeyPath()Gets the allowed key path.AbstractPollableEndpointConfigurationgetEndpointConfiguration()StringgetHostKeyPath()Gets the host key path.SshMessageConvertergetMessageConverter()Gets the message converter.StringgetPassword()Gets the user password.intgetPort()Gets the server port.protected org.apache.sshd.scp.common.ScpTransferEventListenergetScpTransferEventListener()Gets Scp trsanfer event listener.protected org.apache.sshd.sftp.server.SftpEventListenergetSftpEventListener()Gets Sftp event listener.StringgetUser()Gets the username.StringgetUserHomePath()Gets the userHomePath.voidsetAllowedKeyPath(String allowedKeyPath)Sets the allowedKeyPath.voidsetHostKeyPath(String hostKeyPath)Sets the hostKeyPath.voidsetMarshaller(SshMarshaller marshaller)Sets the marshaller.voidsetMessageConverter(SshMessageConverter messageConverter)Sets the message converter.voidsetPassword(String password)Sets the password.voidsetPort(int port)Sets the port.voidsetUser(String user)Sets the user.voidsetUserHomePath(String userHomePath)Sets the userHomePath.protected voidshutdown()protected voidstartup()-
Methods inherited from class com.consol.citrus.server.AbstractServer
createConsumer, createProducer, destroy, getDefaultTimeout, getEndpointAdapter, getInterceptors, getReferenceResolver, initialize, isAutoStart, isDebugLogging, isRunning, join, run, setAutoStart, setDebugLogging, setDefaultTimeout, setEndpointAdapter, setInterceptors, setReferenceResolver, setRunning, start, stop
-
Methods inherited from class com.consol.citrus.endpoint.AbstractEndpoint
getActor, getConsumerName, getName, getProducerName, setActor, setName
-
-
-
-
Constructor Detail
-
SshServer
public SshServer()
Default constructor using default endpoint configuration.
-
SshServer
public SshServer(SshEndpointConfiguration endpointConfiguration)
Constructor using endpoint configuration.- Parameters:
endpointConfiguration-
-
-
Method Detail
-
startup
protected void startup()
- Specified by:
startupin classAbstractServer
-
getScpTransferEventListener
protected org.apache.sshd.scp.common.ScpTransferEventListener getScpTransferEventListener()
Gets Scp trsanfer event listener. By default uses abstract implementation that use trace level logging of all operations.- Returns:
-
getSftpEventListener
protected org.apache.sshd.sftp.server.SftpEventListener getSftpEventListener()
Gets Sftp event listener. By default uses abstract implementation that use trace level logging of all operations.- Returns:
-
shutdown
protected void shutdown()
- Specified by:
shutdownin classAbstractServer
-
getEndpointConfiguration
public AbstractPollableEndpointConfiguration getEndpointConfiguration()
- Specified by:
getEndpointConfigurationin interfaceEndpoint- Overrides:
getEndpointConfigurationin classAbstractServer
-
getPort
public int getPort()
Gets the server port.- Returns:
-
setPort
public void setPort(int port)
Sets the port.- Parameters:
port- the port to set
-
getUser
public String getUser()
Gets the username.- Returns:
-
setUser
public void setUser(String user)
Sets the user.- Parameters:
user- the user to set
-
getPassword
public String getPassword()
Gets the user password.- Returns:
-
setPassword
public void setPassword(String password)
Sets the password.- Parameters:
password- the password to set
-
getAllowedKeyPath
public String getAllowedKeyPath()
Gets the allowed key path.- Returns:
-
setAllowedKeyPath
public void setAllowedKeyPath(String allowedKeyPath)
Sets the allowedKeyPath.- Parameters:
allowedKeyPath- the allowedKeyPath to set
-
getHostKeyPath
public String getHostKeyPath()
Gets the host key path.- Returns:
-
setHostKeyPath
public void setHostKeyPath(String hostKeyPath)
Sets the hostKeyPath.- Parameters:
hostKeyPath- the hostKeyPath to set
-
getUserHomePath
public String getUserHomePath()
Gets the userHomePath.- Returns:
-
setUserHomePath
public void setUserHomePath(String userHomePath)
Sets the userHomePath.- Parameters:
userHomePath-
-
getMessageConverter
public SshMessageConverter getMessageConverter()
Gets the message converter.- Returns:
-
setMarshaller
public void setMarshaller(SshMarshaller marshaller)
Sets the marshaller.- Parameters:
marshaller-
-
setMessageConverter
public void setMessageConverter(SshMessageConverter messageConverter)
Sets the message converter.- Parameters:
messageConverter-
-
-