public void destroyVmOnKvmSuccess(final KVMHostInventory host, final VmInstanceInventory vm) { CollectionUtils.safeForEach(destroyVmExts, new ForEachFunction<KVMDestroyVmExtensionPoint>() { @Override public void run(KVMDestroyVmExtensionPoint arg) { arg.destroyVmOnKvmSuccess(host, vm); } }); }
public void addOn(final KVMHostInventory host, final VmInstanceSpec spec, final StartVmCmd cmd) { CollectionUtils.safeForEach(addonsExts, new ForEachFunction<KVMStartVmAddonExtensionPoint>() { @Override public void run(KVMStartVmAddonExtensionPoint extp) { if (spec.getVmInventory().getType().equals(extp.getVmTypeForAddonExtension().toString())) { extp.addAddon(host, spec, cmd); } } }); }
public void beforeDelete(final L2NetworkInventory inv) { CollectionUtils.safeForEach(extensions, new ForEachFunction<L2NetworkDeleteExtensionPoint>() { @Override public void run(L2NetworkDeleteExtensionPoint arg) { arg.beforeDeleteL2Network(inv); } }); }
void afterDelete(final ClusterInventory cinv) { CollectionUtils.safeForEach(deleteExts, new ForEachFunction<ClusterDeleteExtensionPoint>() { @Override public void run(ClusterDeleteExtensionPoint arg) { arg.afterDeleteCluster(cinv); } }); }
public void handleSystemTag(String vmUuid, List<String> tags){ CollectionUtils.safeForEach(VmInstanceBeforeStartExtensions, new ForEachFunction<VmInstanceBeforeStartExtensionPoint>() { @Override public void run(VmInstanceBeforeStartExtensionPoint arg) { arg.handleSystemTag(vmUuid, tags); } }); }
public void beforeRebootVm(final VmInstanceInventory inv) { CollectionUtils.safeForEach(rebootVmExtensions, new ForEachFunction<VmInstanceRebootExtensionPoint>() { @Override public void run(VmInstanceRebootExtensionPoint arg) { arg.beforeRebootVm(inv); } }); }
public void failedToRebootVm(final VmInstanceInventory inv, final ErrorCode reason) { CollectionUtils.safeForEach(rebootVmExtensions, new ForEachFunction<VmInstanceRebootExtensionPoint>() { @Override public void run(VmInstanceRebootExtensionPoint arg) { arg.failedToRebootVm(inv, reason); } }); }
public void afterDelete(final L3NetworkInventory inv) { CollectionUtils.safeForEach(extensions, new ForEachFunction<L3NetworkDeleteExtensionPoint>() { @Override public void run(L3NetworkDeleteExtensionPoint arg) { arg.afterDeleteL3Network(inv); } }); }
public void destroyVmOnKvmFailed(final KVMHostInventory host, final VmInstanceInventory vm, final ErrorCode err) { CollectionUtils.safeForEach(destroyVmExts, new ForEachFunction<KVMDestroyVmExtensionPoint>() { @Override public void run(KVMDestroyVmExtensionPoint arg) { arg.destroyVmOnKvmFailed(host, vm, err); } }); }
void beforeDelete(final ZoneInventory zinv) { CollectionUtils.safeForEach(delExts, new ForEachFunction<ZoneDeleteExtensionPoint>() { @Override public void run(ZoneDeleteExtensionPoint arg) { arg.beforeDeleteZone(zinv); } }); }
void afterDelete(final ZoneInventory zinv) { CollectionUtils.safeForEach(delExts, new ForEachFunction<ZoneDeleteExtensionPoint>() { @Override public void run(ZoneDeleteExtensionPoint arg) { arg.afterDeleteZone(zinv); } }); }
public void beforeStartNewCreatedVm(final VmInstanceInventory inv) { CollectionUtils.safeForEach(startNewCreatedVmExtensions, new ForEachFunction<VmInstanceStartNewCreatedVmExtensionPoint>() { @Override public void run(VmInstanceStartNewCreatedVmExtensionPoint arg) { arg.beforeStartNewCreatedVm(inv); } }); }
public void afterStartVm(final VmInstanceInventory inv) { CollectionUtils.safeForEach(startVmExtensions, new ForEachFunction<VmInstanceStartExtensionPoint>() { @Override public void run(VmInstanceStartExtensionPoint arg) { arg.afterStartVm(inv); } }); }
public void beforeDetachVolume(final VmInstanceInventory vm, final VolumeInventory volume) { CollectionUtils.safeForEach(detachVolumeExtensions, new ForEachFunction<VmDetachVolumeExtensionPoint>() { @Override public void run(VmDetachVolumeExtensionPoint arg) { arg.beforeDetachVolume(vm, volume); } }); }
@Override public void iJoin(ManagementNodeInventory inv) { ManagementNodeChangeListener l = (ManagementNodeChangeListener) destinationMaker; l.iJoin(inv); CollectionUtils.safeForEach(lifeCycleExtension, new ForEachFunction<ManagementNodeChangeListener>() { @Override public void run(ManagementNodeChangeListener arg) { arg.iJoin(inv); } }); } };
void afterChange(ClusterVO vo, final ClusterStateEvent event, final ClusterState prevState) { final ClusterInventory cinv = ClusterInventory.valueOf(vo); CollectionUtils.safeForEach(changeExts, new ForEachFunction<ClusterChangeStateExtensionPoint>() { @Override public void run(ClusterChangeStateExtensionPoint extp) { extp.afterChangeClusterState(cinv, event, prevState); } }); }
void afterDetach(BackupStorageVO vo, final String zoneUuid) { final BackupStorageInventory inv = BackupStorageInventory.valueOf(vo); CollectionUtils.safeForEach(detachExts, new ForEachFunction<BackupStorageDetachExtensionPoint>() { @Override public void run(BackupStorageDetachExtensionPoint arg) { arg.afterDetachBackupStorage(inv, zoneUuid); } }); }
public void beforeChange(HostVO vo, final HostStateEvent event) { final HostInventory hinv = HostInventory.valueOf(vo); final HostState next = vo.getState().nextState(event); CollectionUtils.safeForEach(changeStateExts, new ForEachFunction<HostChangeStateExtensionPoint>() { @Override public void run(HostChangeStateExtensionPoint extp) { extp.beforeChangeHostState(hinv, event, next); } }); }
void beforeChange(ClusterVO vo, final ClusterStateEvent event) { final ClusterInventory cinv = ClusterInventory.valueOf(vo); final ClusterState next = AbstractCluster.getNextState(vo.getState(), event); CollectionUtils.safeForEach(changeExts, new ForEachFunction<ClusterChangeStateExtensionPoint>() { @Override public void run(ClusterChangeStateExtensionPoint extp) { extp.beforeChangeClusterState(cinv, event, next); } }); }
@Override public void success() { self.setAllocatorStrategy(inv.getAllocatorStrategy()); self.setInstanceOfferingUuid(msg.getInstanceOfferingUuid()); self = dbf.updateAndRefresh(self); CollectionUtils.safeForEach(exts, ext -> ext.afterChangeInstanceOffering(vm, inv)); completion.success(); }