com.stratelia.webactiv.util.exception
Class SilverpeasException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.stratelia.webactiv.util.exception.SilverpeasException
All Implemented Interfaces:
FromModule, WithNested, Serializable
Direct Known Subclasses:
AccessForbiddenException, AdminException, AgendaException, AlertUserException, AlertUserPeasException, AuthenticationException, CalendarException, ClassifyEngineException, ClipboardException, CommunicationUserException, ContainerManagerException, ContentManagerException, DAOException, DirectoryException, DomainConflictException, DomainCreationException, DomainDeletionException, ExtractorException, ForgottenPasswordException, FormException, GenericPanelException, ImportExportException, InstanciationException, JobDomainPeasException, JobManagerPeasException, JobOrganizationPeasException, JobSearchPeasException, JobStartPagePeasException, NotificationManagerException, NotificationServerException, PdcException, PeasCoreException, PersistenceException, POPUPException, PortletException, PublicationTemplateException, QuotaException, SearchEngineException, SelectionException, SelectionPeasException, SILVERMAILException, SilverpeasTrappedException, SilverStatisticsConfigException, SilverStatisticsTypeStatisticsException, SocialNetworkAuthorizationException, SocialNetworkException, SQLDomainDAOException, TemplateDesignerException, ThesaurusException, ThumbnailException, TodoException, TreeManagerException, WorkflowDesignerException, WorkflowException, WysiwygException

public abstract class SilverpeasException
extends Exception
implements WithNested, FromModule

SilverpeasException est la racine de la hiérarchie d'exception silverpeas. Toutes les classes d'exception spécifiques aux differents modules doivent dériver (directement ou non) de SilverpeasException. La page d'erreur globale à l'application ne saura traiter correctement que les SilverpeasException. Les autres exception (ou error ou runtime) provoqueront l'affichage d'une page d'erreur imprévue. Le message que l'on donne à l'exception est très important, il doit etre affiché à l'utilisateur. C'est pourquoi le label est multilangue. Chaque classe heritant de SilverpeasException doit surdefinir la fonction getModule qui retourne le nom du module (le meme nom que celui defini dans Silvertrace)

See Also:
Serialized Form

Field Summary
static int ERROR
           
static int FATAL
           
static int WARNING
           
 
Constructor Summary
SilverpeasException(Exception exception)
           
SilverpeasException(String message)
          Deprecated.  
SilverpeasException(String message, Exception nested)
          Deprecated.  
SilverpeasException(String message, Exception nested, int errorLevel)
          Deprecated.  
SilverpeasException(String callingClass, int errorLevel, String message)
           
SilverpeasException(String callingClass, int errorLevel, String message, Exception nested)
           
SilverpeasException(String callingClass, int errorLevel, String message, String extraParams)
           
SilverpeasException(String callingClass, int errorLevel, String message, String extraParams, Exception nested)
           
 
Method Summary
static Collection<Throwable> getChainedExceptions(Throwable e)
          méthode utilitaire dont le role est de représenter les exceptions encapsulées sous forme d'une collection.
 int getErrorLevel()
          retourne le niveau de critissicité de l'exception
 String getExtraInfos()
           
 String getMessageLang()
           
 String getMessageLang(String language)
           
abstract  String getModule()
          This function must be defined by the Classes that herit from this one
 Exception getNested()
          retourne l'exception qui a provoqué la creation de celle-ci.
 void printStackTrace()
           
 void printStackTrace(PrintStream s)
           
 void printStackTrace(PrintWriter w)
           
 void traceException()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FATAL

public static final int FATAL
See Also:
Constant Field Values

ERROR

public static final int ERROR
See Also:
Constant Field Values

WARNING

public static final int WARNING
See Also:
Constant Field Values
Constructor Detail

SilverpeasException

public SilverpeasException(Exception exception)

SilverpeasException

public SilverpeasException(String message)
Deprecated. 

Fabriquation d'une exception silverpeas avec un message multilangue. Il n'y a pas d'exception ayant provoqué celle-ci (getNested() renvera null). Le niveau d'importance est ERROR.

Parameters:
message - Le label multilangue. Ex : "impossibleDeFabriquerUneConnexionBDD". Le label est traduit dans des fichiers de properties.

SilverpeasException

public SilverpeasException(String message,
                           Exception nested)
Deprecated. 

Fabriquation d'une exception silverpeas avec un message multilangue et une exception à imbriquer. Le niveau d'importance est ERROR.

Parameters:
message - Le label multilangue. Ex : "impossibleDeFabriquerUneConnexionBDD". Le label est traduit dans des fichiers de properties.
nested - L'exception qui a provoqué le problème. nested peut etre une SilverpeasException ou une exception technique (SQLException, RemoteException...)

SilverpeasException

public SilverpeasException(String message,
                           Exception nested,
                           int errorLevel)
Deprecated. 

Fabriquation d'une exception silverpeas avec un message multilangue, une eception à imbriquer et un niveau d'importance.

Parameters:
message - Le label multilangue. Ex : "impossibleDeFabriquerUneConnexionBDD". Le label est traduit dans des fichiers de properties.
nested - L'exception qui a provoqué le problème. nested peut etre une SilverpeasException ou une exception technique (SQLException, RemoteException...)
errorLevel - Le niveau de critissicité de l'erreur (FATAL, ERROR, ou WARNING)

SilverpeasException

public SilverpeasException(String callingClass,
                           int errorLevel,
                           String message)

SilverpeasException

public SilverpeasException(String callingClass,
                           int errorLevel,
                           String message,
                           String extraParams)

SilverpeasException

public SilverpeasException(String callingClass,
                           int errorLevel,
                           String message,
                           Exception nested)

SilverpeasException

public SilverpeasException(String callingClass,
                           int errorLevel,
                           String message,
                           String extraParams,
                           Exception nested)
Method Detail

getNested

public Exception getNested()
retourne l'exception qui a provoqué la creation de celle-ci. Permet l'encapsulation des exception technique.

Specified by:
getNested in interface WithNested
Returns:
L'exception précédente qui a provoqué celle-ci, null s'il n'y en a pas.

printStackTrace

public void printStackTrace()
Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintStream s)
Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintWriter w)
Overrides:
printStackTrace in class Throwable

getModule

public abstract String getModule()
This function must be defined by the Classes that herit from this one

Specified by:
getModule in interface FromModule
Returns:
The SilverTrace's module name

getMessageLang

public String getMessageLang()
Specified by:
getMessageLang in interface FromModule

getMessageLang

public String getMessageLang(String language)
Specified by:
getMessageLang in interface FromModule

traceException

public void traceException()
Specified by:
traceException in interface FromModule

getErrorLevel

public int getErrorLevel()
retourne le niveau de critissicité de l'exception

Specified by:
getErrorLevel in interface FromModule
Returns:
le niveau d'erreur, FATAL, ERROR, ou WARNING

getExtraInfos

public String getExtraInfos()

getChainedExceptions

public static Collection<Throwable> getChainedExceptions(Throwable e)
méthode utilitaire dont le role est de représenter les exceptions encapsulées sous forme d'une collection. L'exception courante se trouvera en première position de la collection. Les eventuelles imbrications succéssive suivront dans la liste.

Parameters:
e - L'exception de plus haut niveau
Returns:
une collection de Throwable, qui contiendra au moins l'exception passee en parametre. Et plus si cette exception en imbrique d'autre.


Copyright © 2016 Silverpeas. All Rights Reserved.