Package org.citrusframework.ssh.server
Class SshServer
java.lang.Object
org.citrusframework.endpoint.AbstractEndpoint
org.citrusframework.server.AbstractServer
org.citrusframework.ssh.server.SshServer
- All Implemented Interfaces:
Runnable,InitializingPhase,Named,ShutdownPhase,Endpoint,Server,ReferenceResolverAware
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:
<ssh-request>
cat -
This is the standard input sent
</ssh-request>
The reply message to be generated by a handler should have the following format
<ssh-response>
0
This is the standard input sent
warning: no tty
</ssh-response>
- Since:
- 04.09.12
- Author:
- Roland Huss
-
Field Summary
Fields inherited from class org.citrusframework.server.AbstractServer
DEFAULT_CHANNEL_ID_SUFFIX -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor using default endpoint configuration.SshServer(SshEndpointConfiguration endpointConfiguration) Constructor using endpoint configuration. -
Method Summary
Modifier and TypeMethodDescriptionGets the allowed key path.Gets the host key path.Gets the message converter.Gets the user password.intgetPort()Gets the server port.protected org.apache.sshd.scp.common.ScpTransferEventListenerGets Scp trsanfer event listener.protected org.apache.sshd.sftp.server.SftpEventListenerGets Sftp event listener.getUser()Gets the username.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.voidSets the user.voidsetUserHomePath(String userHomePath) Sets the userHomePath.protected voidshutdown()protected voidstartup()Methods inherited from class org.citrusframework.server.AbstractServer
createConsumer, createProducer, destroy, getDefaultTimeout, getEndpointAdapter, getInterceptors, getReferenceResolver, initialize, isAutoStart, isDebugLogging, isRunning, join, run, setAutoStart, setDebugLogging, setDefaultTimeout, setEndpointAdapter, setInterceptors, setReferenceResolver, setRunning, start, stopMethods inherited from class org.citrusframework.endpoint.AbstractEndpoint
getActor, getConsumerName, getName, getProducerName, setActor, setName
-
Constructor Details
-
SshServer
public SshServer()Default constructor using default endpoint configuration. -
SshServer
Constructor using endpoint configuration.- Parameters:
endpointConfiguration-
-
-
Method Details
-
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
- 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
Gets the username.- Returns:
-
setUser
Sets the user.- Parameters:
user- the user to set
-
getPassword
Gets the user password.- Returns:
-
setPassword
Sets the password.- Parameters:
password- the password to set
-
getAllowedKeyPath
Gets the allowed key path.- Returns:
-
setAllowedKeyPath
Sets the allowedKeyPath.- Parameters:
allowedKeyPath- the allowedKeyPath to set
-
getHostKeyPath
Gets the host key path.- Returns:
-
setHostKeyPath
Sets the hostKeyPath.- Parameters:
hostKeyPath- the hostKeyPath to set
-
getUserHomePath
Gets the userHomePath.- Returns:
-
setUserHomePath
Sets the userHomePath.- Parameters:
userHomePath-
-
getMessageConverter
Gets the message converter.- Returns:
-
setMarshaller
Sets the marshaller.- Parameters:
marshaller-
-
setMessageConverter
Sets the message converter.- Parameters:
messageConverter-
-