Class Saml2ErrorStatusException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.security.core.AuthenticationException
se.swedenconnect.spring.saml.idp.error.Saml2ErrorStatusException
- All Implemented Interfaces:
- Serializable
public class Saml2ErrorStatusException
extends org.springframework.security.core.AuthenticationException
Exception class that when thrown will lead to a SAML error status message being sent.
 
 A message source code, and optionally parameters, may be supplied. This message code is resolved into a text that is
 used as the Status status message.
 
- Author:
- Martin Lindström
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionSaml2ErrorStatusException(String statusCode, String subStatusCode, String statusMessageCode, String defaultStatusMessage) Constructor.Saml2ErrorStatusException(String statusCode, String subStatusCode, String statusMessageCode, String defaultStatusMessage, String msg) Constructor.Saml2ErrorStatusException(String statusCode, String subStatusCode, String statusMessageCode, String defaultStatusMessage, String msg, Throwable cause) Constructor.Saml2ErrorStatusException(String statusCode, String subStatusCode, String statusMessageCode, String defaultStatusMessage, Throwable cause) Constructor.Constructor.Saml2ErrorStatusException(Saml2ErrorStatus status, String msg) Constructor.Saml2ErrorStatusException(Saml2ErrorStatus status, String msg, Throwable cause) Constructor.Saml2ErrorStatusException(Saml2ErrorStatus status, Throwable cause) Constructor.
- 
Method SummaryModifier and TypeMethodDescriptionGets a SAML v2Statuselement given this exception.getStatus(MessageSource messageSource, Locale locale) Gets a SAML v2Statuselement given this exception.voidsetCustomStatusMessage(String statusMessage) Assigns a custom status message.voidsetCustomStatusMessage(String statusMessageCode, String defaultStatusMessage) Assigns a custom status message.toString()Methods inherited from class java.lang.ThrowableaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
- 
Constructor Details- 
Saml2ErrorStatusExceptionConstructor.- Parameters:
- status- the- Saml2ErrorStatus
 
- 
Saml2ErrorStatusExceptionConstructor.- Parameters:
- status- the- Saml2ErrorStatus
- msg- the error message (will not be included in the resulting- Statusmessage)
 
- 
Saml2ErrorStatusExceptionConstructor.- Parameters:
- status- the- Saml2ErrorStatus
- cause- the cause of the error
 
- 
Saml2ErrorStatusExceptionConstructor.- Parameters:
- status- the- Saml2ErrorStatus
- msg- the error message (will not be included in the resulting- Statusmessage)
- cause- the cause of the error
 
- 
Saml2ErrorStatusExceptionpublic Saml2ErrorStatusException(String statusCode, String subStatusCode, String statusMessageCode, String defaultStatusMessage) Constructor.- Parameters:
- statusCode- the main status code
- subStatusCode- the subordinate status code
- statusMessageCode- the status message code (will be resolved against a- MessageSource)
- defaultStatusMessage- the status message to use if the- statusMessageCodecan not be resolved against a- MessageSource
 
- 
Saml2ErrorStatusExceptionpublic Saml2ErrorStatusException(String statusCode, String subStatusCode, String statusMessageCode, String defaultStatusMessage, String msg) Constructor.- Parameters:
- statusCode- the main status code
- subStatusCode- the subordinate status code
- statusMessageCode- the status message code (will be resolved against a- MessageSource
- defaultStatusMessage- the status message to use if the- statusMessageCodecan not be resolved against a- MessageSource
- msg- the error message (will not be included in the resulting- Statusmessage)
 
- 
Saml2ErrorStatusExceptionpublic Saml2ErrorStatusException(String statusCode, String subStatusCode, String statusMessageCode, String defaultStatusMessage, Throwable cause) Constructor.- Parameters:
- statusCode- the main status code
- subStatusCode- the subordinate status code
- statusMessageCode- the status message code (will be resolved against a- MessageSource
- defaultStatusMessage- the status message to use if the- statusMessageCodecan not be resolved against a- MessageSource
- cause- the cause of the error
 
- 
Saml2ErrorStatusExceptionpublic Saml2ErrorStatusException(String statusCode, String subStatusCode, String statusMessageCode, String defaultStatusMessage, String msg, Throwable cause) Constructor.- Parameters:
- statusCode- the main status code
- subStatusCode- the subordinate status code
- statusMessageCode- the status message code (will be resolved against a- MessageSource
- defaultStatusMessage- the status message to use if the- statusMessageCodecan not be resolved against a- MessageSource
- msg- the error message (will not be included in the resulting- Statusmessage)
- cause- the cause of the error
 
 
- 
- 
Method Details- 
setCustomStatusMessageAssigns a custom status message. May be used if the exception object is initialized using aSaml2ErrorStatusobject.- Parameters:
- statusMessageCode- the status message code (for resolving against a- MessageSource
- defaultStatusMessage- the default status message (if resolving fails)
 
- 
setCustomStatusMessageAssigns a custom status message. If aMessageSourceis being used when obtaining theStatususesetCustomStatusMessage(String, String)instead.- Parameters:
- statusMessage- the status message
 
- 
getStatusGets a SAML v2Statuselement given this exception.- Returns:
- a Status element
 
- 
getStatusGets a SAML v2Statuselement given this exception.- Parameters:
- messageSource- the message source to use when resolving the status message (if null, the- defaultStatusMessagewill be used)
- locale- the locale to use when resolving the status message
- Returns:
- a Status element
 
- 
toString
 
-