Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Stubbed out logic to load the username and password from the settings

file if an <id> element is provided and username and password are both
null.
  • Loading branch information...
commit 9b7aaf9ac5467963f61ef754f363d6fe8c5caf1f 1 parent 4e81f83
@smoyer64 authored
View
19 src/main/java/org/jboss/as/plugin/common/AbstractServerConnection.java
@@ -59,6 +59,13 @@
*/
@Parameter(defaultValue = "9999", property = "jboss-as.port")
private int port;
+
+ /**
+ * Specifies the id of the server if the username and password is to be
+ * retrieved from the settings.xml file
+ */
+ @Parameter(property = "jboss-as.id")
+ private String id;
/**
* Specifies the username to use if prompted to authenticate by the server.
@@ -168,10 +175,22 @@ public synchronized final InetAddress getHostAddress() {
public synchronized final CallbackHandler getCallbackHandler() {
CallbackHandler result = handler;
if (result == null) {
+ if(username == null && password == null && id != null) {
+ username = getUsernameFromSettings();
+ password = getPasswordFromSettings();
+ }
result = handler = new ClientCallbackHandler(username, password);
}
return result;
}
+
+ private String getPasswordFromSettings() {
+ return "testPassword";
+ }
+
+ private String getUsernameFromSettings() {
+ return "testUsername";
+ }
private boolean isDomainServer(final ModelControllerClient client) {
boolean result = false;
Please sign in to comment.
Something went wrong with that request. Please try again.