SWS-745 - Convenience constructor for SimpleUsernamePasswordCallbackHandler

This commit is contained in:
Arjen Poutsma
2012-01-24 15:26:12 +00:00
parent 61a1f6210d
commit 0f277d4e4a

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,13 +20,13 @@ import java.io.IOException;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.UnsupportedCallbackException;
import com.sun.xml.wss.impl.callback.PasswordCallback;
import com.sun.xml.wss.impl.callback.UsernameCallback;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;
import org.springframework.ws.soap.security.callback.AbstractCallbackHandler;
import com.sun.xml.wss.impl.callback.PasswordCallback;
import com.sun.xml.wss.impl.callback.UsernameCallback;
/**
* Simple callback handler that supplies a username and password to a username token at runtime.
* <p/>
@@ -44,6 +44,21 @@ public class SimpleUsernamePasswordCallbackHandler extends AbstractCallbackHandl
private String password;
/**
* Constructs an empty instance of the {@code SimpleUsernamePasswordCallbackHandler}.
*/
public SimpleUsernamePasswordCallbackHandler() {
}
/**
* Constructs an instance of the {@code SimpleUsernamePasswordCallbackHandler} with the given name and password.
*/
public SimpleUsernamePasswordCallbackHandler(String username, String password) {
this.username = username;
this.password = password;
}
public void setPassword(String password) {
this.password = password;
}