Author: anil.saldhana(a)jboss.com
Date: 2008-12-11 10:26:54 -0500 (Thu, 11 Dec 2008)
New Revision: 143
Added:
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/saml/v2/jboss/
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/saml/v2/jboss/IDPInfoHolder.java
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/saml/v2/jboss/IssuerInfoHolder.java
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/saml/v2/jboss/JBossSAMLConstants.java
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/saml/v2/jboss/JBossSAMLURIConstants.java
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/saml/v2/jboss/SPInfoHolder.java
Log:
JBoss constants and holders
Added:
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/saml/v2/jboss/IDPInfoHolder.java
===================================================================
---
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/saml/v2/jboss/IDPInfoHolder.java
(rev 0)
+++
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/saml/v2/jboss/IDPInfoHolder.java 2008-12-11
15:26:54 UTC (rev 143)
@@ -0,0 +1,66 @@
+/*
+ * 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.saml.v2.jboss;
+
+
+/**
+ * Holds essential information about an IDP for creating
+ * saml messages.
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Dec 10, 2008
+ */
+public class IDPInfoHolder
+{
+ private String subjectConfirmationMethod =
JBossSAMLURIConstants.SUBJECT_CONFIRMATION_BEARER.get();
+ private String nameIDFormat = JBossSAMLURIConstants.TRANSIENT_FORMAT.get();
+ private String nameIDFormatValue;
+
+ public String getSubjectConfirmationMethod()
+ {
+ return subjectConfirmationMethod;
+ }
+
+ public void setSubjectConfirmationMethod(String subjectConfirmationMethod)
+ {
+ this.subjectConfirmationMethod = subjectConfirmationMethod;
+ }
+
+ public String getNameIDFormat()
+ {
+ return nameIDFormat;
+ }
+
+ public void setNameIDFormat(String nameIDFormat)
+ {
+ this.nameIDFormat = nameIDFormat;
+ }
+
+ public String getNameIDFormatValue()
+ {
+ return nameIDFormatValue;
+ }
+
+ public void setNameIDFormatValue(String nameIDFormatValue)
+ {
+ this.nameIDFormatValue = nameIDFormatValue;
+ }
+}
\ No newline at end of file
Added:
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/saml/v2/jboss/IssuerInfoHolder.java
===================================================================
---
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/saml/v2/jboss/IssuerInfoHolder.java
(rev 0)
+++
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/saml/v2/jboss/IssuerInfoHolder.java 2008-12-11
15:26:54 UTC (rev 143)
@@ -0,0 +1,86 @@
+/*
+ * 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.saml.v2.jboss;
+
+import org.jboss.identity.federation.saml.v2.assertion.NameIDType;
+import org.jboss.identity.federation.saml.v2.assertion.ObjectFactory;
+
+/**
+ * Holds info about the issuer for saml messages creation
+ * @author Anil.Saldhana(a)redhat.com
+ * @param <JBossSAMLConstants>
+ * @since Dec 10, 2008
+ */
+public class IssuerInfoHolder
+{
+ private NameIDType issuer;
+
+ private String statusCodeURI;
+ private String samlVersion = JBossSAMLConstants.VERSION_2_0.get();
+
+
+ public IssuerInfoHolder(NameIDType issuer)
+ {
+ if(issuer == null)
+ throw new IllegalArgumentException("issuer in ctr in null");
+ this.issuer = issuer;
+ }
+
+ public IssuerInfoHolder(String issuerAsString)
+ {
+ if(issuerAsString == null)
+ throw new IllegalArgumentException("issuerAsString is null");
+ ObjectFactory assertionObjectFactory = new ObjectFactory();
+ issuer = assertionObjectFactory.createNameIDType();
+ issuer.setValue(issuerAsString);
+ }
+
+ public NameIDType getIssuer()
+ {
+ return issuer;
+ }
+
+ public void setIssuer(NameIDType issuer)
+ {
+ this.issuer = issuer;
+ }
+
+ public String getStatusCode()
+ {
+ return statusCodeURI;
+ }
+
+ public void setStatusCode(String statusCode)
+ {
+ this.statusCodeURI = statusCode;
+ }
+
+ public String getSamlVersion()
+ {
+ return samlVersion;
+ }
+
+ public void setSamlVersion(String samlVersion)
+ {
+ this.samlVersion = samlVersion;
+ }
+}
\ No newline at end of file
Added:
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/saml/v2/jboss/JBossSAMLConstants.java
===================================================================
---
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/saml/v2/jboss/JBossSAMLConstants.java
(rev 0)
+++
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/saml/v2/jboss/JBossSAMLConstants.java 2008-12-11
15:26:54 UTC (rev 143)
@@ -0,0 +1,44 @@
+/*
+ * 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.saml.v2.jboss;
+
+/**
+ * SAML Constants
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Dec 10, 2008
+ */
+public enum JBossSAMLConstants
+{
+ VERSION_2_0("2.0");
+
+ private String val;
+
+ private JBossSAMLConstants(String val)
+ {
+ this.val = val;
+ }
+
+ public String get()
+ {
+ return this.val;
+ }
+}
\ No newline at end of file
Added:
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/saml/v2/jboss/JBossSAMLURIConstants.java
===================================================================
---
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/saml/v2/jboss/JBossSAMLURIConstants.java
(rev 0)
+++
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/saml/v2/jboss/JBossSAMLURIConstants.java 2008-12-11
15:26:54 UTC (rev 143)
@@ -0,0 +1,48 @@
+/*
+ * 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.saml.v2.jboss;
+
+
+/**
+ * Define the constants based on URI
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Dec 10, 2008
+ */
+public enum JBossSAMLURIConstants
+{
+
AC_PASSWORD_PROTECTED_TRANSPORT("urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"),
+ SUBJECT_CONFIRMATION_BEARER("urn:oasis:names:tc:SAML:2.0:cm:bearer"),
+ STATUS_SUCCESS("urn:oasis:names:tc:SAML:2.0:status:Success"),
+ TRANSIENT_FORMAT("urn:oasis:names:tc:SAML:2.0:nameid-format:transient");
+
+ private String uri = null;
+
+ private JBossSAMLURIConstants(String uristr)
+ {
+ this.uri = uristr;
+ }
+
+ public String get()
+ {
+ return this.uri;
+ }
+}
\ No newline at end of file
Added:
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/saml/v2/jboss/SPInfoHolder.java
===================================================================
---
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/saml/v2/jboss/SPInfoHolder.java
(rev 0)
+++
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/saml/v2/jboss/SPInfoHolder.java 2008-12-11
15:26:54 UTC (rev 143)
@@ -0,0 +1,55 @@
+/*
+ * 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.saml.v2.jboss;
+
+/**
+ * <p>Holds the information about a Service Provider</p>
+ * <p>This holder is useful in generating saml messages</p>
+ *
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Dec 10, 2008
+ */
+public class SPInfoHolder
+{
+ private String requestID;
+ private String responseDestinationURI;
+
+ public String getRequestID()
+ {
+ return requestID;
+ }
+
+ public void setRequestID(String requestID)
+ {
+ this.requestID = requestID;
+ }
+
+ public String getResponseDestinationURI()
+ {
+ return responseDestinationURI;
+ }
+
+ public void setResponseDestinationURI(String responseDestinationURI)
+ {
+ this.responseDestinationURI = responseDestinationURI;
+ }
+}
\ No newline at end of file