Пример #1
0
 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);
 }
Пример #2
0
 protected VolumeInventory getSelfInventory() {
   return VolumeInventory.valueOf(self);
 }