Package org.jclouds.predicates

Examples of org.jclouds.predicates.SocketOpen


   public void setupContext() {
      super.setupContext();
      Injector injector = view.utils().injector();
      client = injector.getInstance(CloudServersClient.class);
      sshFactory = injector.getInstance(SshClient.Factory.class);
      SocketOpen socketOpen = injector.getInstance(SocketOpen.class);
      socketTester = retry(socketOpen, 120, 1, SECONDS);
      injector.injectMembers(socketOpen); // add logger
   }
View Full Code Here


   public void setupContext() {
      super.setupContext();

      client = view.utils().injector().getInstance(CloudSigmaClient.class);
      driveNotClaimed = retry(Predicates.not(new DriveClaimed(client)), maxDriveImageTime, 1, SECONDS);
      SocketOpen socketOpten = context.utils().injector().getInstance(SocketOpen.class);
      socketTester = retry(socketOpten, maxDriveImageTime, 1, SECONDS);

      if (template == null || template.getImageId() == null) {
         imageId = view.getComputeService().templateBuilder().build().getImage().getId();
      }
View Full Code Here

      super.setupContext();
      imageId = view.getComputeService().templateBuilder().build().getImage().getId();
        
      client = view.utils().injector().getInstance(ElasticStackClient.class);
      driveNotClaimed = retry(Predicates.not(new DriveClaimed(client)), maxDriveImageTime, 1, SECONDS);
      SocketOpen socketOpen = context.utils().injector().getInstance(SocketOpen.class);
      socketTester = retry(socketOpen, maxDriveImageTime, 1, SECONDS);
   }
View Full Code Here

         System.out.format("    Go to http://%s%n", publicAddress);
      }
   }

   private void awaitSsh(String ip) throws TimeoutException {
      SocketOpen socketOpen = computeService.getContext().utils().injector().getInstance(SocketOpen.class);
      Predicate<HostAndPort> socketTester = retry(socketOpen, 300, 5, 5, SECONDS);
      socketTester.apply(HostAndPort.fromParts(ip, 22));
   }
View Full Code Here

   public void setupContext() {
      super.setupContext();
      Injector injector = view.utils().injector();
      client = injector.getInstance(EC2Api.class);
      sshFactory = injector.getInstance(SshClient.Factory.class);
      SocketOpen socketOpen = injector.getInstance(SocketOpen.class);
      socketTester = retry(socketOpen, 120, 1, SECONDS);

      VolumeAvailable volumeAvailable = injector.getInstance(VolumeAvailable.class);
      volumeTester = retry(volumeAvailable, 60, 1, SECONDS);
View Full Code Here

         BlobMetadata metadata = view.getBlobStore().blobMetadata(containerName, "hello");

         assertNotNull(metadata.getPublicUri(), metadata.toString());

         SocketOpen socketOpen = context.utils().injector().getInstance(SocketOpen.class);
         Predicate<HostAndPort> socketTester = retry(socketOpen, 1200, 10, SECONDS);
         assertTrue(socketTester.apply(HostAndPort.fromHost(metadata.getPublicUri().getHost()).withDefaultPort(80)), metadata.getPublicUri().toString());

         assertEquals(Strings2.toStringAndClose(view.utils().http().get(metadata.getPublicUri())), TEST_STRING);
View Full Code Here

      computeContext = builder.buildView(ComputeServiceContext.class);
   }

   protected void buildSocketTester() {
      SocketOpen socketOpen = Guice.createInjector(getSshModule()).getInstance(SocketOpen.class);
      socketTester = retry(socketOpen, 60, 1, SECONDS);
   }
View Full Code Here

         adminClient = globalAdminClient;
      }

      injector = cloudStackContext.utils().injector();
      sshFactory = injector.getInstance(SshClient.Factory.class);
      SocketOpen socketOpen = context.utils().injector().getInstance(SocketOpen.class);
      socketTester = retry(socketOpen, 180, 1, 1, SECONDS);
      injector.injectMembers(socketTester);

      jobComplete = retry(new JobComplete(client), 1200, 1, 5, SECONDS);
      injector.injectMembers(jobComplete);
View Full Code Here

   public void setupContext() {
      super.setupContext();
      Injector injector = view.utils().injector();
      client = injector.getInstance(EC2Api.class);
      sshFactory = injector.getInstance(SshClient.Factory.class);
      SocketOpen socketOpen = injector.getInstance(SocketOpen.class);
      socketTester = retry(socketOpen, 120, 1, SECONDS);

      VolumeAvailable volumeAvailable = injector.getInstance(VolumeAvailable.class);
      volumeTester = retry(volumeAvailable, 60, 1, SECONDS);
View Full Code Here

      Map<String, Credentials> credsMap = api.getServerServices().getServerCredentialsList();
      LoginCredentials instanceCredentials = LoginCredentials.fromCredentials(credsMap.get(createdServer.getName()));
      assertNotNull(instanceCredentials);

      HostAndPort socket = HostAndPort.fromParts(createdServer.getIp().getIp(), 22);
      SocketOpen socketOpen = Guice.createInjector().getInstance(SocketOpen.class);
      Predicate<HostAndPort> socketTester = retry(socketOpen, 180, 5, SECONDS);
      socketTester.apply(socket);

      // check that the get credentials call is the same as this
      assertEquals(api.getServerServices().getServerCredentials(createdServer.getId()), instanceCredentials);
View Full Code Here

TOP

Related Classes of org.jclouds.predicates.SocketOpen

Copyright © 2018 www.massapicom. 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.