public boolean apply(RunningInstance input) { return input.getKeyName().equals(keyName) && input.getInstanceState() != InstanceState.TERMINATED; }
@Override public boolean apply(RunningInstance input) { switch (input.getInstanceState()) { case TERMINATED: case SHUTTING_DOWN: return false; } return keyPair.getKeyName().equals(input.getKeyName()); } };
@Override public boolean apply(RunningInstance input) { switch (input.getInstanceState()) { case TERMINATED: case SHUTTING_DOWN: return false; } return keyPair.getKeyName().equals(input.getKeyName()); } };
public boolean apply(RunningInstance instance) { logger.trace("looking for state on instance %s", instance); try { instance = refresh(instance); logger.trace("%s: looking for instance state %s: currently: %s", instance.getId(), InstanceState.RUNNING, instance .getInstanceState()); return instance.getInstanceState() == InstanceState.RUNNING; } catch (ResourceNotFoundException e) { return false; } }
public boolean apply(RunningInstance instance) { logger.trace("looking for state on instance %s", instance); instance = refresh(instance); logger.trace("%s: looking for instance state %s: currently: %s", instance.getId(), InstanceState.STOPPED, instance.getInstanceState()); return instance.getInstanceState() == InstanceState.STOPPED; }
public boolean apply(RunningInstance instance) { logger.trace("looking for state on instance %s", instance); instance = refresh(instance); logger.trace("%s: looking for instance state %s: currently: %s", instance.getId(), InstanceState.STOPPED, instance.getInstanceState()); return instance.getInstanceState() == InstanceState.STOPPED; }
public boolean apply(RunningInstance instance) { logger.trace("looking for state on instance %s", instance); instance = refresh(instance); logger.trace("%s: looking for instance state %s: currently: %s", instance.getId(), InstanceState.STOPPED, instance.getInstanceState()); return instance.getInstanceState() == InstanceState.STOPPED; }
public boolean apply(RunningInstance instance) { logger.trace("looking for state on instance %s", instance); try { instance = refresh(instance); } catch (NoSuchElementException e) { return true; } logger.trace("%s: looking for instance state %s: currently: %s", instance.getId(), InstanceState.TERMINATED, instance.getInstanceState()); return instance.getInstanceState() == InstanceState.TERMINATED; }
public boolean apply(RunningInstance instance) { logger.trace("looking for state on instance %s", instance); instance = refresh(instance); logger.trace("%s: looking for instance state %s: currently: %s", instance.getId(), InstanceState.STOPPED, instance.getInstanceState()); return instance.getInstanceState() == InstanceState.STOPPED; }
public boolean apply(RunningInstance instance) { logger.trace("looking for state on instance %s", instance); try { instance = refresh(instance); } catch (NoSuchElementException e) { return true; } logger.trace("%s: looking for instance state %s: currently: %s", instance.getId(), InstanceState.TERMINATED, instance.getInstanceState()); return instance.getInstanceState() == InstanceState.TERMINATED; }
public boolean apply(RunningInstance instance) { logger.trace("looking for state on instance %s", instance); try { instance = refresh(instance); logger.trace("%s: looking for instance state %s: currently: %s", instance.getId(), InstanceState.RUNNING, instance .getInstanceState()); return instance.getInstanceState() == InstanceState.RUNNING; } catch (ResourceNotFoundException e) { return false; } }
public boolean apply(RunningInstance instance) { logger.trace("looking for state on instance %s", instance); try { instance = refresh(instance); logger.trace("%s: looking for instance state %s: currently: %s", instance.getId(), InstanceState.RUNNING, instance .getInstanceState()); return instance.getInstanceState() == InstanceState.RUNNING; } catch (ResourceNotFoundException e) { return false; } }
public boolean apply(RunningInstance instance) { logger.trace("looking for state on instance %s", instance); instance = refresh(instance); logger.trace("%s: looking for instance state %s: currently: %s", instance.getId(), InstanceState.STOPPED, instance.getInstanceState()); return instance.getInstanceState() == InstanceState.STOPPED; }
public boolean apply(RunningInstance instance) { logger.trace("looking for state on instance %s", instance); try { instance = refresh(instance); } catch (NoSuchElementException e) { return true; } logger.trace("%s: looking for instance state %s: currently: %s", instance.getId(), InstanceState.TERMINATED, instance.getInstanceState()); return instance.getInstanceState() == InstanceState.TERMINATED; }
public boolean apply(RunningInstance instance) { logger.trace("looking for state on instance %s", instance); try { instance = refresh(instance); } catch (NoSuchElementException e) { return true; } logger.trace("%s: looking for instance state %s: currently: %s", instance.getId(), InstanceState.TERMINATED, instance.getInstanceState()); return instance.getInstanceState() == InstanceState.TERMINATED; }
public boolean apply(RunningInstance instance) { logger.trace("looking for state on instance %s", instance); try { instance = refresh(instance); logger.trace("%s: looking for instance state %s: currently: %s", instance.getId(), InstanceState.RUNNING, instance .getInstanceState()); return instance.getInstanceState() == InstanceState.RUNNING; } catch (ResourceNotFoundException e) { return false; } }
public boolean apply(RunningInstance instance) { logger.trace("looking for state on instance %s", instance); try { instance = refresh(instance); } catch (NoSuchElementException e) { return true; } logger.trace("%s: looking for instance state %s: currently: %s", instance.getId(), InstanceState.TERMINATED, instance.getInstanceState()); return instance.getInstanceState() == InstanceState.TERMINATED; }
public boolean apply(RunningInstance instance) { logger.trace("looking for state on instance %s", instance); try { instance = refresh(instance); logger.trace("%s: looking for instance state %s: currently: %s", instance.getId(), InstanceState.RUNNING, instance .getInstanceState()); return instance.getInstanceState() == InstanceState.RUNNING; } catch (ResourceNotFoundException e) { return false; } }
public void testWhenRunning() throws UnknownHostException { Set<Reservation<RunningInstance>> contents = ImmutableSet.of(new Reservation<RunningInstance>(defaultRegion, ImmutableSet.of("adriancole.ec2ingress"), ImmutableSet.of(RunningInstance.builder().region( defaultRegion).groupName("adriancole.ec2ingress").amiLaunchIndex("0").dnsName( "ec2-174-129-81-68.compute-1.amazonaws.com").imageId("ami-82e4b5c7").instanceId("i-0799056f") .instanceState(InstanceState.RUNNING).rawState("running").instanceType(InstanceType.M1_SMALL) .ipAddress("174.129.81.68").kernelId("aki-a71cf9ce").keyName("adriancole.ec21").launchTime( dateService.iso8601DateParse("2009-11-09T03:00:34.000Z")) // MonitoringState.DISABLED, .availabilityZone("us-east-1c").virtualizationType("paravirtual").privateDnsName( "ip-10-243-42-70.ec2.internal").privateIpAddress("10.243.42.70").ramdiskId( "ari-a51cf9cc").rootDeviceType(RootDeviceType.INSTANCE_STORE).build()), "993194456877", null, "r-a3c508cb")); Set<Reservation<? extends RunningInstance>> result = parseRunningInstances("/describe_instances_running.xml"); assertEquals(result.toString(), contents.toString()); assertEquals(get(get(result, 0), 0).getInstanceState(), InstanceState.RUNNING); assertEquals(get(get(result, 0), 0).getRawState(), "running"); }
public void testWhenRunning() throws UnknownHostException { Set<Reservation<RunningInstance>> contents = ImmutableSet.of(new Reservation<RunningInstance>(defaultRegion, ImmutableSet.of("adriancole.ec2ingress"), ImmutableSet.of(RunningInstance.builder().region( defaultRegion).groupName("adriancole.ec2ingress").amiLaunchIndex("0").dnsName( "ec2-174-129-81-68.compute-1.amazonaws.com").imageId("ami-82e4b5c7").instanceId("i-0799056f") .instanceState(InstanceState.RUNNING).rawState("running").instanceType(InstanceType.M1_SMALL) .ipAddress("174.129.81.68").kernelId("aki-a71cf9ce").keyName("adriancole.ec21").launchTime( dateService.iso8601DateOrSecondsDateParse("2009-11-09T03:00:34.000Z")) // MonitoringState.DISABLED, .availabilityZone("us-east-1c").virtualizationType("paravirtual").privateDnsName( "ip-10-243-42-70.ec2.internal").privateIpAddress("10.243.42.70").ramdiskId( "ari-a51cf9cc").rootDeviceType(RootDeviceType.INSTANCE_STORE).build()), "993194456877", null, "r-a3c508cb")); Set<Reservation<? extends RunningInstance>> result = parseRunningInstances("/describe_instances_running.xml"); assertEquals(result.toString(), contents.toString()); assertEquals(get(get(result, 0), 0).getInstanceState(), InstanceState.RUNNING); assertEquals(get(get(result, 0), 0).getRawState(), "running"); }