Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 10321 invoked from network); 11 Dec 2008 19:40:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Dec 2008 19:40:48 -0000 Received: (qmail 15187 invoked by uid 500); 11 Dec 2008 19:41:00 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 15123 invoked by uid 500); 11 Dec 2008 19:41:00 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 15110 invoked by uid 99); 11 Dec 2008 19:41:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Dec 2008 11:41:00 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Dec 2008 19:40:45 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A41F2238889D; Thu, 11 Dec 2008 11:40:24 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r725791 - /cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java Date: Thu, 11 Dec 2008 19:40:24 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081211194024.A41F2238889D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Thu Dec 11 11:40:24 2008 New Revision: 725791 URL: http://svn.apache.org/viewvc?rev=725791&view=rev Log: Make stsclient configurable in spring Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java?rev=725791&r1=725790&r2=725791&view=diff ============================================================================== --- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java (original) +++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java Thu Dec 11 11:40:24 2008 @@ -32,6 +32,8 @@ import org.apache.cxf.binding.BindingFactoryManager; import org.apache.cxf.binding.soap.SoapBindingConstants; import org.apache.cxf.binding.soap.model.SoapOperationInfo; +import org.apache.cxf.configuration.Configurable; +import org.apache.cxf.configuration.Configurer; import org.apache.cxf.databinding.source.SourceDataBinding; import org.apache.cxf.endpoint.Client; import org.apache.cxf.endpoint.ClientImpl; @@ -59,8 +61,10 @@ /** * */ -public class STSClient { +public class STSClient implements Configurable { + Bus bus; + String name = "default.sts-client"; Client client; String location; Policy policy; @@ -72,6 +76,12 @@ bus = b; } + public String getBeanName() { + return name; + } + public void setBeanName(String s) { + name = s; + } public void setLocation(String location) { this.location = location; } @@ -84,16 +94,37 @@ public void setSoap11() { soapVersion = SoapBindingConstants.SOAP11_BINDING_ID; } + public void setSoap11(boolean b) { + if (b) { + setSoap11(); + } else { + setSoap12(); + } + } public void setTrust(Trust10 trust) { } public void setTrust(Trust13 trust) { } + + public Map getRequestContext() { + return ctx; + } + public void setProperties(Map p) { + ctx.putAll(p); + } + public Map getProperties() { + return ctx; + } + private void createClient() throws BusException, EndpointException { if (client != null) { return; } + bus.getExtension(Configurer.class).configureBean(name, this); + + Service service = null; String ns = "http://schemas.xmlsoap.org/ws/2005/02/trust/wsdl"; String typeNs = "http://schemas.xmlsoap.org/ws/2005/02/trust"; @@ -148,9 +179,6 @@ } - public Map getRequestContext() throws Exception { - return ctx; - } public SecurityToken requestSecurityToken() throws Exception { createClient(); client.getRequestContext().putAll(ctx); @@ -180,6 +208,8 @@ return null; } + + }