public static APIUpdateVolumeSnapshotMsg __example__() { APIUpdateVolumeSnapshotMsg msg = new APIUpdateVolumeSnapshotMsg(); msg.setUuid(uuid()); msg.setName("My Snapshot"); return msg; }
private void handle(APIUpdateVolumeSnapshotMsg msg) { VolumeSnapshotVO self = dbf.findByUuid(msg.getUuid(), VolumeSnapshotVO.class); boolean update = false; if (msg.getName() != null) { self.setName(msg.getName()); update = true; } if (msg.getDescription() != null) { self.setDescription(msg.getDescription()); update = true; } if (update) { self = dbf.updateAndRefresh(self); } APIUpdateVolumeSnapshotEvent evt = new APIUpdateVolumeSnapshotEvent(msg.getId()); evt.setInventory(VolumeSnapshotInventory.valueOf(self)); bus.publish(evt); }