From 0f277d4e4a06c7e5b73a21495d5cb79fb83e372f Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Tue, 24 Jan 2012 15:26:12 +0000 Subject: [PATCH] SWS-745 - Convenience constructor for SimpleUsernamePasswordCallbackHandler --- ...SimpleUsernamePasswordCallbackHandler.java | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/security/src/main/java/org/springframework/ws/soap/security/xwss/callback/SimpleUsernamePasswordCallbackHandler.java b/security/src/main/java/org/springframework/ws/soap/security/xwss/callback/SimpleUsernamePasswordCallbackHandler.java index 04e15f9e..82c714fa 100644 --- a/security/src/main/java/org/springframework/ws/soap/security/xwss/callback/SimpleUsernamePasswordCallbackHandler.java +++ b/security/src/main/java/org/springframework/ws/soap/security/xwss/callback/SimpleUsernamePasswordCallbackHandler.java @@ -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. *

@@ -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; }