public ServerRecord getDefaultHostRecord() { if (serverUpdateCache != null) { return serverUpdateCache.getDefaultRecord(); } else { return ServerList.getDefaultRecord(); } }
public UpDownLoader(ExecutionEnvironment execEnv, Node[] nodes, InputOutput tab) { this.execEnv = execEnv; this.nodes = nodes; this.tab = tab; envName = ServerList.get(execEnv).getDisplayName(); }
public Collection<? extends ServerRecord> getHosts() { if (serverUpdateCache != null) { return serverUpdateCache.getHosts(); } return ServerList.getRecords(); }
private ExecutionEnvironment getSelectedExecutionEnvironment() { Object obj = hostComboBox.getSelectedItem(); if (obj != null && obj instanceof ServerRecord) { ServerRecord sr = (ServerRecord) obj; return sr.getExecutionEnvironment(); } return ServerList.getDefaultRecord().getExecutionEnvironment(); }
/** * For the case we know environment for sure, but project can be null - * instead of repeating in client construct like * pathMap = (project == null) ? HostInfoProvider.getMapper(execEnv) : RemoteSyncSupport.getPathMap(project); */ public static PathMap getPathMap(ExecutionEnvironment env, Lookup.Provider project) { PathMap pathMap = null; if (project != null) { pathMap = getPathMap(project); } if (pathMap == null) { pathMap = HostInfoProvider.getMapper(env); } return pathMap; }
public static void ensureHostSetup(ExecutionEnvironment env) { if (env != null) { ServerList.get(env); // this will ensure the remote host is setup } } public static boolean isDevHostValid(ExecutionEnvironment env) {
@Override public void setHosts(Collection<? extends ServerRecord> list) { if (serverUpdateCache == null) { serverUpdateCache = new ServerUpdateCache(); } serverUpdateCache.setHosts(list); }
private boolean addDevelopmentHost(ExecutionEnvironment execEnv) { final ServerRecord record = ServerList.addServer(execEnv, null, null, false, false); servers = ServerList.getEnvironments(); return record != null; }
/** * The same as ensureRecordOnline(ServerRecord record), * but allows to specify a message instead of default one * @param message message to display in the case the record is not connected * @return */ public static boolean ensureRecordOnline(ExecutionEnvironment env, String message) { return getDefault().ensureRecordOnlineImpl(env, message); }
@Override protected boolean ensureRecordOnlineImpl(ExecutionEnvironment env) { warning(); return false; } }
@Override public void run() { ServerListUI.showServerRecordPropertiesDialog(execEnv); } });
private SelectHostWizardProvider getSelectHostWizardProvider() { if (selectHostWizardProvider == null) { selectHostWizardProvider = SelectHostWizardProvider.createInstance(false, false, new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { fireStateChanged(); } }); } return selectHostWizardProvider; }
@Override protected void performAction(final ExecutionEnvironment execEnv, final Node[] activatedNodes) { RP.post(new NamedRunnable("Uploading to " + ServerList.get(execEnv).getDisplayName()) { // NOI18N @Override protected void runImpl() { upload(execEnv, activatedNodes); } }); }
/** * Checks whether the record is initialized, * if it is not, ask user whether (s)he wants to (re)connect, * asks password if needs, connects * @param record record to check * @return true in the case record is connected (or it wasn't, user agreed, and it's now connected); * otherwise false */ public static boolean ensureRecordOnline(ExecutionEnvironment env) { return getDefault().ensureRecordOnlineImpl(env); }
@Override protected boolean showServerListDialogImpl() { warning(); return false; }
@Override protected boolean showServerListDialogImpl(AtomicReference<ExecutionEnvironment> selectedEnv) { warning(); return false; }
@Override protected boolean showServerRecordPropertiesDialogImpl(ExecutionEnvironment env) { warning(); return false; }
@Override protected boolean ensureRecordOnlineImpl(ExecutionEnvironment env, String message) { warning(); return false; }