|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.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,
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,
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 |
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 |
org.w3c.dom.Node |
toDOM(org.w3c.dom.Document doc)
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 message
public SAMLException(java.lang.String msg,
java.lang.Exception e)
msg - The detail messagee - The exception to be wrapped in a SAMLException
public SAMLException(java.util.Collection codes,
java.lang.String msg)
codes - A collection of QNamesmsg - The detail message
public 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 SAMLException
public 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 SAMLException
public SAMLException(QName code,
java.lang.String msg)
code - A status codemsg - The detail message
public 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 SAMLException
public 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 SAMLException| Method Detail |
public void fromDOM(org.w3c.dom.Element e)
throws SAMLException
e -
SAMLException - Raised if an exception occurs while initializing the object
public void toStream(java.io.OutputStream out)
throws java.io.IOException
out - Stream to use for output
java.io.IOException - Raised if an I/O problem is detected
public org.w3c.dom.Node toDOM(org.w3c.dom.Document doc)
throws org.w3c.dom.DOMException
doc - A Document object to use in manufacturing the
tree
org.w3c.dom.DOMException - Raised if an XML exception is detected
public org.w3c.dom.Node toDOM()
throws org.w3c.dom.DOMException
org.w3c.dom.DOMException - Raised if an XML exception is detectedpublic 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.
getMessage in class java.lang.Throwablepublic 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.
toString in class java.lang.Throwable
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionObject.clone()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||