Examples of ConnectionOptions


Examples of com.xebialabs.overthere.ConnectionOptions

import com.xebialabs.overthere.OverthereFile;

public class GetFileInfo {

  public static void main(String[] args) throws IOException {
    ConnectionOptions options = new ConnectionOptions();
    options.set(ADDRESS, "unix-box");
    options.set(USERNAME, "demo");
    options.set(PASSWORD, "secret");
    options.set(OPERATING_SYSTEM, UNIX);
    options.set(CONNECTION_TYPE, SFTP);
    OverthereConnection connection = Overthere.getConnection("ssh", options);
    try {
      OverthereFile motd = connection.getFile("/etc/motd");
      System.out.println("Length        : " + motd.length());
      System.out.println("Last modified : " + motd.lastModified());
View Full Code Here

Examples of com.xebialabs.overthere.ConnectionOptions

import com.xebialabs.overthere.OverthereFile;

public class ManipulateDirectory {

  public static void main(String[] args) throws IOException {
    ConnectionOptions options = new ConnectionOptions();
    options.set(ADDRESS, "unix-box");
    options.set(USERNAME, "demo");
    options.set(PASSWORD, "secret");
    options.set(OPERATING_SYSTEM, UNIX);
    options.set(CONNECTION_TYPE, SFTP);
    OverthereConnection connection = Overthere.getConnection("ssh", options);
    try {
      connection.execute(CmdLine.build("cp", "-r", "/var/log/apt", "/tmp/logs1"));
      OverthereFile logs1 = connection.getFile("/tmp/logs1");
      OverthereFile logs2 = connection.getFile("/tmp/logs2");
View Full Code Here

Examples of com.xebialabs.overthere.ConnectionOptions

import com.xebialabs.overthere.OverthereFile;

public class WriteFile {

  public static void main(String[] args) throws IOException {
    ConnectionOptions options = new ConnectionOptions();
    options.set(ADDRESS, "unix-box");
    options.set(USERNAME, "demo");
    options.set(PASSWORD, "secret");
    options.set(OPERATING_SYSTEM, UNIX);
    options.set(CONNECTION_TYPE, SCP);
    OverthereConnection connection = Overthere.getConnection("ssh", options);
    try {
      OverthereFile motd = connection.getFile("/tmp/new-motd");
      PrintWriter w = new PrintWriter(motd.getOutputStream());
      try {
View Full Code Here

Examples of com.xebialabs.overthere.ConnectionOptions

    w.write(origBytes);
    w.close();
  }

  public void start() {
    ConnectionOptions options = new ConnectionOptions();
    options.set(ConnectionOptions.USERNAME, login);
    options.set(ConnectionOptions.PASSWORD, passwd);
    options.set(ConnectionOptions.ADDRESS, host);
    options.set(ConnectionOptions.OPERATING_SYSTEM,
        OperatingSystemFamily.UNIX);
    options.set(SshConnectionBuilder.CONNECTION_TYPE, SshConnectionType.SCP);

    connection = Overthere.getConnection(SshConnectionBuilder.SSH_PROTOCOL,
        options);

  }
View Full Code Here

Examples of net.jodah.lyra.ConnectionOptions

      when(connectionFactory.newConnection(any(ExecutorService.class), any(Address[].class)))
          .thenReturn(connection);
    }

    if (options == null)
      options = new ConnectionOptions().withHost("test-host");
    options.withConnectionFactory(connectionFactory);
    if (config == null)
      config =
          new Config().withRetryPolicy(
              RetryPolicies.retryAlways().withInterval(Duration.millis(10))).withRecoveryPolicy(
View Full Code Here

Examples of net.jodah.lyra.ConnectionOptions

  @Override
  public Firehose connect(StringInputRowParser firehoseParser) throws IOException
  {
    final StringInputRowParser stringParser = firehoseParser;

    ConnectionOptions lyraOptions = new ConnectionOptions(this.connectionFactory);
    Config lyraConfig = new Config()
        .withRecoveryPolicy(
            new RetryPolicy()
                .withMaxRetries(config.getMaxRetries())
                .withRetryInterval(Duration.seconds(config.getRetryIntervalSeconds()))
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.