@CliCommand(value = {"admin config server"}, help = "Configure the XD admin server to use")
	public String target(
			@CliOption(mandatory = false, key = {"", "uri"},
					help = "the location of the XD Admin REST endpoint",
					unspecifiedDefaultValue = Target.DEFAULT_TARGET) String targetUriString,
			@CliOption(mandatory = false, key = {"username"},
					help = "the username for authenticated access to the Admin REST endpoint",
					unspecifiedDefaultValue = Target.DEFAULT_USERNAME) String targetUsername,
			@CliOption(mandatory = false, key = {"password"},
					help = "the password for authenticated access to the Admin REST endpoint (valid only with a username)",
					specifiedDefaultValue = Target.DEFAULT_SPECIFIED_PASSWORD,
					unspecifiedDefaultValue = Target.DEFAULT_UNSPECIFIED_PASSWORD) String targetPassword) {

		try {
			if (!StringUtils.isEmpty(targetPassword) && StringUtils.isEmpty(targetUsername)) {
				return "A password may be specified only together with a username";
			}
			if (Target.DEFAULT_SPECIFIED_PASSWORD.equalsIgnoreCase(targetPassword) && !StringUtils.isEmpty(targetUsername)) {
				// read password from the command line
				targetPassword = userInput.prompt("Password", "", false);
			}
			configuration.setTarget(new Target(targetUriString, targetUsername, targetPassword));
			if (configuration.getTarget().getTargetCredentials() != null) {
				BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider();
				credentialsProvider.setCredentials(AuthScope.ANY,
						new UsernamePasswordCredentials(
								configuration.getTarget().getTargetCredentials().getUsername(),
								configuration.getTarget().getTargetCredentials().getPassword()));
				CloseableHttpClient httpClient = HttpClientBuilder.create().setDefaultCredentialsProvider(credentialsProvider).build();
				HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
				this.xdShell.setSpringXDOperations(new SpringXDTemplate(requestFactory, configuration.getTarget().getTargetUri()));
			}
			else {
				this.xdShell.setSpringXDOperations(new SpringXDTemplate(configuration.getTarget().getTargetUri()));
			}
			configuration.getTarget().setTargetResultMessage(
					String.format("Successfully targeted %s", configuration.getTarget().getTargetUri()));
		}
		catch (Exception e) {
			configuration.getTarget().setTargetException(e);
			this.xdShell.setSpringXDOperations(null);
			configuration.getTarget().setTargetResultMessage(
					String.format("Unable to contact XD Admin Server at '%s'.",
							targetUriString));
			if (logger.isTraceEnabled()) {
				logger.trace(configuration.getTarget().getTargetResultMessage(), e);
			}
		}

		return configuration.getTarget().getTargetResultMessage();
	}
Defines several shell commands in order to configure the shell itself. The
commands will set properties on the {@link Configuration} object.

@author Gunnar Hillert
@author Marius Bogoevici
@since 1.0
spring-xd-shell/src/main/java/org/springframework/xd/shell/command/ConfigCommands.java