public void endElement(String uri, String name, String qName) { if (qName.equals("volumeId")) { if (inAttachmentSet) { volumeId = currentText.toString().trim(); } else { id = currentText.toString().trim(); } } else if (qName.equals("size")) { size = Integer.parseInt(currentText.toString().trim()); } else if (qName.equals("availabilityZone")) { availabilityZone = currentText.toString().trim(); } else if (qName.equals("volumeId")) { if (inAttachmentSet) { volumeId = currentText.toString().trim(); } else { id = currentText.toString().trim(); } } else if (qName.equals("status")) { if (inAttachmentSet) { attachmentStatus = Attachment.Status.fromValue(currentText.toString().trim()); } else { volumeStatus = Volume.Status.fromValue(currentText.toString().trim()); } } else if (qName.equals("createTime")) { createTime = dateService.iso8601DateOrSecondsDateParse(currentText.toString().trim()); } else if (qName.equals("attachmentSet")) { inAttachmentSet = false; } else if (qName.equals("instanceId")) { instanceId = currentText.toString().trim(); } else if (qName.equals("snapshotId")) { snapshotId = currentText.toString().trim(); if (snapshotId.equals("")) snapshotId = null; } else if (qName.equals("device")) { device = currentText.toString().trim(); } else if (qName.equals("attachTime")) { attachTime = dateService.iso8601DateOrSecondsDateParse(currentText.toString().trim()); } else if (qName.equals("volumeType")) { volumeType = currentText.toString().trim(); if (volumeType.equals("")) volumeType = null; } else if (qName.equals("iops")) { iops = Integer.parseInt(currentText.toString().trim()); } else if (qName.equals("encrypted")) { encrypted = Boolean.parseBoolean(currentText.toString().trim()); } else if (qName.equals("item")) { if (inAttachmentSet) { attachments.add( new Attachment(region, volumeId, instanceId, device, attachmentStatus, attachTime)); volumeId = null; instanceId = null; device = null; attachmentStatus = null; attachTime = null; } } currentText.setLength(0); }
public void endElement(String uri, String name, String qName) { if (qName.equals("volumeId")) { if (inAttachmentSet) { volumeId = currentText.toString().trim(); } else { id = currentText.toString().trim(); } } else if (qName.equals("size")) { size = Integer.parseInt(currentText.toString().trim()); } else if (qName.equals("availabilityZone")) { availabilityZone = currentText.toString().trim(); } else if (qName.equals("volumeId")) { if (inAttachmentSet) { volumeId = currentText.toString().trim(); } else { id = currentText.toString().trim(); } } else if (qName.equals("status")) { if (inAttachmentSet) { attachmentStatus = Attachment.Status.fromValue(currentText.toString().trim()); } else { volumeStatus = Volume.Status.fromValue(currentText.toString().trim()); } } else if (qName.equals("createTime")) { createTime = dateCodec.toDate(currentText.toString().trim()); } else if (qName.equals("attachmentSet")) { inAttachmentSet = false; } else if (qName.equals("instanceId")) { instanceId = currentText.toString().trim(); } else if (qName.equals("snapshotId")) { snapshotId = currentText.toString().trim(); if (snapshotId.equals("")) snapshotId = null; } else if (qName.equals("device")) { device = currentText.toString().trim(); } else if (qName.equals("attachTime")) { attachTime = dateCodec.toDate(currentText.toString().trim()); } else if (qName.equals("item")) { if (inAttachmentSet) { attachments.add( new Attachment(region, volumeId, instanceId, device, attachmentStatus, attachTime)); volumeId = null; instanceId = null; device = null; attachmentStatus = null; attachTime = null; } } currentText = new StringBuilder(); }
public void endElement(String uri, String name, String qName) { if (equalsOrSuffix(qName, "item")) { inItem(); itemDepth--; } else if (equalsOrSuffix(qName, "instancesSet")) { inInstancesSet = false; } else if (equalsOrSuffix(qName, "productCodes")) { inProductCodes = false; } else if (equalsOrSuffix(qName, "groupSet")) { inGroupSet = false; } else if (equalsOrSuffix(qName, "groupId")) { groupNames.add(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "ownerId")) { ownerId = currentOrNull(currentText); } else if (equalsOrSuffix(qName, "requesterId")) { requesterId = currentOrNull(currentText); } else if (equalsOrSuffix(qName, "reservationId")) { reservationId = currentOrNull(currentText); } else if (equalsOrSuffix(qName, "amiLaunchIndex")) { builder.amiLaunchIndex(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "dnsName")) { String dnsName = currentOrNull(currentText); // Eucalyptus if (!"0.0.0.0".equals(dnsName)) builder.dnsName(dnsName); } else if (equalsOrSuffix(qName, "imageId")) { builder.imageId(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "instanceId")) { builder.instanceId(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "name")) { String rawState = currentOrNull(currentText); if (rawState != null) { builder.rawState(rawState); builder.instanceState(InstanceState.fromValue(rawState)); } } else if (equalsOrSuffix(qName, "instanceType")) { builder.instanceType(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "ipAddress")) { builder.ipAddress(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "kernelId")) { builder.kernelId(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "keyName")) { builder.keyName(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "launchTime")) { builder.launchTime(dateCodec.toDate(currentOrNull(currentText))); } else if (equalsOrSuffix(qName, "availabilityZone")) { builder.availabilityZone(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "virtualizationType")) { builder.virtualizationType(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "platform")) { builder.platform(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "privateDnsName")) { String privateDnsName = currentOrNull(currentText); // Eucalyptus if (!"0.0.0.0".equals(privateDnsName)) builder.privateDnsName(privateDnsName); } else if (equalsOrSuffix(qName, "privateIpAddress")) { builder.privateIpAddress(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "ramdiskId")) { builder.ramdiskId(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "reason")) { builder.reason(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "rootDeviceType")) { builder.rootDeviceType(RootDeviceType.fromValue(currentOrNull(currentText))); } else if (equalsOrSuffix(qName, "rootDeviceName")) { builder.rootDeviceName(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "deviceName")) { deviceName = currentOrNull(currentText); } else if (equalsOrSuffix(qName, "volumeId")) { volumeId = currentOrNull(currentText); } else if (equalsOrSuffix(qName, "status")) { attachmentStatus = Attachment.Status.fromValue(currentText.toString().trim()); } else if (equalsOrSuffix(qName, "attachTime")) { attachTime = dateCodec.toDate(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "deleteOnTermination")) { deleteOnTermination = Boolean.parseBoolean(currentText.toString().trim()); } else if (equalsOrSuffix(qName, "ebs")) { builder.device( deviceName, new BlockDevice(volumeId, attachmentStatus, attachTime, deleteOnTermination)); this.deviceName = null; this.volumeId = null; this.attachmentStatus = null; this.attachTime = null; this.deleteOnTermination = true; } currentText = new StringBuilder(); }
public void endElement(String uri, String name, String qName) { if (equalsOrSuffix(qName, "item")) { inItem(); itemDepth--; } else if (equalsOrSuffix(qName, "state")) { builder.monitoringState(MonitoringState.fromValue(currentOrNull(currentText))); } else if (equalsOrSuffix(qName, "groupId")) { groupId = currentOrNull(currentText); } else if (equalsOrSuffix(qName, "groupName") && inPlacement) { builder.placementGroup(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "groupName")) { switch (itemDepth) { case 2: reservationGroupIdToNames.put(groupId, currentOrNull(currentText)); break; case 3: builder.securityGroupIdToName(groupId, currentOrNull(currentText)); break; } groupId = null; } else if (equalsOrSuffix(qName, "subnetId")) { builder.subnetId(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "spotInstanceRequestId")) { builder.spotInstanceRequestId(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "vpcId")) { builder.vpcId(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "hypervisor")) { builder.hypervisor(Hypervisor.fromValue(currentOrNull(currentText))); } else if (equalsOrSuffix(qName, "productCode")) { builder.productCode(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "instancesSet")) { inInstancesSet = false; } else if (equalsOrSuffix(qName, "placement")) { inPlacement = false; } else if (equalsOrSuffix(qName, "ownerId")) { ownerId = currentOrNull(currentText); } else if (equalsOrSuffix(qName, "requesterId")) { requesterId = currentOrNull(currentText); } else if (equalsOrSuffix(qName, "reservationId")) { reservationId = currentOrNull(currentText); } else if (equalsOrSuffix(qName, "amiLaunchIndex")) { builder.amiLaunchIndex(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "dnsName")) { builder.dnsName(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "imageId")) { builder.imageId(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "instanceId")) { builder.instanceId(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "name")) { builder.instanceState(InstanceState.fromValue(currentOrNull(currentText))); } else if (equalsOrSuffix(qName, "instanceType")) { builder.instanceType(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "ipAddress")) { builder.ipAddress(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "kernelId")) { builder.kernelId(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "keyName")) { builder.keyName(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "launchTime")) { builder.launchTime(parseDate()); } else if (equalsOrSuffix(qName, "availabilityZone")) { builder.availabilityZone(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "virtualizationType")) { builder.virtualizationType(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "platform")) { builder.platform(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "privateDnsName")) { builder.privateDnsName(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "privateIpAddress")) { builder.privateIpAddress(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "ramdiskId")) { builder.ramdiskId(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "reason")) { builder.reason(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "rootDeviceType")) { builder.rootDeviceType(RootDeviceType.fromValue(currentOrNull(currentText))); } else if (equalsOrSuffix(qName, "rootDeviceName")) { builder.rootDeviceName(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "deviceName")) { deviceName = currentOrNull(currentText); } else if (equalsOrSuffix(qName, "volumeId")) { volumeId = currentOrNull(currentText); } else if (equalsOrSuffix(qName, "status")) { attachmentStatus = Attachment.Status.fromValue(currentText.toString().trim()); } else if (equalsOrSuffix(qName, "attachTime")) { attachTime = dateService.iso8601DateParse(currentText.toString().trim()); } else if (equalsOrSuffix(qName, "deleteOnTermination")) { deleteOnTermination = Boolean.parseBoolean(currentText.toString().trim()); } else if (equalsOrSuffix(qName, "ebs")) { builder.device( deviceName, new BlockDevice(volumeId, attachmentStatus, attachTime, deleteOnTermination)); this.deviceName = null; this.volumeId = null; this.attachmentStatus = null; this.attachTime = null; this.deleteOnTermination = true; } currentText = new StringBuilder(); }