[jboss-cvs] Picketlink SVN: r735 - in federation/trunk/picketlink-fed-core/src: main/java/org/picketlink/identity/federation/core/handler/config and 5 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Feb 4 17:44:27 EST 2011
Author: anil.saldhana at jboss.com
Date: 2011-02-04 17:44:25 -0500 (Fri, 04 Feb 2011)
New Revision: 735
Added:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/config/
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/config/SAMLConfigParser.java
Removed:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ObjectFactory.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/handler/config/ObjectFactory.java
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/AuthPropertyType.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ClaimsProcessorType.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ClaimsProcessorsType.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/EncAlgoType.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/EncryptionType.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/IDPType.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/KeyProviderType.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/KeyValueType.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/MetadataProviderType.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ProviderType.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/SPType.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/STSType.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ServiceProviderType.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ServiceProvidersType.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/TokenProviderType.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/TokenProvidersType.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/TrustType.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/package-info.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/handler/config/Handler.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/handler/config/Handlers.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/handler/config/package-info.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/sts/STSConfigParser.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/WSTrustUtil.java
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/config/ConfigUnitTestCase.java
Log:
PLFED-126: stax parsing of PL config
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/AuthPropertyType.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/AuthPropertyType.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/AuthPropertyType.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,17 +1,5 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.09.03 at 01:21:42 PM BRT
-
-
package org.picketlink.identity.federation.core.config;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlType;
-
-
/**
* <p>Java class for AuthPropertyType complex type.
*
@@ -28,11 +16,7 @@
*
*
*/
- at XmlAccessorType(XmlAccessType.FIELD)
- at XmlType(name = "AuthPropertyType")
public class AuthPropertyType
extends KeyValueType
-{
-
-
-}
+{
+}
\ No newline at end of file
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ClaimsProcessorType.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ClaimsProcessorType.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ClaimsProcessorType.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,22 +1,9 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.10.30 at 03:20:31 PM GMT-03:00
-//
-
-
package org.picketlink.identity.federation.core.config;
import java.util.ArrayList;
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
+import java.util.Collections;
+import java.util.List;
-
/**
* <p>Java class for ClaimsProcessorType complex type.
*
@@ -37,47 +24,33 @@
* </pre>
*
*
- */
- at XmlAccessorType(XmlAccessType.FIELD)
- at XmlType(name = "ClaimsProcessorType", propOrder = {
- "property"
-})
+ */
public class ClaimsProcessorType {
- @XmlElement(name = "Property")
- protected List<KeyValueType> property;
- @XmlAttribute(name = "ProcessorClass", required = true)
+ protected List<KeyValueType> property = new ArrayList<KeyValueType>();
protected String processorClass;
- @XmlAttribute(name = "Dialect", required = true)
protected String dialect;
+ public void add( KeyValueType kv )
+ {
+ this.property.add(kv);
+ }
+
+ public void remove( KeyValueType kv )
+ {
+ this.property.remove(kv);
+ }
+
/**
* Gets the value of the property property.
- *
* <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the property property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getProperty().add(newItem);
- * </pre>
- *
- *
- * <p>
* Objects of the following type(s) are allowed in the list
* {@link KeyValueType }
*
*
*/
- public List<KeyValueType> getProperty() {
- if (property == null) {
- property = new ArrayList<KeyValueType>();
- }
- return this.property;
+ public List<KeyValueType> getProperty() {
+ return Collections.unmodifiableList( this.property );
}
/**
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ClaimsProcessorsType.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ClaimsProcessorsType.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ClaimsProcessorsType.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,21 +1,9 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.10.30 at 02:46:25 PM GMT-03:00
-//
-
-
package org.picketlink.identity.federation.core.config;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
/**
*
* The claims processors specify the classes that are capable of processing specific claims dialects.
@@ -38,43 +26,31 @@
* </pre>
*
*
- */
- at XmlAccessorType(XmlAccessType.FIELD)
- at XmlType(name = "ClaimsProcessorsType", propOrder = {
- "claimsProcessor"
-})
+ */
public class ClaimsProcessorsType {
- @XmlElement(name = "ClaimsProcessor", required = true)
- protected List<ClaimsProcessorType> claimsProcessor;
+ protected List<ClaimsProcessorType> claimsProcessor = new ArrayList<ClaimsProcessorType>();
+ public void add( ClaimsProcessorType claim )
+ {
+ this.claimsProcessor.add( claim);
+ }
+
+ public void remove( ClaimsProcessorType claim )
+ {
+ this.claimsProcessor.remove( claim);
+ }
+
/**
* Gets the value of the claimsProcessor property.
- *
* <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the claimsProcessor property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getClaimsProcessor().add(newItem);
- * </pre>
- *
- *
- * <p>
* Objects of the following type(s) are allowed in the list
* {@link ClaimsProcessorType }
*
*
*/
- public List<ClaimsProcessorType> getClaimsProcessor() {
- if (claimsProcessor == null) {
- claimsProcessor = new ArrayList<ClaimsProcessorType>();
- }
- return this.claimsProcessor;
+ public List<ClaimsProcessorType> getClaimsProcessor() {
+ return Collections.unmodifiableList( this.claimsProcessor );
}
-}
+}
\ No newline at end of file
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/EncAlgoType.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/EncAlgoType.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/EncAlgoType.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,16 +1,5 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.09.03 at 01:21:42 PM BRT
-
package org.picketlink.identity.federation.core.config;
-import javax.xml.bind.annotation.XmlEnum;
-import javax.xml.bind.annotation.XmlEnumValue;
-import javax.xml.bind.annotation.XmlType;
-
-
/**
* <p>Java class for EncAlgoType.
*
@@ -26,14 +15,11 @@
* </simpleType>
* </pre>
*
- */
- at XmlType(name = "EncAlgoType")
- at XmlEnum
+ */
public enum EncAlgoType {
AES("AES"),
- DES("DES"),
- @XmlEnumValue("DESede")
+ DES("DES"),
DE_SEDE("DESede");
private final String value;
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/EncryptionType.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/EncryptionType.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/EncryptionType.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,17 +1,6 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.09.03 at 01:21:42 PM BRT
-
package org.picketlink.identity.federation.core.config;
+
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-
/**
* <p>Java class for EncryptionType complex type.
*
@@ -31,17 +20,10 @@
* </pre>
*
*
- */
- at XmlAccessorType(XmlAccessType.FIELD)
- at XmlType(name = "EncryptionType", propOrder = {
- "encAlgo",
- "keySize"
-})
+ */
public class EncryptionType {
-
- @XmlElement(name = "EncAlgo", required = true)
- protected EncAlgoType encAlgo;
- @XmlElement(name = "KeySize")
+
+ protected EncAlgoType encAlgo;
protected int keySize;
/**
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/IDPType.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/IDPType.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/IDPType.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,20 +1,6 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.09.03 at 01:21:42 PM BRT
-//
-
-
package org.picketlink.identity.federation.core.config;
+
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-
/**
*
* IDP Type defines the configuration for an Identity
@@ -42,24 +28,15 @@
* </pre>
*
*
- */
- at XmlAccessorType(XmlAccessType.FIELD)
- at XmlType(name = "IDPType", propOrder = {
- "encryption"
-})
+ */
public class IDPType
extends ProviderType
{
- @XmlElement(name = "Encryption")
protected EncryptionType encryption;
- @XmlAttribute(name = "AssertionValidity")
protected Long assertionValidity;
- @XmlAttribute(name = "RoleGenerator")
protected String roleGenerator;
- @XmlAttribute(name = "AttributeManager")
protected String attributeManager;
- @XmlAttribute(name = "Encrypt")
protected Boolean encrypt;
/**
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/KeyProviderType.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/KeyProviderType.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/KeyProviderType.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,20 +1,9 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.09.03 at 01:21:42 PM BRT
-//
-
-
package org.picketlink.identity.federation.core.config;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
+
/**
@@ -42,80 +31,54 @@
* </pre>
*
*
- */
- at XmlAccessorType(XmlAccessType.FIELD)
- at XmlType(name = "KeyProviderType", propOrder = {
- "auth",
- "validatingAlias",
- "signingAlias"
-})
+ */
public class KeyProviderType {
-
- @XmlElement(name = "Auth")
- protected List<AuthPropertyType> auth;
- @XmlElement(name = "ValidatingAlias")
- protected List<KeyValueType> validatingAlias;
- @XmlElement(name = "SigningAlias")
+
+ protected List<AuthPropertyType> auth = new ArrayList<AuthPropertyType>();
+ protected List<KeyValueType> validatingAlias = new ArrayList<KeyValueType>();
protected String signingAlias;
- @XmlAttribute(name = "ClassName")
protected String className;
+ public void add( AuthPropertyType kv)
+ {
+ this.auth.add(kv);
+ }
+ public void remove( AuthPropertyType kv)
+ {
+ this.auth.remove(kv);
+ }
+
/**
* Gets the value of the auth property.
- *
* <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the auth property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAuth().add(newItem);
- * </pre>
- *
- *
- * <p>
* Objects of the following type(s) are allowed in the list
* {@link AuthPropertyType }
*
*
*/
- public List<AuthPropertyType> getAuth() {
- if (auth == null) {
- auth = new ArrayList<AuthPropertyType>();
- }
- return this.auth;
+ public List<AuthPropertyType> getAuth() {
+ return Collections.unmodifiableList( this.auth );
}
+
+ public void add(KeyValueType kv)
+ {
+ this.validatingAlias.add(kv);
+ }
+ public void remove(KeyValueType kv)
+ {
+ this.validatingAlias.remove(kv);
+ }
/**
* Gets the value of the validatingAlias property.
- *
* <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the validatingAlias property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getValidatingAlias().add(newItem);
- * </pre>
- *
- *
- * <p>
* Objects of the following type(s) are allowed in the list
* {@link KeyValueType }
*
*
*/
- public List<KeyValueType> getValidatingAlias() {
- if (validatingAlias == null) {
- validatingAlias = new ArrayList<KeyValueType>();
- }
- return this.validatingAlias;
+ public List<KeyValueType> getValidatingAlias() {
+ return Collections.unmodifiableList( this.validatingAlias );
}
/**
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/KeyValueType.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/KeyValueType.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/KeyValueType.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,20 +1,5 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.09.03 at 01:21:42 PM BRT
-//
-
-
package org.picketlink.identity.federation.core.config;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import javax.xml.bind.annotation.XmlType;
-
-
/**
* <p>Java class for KeyValueType complex type.
*
@@ -32,17 +17,10 @@
* </pre>
*
*
- */
- at XmlAccessorType(XmlAccessType.FIELD)
- at XmlType(name = "KeyValueType")
- at XmlSeeAlso({
- AuthPropertyType.class
-})
+ */
public class KeyValueType {
-
- @XmlAttribute(name = "Key")
- protected String key;
- @XmlAttribute(name = "Value")
+
+ protected String key;
protected String value;
/**
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/MetadataProviderType.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/MetadataProviderType.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/MetadataProviderType.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,20 +1,8 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.09.03 at 01:21:42 PM BRT
-//
-
-
package org.picketlink.identity.federation.core.config;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
/**
@@ -36,45 +24,32 @@
* </pre>
*
*
- */
- at XmlAccessorType(XmlAccessType.FIELD)
- at XmlType(name = "MetadataProviderType", propOrder = {
- "option"
-})
+ */
public class MetadataProviderType {
-
- @XmlElement(name = "Option")
- protected List<KeyValueType> option;
- @XmlAttribute(name = "ClassName")
+
+ protected List<KeyValueType> option = new ArrayList<KeyValueType>();
protected String className;
+ public void add( KeyValueType kv )
+ {
+ this.option.add(kv);
+ }
+ public void remove( KeyValueType kv )
+ {
+ this.option.remove(kv);
+ }
+
/**
* Gets the value of the option property.
*
* <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the option property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getOption().add(newItem);
- * </pre>
- *
- *
- * <p>
* Objects of the following type(s) are allowed in the list
* {@link KeyValueType }
*
*
*/
- public List<KeyValueType> getOption() {
- if (option == null) {
- option = new ArrayList<KeyValueType>();
- }
- return this.option;
+ public List<KeyValueType> getOption() {
+ return Collections.unmodifiableList( this.option );
}
/**
Deleted: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ObjectFactory.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ObjectFactory.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ObjectFactory.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,200 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.10.30 at 02:46:25 PM GMT-03:00
-//
-
-
-package org.picketlink.identity.federation.core.config;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlElementDecl;
-import javax.xml.bind.annotation.XmlRegistry;
-import javax.xml.namespace.QName;
-
-
-/**
- * This object contains factory methods for each
- * Java content interface and Java element interface
- * generated in the picketlink.identity_federation.config._1 package.
- * <p>An ObjectFactory allows you to programatically
- * construct new instances of the Java representation
- * for XML content. The Java representation of XML
- * content can consist of schema derived interfaces
- * and classes representing the binding of schema
- * type definitions, element declarations and model
- * groups. Factory methods for each of these are
- * provided in this class.
- *
- */
- at XmlRegistry
-public class ObjectFactory {
-
- private final static QName _picketlinkIDP_QNAME = new QName("urn:picketlink:identity-federation:config:1.0", "PicketLinkIDP");
- private final static QName _PicketLinkSTS_QNAME = new QName("urn:picketlink:identity-federation:config:1.0", "PicketLinkSTS");
- private final static QName _picketlinkSP_QNAME = new QName("urn:picketlink:identity-federation:config:1.0", "PicketLinkSP");
-
- /**
- * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: picketlink.identity_federation.config._1
- *
- */
- public ObjectFactory() {
- }
-
- /**
- * Create an instance of {@link SPType }
- *
- */
- public SPType createSPType() {
- return new SPType();
- }
-
- /**
- * Create an instance of {@link AuthPropertyType }
- *
- */
- public AuthPropertyType createAuthPropertyType() {
- return new AuthPropertyType();
- }
-
- /**
- * Create an instance of {@link ServiceProviderType }
- *
- */
- public ServiceProviderType createServiceProviderType() {
- return new ServiceProviderType();
- }
-
- /**
- * Create an instance of {@link TrustType }
- *
- */
- public TrustType createTrustType() {
- return new TrustType();
- }
-
- /**
- * Create an instance of {@link STSType }
- *
- */
- public STSType createSTSType() {
- return new STSType();
- }
-
- /**
- * Create an instance of {@link MetadataProviderType }
- *
- */
- public MetadataProviderType createMetadataProviderType() {
- return new MetadataProviderType();
- }
-
- /**
- * Create an instance of {@link TokenProvidersType }
- *
- */
- public TokenProvidersType createTokenProvidersType() {
- return new TokenProvidersType();
- }
-
- /**
- * Create an instance of {@link ClaimsProcessorType }
- *
- */
- public ClaimsProcessorType createClaimsProcessorType() {
- return new ClaimsProcessorType();
- }
-
- /**
- * Create an instance of {@link ServiceProvidersType }
- *
- */
- public ServiceProvidersType createServiceProvidersType() {
- return new ServiceProvidersType();
- }
-
- /**
- * Create an instance of {@link ClaimsProcessorsType }
- *
- */
- public ClaimsProcessorsType createClaimsProcessorsType() {
- return new ClaimsProcessorsType();
- }
-
- /**
- * Create an instance of {@link KeyProviderType }
- *
- */
- public KeyProviderType createKeyProviderType() {
- return new KeyProviderType();
- }
-
- /**
- * Create an instance of {@link TokenProviderType }
- *
- */
- public TokenProviderType createTokenProviderType() {
- return new TokenProviderType();
- }
-
- /**
- * Create an instance of {@link ProviderType }
- *
- */
- public ProviderType createProviderType() {
- return new ProviderType();
- }
-
- /**
- * Create an instance of {@link IDPType }
- *
- */
- public IDPType createIDPType() {
- return new IDPType();
- }
-
- /**
- * Create an instance of {@link EncryptionType }
- *
- */
- public EncryptionType createEncryptionType() {
- return new EncryptionType();
- }
-
- /**
- * Create an instance of {@link KeyValueType }
- *
- */
- public KeyValueType createKeyValueType() {
- return new KeyValueType();
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link IDPType }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "urn:picketlink:identity-federation:config:1.0", name = "PicketLinkIDP")
- public JAXBElement<IDPType> createpicketlinkIDP(IDPType value) {
- return new JAXBElement<IDPType>(_picketlinkIDP_QNAME, IDPType.class, null, value);
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link STSType }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "urn:picketlink:identity-federation:config:1.0", name = "PicketLinkSTS")
- public JAXBElement<STSType> createPicketLinkSTS(STSType value) {
- return new JAXBElement<STSType>(_PicketLinkSTS_QNAME, STSType.class, null, value);
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link SPType }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "urn:picketlink:identity-federation:config:1.0", name = "PicketLinkSP")
- public JAXBElement<SPType> createpicketlinkSP(SPType value) {
- return new JAXBElement<SPType>(_picketlinkSP_QNAME, SPType.class, null, value);
- }
-
-}
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ProviderType.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ProviderType.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ProviderType.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,19 +1,5 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.09.03 at 01:21:42 PM BRT
-//
-
-
package org.picketlink.identity.federation.core.config;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import javax.xml.bind.annotation.XmlType;
import javax.xml.crypto.dsig.CanonicalizationMethod;
@@ -51,31 +37,14 @@
* </pre>
*
*
- */
- at XmlAccessorType(XmlAccessType.FIELD)
- at XmlType(name = "ProviderType", propOrder = {
- "identityURL",
- "trust",
- "keyProvider",
- "metaDataProvider"
-})
- at XmlSeeAlso({
- SPType.class,
- IDPType.class
-})
+ */
public class ProviderType {
- @XmlElement(name = "IdentityURL", required = true)
protected String identityURL;
- @XmlElement(name = "Trust")
protected TrustType trust;
- @XmlElement(name = "KeyProvider")
protected KeyProviderType keyProvider;
- @XmlElement(name = "MetaDataProvider")
protected MetadataProviderType metaDataProvider;
- @XmlAttribute(name = "ServerEnvironment")
protected String serverEnvironment;
- @XmlAttribute(name = "CanonicalizationMethod")
protected String canonicalizationMethod;
/**
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/SPType.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/SPType.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/SPType.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,19 +1,6 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.09.03 at 01:21:42 PM BRT
-//
-
-
package org.picketlink.identity.federation.core.config;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
/**
* Service Provider Type
*
@@ -34,16 +21,11 @@
* </pre>
*
*
- */
- at XmlAccessorType(XmlAccessType.FIELD)
- at XmlType(name = "SPType", propOrder = {
- "serviceURL"
-})
+ */
public class SPType
extends ProviderType
{
-
- @XmlElement(name = "ServiceURL", required = true)
+
protected String serviceURL;
/**
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/STSType.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/STSType.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/STSType.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,21 +1,9 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.10.30 at 02:46:25 PM GMT-03:00
-//
-
-
package org.picketlink.identity.federation.core.config;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
import javax.xml.crypto.dsig.CanonicalizationMethod;
+
/**
* <p>Java class for STSType complex type.
*
@@ -44,36 +32,18 @@
* </pre>
*
*
- */
- at XmlAccessorType(XmlAccessType.FIELD)
- at XmlType(name = "STSType", propOrder = {
- "keyProvider",
- "requestHandler",
- "claimsProcessors",
- "tokenProviders",
- "serviceProviders"
-})
+ */
public class STSType {
-
- @XmlElement(name = "KeyProvider")
- protected KeyProviderType keyProvider;
- @XmlElement(name = "RequestHandler")
- protected String requestHandler;
- @XmlElement(name = "ClaimsProcessors")
- protected ClaimsProcessorsType claimsProcessors;
- @XmlElement(name = "TokenProviders")
- protected TokenProvidersType tokenProviders;
- @XmlElement(name = "ServiceProviders")
- protected ServiceProvidersType serviceProviders;
- @XmlAttribute(name = "STSName")
- protected String stsName;
- @XmlAttribute(name = "TokenTimeout")
- protected Integer tokenTimeout;
- @XmlAttribute(name = "SignToken")
- protected Boolean signToken;
- @XmlAttribute(name = "EncryptToken")
- protected Boolean encryptToken;
- @XmlAttribute(name = "CanonicalizationMethod")
+
+ protected KeyProviderType keyProvider;
+ protected String requestHandler;
+ protected ClaimsProcessorsType claimsProcessors;
+ protected TokenProvidersType tokenProviders;
+ protected ServiceProvidersType serviceProviders;
+ protected String stsName;
+ protected Integer tokenTimeout;
+ protected Boolean signToken;
+ protected Boolean encryptToken;
protected String canonicalizationMethod;
/**
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ServiceProviderType.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ServiceProviderType.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ServiceProviderType.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,19 +1,6 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.09.03 at 01:21:42 PM BRT
-//
-
-
package org.picketlink.identity.federation.core.config;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
-
/**
*
* The service provider type contains information about a specific service provider. In particular,
@@ -29,14 +16,10 @@
* <pre>
* <complexType name="ServiceProviderType">
* <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-<<<<<<< .mine
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <attribute name="Endpoint" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="TruststoreAlias" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-=======
- * <attribute name="Endpoint" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
->>>>>>> .r772
- * <attribute name="TokenType" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ <attribute name="TokenType" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="TruststoreAlias" type="{http://www.w3.org/2001/XMLSchema}string" />
* </restriction>
* </complexContent>
@@ -44,16 +27,11 @@
* </pre>
*
*
- */
- at XmlAccessorType(XmlAccessType.FIELD)
- at XmlType(name = "ServiceProviderType")
+ */
public class ServiceProviderType {
-
- @XmlAttribute(name = "Endpoint", required = true)
- protected String endpoint;
- @XmlAttribute(name = "TokenType", required = true)
- protected String tokenType;
- @XmlAttribute(name = "TruststoreAlias")
+
+ protected String endpoint;
+ protected String tokenType;
protected String truststoreAlias;
/**
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ServiceProvidersType.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ServiceProvidersType.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ServiceProvidersType.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,21 +1,9 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.09.03 at 01:21:42 PM BRT
-//
-
-
package org.picketlink.identity.federation.core.config;
import java.util.ArrayList;
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
+import java.util.Collections;
+import java.util.List;
-
/**
*
* The service providers specify the token type expected by each service provider.
@@ -38,43 +26,32 @@
* </pre>
*
*
- */
- at XmlAccessorType(XmlAccessType.FIELD)
- at XmlType(name = "ServiceProvidersType", propOrder = {
- "serviceProvider"
-})
+ */
public class ServiceProvidersType {
+
+ protected List<ServiceProviderType> serviceProvider = new ArrayList<ServiceProviderType>();
- @XmlElement(name = "ServiceProvider", required = true)
- protected List<ServiceProviderType> serviceProvider;
-
+ public void add( ServiceProviderType sp )
+ {
+ this.serviceProvider.add(sp);
+ }
+
+ public void remove( ServiceProviderType sp )
+ {
+ this.serviceProvider.remove(sp);
+ }
+
/**
* Gets the value of the serviceProvider property.
*
* <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the serviceProvider property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getServiceProvider().add(newItem);
- * </pre>
- *
- *
- * <p>
* Objects of the following type(s) are allowed in the list
* {@link ServiceProviderType }
*
*
*/
- public List<ServiceProviderType> getServiceProvider() {
- if (serviceProvider == null) {
- serviceProvider = new ArrayList<ServiceProviderType>();
- }
- return this.serviceProvider;
+ public List<ServiceProviderType> getServiceProvider() {
+ return Collections.unmodifiableList( this.serviceProvider );
}
-}
+}
\ No newline at end of file
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/TokenProviderType.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/TokenProviderType.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/TokenProviderType.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,20 +1,8 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.09.03 at 01:21:42 PM BRT
-//
-
-
package org.picketlink.identity.federation.core.config;
import java.util.ArrayList;
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
+import java.util.Collections;
+import java.util.List;
/**
@@ -39,51 +27,35 @@
* </pre>
*
*
- */
- at XmlAccessorType(XmlAccessType.FIELD)
- at XmlType(name = "TokenProviderType", propOrder = {
- "property"
-})
+ */
public class TokenProviderType {
-
- @XmlElement(name = "Property")
- protected List<KeyValueType> property;
- @XmlAttribute(name = "ProviderClass", required = true)
- protected String providerClass;
- @XmlAttribute(name = "TokenType", required = true)
- protected String tokenType;
- @XmlAttribute(name = "TokenElement", required = true)
- protected String tokenElement;
- @XmlAttribute(name = "TokenElementNS", required = true)
+
+ protected List<KeyValueType> property = new ArrayList<KeyValueType>();
+ protected String providerClass;
+ protected String tokenType;
+ protected String tokenElement;
protected String tokenElementNS;
+ public void add( KeyValueType kv )
+ {
+ property.add(kv);
+ }
+
+ public void remove( KeyValueType kv )
+ {
+ this.remove(kv);
+ }
+
/**
* Gets the value of the property property.
- *
* <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the property property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getProperty().add(newItem);
- * </pre>
- *
- *
- * <p>
* Objects of the following type(s) are allowed in the list
* {@link KeyValueType }
*
*
*/
- public List<KeyValueType> getProperty() {
- if (property == null) {
- property = new ArrayList<KeyValueType>();
- }
- return this.property;
+ public List<KeyValueType> getProperty() {
+ return Collections.unmodifiableList( this.property );
}
/**
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/TokenProvidersType.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/TokenProvidersType.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/TokenProvidersType.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,19 +1,8 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.09.03 at 01:21:42 PM BRT
-//
-
-
package org.picketlink.identity.federation.core.config;
import java.util.ArrayList;
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
+import java.util.Collections;
+import java.util.List;
/**
@@ -40,43 +29,31 @@
* </pre>
*
*
- */
- at XmlAccessorType(XmlAccessType.FIELD)
- at XmlType(name = "TokenProvidersType", propOrder = {
- "tokenProvider"
-})
+ */
public class TokenProvidersType {
+
+ protected List<TokenProviderType> tokenProvider = new ArrayList<TokenProviderType>();
- @XmlElement(name = "TokenProvider", required = true)
- protected List<TokenProviderType> tokenProvider;
-
+ public void add( TokenProviderType tp )
+ {
+ this.tokenProvider.add(tp);
+ }
+
+ public void remove( TokenProviderType tp )
+ {
+ this.tokenProvider.remove(tp);
+ }
+
/**
* Gets the value of the tokenProvider property.
- *
* <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the tokenProvider property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getTokenProvider().add(newItem);
- * </pre>
- *
- *
- * <p>
* Objects of the following type(s) are allowed in the list
* {@link TokenProviderType }
*
*
*/
- public List<TokenProviderType> getTokenProvider() {
- if (tokenProvider == null) {
- tokenProvider = new ArrayList<TokenProviderType>();
- }
- return this.tokenProvider;
+ public List<TokenProviderType> getTokenProvider() {
+ return Collections.unmodifiableList( this.tokenProvider );
}
}
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/TrustType.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/TrustType.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/TrustType.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,19 +1,5 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.09.03 at 01:21:42 PM BRT
-//
-
-
package org.picketlink.identity.federation.core.config;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-
+
/**
* Aspects involved in trust decisions such as the domains that the IDP or the Service Provider trusts.
*
@@ -34,14 +20,9 @@
* </pre>
*
*
- */
- at XmlAccessorType(XmlAccessType.FIELD)
- at XmlType(name = "TrustType", propOrder = {
- "domains"
-})
+ */
public class TrustType {
-
- @XmlElement(name = "Domains", required = true)
+
protected String domains;
/**
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/package-info.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/package-info.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/package-info.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,9 +1 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.09.03 at 01:21:42 PM BRT
-//
-
- at javax.xml.bind.annotation.XmlSchema(namespace = "urn:picketlink:identity-federation:config:1.0", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package org.picketlink.identity.federation.core.config;
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/handler/config/Handler.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/handler/config/Handler.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/handler/config/Handler.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,20 +1,8 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.10.06 at 01:13:30 PM CDT
-//
-
-
package org.picketlink.identity.federation.core.handler.config;
import java.util.ArrayList;
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
-
+import java.util.Collections;
+import java.util.List;
import org.picketlink.identity.federation.core.config.KeyValueType;
@@ -38,46 +26,33 @@
* </pre>
*
*
- */
- at XmlAccessorType(XmlAccessType.FIELD)
- at XmlType(name = "Handler", propOrder = {
- "Option"
-})
+ */
public class Handler {
- protected List<KeyValueType> Option;
- @XmlAttribute
+ protected List<KeyValueType> option = new ArrayList<KeyValueType>();
protected String name;
- @XmlAttribute(name = "class")
protected String clazz;
+ public void add( KeyValueType kv )
+ {
+ this.option.add(kv);
+ }
+
+ public void remove( KeyValueType kv )
+ {
+ this.option.remove(kv);
+ }
+
/**
* Gets the value of the option property.
- *
* <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the option property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getOption().add(newItem);
- * </pre>
- *
- *
- * <p>
* Objects of the following type(s) are allowed in the list
* {@link KeyValueType }
*
*
*/
- public List<KeyValueType> getOption() {
- if (Option == null) {
- Option = new ArrayList<KeyValueType>();
- }
- return this.Option;
+ public List<KeyValueType> getOption() {
+ return Collections.unmodifiableList( this.option );
}
/**
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/handler/config/Handlers.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/handler/config/Handlers.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/handler/config/Handlers.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,19 +1,8 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.10.06 at 01:13:30 PM CDT
-//
-
-
package org.picketlink.identity.federation.core.handler.config;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
/**
@@ -34,43 +23,31 @@
* </pre>
*
*
- */
- at XmlAccessorType(XmlAccessType.FIELD)
- at XmlType(name = "Handlers", propOrder = {
- "handler"
-})
+ */
public class Handlers {
+
+ protected List<Handler> handler = new ArrayList<Handler>();
- @XmlElement(name = "Handler", required = true)
- protected List<Handler> handler;
-
+ public void add( Handler h )
+ {
+ this.handler.add( h );
+ }
+
+ public void remove( Handler h )
+ {
+ this.handler.remove( h );
+ }
+
/**
* Gets the value of the handler property.
- *
* <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the handler property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getHandler().add(newItem);
- * </pre>
- *
- *
- * <p>
* Objects of the following type(s) are allowed in the list
* {@link Handler }
*
*
*/
- public List<Handler> getHandler() {
- if (handler == null) {
- handler = new ArrayList<Handler>();
- }
- return this.handler;
+ public List<Handler> getHandler() {
+ return Collections.unmodifiableList( this.handler );
}
-}
+}
\ No newline at end of file
Deleted: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/handler/config/ObjectFactory.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/handler/config/ObjectFactory.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/handler/config/ObjectFactory.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,68 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.10.06 at 02:14:55 PM CDT
-//
-
-
-package org.picketlink.identity.federation.core.handler.config;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlElementDecl;
-import javax.xml.bind.annotation.XmlRegistry;
-import javax.xml.namespace.QName;
-
-
-/**
- * This object contains factory methods for each
- * Java content interface and Java element interface
- * generated in the picketlink.identity_federation.handler.config._1 package.
- * <p>An ObjectFactory allows you to programatically
- * construct new instances of the Java representation
- * for XML content. The Java representation of XML
- * content can consist of schema derived interfaces
- * and classes representing the binding of schema
- * type definitions, element declarations and model
- * groups. Factory methods for each of these are
- * provided in this class.
- *
- */
- at XmlRegistry
-public class ObjectFactory {
-
- private final static QName _Handlers_QNAME = new QName("urn:picketlink:identity-federation:handler:config:1.0", "Handlers");
-
- /**
- * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: picketlink.identity_federation.handler.config._1
- *
- */
- public ObjectFactory() {
- }
-
- /**
- * Create an instance of {@link Handler }
- *
- */
- public Handler createHandler() {
- return new Handler();
- }
-
- /**
- * Create an instance of {@link Handlers }
- *
- */
- public Handlers createHandlers() {
- return new Handlers();
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link Handlers }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "urn:picketlink:identity-federation:handler:config:1.0", name = "Handlers")
- public JAXBElement<Handlers> createHandlers(Handlers value) {
- return new JAXBElement<Handlers>(_Handlers_QNAME, Handlers.class, null, value);
- }
-
-}
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/handler/config/package-info.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/handler/config/package-info.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/handler/config/package-info.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -1,9 +1 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.10.06 at 01:13:30 PM CDT
-//
-
- at javax.xml.bind.annotation.XmlSchema(namespace = "urn:picketlink:identity-federation:handler:config:1.0", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package org.picketlink.identity.federation.core.handler.config;
Added: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/config/SAMLConfigParser.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/config/SAMLConfigParser.java (rev 0)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/config/SAMLConfigParser.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -0,0 +1,421 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.parsers.config;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.events.Attribute;
+import javax.xml.stream.events.EndElement;
+import javax.xml.stream.events.StartElement;
+import javax.xml.stream.events.XMLEvent;
+
+import org.picketlink.identity.federation.core.config.AuthPropertyType;
+import org.picketlink.identity.federation.core.config.IDPType;
+import org.picketlink.identity.federation.core.config.KeyProviderType;
+import org.picketlink.identity.federation.core.config.KeyValueType;
+import org.picketlink.identity.federation.core.config.MetadataProviderType;
+import org.picketlink.identity.federation.core.config.SPType;
+import org.picketlink.identity.federation.core.config.TrustType;
+import org.picketlink.identity.federation.core.exceptions.ParsingException;
+import org.picketlink.identity.federation.core.handler.config.Handler;
+import org.picketlink.identity.federation.core.handler.config.Handlers;
+import org.picketlink.identity.federation.core.parsers.AbstractParser;
+import org.picketlink.identity.federation.core.parsers.util.StaxParserUtil;
+
+/**
+ * Parse the SAML IDP/SP config as well as the handlers
+ * @author Anil.Saldhana at redhat.com
+ * @since Feb 4, 2011
+ */
+public class SAMLConfigParser extends AbstractParser
+{
+ public static final String IDP = "PicketLinkIDP";
+ public static final String SP = "PicketLinkSP";
+
+ public static final String IDENTITY_URL = "IdentityURL";
+ public static final String SERVICE_URL = "ServiceURL";
+
+ public static final String TRUST = "Trust";
+
+ public static final String DOMAINS = "Domains";
+
+ public static final String KEY_PROVIDER = "KeyProvider";
+ public static final String META_PROVIDER = "MetaDataProvider";
+ public static final String CLASS_NAME = "ClassName";
+ public static final String CLASS = "class";
+ public static final String AUTH = "Auth";
+ public static final String KEY = "Key";
+ public static final String VALUE = "Value";
+ public static final String VALIDATING_ALIAS = "ValidatingAlias";
+ public static final String ASSERTION_VALIDITY = "AssertionValidity";
+
+ public static final String ROLE_GENERATOR = "RoleGenerator";
+
+ public static final String ENCRYPT = "Encrypt";
+
+
+ public static final String ATTRIBUTE_MANAGER = "AttributeManager";
+ public static final String CANONICALIZATION_METHOD = "CanonicalizationMethod";
+
+ public static final String HANDLERS = "Handlers";
+ public static final String HANDLER = "Handler";
+ public static final String OPTION = "Option";
+
+
+ public Object parse(XMLEventReader xmlEventReader) throws ParsingException
+ {
+ StartElement startElement = StaxParserUtil.peekNextStartElement( xmlEventReader );
+
+ if( StaxParserUtil.getStartElementName(startElement).equals( IDP ))
+ return parseIDPConfiguration( xmlEventReader );
+ if( StaxParserUtil.getStartElementName(startElement).equals( SP ))
+ return parseSPConfiguration(xmlEventReader);
+
+ return parseHandlers(xmlEventReader);
+ }
+
+ public boolean supports(QName qname)
+ {
+ return false;
+ }
+
+ protected Handlers parseHandlers( XMLEventReader xmlEventReader ) throws ParsingException
+ {
+ Handlers handlers = new Handlers();
+
+ StartElement startElement = StaxParserUtil.getNextStartElement( xmlEventReader );
+ StaxParserUtil.validate( startElement, HANDLERS );
+
+ while (xmlEventReader.hasNext())
+ {
+ XMLEvent xmlEvent = StaxParserUtil.peek(xmlEventReader);
+ if (xmlEvent == null)
+ break;
+ if (xmlEvent instanceof EndElement)
+ {
+ EndElement endElement = (EndElement) StaxParserUtil.getNextEvent(xmlEventReader);
+ String endElementName = StaxParserUtil.getEndElementName(endElement);
+ if (endElementName.equals( HANDLERS ))
+ break;
+ else
+ throw new RuntimeException("Unknown End Element:" + endElementName);
+ }
+
+ startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
+ if ( startElement == null)
+ break;
+ String elementName = StaxParserUtil.getStartElementName( startElement );
+ if( elementName.equals( HANDLER ))
+ {
+ Handler handler = parseHandler(xmlEventReader, startElement);
+ handlers.add(handler);
+ }
+ }
+
+ return handlers;
+ }
+
+ protected IDPType parseIDPConfiguration( XMLEventReader xmlEventReader ) throws ParsingException
+ {
+ IDPType idp = new IDPType();
+ StartElement startElement = StaxParserUtil.getNextStartElement( xmlEventReader );
+ StaxParserUtil.validate( startElement, IDP );
+
+ // parse and set the root element attributes.
+ QName attributeQName = new QName("", ASSERTION_VALIDITY);
+ Attribute attribute = startElement.getAttributeByName(attributeQName);
+ if (attribute != null)
+ idp.setAssertionValidity( Long.parseLong( StaxParserUtil.getAttributeValue( attribute )) );
+
+ attributeQName = new QName("", ROLE_GENERATOR);
+ attribute = startElement.getAttributeByName(attributeQName);
+ if (attribute != null)
+ idp.setRoleGenerator( StaxParserUtil.getAttributeValue( attribute )) ;
+
+ attributeQName = new QName("", ENCRYPT);
+ attribute = startElement.getAttributeByName(attributeQName);
+ if (attribute != null)
+ idp.setEncrypt( Boolean.parseBoolean( StaxParserUtil.getAttributeValue( attribute )) ) ;
+
+ attributeQName = new QName("", CANONICALIZATION_METHOD );
+ attribute = startElement.getAttributeByName(attributeQName);
+ if (attribute != null)
+ idp.setCanonicalizationMethod( StaxParserUtil.getAttributeValue( attribute ));
+
+ attributeQName = new QName("", ATTRIBUTE_MANAGER );
+ attribute = startElement.getAttributeByName(attributeQName);
+ if (attribute != null)
+ idp.setAttributeManager( StaxParserUtil.getAttributeValue( attribute ));
+
+
+ while (xmlEventReader.hasNext())
+ {
+ XMLEvent xmlEvent = StaxParserUtil.peek(xmlEventReader);
+ if (xmlEvent == null)
+ break;
+ if (xmlEvent instanceof EndElement)
+ {
+ EndElement endElement = (EndElement) StaxParserUtil.getNextEvent(xmlEventReader);
+ String endElementName = StaxParserUtil.getEndElementName(endElement);
+ if (endElementName.equals( IDP ))
+ break;
+ else
+ throw new RuntimeException("Unknown End Element:" + endElementName);
+ }
+
+ startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
+ if ( startElement == null)
+ break;
+ String elementName = StaxParserUtil.getStartElementName( startElement );
+ if( elementName.equals( IDENTITY_URL ))
+ {
+ idp.setIdentityURL( StaxParserUtil.getElementText(xmlEventReader) );
+ }
+ else if( elementName.equals( TRUST ))
+ {
+ TrustType trustType = new TrustType();
+ startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
+ StaxParserUtil.validate(startElement, DOMAINS);
+ trustType.setDomains( StaxParserUtil.getElementText(xmlEventReader) );
+ EndElement endElement = StaxParserUtil.getNextEndElement(xmlEventReader);
+ StaxParserUtil.validate(endElement, TRUST);
+ idp.setTrust(trustType);
+ }
+ else if( elementName.equals( KEY_PROVIDER) )
+ {
+ KeyProviderType keyProviderType = this.parseKeyProvider(xmlEventReader, startElement);
+ idp.setKeyProvider(keyProviderType);
+ }
+ else if( elementName.equals( META_PROVIDER) )
+ {
+ MetadataProviderType mdProviderType = parseMDProvider( xmlEventReader, startElement);
+ idp.setMetaDataProvider( mdProviderType );
+ }
+ }
+ return idp;
+ }
+
+ protected SPType parseSPConfiguration( XMLEventReader xmlEventReader ) throws ParsingException
+ {
+ SPType sp = new SPType();
+ StartElement startElement = StaxParserUtil.getNextStartElement( xmlEventReader );
+ StaxParserUtil.validate( startElement, SP );
+
+
+ QName attributeQName = new QName("", CANONICALIZATION_METHOD );
+ Attribute attribute = startElement.getAttributeByName(attributeQName);
+ if (attribute != null)
+ sp.setCanonicalizationMethod( StaxParserUtil.getAttributeValue( attribute ));
+
+
+ while (xmlEventReader.hasNext())
+ {
+ XMLEvent xmlEvent = StaxParserUtil.peek(xmlEventReader);
+ if (xmlEvent == null)
+ break;
+ if (xmlEvent instanceof EndElement)
+ {
+ EndElement endElement = (EndElement) StaxParserUtil.getNextEvent(xmlEventReader);
+ String endElementName = StaxParserUtil.getEndElementName(endElement);
+ if (endElementName.equals( SP ))
+ break;
+ else
+ throw new RuntimeException("Unknown End Element:" + endElementName);
+ }
+
+ startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
+ if ( startElement == null)
+ break;
+ String elementName = StaxParserUtil.getStartElementName( startElement );
+ if( elementName.equals( IDENTITY_URL ))
+ {
+ sp.setIdentityURL( StaxParserUtil.getElementText(xmlEventReader) );
+ }
+ else if( elementName.equals( SERVICE_URL ))
+ {
+ sp.setServiceURL( StaxParserUtil.getElementText(xmlEventReader) );
+ }
+ else if( elementName.equals( TRUST ))
+ {
+ TrustType trustType = new TrustType();
+ startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
+ StaxParserUtil.validate(startElement, DOMAINS);
+ trustType.setDomains( StaxParserUtil.getElementText(xmlEventReader) );
+ EndElement endElement = StaxParserUtil.getNextEndElement(xmlEventReader);
+ StaxParserUtil.validate(endElement, TRUST);
+ sp.setTrust(trustType);
+ }
+ else if( elementName.equals( KEY_PROVIDER) )
+ {
+ KeyProviderType keyProviderType = parseKeyProvider(xmlEventReader, startElement);
+ sp.setKeyProvider(keyProviderType);
+ }
+ else if( elementName.equals( META_PROVIDER) )
+ {
+ MetadataProviderType mdProviderType = parseMDProvider( xmlEventReader, startElement);
+ sp.setMetaDataProvider( mdProviderType );
+ }
+ }
+ return sp;
+ }
+
+ protected KeyProviderType parseKeyProvider(XMLEventReader xmlEventReader, StartElement startElement ) throws ParsingException
+ {
+ XMLEvent xmlEvent = null;
+ KeyProviderType keyProviderType = new KeyProviderType();
+
+ // parse and set the ClassName element attributes.
+ QName attributeQName = new QName("", CLASS_NAME );
+ Attribute attribute = startElement.getAttributeByName(attributeQName);
+ if (attribute != null)
+ keyProviderType.setClassName( StaxParserUtil.getAttributeValue( attribute ) );
+
+ while( xmlEventReader.hasNext() )
+ {
+ xmlEvent = StaxParserUtil.peek(xmlEventReader);
+ if( xmlEvent == null )
+ break;
+ if( xmlEvent instanceof EndElement )
+ {
+ EndElement endElement = StaxParserUtil.getNextEndElement(xmlEventReader);
+ String endElementName = StaxParserUtil.getEndElementName( endElement );
+ if( endElementName.equals( KEY_PROVIDER ))
+ break;
+ else
+ continue;
+ }
+ startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
+ String startElementName = StaxParserUtil.getStartElementName(startElement);
+ if( startElementName.equals( AUTH ))
+ {
+ AuthPropertyType auth = new AuthPropertyType();
+ populateKeyValueType(auth, startElement);
+
+ keyProviderType.add(auth);
+ }
+ else if( startElementName.equals( VALIDATING_ALIAS ))
+ {
+ KeyValueType auth = new KeyValueType();
+ populateKeyValueType(auth, startElement);
+
+ keyProviderType.add(auth);
+ }
+ }
+ return keyProviderType;
+ }
+
+ protected Handler parseHandler(XMLEventReader xmlEventReader, StartElement startElement ) throws ParsingException
+ {
+ XMLEvent xmlEvent = null;
+ Handler handlerType = new Handler();
+
+ // parse and set the ClassName element attributes.
+ QName attributeQName = new QName("", CLASS );
+ Attribute attribute = startElement.getAttributeByName(attributeQName);
+ if (attribute != null)
+ handlerType.setClazz( StaxParserUtil.getAttributeValue( attribute ) );
+
+ while( xmlEventReader.hasNext() )
+ {
+ xmlEvent = StaxParserUtil.peek(xmlEventReader);
+ if( xmlEvent == null )
+ break;
+ if( xmlEvent instanceof EndElement )
+ {
+ EndElement endElement = StaxParserUtil.getNextEndElement(xmlEventReader);
+ String endElementName = StaxParserUtil.getEndElementName( endElement );
+ if( endElementName.equals( HANDLER ))
+ break;
+ else
+ continue;
+ }
+ startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
+ String startElementName = StaxParserUtil.getStartElementName(startElement);
+
+ if( startElementName.equals( OPTION ))
+ {
+ KeyValueType auth = new KeyValueType();
+ populateKeyValueType(auth, startElement);
+
+ handlerType.add(auth);
+ }
+ }
+ return handlerType;
+ }
+
+ protected MetadataProviderType parseMDProvider(XMLEventReader xmlEventReader, StartElement startElement ) throws ParsingException
+ {
+ XMLEvent xmlEvent = null;
+ MetadataProviderType metaProviderType = new MetadataProviderType();
+
+ // parse and set the ClassName element attributes.
+ QName attributeQName = new QName("", CLASS_NAME );
+ Attribute attribute = startElement.getAttributeByName(attributeQName);
+ if (attribute != null)
+ metaProviderType.setClassName( StaxParserUtil.getAttributeValue( attribute ) );
+
+ while( xmlEventReader.hasNext() )
+ {
+ xmlEvent = StaxParserUtil.peek(xmlEventReader);
+ if( xmlEvent == null )
+ break;
+ if( xmlEvent instanceof EndElement )
+ {
+ EndElement endElement = StaxParserUtil.getNextEndElement(xmlEventReader);
+ String endElementName = StaxParserUtil.getEndElementName( endElement );
+ if( endElementName.equals( META_PROVIDER ))
+ break;
+ else
+ continue;
+ }
+ startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
+ String startElementName = StaxParserUtil.getStartElementName(startElement);
+ if( startElementName.equals( OPTION ))
+ {
+ KeyValueType auth = new KeyValueType();
+ populateKeyValueType(auth, startElement);
+
+ metaProviderType.add(auth);
+ }
+ }
+ return metaProviderType;
+ }
+
+ protected void populateKeyValueType( KeyValueType kvt, StartElement startElement )
+ {
+ QName attributeQName = new QName("", KEY );
+ Attribute attribute = startElement.getAttributeByName(attributeQName);
+ if (attribute != null)
+ kvt.setKey( StaxParserUtil.getAttributeValue( attribute ) );
+
+ attributeQName = new QName("", OPTION );
+ attribute = startElement.getAttributeByName(attributeQName);
+ if (attribute != null)
+ kvt.setKey( StaxParserUtil.getAttributeValue( attribute ) );
+
+
+ attributeQName = new QName("", VALUE );
+ attribute = startElement.getAttributeByName(attributeQName);
+ if (attribute != null)
+ kvt.setValue( StaxParserUtil.getAttributeValue( attribute ) );
+ }
+}
\ No newline at end of file
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/sts/STSConfigParser.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/sts/STSConfigParser.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/sts/STSConfigParser.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -88,7 +88,6 @@
*
* @see org.picketlink.identity.federation.core.parsers.ParserNamespaceSupport#parse(javax.xml.stream.XMLEventReader)
*/
- @Override
public Object parse(XMLEventReader xmlEventReader) throws ParsingException
{
StartElement startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
@@ -174,8 +173,7 @@
* (non-Javadoc)
*
* @see org.picketlink.identity.federation.core.parsers.ParserNamespaceSupport#supports(javax.xml.namespace.QName)
- */
- @Override
+ */
public boolean supports(QName qname)
{
return CONFIG_NS.equals(qname.getNamespaceURI());
@@ -248,7 +246,7 @@
EndElement endElement = StaxParserUtil.getNextEndElement(xmlEventReader);
StaxParserUtil.validate(endElement, VALIDATING_ALIAS_ELEMENT);
- keyProvider.getValidatingAlias().add(keyValue);
+ keyProvider.add( keyValue );
}
else if (AUTH_ELEMENT.equalsIgnoreCase(elementName))
{
@@ -266,7 +264,7 @@
EndElement endElement = StaxParserUtil.getNextEndElement(xmlEventReader);
StaxParserUtil.validate(endElement, AUTH_ELEMENT);
- keyProvider.getAuth().add(authProperty);
+ keyProvider.add(authProperty);
}
else
throw new ParsingException("Unknown Element: " + elementName);
@@ -364,12 +362,12 @@
EndElement endElement = StaxParserUtil.getNextEndElement(xmlEventReader);
StaxParserUtil.validate(endElement, PROPERTY_ELEMENT);
- claimsProcessor.getProperty().add(keyValue);
+ claimsProcessor.add(keyValue);
}
else
throw new ParsingException("Unknown Element: " + elementName);
}
- claimsProcessors.getClaimsProcessor().add(claimsProcessor);
+ claimsProcessors.add( claimsProcessor );
}
else
throw new ParsingException("Unknown Element: " + elementName);
@@ -475,12 +473,12 @@
EndElement endElement = StaxParserUtil.getNextEndElement(xmlEventReader);
StaxParserUtil.validate(endElement, PROPERTY_ELEMENT);
- tokenProvider.getProperty().add(keyValue);
+ tokenProvider.add(keyValue);
}
else
throw new ParsingException("Unknown Element: " + elementName);
}
- tokenProviders.getTokenProvider().add(tokenProvider);
+ tokenProviders.add( tokenProvider );
}
else
throw new ParsingException("Unknown Element: " + elementName);
@@ -547,7 +545,7 @@
EndElement endElement = StaxParserUtil.getNextEndElement(xmlEventReader);
StaxParserUtil.validate(endElement, SERVICE_PROVIDER_ELEMENT);
- serviceProviders.getServiceProvider().add(serviceProvider);
+ serviceProviders.add(serviceProvider);
}
else
throw new ParsingException("Unknown Element: " + elementName);
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/WSTrustUtil.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/WSTrustUtil.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/WSTrustUtil.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -289,11 +289,13 @@
*/
public static void persistSTSConfiguration(STSType stsConfiguration, OutputStream outputStream) throws JAXBException
{
- String pkgName = "org.picketlink.identity.federation.core.config";
+ throw new RuntimeException();
+
+ /*String pkgName = "org.picketlink.identity.federation.core.config";
Marshaller marshaller = JAXBUtil.getMarshaller(pkgName);
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
org.picketlink.identity.federation.core.config.ObjectFactory objectFactory = new org.picketlink.identity.federation.core.config.ObjectFactory();
- marshaller.marshal(objectFactory.createPicketLinkSTS(stsConfiguration), outputStream);
+ marshaller.marshal(objectFactory.createPicketLinkSTS(stsConfiguration), outputStream);*/
}
/**
Modified: federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/config/ConfigUnitTestCase.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/config/ConfigUnitTestCase.java 2011-02-04 21:28:40 UTC (rev 734)
+++ federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/config/ConfigUnitTestCase.java 2011-02-04 22:44:25 UTC (rev 735)
@@ -21,15 +21,16 @@
*/
package org.picketlink.test.identity.federation.core.config;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
import java.io.InputStream;
import java.util.List;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.Unmarshaller;
import javax.xml.crypto.dsig.CanonicalizationMethod;
-import junit.framework.TestCase;
-
+import org.junit.Test;
import org.picketlink.identity.federation.core.config.AuthPropertyType;
import org.picketlink.identity.federation.core.config.IDPType;
import org.picketlink.identity.federation.core.config.KeyProviderType;
@@ -43,7 +44,8 @@
import org.picketlink.identity.federation.core.config.TrustType;
import org.picketlink.identity.federation.core.handler.config.Handler;
import org.picketlink.identity.federation.core.handler.config.Handlers;
-import org.picketlink.identity.federation.core.util.JAXBUtil;
+import org.picketlink.identity.federation.core.parsers.config.SAMLConfigParser;
+import org.picketlink.identity.federation.core.parsers.sts.STSConfigParser;
/**
* Unit Test the various config
@@ -51,18 +53,19 @@
* @author Anil.Saldhana at redhat.com
* @since Jan 21, 2009
*/
-public class ConfigUnitTestCase extends TestCase
+public class ConfigUnitTestCase
{
String config = "config/test-config-";
- @SuppressWarnings("unchecked")
+ @Test
public void test01() throws Exception
{
Object object = this.unmarshall(config + "1.xml");
assertNotNull("IDP is not null", object);
- assertTrue(object instanceof JAXBElement);
+ /*assertTrue(object instanceof JAXBElement);
- IDPType idp = ((JAXBElement<IDPType>) object).getValue();
+ IDPType idp = ((JAXBElement<IDPType>) object).getValue();*/
+ IDPType idp = (IDPType) object;
assertEquals("300000", 300000L, idp.getAssertionValidity());
assertEquals("org.picketlink.identity.federation.bindings.tomcat.TomcatRoleGenerator", idp.getRoleGenerator());
@@ -73,14 +76,13 @@
assertTrue("jboss.com trusted", domains.indexOf("jboss.com") > -1);
}
- @SuppressWarnings("unchecked")
+ @Test
public void test02() throws Exception
{
Object object = this.unmarshall(config + "2.xml");
- assertNotNull("IDP is not null", object);
- assertTrue(object instanceof JAXBElement);
+ assertNotNull("IDP is not null", object);
- IDPType idp = ((JAXBElement<IDPType>) object).getValue();
+ IDPType idp = (IDPType) object;
assertEquals("20000", 20000L, idp.getAssertionValidity());
assertEquals("somefqn", idp.getRoleGenerator());
assertTrue(idp.isEncrypt());
@@ -115,14 +117,13 @@
assertTrue("jboss.com trusted", domains.indexOf("jboss.com") > -1);
}
- @SuppressWarnings("unchecked")
+ @Test
public void test03() throws Exception
{
Object object = this.unmarshall(config + "3.xml");
- assertNotNull("SP is null", object);
- assertTrue(object instanceof JAXBElement);
+ assertNotNull("SP is null", object);
- SPType sp = ((JAXBElement<SPType>) object).getValue();
+ SPType sp = (SPType) object;
assertEquals("http://localhost:8080/idp", sp.getIdentityURL());
assertEquals("http://localhost:8080/sales", sp.getServiceURL());
assertEquals( CanonicalizationMethod.EXCLUSIVE , sp.getCanonicalizationMethod() );
@@ -135,14 +136,19 @@
*
* @throws Exception if an error occurs while running the test.
*/
- @SuppressWarnings("unchecked")
+ @Test
public void test04() throws Exception
{
- Object object = this.unmarshall(this.config + "4.xml");
+ ClassLoader tcl = Thread.currentThread().getContextClassLoader();
+ InputStream is = tcl.getResourceAsStream( this.config + "4.xml" );
+ assertNotNull("Inputstream not null for config file:" + this.config + "4.xml", is);
+
+ STSConfigParser parser = new STSConfigParser();
+
+ Object object = parser.parse(is);
assertNotNull("Found a null STS configuration", object);
- assertTrue("Unexpected configuration type", object instanceof JAXBElement);
- STSType stsType = ((JAXBElement<STSType>) object).getValue();
+ STSType stsType = (STSType) object;
// general STS configurations.
assertEquals("Unexpected STS name", "Test STS", stsType.getSTSName());
assertEquals("Unexpected token timeout value", 7200, stsType.getTokenTimeout());
@@ -175,13 +181,10 @@
assertEquals("Unexpected token type", "specialToken", serviceProvider.getTokenType());
}
- @SuppressWarnings("unchecked")
+ @Test
public void test05() throws Exception
- {
- JAXBElement<Handlers> handlersJaxb = (JAXBElement<Handlers>) this.unmarshall(config + "5.xml");
- assertNotNull("Handlers not null", handlersJaxb);
-
- Handlers handlers = handlersJaxb.getValue();
+ {
+ Handlers handlers = (Handlers) this.unmarshall(config + "5.xml");
List<Handler> handlerList = handlers.getHandler();
assertEquals("1 handler",1, handlerList.size());
@@ -199,17 +202,21 @@
private Object unmarshall(String configFile) throws Exception
{
- String[] schemas = new String[] { "schema/config/picketlink-fed.xsd",
- "schema/config/picketlink-fed-handler.xsd"};
+
+ /*String[] schemas = new String[] { "schema/config/picketlink-fed.xsd",
+ "schema/config/picketlink-fed-handler.xsd"};*/
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
InputStream is = tcl.getResourceAsStream(configFile);
assertNotNull("Inputstream not null for config file:" + configFile, is);
+
+ SAMLConfigParser parser = new SAMLConfigParser();
+ return parser.parse( is );
- String[] pkgNames = new String[] {"org.picketlink.identity.federation.core.config",
+ /* String[] pkgNames = new String[] {"org.picketlink.identity.federation.core.config",
"org.picketlink.identity.federation.core.handler.config"};
Unmarshaller un = JAXBUtil.getValidatingUnmarshaller(pkgNames,
schemas);
- return un.unmarshal(is);
+ return un.unmarshal(is);*/
}
}
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list