Examples of SLF4JLoggingModule


Examples of org.jclouds.logging.slf4j.config.SLF4JLoggingModule

            String password = getConnectionCredentials().getCredential();

            try {
                cloudWatchContext = ContextBuilder.newBuilder("aws-cloudwatch")
                        .credentials(username, password)
                        .modules(ImmutableSet.<Module>of(new SLF4JLoggingModule()))
                        .build();
            } catch (AuthorizationException ae) {
                throw new InvalidCredentialsException(ae);
            }
        }
View Full Code Here

Examples of org.jclouds.logging.slf4j.config.SLF4JLoggingModule

    protected RestContext<CloudStackClient, CloudStackAsyncClient> newCloudStackContext(Provider provider) {
        Properties overrides = new Properties();
        overrides.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS, "true");
        return ContextBuilder.newBuilder(new CloudStackApiMetadata())
            .endpoint(provider.getEndpoint().get())
            .modules(ImmutableSet.of(new SLF4JLoggingModule()))
            .credentials(provider.getAccessKey(), provider.getSecretKey())
            .overrides(overrides)
            .build(CloudStackApiMetadata.CONTEXT_TOKEN);
    }
View Full Code Here

Examples of org.jclouds.logging.slf4j.config.SLF4JLoggingModule

        checkArgument(provider.getEndpoint().isPresent(), "please specify an endpoint for this provider");
        Properties overrides = new Properties();
        overrides.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS, "true");
        return ContextBuilder.newBuilder(new CloudStackApiMetadata())
            .endpoint(provider.getEndpoint().get())
            .modules(ImmutableSet.<Module>of(new SLF4JLoggingModule()))
            .credentials(provider.getAccessKey(), provider.getSecretKey())
            .overrides(overrides)
            .build(CloudStackApiMetadata.CONTEXT_TOKEN);
    }
View Full Code Here

Examples of org.jclouds.logging.slf4j.config.SLF4JLoggingModule

    // Openstack login identity becomes: "tentantId:username"
    String identity = account.getTenantName() + ":" + account.getUserName();
    String password = account.getPassword();

    ImmutableSet<Module> modules = ImmutableSet
        .<Module> of(new SLF4JLoggingModule());
    return ContextBuilder.newBuilder(new NovaApiMetadata())
        .endpoint(account.getKeystoneEndpoint()).modules(modules)
        .credentials(identity, password).overrides(overrides)
        .buildApi(NovaApi.class);
  }
View Full Code Here

Examples of org.jclouds.logging.slf4j.config.SLF4JLoggingModule

       Injector i = Guice.createInjector(module(), new AbstractModule() {
         @Override
         protected void configure() {
            bindProperties(binder(), props);
         }
      }, new SLF4JLoggingModule());
      SshClient.Factory factory = i.getInstance(SshClient.Factory.class);
      JschSshClient ssh = JschSshClient.class.cast(factory.create(HostAndPort.fromParts("localhost", 22), LoginCredentials
            .builder().user("username").password("password").build()));
      return ssh;
   }
View Full Code Here

Examples of org.jclouds.logging.slf4j.config.SLF4JLoggingModule

               throw new RuntimeException("command " + command + " not stubbed");
            }

         };
      } else {
         Injector i = Guice.createInjector(new JschSshClientModule(), new SLF4JLoggingModule());
         SshClient.Factory factory = i.getInstance(SshClient.Factory.class);
         SshClient connection;
         if (Strings.emptyToNull(sshKeyFile) != null) {
            connection = factory.create(HostAndPort.fromParts(sshHost, port), LoginCredentials.builder().user(sshUser)
                  .privateKey(Files.toString(new File(sshKeyFile), Charsets.UTF_8)).build());
View Full Code Here

Examples of org.jclouds.logging.slf4j.config.SLF4JLoggingModule

@Test
public class JschSshClientModuleTest {

   public void testConfigureBindsClient() throws UnknownHostException {

      Injector i = Guice.createInjector(new JschSshClientModule(), new SLF4JLoggingModule());
      SshClient.Factory factory = i.getInstance(SshClient.Factory.class);
      SshClient connection = factory.create(HostAndPort.fromParts("localhost", 22), LoginCredentials.builder().user("username")
            .password("password").build());
      assert connection instanceof JschSshClient;
   }
View Full Code Here

Examples of org.jclouds.logging.slf4j.config.SLF4JLoggingModule

         @Override
         protected void configure() {
            bindProperties(binder(), props);
         }

      }, new SLF4JLoggingModule());
      SshClient.Factory factory = i.getInstance(SshClient.Factory.class);
      SshjSshClient ssh = SshjSshClient.class.cast(factory.create(HostAndPort.fromParts("localhost", 22), LoginCredentials
            .builder().user("username").password("password").build()));
      return ssh;
   }
View Full Code Here

Examples of org.jclouds.logging.slf4j.config.SLF4JLoggingModule

@Test
public class SshjSshClientModuleTest {

   public void testConfigureBindsClient() {

      Injector i = Guice.createInjector(new SshjSshClientModule(), new SLF4JLoggingModule());
      SshClient.Factory factory = i.getInstance(SshClient.Factory.class);
      SshClient connection = factory.create(HostAndPort.fromParts("localhost", 22), LoginCredentials.builder().user("username")
            .password("password").build());
      assert connection instanceof SshjSshClient;
   }
View Full Code Here

Examples of org.jclouds.logging.slf4j.config.SLF4JLoggingModule

               }
               throw new RuntimeException("command " + command + " not stubbed");
            }
         };
      } else {
         Injector i = Guice.createInjector(new SshjSshClientModule(), new SLF4JLoggingModule());
         SshClient.Factory factory = i.getInstance(SshClient.Factory.class);
         SshClient connection;
         if (Strings.emptyToNull(sshKeyFile) != null) {
            connection = factory.create(HostAndPort.fromParts(sshHost, port), LoginCredentials.builder().user(sshUser)
                  .privateKey(Files.toString(new File(sshKeyFile), Charsets.UTF_8)).build());
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.