private void handle(APIChangeVolumeStateMsg msg) { VolumeStateEvent sevt = VolumeStateEvent.valueOf(msg.getStateEvent()); if (sevt == VolumeStateEvent.enable) { self.setState(VolumeState.Enabled); } else { self.setState(VolumeState.Disabled); } self = dbf.updateAndRefresh(self); VolumeInventory inv = VolumeInventory.valueOf(self); APIChangeVolumeStateEvent evt = new APIChangeVolumeStateEvent(msg.getId()); evt.setInventory(inv); bus.publish(evt); }
protected VolumeInventory getSelfInventory() { return VolumeInventory.valueOf(self); }