private File fillFile(Node node, File file) throws SystemException { fillBitBunkerObject(node, file); file.setInCache(Boolean.parseBoolean(Utils.findNodeText(Utils.findChild(node, "is_in_cache")))); file.setReceived( Boolean.parseBoolean(Utils.findNodeText(Utils.findChild(node, "is_received")))); file.setStatus(Utils.findNodeText(Utils.findChild(node, "status"))); fillDurability(file, Utils.findNodeText(Utils.findChild(node, "durability"))); file.setCreated(UTCDateFormat.tryParse(Utils.findNodeText(Utils.findChild(node, "created")))); return file; }
public FileInstance createFileInstance(Node node) { FileInstance instance = new FileInstance(); instance.setVolume(Utils.findNodeText(Utils.findChild(node, "volume"))); instance.setRecord( Integer.valueOf(Utils.findNodeText(Utils.findChild(node, "record"))).intValue()); instance.setLength( Float.valueOf(Utils.findNodeText(Utils.findChild(node, "length"))).floatValue()); instance.setCreated( UTCDateFormat.tryParse(Utils.findNodeText(Utils.findChild(node, "created")))); instance.setClient(getClient()); return instance; }
public FileProperties createFileProperties(Node node) throws SystemException { FileProperties properties = (FileProperties) fillFile(node, new FileProperties()); properties.setClient(this.getClient()); properties.setReceivedDate( UTCDateFormat.tryParse(Utils.findNodeText(Utils.findChild(node, "received")))); properties.setChecksum(Utils.findNodeText(Utils.findChild(node, "checksum"))); properties.setKey(Utils.findNodeText(Utils.findChild(node, "key"))); properties.setAchievedDurability( Integer.valueOf(Utils.findNodeText(Utils.findChild(node, "achieved_durability"))) .intValue()); properties.setRequestedDurability( Integer.valueOf(Utils.findNodeText(Utils.findChild(node, "requested_durability"))) .intValue()); NodeList instanceNodes = Utils.findChild(node, "instances").getChildNodes(); for (int i = 0; i < instanceNodes.getLength(); i++) { if (instanceNodes.item(i).getNodeType() == Node.ELEMENT_NODE) { properties.getFileInstances().add(createFileInstance(instanceNodes.item(i))); } } return properties; }