Package org.springframework.xd.shell

Examples of org.springframework.xd.shell.Target


      }
      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(),
View Full Code Here


  @CliCommand(value = {"admin config info"}, help = "Show the XD admin server being used")
  public String info() {

    final Map<String, String> statusValues = new TreeMap<String, String>();

    final Target target = configuration.getTarget();

    statusValues.put("Target", target.getTargetUriAsString());
    if (target.getTargetCredentials() != null) {
      statusValues.put("Credentials", target.getTargetCredentials().getDisplayableContents());
    }
    statusValues.put("Result", target.getTargetResultMessage() != null ? target.getTargetResultMessage() : "");
    statusValues.put("Timezone used", CommonUtils.getTimeZoneNameWithOffset(this.configuration.getClientTimeZone()));

    final StringBuilder sb = new StringBuilder(UiUtils.renderParameterInfoDataAsTable(statusValues, false, 66));

    if (TargetStatus.ERROR.equals(target.getStatus())) {
      sb.append(UiUtils.HORIZONTAL_LINE);
      sb.append("An exception ocurred during targeting:\n");

      final StringWriter stringWriter = new StringWriter();
      target.getTargetException().printStackTrace(new PrintWriter(stringWriter));

      sb.append(stringWriter.toString());
    }
    return sb.toString();
  }
View Full Code Here

TOP

Related Classes of org.springframework.xd.shell.Target

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.