Skip to content

Commit

Permalink
Stubbed out logic to load the username and password from the settings
Browse files Browse the repository at this point in the history
file if an <id> element is provided and username and password are both
null.
  • Loading branch information
smoyer64 committed Nov 20, 2012
1 parent 4e81f83 commit 9b7aaf9
Showing 1 changed file with 19 additions and 0 deletions.
Expand Up @@ -59,6 +59,13 @@ public abstract class AbstractServerConnection extends AbstractMojo implements C
*/
@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.
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9b7aaf9

Please sign in to comment.