Skip to content

Commit 0f277d4

Browse files
committed
SWS-745 - Convenience constructor for SimpleUsernamePasswordCallbackHandler
1 parent 61a1f62 commit 0f277d4

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

security/src/main/java/org/springframework/ws/soap/security/xwss/callback/SimpleUsernamePasswordCallbackHandler.java

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2005-2010 the original author or authors.
2+
* Copyright 2002-2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,13 +20,13 @@
2020
import javax.security.auth.callback.Callback;
2121
import javax.security.auth.callback.UnsupportedCallbackException;
2222

23-
import com.sun.xml.wss.impl.callback.PasswordCallback;
24-
import com.sun.xml.wss.impl.callback.UsernameCallback;
25-
2623
import org.springframework.beans.factory.InitializingBean;
2724
import org.springframework.util.Assert;
2825
import org.springframework.ws.soap.security.callback.AbstractCallbackHandler;
2926

27+
import com.sun.xml.wss.impl.callback.PasswordCallback;
28+
import com.sun.xml.wss.impl.callback.UsernameCallback;
29+
3030
/**
3131
* Simple callback handler that supplies a username and password to a username token at runtime.
3232
* <p/>
@@ -44,6 +44,21 @@ public class SimpleUsernamePasswordCallbackHandler extends AbstractCallbackHandl
4444

4545
private String password;
4646

47+
48+
/**
49+
* Constructs an empty instance of the {@code SimpleUsernamePasswordCallbackHandler}.
50+
*/
51+
public SimpleUsernamePasswordCallbackHandler() {
52+
}
53+
54+
/**
55+
* Constructs an instance of the {@code SimpleUsernamePasswordCallbackHandler} with the given name and password.
56+
*/
57+
public SimpleUsernamePasswordCallbackHandler(String username, String password) {
58+
this.username = username;
59+
this.password = password;
60+
}
61+
4762
public void setPassword(String password) {
4863
this.password = password;
4964
}

0 commit comments

Comments
 (0)