Author: anil.saldhana(a)jboss.com
Date: 2009-05-22 18:35:53 -0400 (Fri, 22 May 2009)
New Revision: 511
Modified:
identity-federation/trunk/jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/request/SAML2Request.java
identity-federation/trunk/jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/response/SAML2Response.java
Log:
JBID-111: project specific exceptions
Modified:
identity-federation/trunk/jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/request/SAML2Request.java
===================================================================
---
identity-federation/trunk/jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/request/SAML2Request.java 2009-05-22
22:35:06 UTC (rev 510)
+++
identity-federation/trunk/jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/request/SAML2Request.java 2009-05-22
22:35:53 UTC (rev 511)
@@ -27,8 +27,10 @@
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.DatatypeConfigurationException;
import org.jboss.identity.federation.core.constants.JBossIdentityFederationConstants;
import
org.jboss.identity.federation.core.saml.v2.factories.JBossSAMLAuthnRequestFactory;
@@ -40,6 +42,7 @@
import org.jboss.identity.federation.saml.v2.protocol.AuthnRequestType;
import org.jboss.identity.federation.saml.v2.protocol.LogoutRequestType;
import org.jboss.identity.federation.saml.v2.protocol.RequestAbstractType;
+import org.xml.sax.SAXException;
/**
* API for SAML2 Request
@@ -55,12 +58,13 @@
* @param destination
* @param issuerValue
* @return
+ * @throws DatatypeConfigurationException
* @throws Exception
*/
public AuthnRequestType createAuthnRequestType(String id,
String assertionConsumerURL,
String destination,
- String issuerValue) throws Exception
+ String issuerValue) throws DatatypeConfigurationException
{
return JBossSAMLAuthnRequestFactory.createAuthnRequestType(
id, assertionConsumerURL, destination, issuerValue);
@@ -70,11 +74,13 @@
* Get AuthnRequestType from a file
* @param fileName file with the serialized AuthnRequestType
* @return AuthnRequestType
+ * @throws SAXException
+ * @throws JAXBException
* @throws Exception
* @throws IllegalArgumentException if the input fileName is null
* IllegalStateException if the InputStream from the fileName is null
*/
- public AuthnRequestType getAuthnRequestType(String fileName) throws Exception
+ public AuthnRequestType getAuthnRequestType(String fileName) throws JAXBException,
SAXException
{
if(fileName == null)
throw new IllegalArgumentException("fileName is null");
@@ -83,16 +89,17 @@
return getAuthnRequestType(is);
}
-
/**
* Get a Request Type from Input Stream
* @param is
* @return
+ * @throws SAXException
+ * @throws JAXBException
* @throws Exception
* @throws IllegalArgumentException inputstream is null
*/
@SuppressWarnings("unchecked")
- public RequestAbstractType getRequestType(InputStream is) throws Exception
+ public RequestAbstractType getRequestType(InputStream is) throws JAXBException,
SAXException
{
if(is == null)
throw new IllegalStateException("InputStream is null");
@@ -108,11 +115,13 @@
* Get the AuthnRequestType from an input stream
* @param is Inputstream containing the AuthnRequest
* @return
+ * @throws SAXException
+ * @throws JAXBException
* @throws Exception
* @throws IllegalArgumentException inputstream is null
*/
@SuppressWarnings("unchecked")
- public AuthnRequestType getAuthnRequestType(InputStream is) throws Exception
+ public AuthnRequestType getAuthnRequestType(InputStream is) throws JAXBException,
SAXException
{
if(is == null)
throw new IllegalStateException("InputStream is null");
@@ -128,9 +137,10 @@
* Create a Logout Request
* @param issuer
* @return
+ * @throws DatatypeConfigurationException
* @throws Exception
*/
- public LogoutRequestType createLogoutRequest(String issuer) throws Exception
+ public LogoutRequestType createLogoutRequest(String issuer) throws
DatatypeConfigurationException
{
org.jboss.identity.federation.saml.v2.protocol.ObjectFactory of
= new org.jboss.identity.federation.saml.v2.protocol.ObjectFactory();
@@ -149,9 +159,10 @@
* Parse an XACML Authorization Decision Query from an xml file
* @param resourceName
* @return
+ * @throws JAXBException
* @throws Exception
*/
- public XACMLAuthzDecisionQueryType parseXACMLDecisionQuery(String resourceName) throws
Exception
+ public XACMLAuthzDecisionQueryType parseXACMLDecisionQuery(String resourceName) throws
JAXBException
{
ClassLoader tcl = SecurityActions.getContextClassLoader();
InputStream is = tcl.getResourceAsStream(resourceName);
@@ -162,10 +173,11 @@
* XACMLAuthorizationDecisionQuery from an input stream
* @param is The InputStream where the xacml query exists
* @return
+ * @throws JAXBException
* @throws Exception
*/
@SuppressWarnings("unchecked")
- public XACMLAuthzDecisionQueryType parseXACMLDecisionQuery(InputStream is) throws
Exception
+ public XACMLAuthzDecisionQueryType parseXACMLDecisionQuery(InputStream is) throws
JAXBException
{
if(is == null)
throw new IllegalArgumentException("Inputstream is null");
@@ -191,9 +203,11 @@
* Marshall the AuthnRequestType to an output stream
* @param requestType
* @param os
+ * @throws JAXBException
+ * @throws SAXException
* @throws Exception
*/
- public void marshall(RequestAbstractType requestType, OutputStream os) throws
Exception
+ public void marshall(RequestAbstractType requestType, OutputStream os) throws
SAXException, JAXBException
{
String key = JBossIdentityFederationConstants.JAXB_SCHEMA_VALIDATION;
boolean validate = Boolean.parseBoolean(SecurityActions.getSystemProperty(key,
"false"));
@@ -207,9 +221,11 @@
* Marshall the AuthnRequestType to a writer
* @param requestType
* @param writer
+ * @throws JAXBException
+ * @throws SAXException
* @throws Exception
*/
- public void marshall(RequestAbstractType requestType, Writer writer) throws Exception
+ public void marshall(RequestAbstractType requestType, Writer writer) throws
SAXException, JAXBException
{
String key = JBossIdentityFederationConstants.JAXB_SCHEMA_VALIDATION;
boolean validate = Boolean.parseBoolean(SecurityActions.getSystemProperty(key,
"false"));
Modified:
identity-federation/trunk/jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/response/SAML2Response.java
===================================================================
---
identity-federation/trunk/jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/response/SAML2Response.java 2009-05-22
22:35:06 UTC (rev 510)
+++
identity-federation/trunk/jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/response/SAML2Response.java 2009-05-22
22:35:53 UTC (rev 511)
@@ -29,6 +29,7 @@
import javax.xml.bind.Binder;
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;
@@ -50,6 +51,7 @@
import org.jboss.identity.federation.saml.v2.protocol.ResponseType;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
/**
* API for dealing with SAML2 Response objects
@@ -187,7 +189,7 @@
* @param os
* @throws Exception
*/
- public void marshall(ResponseType responseType, OutputStream os) throws Exception
+ public void marshall(ResponseType responseType, OutputStream os) throws SAXException,
JAXBException
{
Marshaller marshaller = JBossSAMLAuthnResponseFactory.getValidatingMarshaller();
JAXBElement<ResponseType> jaxb =
SAMLProtocolFactory.getObjectFactory().createResponse(responseType);