@Override
	public boolean apply(ProjectWizardData data) {
		ServerInfo serverInfo = data.getServerInfo();
		String serverName = serverInfo.getServerName();
		int port = serverInfo.getPortNumber();
		RepositoryServerAdapter server =
			projectManager.getRepositoryServerAdapter(serverName, port, true);
		if (!server.isConnected()) {
			setStatusMessage("Could not connect to server " + serverName + ", port " + port);
			return false;
		}

		data.setServer(server);
		return true;
	}
Wizard step in the new project wizard for choosing the Ghidra server when creating a shared
project.
Ghidra/Framework/Project/src/main/java/ghidra/framework/main/wizard/project/ServerStep.java