public int compareTo(InstanceStateChange o) { return (this == o) ? 0 : getInstanceId().compareTo(o.getInstanceId()); }
public void endElement(String uri, String name, String qName) { if (qName.equals("instanceId")) { this.instanceId = currentOrNull(); } else if (qName.equals("shutdownState") || qName.equals("currentState")) { inCurrentState = false; } else if (qName.equals("previousState")) { inPreviousState = false; } else if (qName.equals("name")) { if (inCurrentState) { shutdownState = InstanceState.fromValue(currentOrNull()); } else if (inPreviousState) { previousState = InstanceState.fromValue(currentOrNull()); } } else if (qName.equals("item")) { String region = AWSUtils.findRegionInArgsOrNull(getRequest()); if (region == null) region = defaultRegion.get(); instances.add(new InstanceStateChange(region, instanceId, shutdownState, previousState)); this.instanceId = null; this.shutdownState = null; this.previousState = null; } currentText.setLength(0); }
public void endElement(String uri, String name, String qName) { if (qName.equals("instanceId")) { this.instanceId = currentOrNull(); } else if (qName.equals("shutdownState") || qName.equals("currentState")) { inCurrentState = false; } else if (qName.equals("previousState")) { inPreviousState = false; } else if (qName.equals("name")) { if (inCurrentState) { shutdownState = InstanceState.fromValue(currentOrNull()); } else if (inPreviousState) { previousState = InstanceState.fromValue(currentOrNull()); } } else if (qName.equals("item")) { String region = AWSUtils.findRegionInArgsOrNull(getRequest()); if (region == null) region = defaultRegion.get(); instances.add(new InstanceStateChange(region, instanceId, shutdownState, previousState)); this.instanceId = null; this.shutdownState = null; this.previousState = null; } currentText = new StringBuilder(); }
public void endElement(String uri, String name, String qName) { if (qName.equals("instanceId")) { this.instanceId = currentOrNull(); } else if (qName.equals("shutdownState") || qName.equals("currentState")) { inCurrentState = false; } else if (qName.equals("previousState")) { inPreviousState = false; } else if (qName.equals("name")) { if (inCurrentState) { shutdownState = InstanceState.fromValue(currentOrNull()); } else if (inPreviousState) { previousState = InstanceState.fromValue(currentOrNull()); } } else if (qName.equals("item")) { String region = AWSUtils.findRegionInArgsOrNull(getRequest()); if (region == null) region = defaultRegion.get(); instances.add(new InstanceStateChange(region, instanceId, shutdownState, previousState)); this.instanceId = null; this.shutdownState = null; this.previousState = null; } currentText = new StringBuilder(); }
public int compareTo(InstanceStateChange o) { return (this == o) ? 0 : getInstanceId().compareTo(o.getInstanceId()); }
public void endElement(String uri, String name, String qName) { if (qName.equals("instanceId")) { this.instanceId = currentOrNull(); } else if (qName.equals("shutdownState") || qName.equals("currentState")) { inCurrentState = false; } else if (qName.equals("previousState")) { inPreviousState = false; } else if (qName.equals("name")) { if (inCurrentState) { shutdownState = InstanceState.fromValue(currentOrNull()); } else if (inPreviousState) { previousState = InstanceState.fromValue(currentOrNull()); } } else if (qName.equals("item")) { String region = AWSUtils.findRegionInArgsOrNull(getRequest()); if (region == null) region = defaultRegion.get(); instances.add(new InstanceStateChange(region, instanceId, shutdownState, previousState)); this.instanceId = null; this.shutdownState = null; this.previousState = null; } currentText.setLength(0); }
public int compareTo(InstanceStateChange o) { return (this == o) ? 0 : getInstanceId().compareTo(o.getInstanceId()); }
public void endElement(String uri, String name, String qName) { if (qName.equals("instanceId")) { this.instanceId = currentOrNull(); } else if (qName.equals("shutdownState") || qName.equals("currentState")) { inCurrentState = false; } else if (qName.equals("previousState")) { inPreviousState = false; } else if (qName.equals("name")) { if (inCurrentState) { shutdownState = InstanceState.fromValue(currentOrNull()); } else if (inPreviousState) { previousState = InstanceState.fromValue(currentOrNull()); } } else if (qName.equals("item")) { String region = AWSUtils.findRegionInArgsOrNull(getRequest()); if (region == null) region = defaultRegion.get(); instances.add(new InstanceStateChange(region, instanceId, shutdownState, previousState)); this.instanceId = null; this.shutdownState = null; this.previousState = null; } currentText.setLength(0); }
public int compareTo(InstanceStateChange o) { return (this == o) ? 0 : getInstanceId().compareTo(o.getInstanceId()); }
public void testStop() { InputStream is = getClass().getResourceAsStream("/stop_instances.xml"); Set<InstanceStateChange> expected = ImmutableSet.of(new InstanceStateChange(defaultRegion, "i-10a64379", InstanceState.STOPPING, InstanceState.RUNNING)); InstanceStateChangeHandler handler = injector.getInstance(InstanceStateChangeHandler.class); addDefaultRegionToHandler(handler); Set<InstanceStateChange> result = factory.create(handler).parse(is); assertEquals(result, expected); }
public int compareTo(InstanceStateChange o) { return (this == o) ? 0 : getInstanceId().compareTo(o.getInstanceId()); }
public void testStop() { InputStream is = getClass().getResourceAsStream("/stop_instances.xml"); Set<InstanceStateChange> expected = ImmutableSet.of(new InstanceStateChange(defaultRegion, "i-10a64379", InstanceState.STOPPING, InstanceState.RUNNING)); InstanceStateChangeHandler handler = injector.getInstance(InstanceStateChangeHandler.class); addDefaultRegionToHandler(handler); Set<InstanceStateChange> result = factory.create(handler).parse(is); assertEquals(result, expected); }
public void testStart() { InputStream is = getClass().getResourceAsStream("/start_instances.xml"); Set<InstanceStateChange> expected = ImmutableSet.of(new InstanceStateChange(defaultRegion, "i-10a64379", InstanceState.PENDING, InstanceState.STOPPED)); InstanceStateChangeHandler handler = injector.getInstance(InstanceStateChangeHandler.class); addDefaultRegionToHandler(handler); Set<InstanceStateChange> result = factory.create(handler).parse(is); assertEquals(result, expected); }
public void testTerminate() { InputStream is = getClass().getResourceAsStream("/terminate_instances.xml"); Set<InstanceStateChange> expected = ImmutableSet.of(new InstanceStateChange(defaultRegion, "i-3ea74257", InstanceState.SHUTTING_DOWN, InstanceState.RUNNING)); InstanceStateChangeHandler handler = injector.getInstance(InstanceStateChangeHandler.class); addDefaultRegionToHandler(handler); Set<InstanceStateChange> result = factory.create(handler).parse(is); assertEquals(result, expected); }
public void testStart() { InputStream is = getClass().getResourceAsStream("/start_instances.xml"); Set<InstanceStateChange> expected = ImmutableSet.of(new InstanceStateChange(defaultRegion, "i-10a64379", InstanceState.PENDING, InstanceState.STOPPED)); InstanceStateChangeHandler handler = injector.getInstance(InstanceStateChangeHandler.class); addDefaultRegionToHandler(handler); Set<InstanceStateChange> result = factory.create(handler).parse(is); assertEquals(result, expected); }
public void testTerminate() { InputStream is = getClass().getResourceAsStream("/terminate_instances.xml"); Set<InstanceStateChange> expected = ImmutableSet.of(new InstanceStateChange(defaultRegion, "i-3ea74257", InstanceState.SHUTTING_DOWN, InstanceState.RUNNING)); InstanceStateChangeHandler handler = injector.getInstance(InstanceStateChangeHandler.class); addDefaultRegionToHandler(handler); Set<InstanceStateChange> result = factory.create(handler).parse(is); assertEquals(result, expected); }