Ejemplo n.º 1
0
 static void fireUsageEvent(final Volume volume, final EventActionInfo<VolumeAction> actionInfo) {
   try {
     ListenerRegistry.getInstance()
         .fireEvent(
             VolumeEvent.with(
                 actionInfo,
                 volume.getNaturalId(),
                 volume.getDisplayName(),
                 volume.getSize(),
                 volume.getOwner(),
                 volume.getPartition()));
   } catch (final Throwable e) {
     LOG.error(
         "Error creating/inserting reporting event "
             + (actionInfo == null ? "null" : actionInfo.getAction().toString())
             + " for volume "
             + (volume == null ? "null" : volume.getDisplayName()),
         e);
   }
 }
Ejemplo n.º 2
0
 public static void annihilateStorageVolume(Volume volume) {
   volume.setState(State.ANNIHILATING);
   fireUsageEvent(volume, VolumeEvent.forVolumeDelete());
 }