public void preChange(HostVO vo, HostStateEvent event) throws HostException { HostState next = vo.getState().nextState(event); HostInventory hinv = HostInventory.valueOf(vo); for (HostChangeStateExtensionPoint extp : changeStateExts) { extp.preChangeHostState(hinv, event, next); } }
public static APIReconnectHostEvent __example__() { APIReconnectHostEvent event = new APIReconnectHostEvent(); HostInventory hi = new HostInventory(); hi.setName("example"); hi.setClusterUuid(uuid()); hi.setManagementIp("192.168.0.1"); hi.setAvailableCpuCapacity(100000L); hi.setAvailableMemoryCapacity(100000L); return event; }
public static APIChangeHostStateMsg __example__() { APIChangeHostStateMsg msg = new APIChangeHostStateMsg(); msg.setUuid(uuid()); msg.setStateEvent(HostStateEvent.enable.toString()); return msg; }
@Override public String call(HostInventory arg) { return arg.getUuid(); } });
@Override public HypervisorType getHypervisorType() { return HypervisorType.valueOf(SimulatorConstant.SIMULATOR_HYPERVISOR_TYPE); } }
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); } }); }
@Override public String call(HostVO arg) { return arg.getUuid(); } });
public static ConnectHostInfo fromConnectHostMsg(ConnectHostMsg msg) { ConnectHostInfo info = new ConnectHostInfo(); info.setNewAdded(msg.isNewAdd()); info.setStartPingTaskOnFailure(msg.isStartPingTaskOnFailure()); return info; } }
@Override public String call(HostVO arg) { return arg.getClusterUuid(); } });
@Override public void run(HostPingTaskExtensionPoint ext) { if (ext.getHypervisorType().equals(type)) { ext.executeTaskAlongWithPingTask(inv); } } });
public void connectionReestablished(HypervisorType hvType, HostInventory host) throws HostException { for (HostConnectionReestablishExtensionPoint ext : connetionReestablishExts) { if (ext.getHypervisorTypeForReestablishExtensionPoint().equals(hvType)) { ext.connectionReestablished(host); } } }
public static APIReconnectHostMsg __example__() { APIReconnectHostMsg msg = new APIReconnectHostMsg(); msg.setUuid(uuid()); return msg; }
@Override public void fail(ErrorCode err) { StartVmOnHypervisorReply reply = new StartVmOnHypervisorReply(); reply.setError(err); reply.setSuccess(false); extEmitter.startVmOnKvmFailed(KVMHostInventory.valueOf(getSelf()), spec, err); bus.reply(msg, reply); completion.done(); } });
@Override public void run(HostChangeStateExtensionPoint extp) { extp.beforeChangeHostState(hinv, event, next); } });
@Override public void run(HostDeleteExtensionPoint extp) { extp.afterDeleteHost(hinv); } });
@Override public void run(HostChangeStateExtensionPoint extp) { extp.afterChangeHostState(hinv, event, prevState); } });
@Override public void run(HostDeleteExtensionPoint extp) { extp.beforeDeleteHost(hinv); } });
@Override public String call(HostVO arg) { return arg.getUuid(); } });
@Override public String call(HostVO arg) { return arg.getUuid(); } });
@Override public String call(HostVO arg) { return arg.getUuid(); } });