Author: anil.saldhana(a)jboss.com
Date: 2009-05-22 18:32:44 -0400 (Fri, 22 May 2009)
New Revision: 508
Modified:
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/JBossSAMLAuthnRequestFactory.java
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/JBossSAMLAuthnResponseFactory.java
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/JBossSAMLBaseFactory.java
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/SOAPSAMLXACMLUtil.java
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/XMLTimeUtil.java
Log:
JBID-111: project specific exceptions
Modified:
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/JBossSAMLAuthnRequestFactory.java
===================================================================
---
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/JBossSAMLAuthnRequestFactory.java 2009-05-22
22:32:21 UTC (rev 507)
+++
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/JBossSAMLAuthnRequestFactory.java 2009-05-22
22:32:44 UTC (rev 508)
@@ -22,14 +22,17 @@
package org.jboss.identity.federation.core.saml.v2.factories;
import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
+import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.XMLGregorianCalendar;
import org.jboss.identity.federation.core.saml.v2.constants.JBossSAMLConstants;
import org.jboss.identity.federation.core.saml.v2.util.XMLTimeUtil;
import org.jboss.identity.federation.saml.v2.assertion.NameIDType;
import org.jboss.identity.federation.saml.v2.protocol.AuthnRequestType;
+import org.xml.sax.SAXException;
/**
* Factory for SAML2 AuthnRequest
@@ -57,10 +60,11 @@
* @param assertionConsumerURL URL of the requestor where the response assertion is
requested
* @param issuerValue URL of the issuer
* @return
+ * @throws DatatypeConfigurationException
* @throws Exception
*/
public static AuthnRequestType createAuthnRequestType(String id,
- String assertionConsumerURL, String destination, String issuerValue) throws
Exception
+ String assertionConsumerURL, String destination, String issuerValue) throws
DatatypeConfigurationException
{
XMLGregorianCalendar issueInstant = XMLTimeUtil.getIssueInstant();
@@ -95,9 +99,11 @@
* Get the validating marshaller
* @param schemaValidation Whether schema validation is needed
* @return
+ * @throws JAXBException
+ * @throws SAXException
* @throws Exception
*/
- public static Marshaller getValidatingMarshaller(boolean schemaValidation) throws
Exception
+ public static Marshaller getValidatingMarshaller(boolean schemaValidation) throws
SAXException, JAXBException
{
if(schemaValidation)
return JBossSAMLBaseFactory.getValidatingMarshaller(pkgName, schemaLocation);
@@ -109,9 +115,11 @@
* Get the validating unmarshaller
* @param schemaValidation whether schema validation is needed
* @return
+ * @throws SAXException
+ * @throws JAXBException
* @throws Exception
*/
- public static Unmarshaller getValidatingUnmarshaller(boolean schemaValidation) throws
Exception
+ public static Unmarshaller getValidatingUnmarshaller(boolean schemaValidation) throws
JAXBException, SAXException
{
if(schemaValidation)
return JBossSAMLBaseFactory.getValidatingUnmarshaller(pkgName, schemaLocation);
Modified:
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/JBossSAMLAuthnResponseFactory.java
===================================================================
---
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/JBossSAMLAuthnResponseFactory.java 2009-05-22
22:32:21 UTC (rev 507)
+++
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/JBossSAMLAuthnResponseFactory.java 2009-05-22
22:32:44 UTC (rev 508)
@@ -22,8 +22,10 @@
package org.jboss.identity.federation.core.saml.v2.factories;
import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
+import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.XMLGregorianCalendar;
import org.jboss.identity.federation.core.saml.v2.holders.IDPInfoHolder;
@@ -38,6 +40,7 @@
import org.jboss.identity.federation.saml.v2.protocol.ResponseType;
import org.jboss.identity.federation.saml.v2.protocol.StatusCodeType;
import org.jboss.identity.federation.saml.v2.protocol.StatusType;
+import org.xml.sax.SAXException;
/**
* Factory for the SAML v2 Authn Response
@@ -121,8 +124,8 @@
return responseType;
}
- public static ResponseType createResponseType(String ID, IssuerInfoHolder issuerInfo,
AssertionType assertionType)
- throws Exception
+ public static ResponseType createResponseType(String ID, IssuerInfoHolder issuerInfo,
AssertionType assertionType)
+ throws DatatypeConfigurationException
{
ResponseType responseType =
SAMLProtocolFactory.getObjectFactory().createResponseType();
responseType.setVersion(issuerInfo.getSamlVersion());
@@ -157,7 +160,7 @@
* @return
* @throws Exception
*/
- public static Marshaller getValidatingMarshaller() throws Exception
+ public static Marshaller getValidatingMarshaller() throws JAXBException, SAXException
{
return JBossSAMLBaseFactory.getValidatingMarshaller(pkgName, schemaLocation);
}
@@ -165,9 +168,11 @@
/**
* Get the JAXB2 Unmarshaller
* @return
+ * @throws SAXException
+ * @throws JAXBException
* @throws Exception
*/
- public static Unmarshaller getValidatingUnmarshaller() throws Exception
+ public static Unmarshaller getValidatingUnmarshaller() throws JAXBException,
SAXException
{
return JBossSAMLBaseFactory.getValidatingUnmarshaller(pkgName, schemaLocation);
}
Modified:
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/JBossSAMLBaseFactory.java
===================================================================
---
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/JBossSAMLBaseFactory.java 2009-05-22
22:32:21 UTC (rev 507)
+++
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/JBossSAMLBaseFactory.java 2009-05-22
22:32:44 UTC (rev 508)
@@ -25,6 +25,7 @@
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import javax.xml.datatype.XMLGregorianCalendar;
@@ -40,6 +41,7 @@
import org.jboss.identity.federation.saml.v2.assertion.SubjectConfirmationDataType;
import org.jboss.identity.federation.saml.v2.assertion.SubjectConfirmationType;
import org.jboss.identity.federation.saml.v2.assertion.SubjectType;
+import org.xml.sax.SAXException;
/**
* Base methods for the factories
@@ -168,7 +170,7 @@
* @throws Exception
*/
public static Marshaller getMarshaller(String pkgName)
- throws Exception
+ throws JAXBException
{
if(pkgName == null)
throw new IllegalArgumentException("pkgName is null");
@@ -184,10 +186,11 @@
* @param pkgName The package name for the jaxb context
* @param schemaLocation location of the schema to validate against
* @return Marshaller
+ * @throws SAXException
* @throws Exception
*/
- public static Marshaller getValidatingMarshaller(String pkgName, String
schemaLocation)
- throws Exception
+ public static Marshaller getValidatingMarshaller(String pkgName, String
schemaLocation)
+ throws SAXException, JAXBException
{
Marshaller marshaller = getMarshaller(pkgName);
marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
@@ -207,9 +210,10 @@
* Get the JAXB Unmarshaller
* @param pkgName The package name for the jaxb context
* @return unmarshaller
+ * @throws JAXBException
* @throws Exception
*/
- public static Unmarshaller getUnmarshaller(String pkgName) throws Exception
+ public static Unmarshaller getUnmarshaller(String pkgName) throws JAXBException
{
if(pkgName == null)
throw new IllegalArgumentException("pkgName is null");
@@ -222,10 +226,12 @@
* @param pkgName The package name for the jaxb context
* @param schemaLocation location of the schema to validate against
* @return unmarshaller
+ * @throws JAXBException
+ * @throws SAXException
* @throws Exception
*/
- public static Unmarshaller getValidatingUnmarshaller(String pkgName, String
schemaLocation)
- throws Exception
+ public static Unmarshaller getValidatingUnmarshaller(String pkgName, String
schemaLocation)
+ throws JAXBException, SAXException
{
Unmarshaller unmarshaller = getUnmarshaller(pkgName);
//Validate against schema
Modified:
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/SOAPSAMLXACMLUtil.java
===================================================================
---
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/SOAPSAMLXACMLUtil.java 2009-05-22
22:32:21 UTC (rev 507)
+++
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/SOAPSAMLXACMLUtil.java 2009-05-22
22:32:44 UTC (rev 508)
@@ -29,7 +29,6 @@
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
-import org.apache.log4j.Logger;
import org.jboss.identity.federation.saml.v2.profiles.xacml.assertion.ObjectFactory;
import
org.jboss.identity.federation.saml.v2.profiles.xacml.assertion.XACMLAuthzDecisionStatementType;
import
org.jboss.identity.federation.saml.v2.profiles.xacml.protocol.XACMLAuthzDecisionQueryType;
@@ -42,9 +41,7 @@
* @since Jan 28, 2009
*/
public class SOAPSAMLXACMLUtil
-{
- private static Logger log = Logger.getLogger(SOAPSAMLXACMLUtil.class);
-
+{
private static String SOAP_PKG =
"org.jboss.identity.federation.org.xmlsoap.schemas.soap.envelope";
private static String SAML_PROTO_PKG =
"org.jboss.identity.federation.saml.v2.protocol";
private static String XACML_CTX_PKG =
"org.jboss.security.xacml.core.model.context";
Modified:
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/XMLTimeUtil.java
===================================================================
---
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/XMLTimeUtil.java 2009-05-22
22:32:21 UTC (rev 507)
+++
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/XMLTimeUtil.java 2009-05-22
22:32:44 UTC (rev 508)
@@ -24,6 +24,7 @@
import java.util.GregorianCalendar;
import java.util.TimeZone;
+import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeConstants;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.Duration;
@@ -58,9 +59,10 @@
* to "GMT"
* @param timezone
* @return
+ * @throws DatatypeConfigurationException
* @throws Exception
*/
- public static XMLGregorianCalendar getIssueInstant(String timezone) throws Exception
+ public static XMLGregorianCalendar getIssueInstant(String timezone) throws
DatatypeConfigurationException
{
TimeZone tz = TimeZone.getTimeZone(timezone);
DatatypeFactory dtf = DatatypeFactory.newInstance();
@@ -74,8 +76,9 @@
/**
* Get the current instant of time
* @return
+ * @throws DatatypeConfigurationException
*/
- public static XMLGregorianCalendar getIssueInstant() throws Exception
+ public static XMLGregorianCalendar getIssueInstant() throws
DatatypeConfigurationException
{
return getIssueInstant(TimeZone.getDefault().getID());
}