@Override public int hashCode() { int hash = 7; hash = 31 * hash + getInstallers().hashCode(); hash = 31 * hash + getEnv().hashCode(); hash = 31 * hash + getAttributes().hashCode(); hash = 31 * hash + getServers().hashCode(); hash = 31 * hash + getVolumes().hashCode(); return hash; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof MachineConfigImpl)) { return false; } final MachineConfigImpl that = (MachineConfigImpl) obj; return getInstallers().equals(that.getInstallers()) && getEnv().equals(that.getEnv()) && getAttributes().equals(that.getAttributes()) && getServers().equals(that.getServers()) && getVolumes().equals(that.getVolumes()); }
private void showInstallers() { String defaultEnvironmentName = appContext.getWorkspace().getConfig().getDefaultEnv(); EnvironmentImpl defaultEnvironment = appContext.getWorkspace().getConfig().getEnvironments().get(defaultEnvironmentName); if (defaultEnvironment == null) { return; } Map<String, MachineConfigImpl> machines = defaultEnvironment.getMachines(); for (final String machineName : machines.keySet()) { MachineConfigImpl machineConfig = machines.get(machineName); for (String installerId : machineConfig.getInstallers()) { String installerName = installernames.get(installerId); if (installerName == null) { installerName = ""; } String installerDescription = installerDescriptions.get(installerId); if (installerDescription == null) { installerDescription = ""; } view.addInstaller(machineName, installerId, installerName, installerDescription); } } }
@Override public void showPanel() { showWorkspaceStatusPanel(); addMachines(); showInstallers(); if (WorkspaceStatus.RUNNING == appContext.getWorkspace().getStatus()) { view.showWorkspaceStarted(); Map<String, MachineImpl> runtimeMachines = appContext.getWorkspace().getRuntime().getMachines(); for (String machineName : runtimeMachines.keySet()) { view.setMachineRunning(machineName); } String defaultEnvironmentName = appContext.getWorkspace().getConfig().getDefaultEnv(); EnvironmentImpl defaultEnvironment = appContext.getWorkspace().getConfig().getEnvironments().get(defaultEnvironmentName); if (defaultEnvironment == null) { return; } Map<String, MachineConfigImpl> environmentMachines = defaultEnvironment.getMachines(); for (final String machineName : environmentMachines.keySet()) { MachineConfigImpl machineConfig = environmentMachines.get(machineName); for (String installerId : machineConfig.getInstallers()) { view.setInstallerRunning(machineName, installerId); } } } }