Author: anil.saldhana(a)jboss.com
Date: 2009-09-14 16:32:37 -0400 (Mon, 14 Sep 2009)
New Revision: 789
Added:
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/common/StatementLocal.java
Modified:
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/util/IDPWebRequestUtil.java
Log:
JBID-152: threadlocal support to hold statements
Added:
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/common/StatementLocal.java
===================================================================
---
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/common/StatementLocal.java
(rev 0)
+++
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/common/StatementLocal.java 2009-09-14
20:32:37 UTC (rev 789)
@@ -0,0 +1,38 @@
+/*
+ * 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.jboss.identity.federation.core.saml.v2.common;
+
+import java.util.List;
+
+import org.jboss.identity.federation.saml.v2.assertion.StatementAbstractType;
+
+/**
+ * Thread Local holding the statements
+ * returned by IDP
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Sep 14, 2009
+ */
+public class StatementLocal
+{
+ public static ThreadLocal<List<StatementAbstractType>> statements
+ = new InheritableThreadLocal<List<StatementAbstractType>>();
+}
\ No newline at end of file
Modified:
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/util/IDPWebRequestUtil.java
===================================================================
---
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/util/IDPWebRequestUtil.java 2009-09-14
20:24:52 UTC (rev 788)
+++
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/util/IDPWebRequestUtil.java 2009-09-14
20:32:37 UTC (rev 789)
@@ -49,6 +49,7 @@
import org.jboss.identity.federation.core.exceptions.ParsingException;
import org.jboss.identity.federation.core.interfaces.AttributeManager;
import org.jboss.identity.federation.core.saml.v2.common.IDGenerator;
+import org.jboss.identity.federation.core.saml.v2.common.StatementLocal;
import org.jboss.identity.federation.core.saml.v2.constants.JBossSAMLURIConstants;
import
org.jboss.identity.federation.core.saml.v2.exceptions.IssueInstantMissingException;
import org.jboss.identity.federation.core.saml.v2.exceptions.IssuerNotTrustedException;
@@ -182,6 +183,9 @@
attributeManager.getAttributes(userPrincipal, this.attribKeys);
List<StatementAbstractType> stats =
StatementUtil.createStatements(attribs);
assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement().addAll(stats);
+
+ //Set it on a thread local for JBID integrators
+ StatementLocal.statements.set(stats);
}
catch(Exception e)
{