Package org.jclouds.gogrid.domain

Examples of org.jclouds.gogrid.domain.Job


   @Override
   public boolean apply(Server server) {
      checkNotNull(server, "Server must be a valid instance");
      checkNotNull(server.getName(), "Server must be a valid name");
      Job latestJob = Iterables.getOnlyElement(jobClient.getJobList(latestJobForObjectByName(server.getName())));
      return JobState.SUCCEEDED.equals(latestJob.getCurrentState());
   }
View Full Code Here


   @Override
   public boolean apply(LoadBalancer loadBalancer) {
      checkNotNull(loadBalancer, "Load balancer must be a valid instance");
      checkNotNull(loadBalancer.getName(), "Load balancer must be a valid name");
      Job latestJob = Iterables.getOnlyElement(jobClient.getJobList(latestJobForObjectByName(loadBalancer.getName())));
      return JobState.SUCCEEDED.equals(latestJob.getCurrentState());
   }
View Full Code Here

   public void testPredicate() {
      final String serverName = "SERVER_NAME";
      Server server = createMock(Server.class);
      expect(server.getName()).andStubReturn(serverName);

      Job job = createMock(Job.class);
      expect(job.getCurrentState()).andReturn(JobState.SUCCEEDED);

      GridJobClient client = createMock(GridJobClient.class);
      expect(client.getJobList(latestJobForObjectByName(serverName))).andReturn(ImmutableSet.<Job> of(job));

      replay(job);
View Full Code Here

   @Override
   public boolean apply(Server server) {
      checkNotNull(server, "Server must be a valid instance");
      checkNotNull(server.getName(), "Server must be a valid name");
      Job latestJob = Iterables.getOnlyElement(jobClient.getJobList(latestJobForObjectByName(server.getName())));
      return JobState.SUCCEEDED.equals(latestJob.getCurrentState());
   }
View Full Code Here

      assert response.size() <= 10 : response;
      for (Job job : response) {
         assert job.getId() >= 0 : job;
         checkJob(job);

         Job query = Iterables.getOnlyElement(api.getJobServices().getJobsById(job.getId()));
         assertEquals(query.getId(), job.getId());

         checkJob(query);
      }
   }
View Full Code Here

      // restart the server
      api.getServerServices().power(nameOfServer, PowerCommand.RESTART);

      Set<Job> jobs = api.getJobServices().getJobsForObjectName(nameOfServer);

      Job latestJob = Iterables.getLast(jobs);
      Long latestJobId = latestJob.getId();

      Job latestJobFetched = Iterables.getOnlyElement(api.getJobServices().getJobsById(latestJobId));

      assert latestJob.equals(latestJobFetched) : "Job and its representation found by ID don't match";

      long[] idsOfAllJobs = new long[jobs.size()];
      int i = 0;
View Full Code Here

            "image", "GSI-f8979644-e646-4711-ad58-d98a5fa3612c",
            "ip", "204.51.240.189",
            "name", "ServerCreated40562",
            "type", "virtual_server");

      Job job = Job.builder().id(250628L).command(Option.createWithIdNameAndDescription(7L, "DeleteVirtualServer", "Delete Virtual Server"))
            .objectType(ObjectType.VIRTUAL_SERVER).createdOn(new Date(1267404528895L)).lastUpdatedOn(new Date(1267404538592L))
            .currentState(JobState.SUCCEEDED).attempts(1).owner("3116784158f0af2d-24076@api.gogrid.com").history(
                  JobProperties.builder().id(940263L).updatedOn(new Date(1267404528897L)).state(JobState.CREATED).build(),
                  JobProperties.builder().id(940264L).updatedOn(new Date(1267404528967L)).state(JobState.QUEUED).build())
            .details(details).build();
View Full Code Here

   @Override
   public boolean apply(LoadBalancer loadBalancer) {
      checkNotNull(loadBalancer, "Load balancer must be a valid instance");
      checkNotNull(loadBalancer.getName(), "Load balancer must be a valid name");
      Job latestJob = Iterables.getOnlyElement(jobClient.getJobList(latestJobForObjectByName(loadBalancer.getName())));
      return JobState.SUCCEEDED.equals(latestJob.getCurrentState());
   }
View Full Code Here

   @Override
   public boolean apply(Server server) {
      checkNotNull(server, "Server must be a valid instance");
      checkNotNull(server.getName(), "Server must be a valid name");
      Job latestJob = Iterables.getOnlyElement(jobClient.getJobList(latestJobForObjectByName(server.getName())));
      return JobState.SUCCEEDED.equals(latestJob.getCurrentState());
   }
View Full Code Here

      assert response.size() <= 10 : response;
      for (Job job : response) {
         assert job.getId() >= 0 : job;
         checkJob(job);

         Job query = Iterables.getOnlyElement(api.getJobServices().getJobsById(job.getId()));
         assertEquals(query.getId(), job.getId());

         checkJob(query);
      }
   }
View Full Code Here

TOP

Related Classes of org.jclouds.gogrid.domain.Job

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.