/** * Check the compatibility of the action with a source configuration. The hosting node must be * online and hosting the sleeping the virtual machine * * @param src the configuration to check * @return {@code true} if the action is compatible */ @Override public boolean isCompatibleWith(Configuration src) { return (src.isOnline(getHost()) && src.isSleeping(getVirtualMachine()) && src.getLocation(getVirtualMachine()).equals(getHost()) && src.isOnline(getDestination())); }
/** * Check the compatibility of the action with a source and a destination configuration. * Destination node must be online and running the VM on the destination configuration while VM * must be sleeping on the hosting node on the source configuration The VM must be waiting in the * source configuration. * * @param src the source configuration * @param dst the configuration to reach * @return true if the action is compatible with the configurations */ @Override public boolean isCompatibleWith(Configuration src, Configuration dst) { if (!src.isOnline(getHost()) || !src.isSleeping(getVirtualMachine()) || !src.getLocation(getVirtualMachine()).equals(getHost())) { return false; } if (!dst.isOnline(getDestination()) || !dst.isRunning(getVirtualMachine()) || !dst.getLocation(getVirtualMachine()).equals(getDestination())) { return false; } return true; }