Permalink
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...
1 parent 4e81f83 commit 9b7aaf9ac5467963f61ef754f363d6fe8c5caf1f @smoyer64 committed Nov 20, 2012
Showing with 19 additions and 0 deletions.
  1. +19 −0 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;

0 comments on commit 9b7aaf9

Please sign in to comment.