Author: anil.saldhana(a)jboss.com
Date: 2010-09-08 16:28:12 -0400 (Wed, 08 Sep 2010)
New Revision: 393
Added:
federation/branches/Branch_1_x/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/confighandlers/BaseSTSConfigHandler.java
Modified:
federation/branches/Branch_1_x/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/PicketLinkSTS.java
federation/branches/Branch_1_x/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/confighandlers/ClassPathConfigHandler.java
federation/branches/Branch_1_x/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/confighandlers/ConsoleHomeDirectoryConfigHandler.java
federation/branches/Branch_1_x/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/confighandlers/STSConfigHandler.java
federation/branches/Branch_1_x/picketlink-fed-core/src/main/resources/picketlink-sts-confighandlers.xml
Log:
PLFED-103: config handler stack for the STS
Modified:
federation/branches/Branch_1_x/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/PicketLinkSTS.java
===================================================================
---
federation/branches/Branch_1_x/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/PicketLinkSTS.java 2010-09-08
18:54:57 UTC (rev 392)
+++
federation/branches/Branch_1_x/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/PicketLinkSTS.java 2010-09-08
20:28:12 UTC (rev 393)
@@ -270,6 +270,8 @@
{
Class<?> clazz = tcl.loadClass( handler.getClazz() );
STSConfigHandler stsConfigHandler = (STSConfigHandler)
clazz.newInstance();
+ stsConfigHandler.setOptions( handler.getOption() );
+
configuration = stsConfigHandler.getConfiguration();
if( configuration != null )
break;
Added:
federation/branches/Branch_1_x/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/confighandlers/BaseSTSConfigHandler.java
===================================================================
---
federation/branches/Branch_1_x/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/confighandlers/BaseSTSConfigHandler.java
(rev 0)
+++
federation/branches/Branch_1_x/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/confighandlers/BaseSTSConfigHandler.java 2010-09-08
20:28:12 UTC (rev 393)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.picketlink.identity.federation.core.wstrust.confighandlers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.picketlink.identity.federation.core.config.KeyValueType;
+
+
+/**
+ * Base class for STS configuration handlers
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Sep 8, 2010
+ */
+public abstract class BaseSTSConfigHandler implements STSConfigHandler
+{
+ protected List<KeyValueType> options = new ArrayList<KeyValueType>();
+
+ @Override
+ public void setOptions(List<KeyValueType> options)
+ {
+ this.options.addAll( options );
+ }
+}
Modified:
federation/branches/Branch_1_x/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/confighandlers/ClassPathConfigHandler.java
===================================================================
---
federation/branches/Branch_1_x/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/confighandlers/ClassPathConfigHandler.java 2010-09-08
18:54:57 UTC (rev 392)
+++
federation/branches/Branch_1_x/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/confighandlers/ClassPathConfigHandler.java 2010-09-08
20:28:12 UTC (rev 393)
@@ -25,7 +25,7 @@
import java.net.URL;
import org.apache.log4j.Logger;
-import org.picketlink.identity.federation.core.config.STSType;
+import org.picketlink.identity.federation.core.config.STSType;
import org.picketlink.identity.federation.core.wstrust.PicketLinkSTSConfiguration;
import org.picketlink.identity.federation.core.wstrust.PicketLinkSTSConstants;
import org.picketlink.identity.federation.core.wstrust.STSConfiguration;
@@ -38,7 +38,7 @@
* @author Anil.Saldhana(a)redhat.com
* @since Sep 8, 2010
*/
-public class ClassPathConfigHandler implements STSConfigHandler
+public class ClassPathConfigHandler extends BaseSTSConfigHandler
{
protected static Logger log = Logger.getLogger( ClassPathConfigHandler.class );
Modified:
federation/branches/Branch_1_x/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/confighandlers/ConsoleHomeDirectoryConfigHandler.java
===================================================================
---
federation/branches/Branch_1_x/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/confighandlers/ConsoleHomeDirectoryConfigHandler.java 2010-09-08
18:54:57 UTC (rev 392)
+++
federation/branches/Branch_1_x/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/confighandlers/ConsoleHomeDirectoryConfigHandler.java 2010-09-08
20:28:12 UTC (rev 393)
@@ -38,7 +38,7 @@
* @author Anil.Saldhana(a)redhat.com
* @since Sep 8, 2010
*/
-public class ConsoleHomeDirectoryConfigHandler implements STSConfigHandler
+public class ConsoleHomeDirectoryConfigHandler extends BaseSTSConfigHandler
{
protected static Logger log = Logger.getLogger(
ConsoleHomeDirectoryConfigHandler.class );
Modified:
federation/branches/Branch_1_x/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/confighandlers/STSConfigHandler.java
===================================================================
---
federation/branches/Branch_1_x/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/confighandlers/STSConfigHandler.java 2010-09-08
18:54:57 UTC (rev 392)
+++
federation/branches/Branch_1_x/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/confighandlers/STSConfigHandler.java 2010-09-08
20:28:12 UTC (rev 393)
@@ -21,6 +21,9 @@
*/
package org.picketlink.identity.federation.core.wstrust.confighandlers;
+import java.util.List;
+
+import org.picketlink.identity.federation.core.config.KeyValueType;
import org.picketlink.identity.federation.core.wstrust.STSConfiguration;
/**
@@ -32,6 +35,12 @@
public interface STSConfigHandler
{
/**
+ * Set the options configured
+ * @param options
+ */
+ void setOptions(List<KeyValueType> options);
+
+ /**
* Return {@code STSConfiguration} or null
* @return
*/
Modified:
federation/branches/Branch_1_x/picketlink-fed-core/src/main/resources/picketlink-sts-confighandlers.xml
===================================================================
---
federation/branches/Branch_1_x/picketlink-fed-core/src/main/resources/picketlink-sts-confighandlers.xml 2010-09-08
18:54:57 UTC (rev 392)
+++
federation/branches/Branch_1_x/picketlink-fed-core/src/main/resources/picketlink-sts-confighandlers.xml 2010-09-08
20:28:12 UTC (rev 393)
@@ -1,10 +1,8 @@
<Handlers xmlns="urn:picketlink:identity-federation:handler:config:1.0">
<Handler
class="org.picketlink.identity.federation.core.wstrust.confighandlers.ConsoleHomeDirectoryConfigHandler">
- <Option Key="1" Value="1.1"/>
- <Option Key="2" Value="2.2"/>
+ <Option Key="description" Value="Configuration Handler that is used
to pick up settings by console"/>
</Handler>
<Handler
class="org.picketlink.identity.federation.core.wstrust.confighandlers.ClassPathConfigHandler">
- <Option Key="1" Value="1.1"/>
- <Option Key="2" Value="2.2"/>
+ <Option Key="description" Value="Configuration Handler that is used
to pick up picketlink-sts.xml"/>
</Handler>
-</Handlers>
\ No newline at end of file
+</Handlers>