|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
org.opensaml.SAMLException
Encapsulates a general SAML error.
If the runtime needs to pass through other types of exceptions, it must wrap those exceptions in a SAMLException or an exception derived from a SAMLxception.
Ideally, this would also inherit from SAMLObject, but Java is limited to single inheritance, so there's no way to inherit the functionality; instead we reimplement the SAMLObject code here. (Note that interfaces!=multiple inheritance and don't solve the problem.)
Field Summary | |
protected java.util.ArrayList |
codes
Collection of status codes (QNames) |
protected SAMLConfig |
config
OpenSAML configuration |
protected java.lang.Exception |
e
Embedded exception, if any |
protected org.apache.log4j.Logger |
log
Class-specific logging object |
protected java.lang.String |
msg
Status message embedded in exception |
static QName |
REQUESTER
SAML Requester status code |
static QName |
RESPONDER
SAML Responder status code |
protected org.w3c.dom.Node |
root
Root node of a DOM tree capturing the object |
static QName |
SUCCESS
SAML Success status code |
static QName |
VERSION
SAML Version Mismatch status code |
Constructor Summary | |
|
SAMLException(java.util.Collection codes)
Creates a new SAMLException |
|
SAMLException(java.util.Collection codes,
java.lang.Exception e)
Creates a new SAMLException wrapping an existing exception |
|
SAMLException(java.util.Collection codes,
java.lang.String msg)
Creates a new SAMLException |
|
SAMLException(java.util.Collection codes,
java.lang.String msg,
java.lang.Exception e)
Creates a new SAMLException from an existing exception. |
protected |
SAMLException(org.w3c.dom.Element e)
Initializes an exception from a DOM tree |
|
SAMLException(QName code)
Creates a new SAMLException |
|
SAMLException(QName code,
java.lang.Exception e)
Creates a new SAMLException wrapping an existing exception |
|
SAMLException(QName code,
java.lang.String msg)
Creates a new SAMLException |
|
SAMLException(QName code,
java.lang.String msg,
java.lang.Exception e)
Creates a new SAMLException from an existing exception. |
|
SAMLException(java.lang.String msg)
Creates a new SAMLException |
|
SAMLException(java.lang.String msg,
java.lang.Exception e)
Creates a new SAMLException |
Method Summary | |
java.lang.Object |
clone()
Copies a SAML object such that no dependencies exist between the original and the copy. |
void |
fromDOM(org.w3c.dom.Element e)
Handles initialization of exceptions from a DOM element |
java.util.Iterator |
getCodes()
Gets the status or fault code QNames |
java.lang.Exception |
getException()
Returns the embedded exception, if any |
static SAMLException |
getInstance(org.w3c.dom.Element e)
Locates an implementation class for an exception and constructs it based on the DOM provided. |
static SAMLException |
getInstance(java.io.InputStream in)
Locates an implementation class for an exception and constructs it based on the stream provided. |
java.lang.String |
getMessage()
Returns a detail message for this exception |
org.w3c.dom.Node |
toDOM()
Transforms the object into a DOM tree without an existing document context, including namespace declarations |
org.w3c.dom.Node |
toDOM(boolean xmlns)
Transforms the object into a DOM tree without an existing document context |
org.w3c.dom.Node |
toDOM(org.w3c.dom.Document doc)
Transforms the object into a DOM tree using an existing document context, including namespace declarations |
org.w3c.dom.Node |
toDOM(org.w3c.dom.Document doc,
boolean xmlns)
Transforms the object into a DOM tree using an existing document context |
void |
toStream(java.io.OutputStream out)
Serializes the XML representation of a SAML Status to a stream |
java.lang.String |
toString()
Overrides toString to pick up any embedded exception |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final QName SUCCESS
public static final QName REQUESTER
public static final QName RESPONDER
public static final QName VERSION
protected java.lang.String msg
protected java.lang.Exception e
protected java.util.ArrayList codes
protected org.w3c.dom.Node root
protected org.apache.log4j.Logger log
protected SAMLConfig config
Constructor Detail |
protected SAMLException(org.w3c.dom.Element e) throws SAMLException
e
- The root of a DOM tree
SAMLException
- Raised if an exception occurs while constructing
the object.public SAMLException(java.lang.String msg)
msg
- The detail messagepublic SAMLException(java.lang.String msg, java.lang.Exception e)
msg
- The detail messagee
- The exception to be wrapped in a SAMLExceptionpublic SAMLException(java.util.Collection codes)
codes
- A collection of QNamespublic SAMLException(java.util.Collection codes, java.lang.String msg)
codes
- A collection of QNamesmsg
- The detail messagepublic SAMLException(java.util.Collection codes, java.lang.Exception e)
The existing exception will be embedded in the new one, and its message will become the default message for the SAMLException.
codes
- A collection of QNamese
- The exception to be wrapped in a SAMLExceptionpublic SAMLException(java.util.Collection codes, java.lang.String msg, java.lang.Exception e)
The existing exception will be embedded in the new one, but the new exception will have its own message.
codes
- A collection of QNamesmsg
- The detail messagee
- The exception to be wrapped in a SAMLExceptionpublic SAMLException(QName code)
code
- A status codepublic SAMLException(QName code, java.lang.String msg)
code
- A status codemsg
- The detail messagepublic SAMLException(QName code, java.lang.Exception e)
The existing exception will be embedded in the new one, and its message will become the default message for the SAMLException.
code
- A status codee
- The exception to be wrapped in a SAMLExceptionpublic SAMLException(QName code, java.lang.String msg, java.lang.Exception e)
The existing exception will be embedded in the new one, but the new exception will have its own message.
code
- A status codemsg
- The detail messagee
- The exception to be wrapped in a SAMLExceptionMethod Detail |
public static SAMLException getInstance(org.w3c.dom.Element e) throws SAMLException
e
- The root of a DOM containing the SAML exception
SAMLException
- Thrown if an error occurs while constructing the objectpublic static SAMLException getInstance(java.io.InputStream in) throws SAMLException
in
- The stream to deserialize from
SAMLException
- Thrown if an error occurs while constructing the objectpublic void fromDOM(org.w3c.dom.Element e) throws SAMLException
e
-
SAMLException
- Raised if an exception occurs while initializing the objectpublic void toStream(java.io.OutputStream out) throws java.io.IOException, SAMLException
out
- Stream to use for output
java.io.IOException
- Raised if an I/O problem is detected
SAMLException
- Raised if the object is invalidpublic org.w3c.dom.Node toDOM(org.w3c.dom.Document doc, boolean xmlns) throws SAMLException
doc
- A Document object to use in manufacturing the treexmlns
- Include namespace(s) on root element?
SAMLException
- Raised if the object is incompletely definedpublic org.w3c.dom.Node toDOM(boolean xmlns) throws SAMLException
xmlns
- Include namespace(s) on root element?
SAMLException
- Raised if the exception is invalidpublic org.w3c.dom.Node toDOM(org.w3c.dom.Document doc) throws SAMLException
doc
- A Document object to use in manufacturing the tree
SAMLException
- Raised if the exception is invalidpublic org.w3c.dom.Node toDOM() throws SAMLException
SAMLException
- Raised if the exception is invalidpublic java.util.Iterator getCodes()
public java.lang.String getMessage()
If there is an embedded exception, and if the SAMLException has no detail message of its own, this method will return the detail message from the embedded exception.
public java.lang.Exception getException()
public java.lang.String toString()
One quirk is that this method does not produce a serialized XML representation of the object. toString is oriented around the usual expectations of Exception clients, while toStream implements the behavior expected by SAMLObject clients.
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
Object.clone()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |