Package org.citrusframework.ssh.client
Class SshClient
java.lang.Object
org.citrusframework.endpoint.AbstractEndpoint
org.citrusframework.ssh.client.SshClient
- All Implemented Interfaces:
Named,Endpoint,org.citrusframework.messaging.Consumer,org.citrusframework.messaging.Producer,org.citrusframework.messaging.ReplyConsumer,org.citrusframework.messaging.SelectiveConsumer
public class SshClient
extends AbstractEndpoint
implements org.citrusframework.messaging.Producer, org.citrusframework.messaging.ReplyConsumer
Ssh client connects to ssh server and sends commands to that server.
- Since:
- 1.4
- Author:
- Roland Huss, Christoph Deppisch
-
Constructor Summary
ConstructorsModifierConstructorDescriptionDefault constructor initializing endpoint configuration.protectedSshClient(SshEndpointConfiguration endpointConfiguration) Default constructor using endpoint configuration. -
Method Summary
Modifier and TypeMethodDescriptionorg.citrusframework.messaging.SelectiveConsumerorg.citrusframework.messaging.Producercom.jcraft.jsch.JSchgetJsch()Gets the JSch implementation.receive(String selector, TestContext context) receive(String selector, TestContext context, long timeout) receive(TestContext context) receive(TestContext context, long timeout) voidsend(Message message, TestContext context) Send a message as SSH request.voidsetCorrelationManager(CorrelationManager<Message> correlationManager) Sets the correlation manager.voidsetJsch(com.jcraft.jsch.JSch jsch) Sets the JSch implementation.Methods inherited from class org.citrusframework.endpoint.AbstractEndpoint
getActor, getConsumerName, getName, getProducerName, setActor, setNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.citrusframework.messaging.Consumer
getNameMethods inherited from interface org.citrusframework.messaging.Producer
getName
-
Constructor Details
-
SshClient
public SshClient()Default constructor initializing endpoint configuration. -
SshClient
Default constructor using endpoint configuration.- Parameters:
endpointConfiguration-
-
-
Method Details
-
getEndpointConfiguration
- Specified by:
getEndpointConfigurationin interfaceEndpoint- Overrides:
getEndpointConfigurationin classAbstractEndpoint
-
send
Send a message as SSH request. The message format is created fromSshServer.- Specified by:
sendin interfaceorg.citrusframework.messaging.Producer- Parameters:
message- the message object to send.context-
-
receive
- Specified by:
receivein interfaceorg.citrusframework.messaging.Consumer
-
receive
- Specified by:
receivein interfaceorg.citrusframework.messaging.SelectiveConsumer
-
receive
- Specified by:
receivein interfaceorg.citrusframework.messaging.Consumer
-
receive
- Specified by:
receivein interfaceorg.citrusframework.messaging.SelectiveConsumer
-
createProducer
public org.citrusframework.messaging.Producer createProducer()- Specified by:
createProducerin interfaceEndpoint
-
createConsumer
public org.citrusframework.messaging.SelectiveConsumer createConsumer()- Specified by:
createConsumerin interfaceEndpoint
-
getJsch
public com.jcraft.jsch.JSch getJsch()Gets the JSch implementation.- Returns:
-
setJsch
public void setJsch(com.jcraft.jsch.JSch jsch) Sets the JSch implementation.- Parameters:
jsch-
-
setCorrelationManager
Sets the correlation manager.- Parameters:
correlationManager-
-