[jboss-cvs] Picketlink SVN: r1427 - in federation/trunk: picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2 and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Feb 21 17:14:07 EST 2012


Author: anil.saldhana at jboss.com
Date: 2012-02-21 17:14:06 -0500 (Tue, 21 Feb 2012)
New Revision: 1427

Added:
   federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/SerializablePrincipal.java
Modified:
   federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2AuthenticationHandler.java
Log:
PLFED-254: use serializable principal that is outside the handler

Added: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/SerializablePrincipal.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/SerializablePrincipal.java	                        (rev 0)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/SerializablePrincipal.java	2012-02-21 22:14:06 UTC (rev 1427)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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;
+
+import java.io.Serializable;
+import java.security.Principal;
+
+/**
+ * An instance of {@link Principal} that is {@link Serializable}
+ * @author Anil Saldhana
+ * @since Feb 21, 2012
+ */
+public class SerializablePrincipal implements Principal, Serializable
+{
+   private static final long serialVersionUID = -4732505034437816312L;
+
+   private final String name;
+
+   public SerializablePrincipal(String name)
+   {
+      this.name = name;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+}
\ No newline at end of file

Modified: federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2AuthenticationHandler.java
===================================================================
--- federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2AuthenticationHandler.java	2012-02-21 22:13:09 UTC (rev 1426)
+++ federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2AuthenticationHandler.java	2012-02-21 22:14:06 UTC (rev 1427)
@@ -21,7 +21,6 @@
  */
 package org.picketlink.identity.federation.web.handlers.saml2;
 
-import java.io.Serializable;
 import java.io.StringWriter;
 import java.security.Principal;
 import java.security.PrivateKey;
@@ -38,6 +37,7 @@
 import org.picketlink.identity.federation.api.saml.v2.request.SAML2Request;
 import org.picketlink.identity.federation.api.saml.v2.response.SAML2Response;
 import org.picketlink.identity.federation.core.ErrorCodes;
+import org.picketlink.identity.federation.core.SerializablePrincipal;
 import org.picketlink.identity.federation.core.exceptions.ConfigurationException;
 import org.picketlink.identity.federation.core.exceptions.ProcessingException;
 import org.picketlink.identity.federation.core.parsers.saml.SAMLParser;
@@ -603,21 +603,4 @@
          return roles;
       }
    }
-   
-   private class SerializablePrincipal implements Principal, Serializable
-   {
-      private static final long serialVersionUID = 7701951188631723253L;
-
-      private String userName;
-      
-      private SerializablePrincipal(String userName)
-      {
-         this.userName = userName;
-      }
-
-      public String getName()
-      {
-         return userName;
-      }      
-   }
 }
\ No newline at end of file



More information about the jboss-cvs-commits mailing list