From 318c8af90fed65b2eb5edc03cfe1439e1fdd7f4c Mon Sep 17 00:00:00 2001 From: mka Date: Wed, 14 Nov 2012 08:56:29 +0000 Subject: [PATCH] BusinessException is added as base class for ...Exception. --- .../splat/exception/BusinessException.java | 74 +++++++++++++++++++ .../exception/LockAlreadyExistsException.java | 2 +- .../exception/LockNotExistsException.java | 2 +- .../exception/LockOutdatedException.java | 2 +- .../exception/LockProtectedException.java | 2 +- .../kernel/DuplicatePropertyException.java | 16 +++- .../kernel/InvalidPropertyException.java | 16 +++- .../org/splat/kernel/MismatchException.java | 16 +++- .../splat/kernel/MissedPropertyException.java | 16 +++- .../kernel/MultiplyDefinedException.java | 16 +++- .../splat/kernel/NotApplicableException.java | 16 +++- 11 files changed, 158 insertions(+), 20 deletions(-) create mode 100644 Workspace/Siman-Common/src/org/splat/exception/BusinessException.java diff --git a/Workspace/Siman-Common/src/org/splat/exception/BusinessException.java b/Workspace/Siman-Common/src/org/splat/exception/BusinessException.java new file mode 100644 index 0000000..faedaa6 --- /dev/null +++ b/Workspace/Siman-Common/src/org/splat/exception/BusinessException.java @@ -0,0 +1,74 @@ +/***************************************************************************** + * Company EURIWARE + * Application SIMAN + * File $Id$ + * Creation date 14.11.2012 + * @author Author: Maria KRUCHININA + * @version Revision: + *****************************************************************************/ + +package org.splat.exception; + +/** + * Define a Business exception send by service. + * This class is send by services when a business error occurred (functionnal error) + * + * @author Maria KRUCHININA + * + */ +public class BusinessException extends AbstractException { + + /** + * serial version id. + */ + private static final long serialVersionUID = 1L; + + /** + * Default constructor. + * @see ServiceException#ServiceException() + */ + public BusinessException() { + super(); + } + + + /** + * Constructor with a throwable param. + * @param throwable the original throwable + * @see ServiceException#ServiceException(Throwable) + */ + public BusinessException(final Throwable throwable) { + super(throwable); + } + + /** + * Constructor with a String param and a throwable param. + * @param message the error message + * @param throwable the original throwable + * @see ServiceException#ServiceException(String, Throwable) + */ + public BusinessException (final String message,final Throwable throwable) { + super(message,throwable); + } + + /** + * Build a BusinessException with message, user message key, and throwable. + * @param messageKey the User Interface Message Key + * @param throwable the original exception + * @param context the execution context + */ + public BusinessException(final String messageKey,final Throwable throwable,final Object... context) { + super(messageKey,throwable,context); + + + } + + /** + * Build a BusinessException with message, user message key and context. + * @param messageKey the User Interface Message Key + * @param context the execution context + */ + public BusinessException(final String messageKey,final Object... context) { + super(messageKey,context); + } +} diff --git a/Workspace/Siman-Common/src/org/splat/exception/LockAlreadyExistsException.java b/Workspace/Siman-Common/src/org/splat/exception/LockAlreadyExistsException.java index b174567..d3ede27 100644 --- a/Workspace/Siman-Common/src/org/splat/exception/LockAlreadyExistsException.java +++ b/Workspace/Siman-Common/src/org/splat/exception/LockAlreadyExistsException.java @@ -16,7 +16,7 @@ import org.splat.common.properties.MessageKeyEnum; * @author Maria KRUCHININA * */ -public class LockAlreadyExistsException extends AbstractException { +public class LockAlreadyExistsException extends BusinessException { /** * loginName of a user who has already locked an object. diff --git a/Workspace/Siman-Common/src/org/splat/exception/LockNotExistsException.java b/Workspace/Siman-Common/src/org/splat/exception/LockNotExistsException.java index 8dc10e3..4ff6fde 100644 --- a/Workspace/Siman-Common/src/org/splat/exception/LockNotExistsException.java +++ b/Workspace/Siman-Common/src/org/splat/exception/LockNotExistsException.java @@ -16,7 +16,7 @@ import org.splat.common.properties.MessageKeyEnum; * @author Maria KRUCHININA * */ -public class LockNotExistsException extends AbstractException { +public class LockNotExistsException extends BusinessException { /** * Version id for serialization. diff --git a/Workspace/Siman-Common/src/org/splat/exception/LockOutdatedException.java b/Workspace/Siman-Common/src/org/splat/exception/LockOutdatedException.java index 44990da..1b78c65 100644 --- a/Workspace/Siman-Common/src/org/splat/exception/LockOutdatedException.java +++ b/Workspace/Siman-Common/src/org/splat/exception/LockOutdatedException.java @@ -18,7 +18,7 @@ import org.splat.common.properties.MessageKeyEnum; * @author Maria KRUCHININA * */ -public class LockOutdatedException extends AbstractException { +public class LockOutdatedException extends BusinessException { /** * Version id for serialization. diff --git a/Workspace/Siman-Common/src/org/splat/exception/LockProtectedException.java b/Workspace/Siman-Common/src/org/splat/exception/LockProtectedException.java index 08fe780..a01a408 100644 --- a/Workspace/Siman-Common/src/org/splat/exception/LockProtectedException.java +++ b/Workspace/Siman-Common/src/org/splat/exception/LockProtectedException.java @@ -17,7 +17,7 @@ import org.splat.common.properties.MessageKeyEnum; * @author Maria KRUCHININA * */ -public class LockProtectedException extends AbstractException { +public class LockProtectedException extends BusinessException { /** * Version id for serialization. diff --git a/Workspace/Siman-Common/src/org/splat/kernel/DuplicatePropertyException.java b/Workspace/Siman-Common/src/org/splat/kernel/DuplicatePropertyException.java index 22392b0..012629c 100644 --- a/Workspace/Siman-Common/src/org/splat/kernel/DuplicatePropertyException.java +++ b/Workspace/Siman-Common/src/org/splat/kernel/DuplicatePropertyException.java @@ -1,15 +1,25 @@ package org.splat.kernel; + +import org.splat.exception.BusinessException; + /** - * + * Exception thrown when the property is duplicated. * @author Daniel Brunier-Coulin * @copyright OPEN CASCADE 2012 */ -public class DuplicatePropertyException extends Exception { +public class DuplicatePropertyException extends BusinessException { + /** + * Version id for serialization. + */ private static final long serialVersionUID = 189342004009382158L; - public DuplicatePropertyException (String message) { + /** + * Create a DuplicatePropertyException. + * @param message the error message. + */ + public DuplicatePropertyException (final String message) { super(message); } } \ No newline at end of file diff --git a/Workspace/Siman-Common/src/org/splat/kernel/InvalidPropertyException.java b/Workspace/Siman-Common/src/org/splat/kernel/InvalidPropertyException.java index 92eb71e..660940e 100644 --- a/Workspace/Siman-Common/src/org/splat/kernel/InvalidPropertyException.java +++ b/Workspace/Siman-Common/src/org/splat/kernel/InvalidPropertyException.java @@ -1,15 +1,25 @@ package org.splat.kernel; + +import org.splat.exception.BusinessException; + /** - * + * Exception thrown when the property is invalid. * @author Daniel Brunier-Coulin * @copyright OPEN CASCADE 2012 */ -public class InvalidPropertyException extends Exception { +public class InvalidPropertyException extends BusinessException { + /** + * Version id for serialization. + */ private static final long serialVersionUID = -3988379180445723963L; - public InvalidPropertyException (String message) { + /** + * Create a InvalidPropertyException. + * @param message the error message. + */ + public InvalidPropertyException (final String message) { super(message); } } \ No newline at end of file diff --git a/Workspace/Siman-Common/src/org/splat/kernel/MismatchException.java b/Workspace/Siman-Common/src/org/splat/kernel/MismatchException.java index f0a103c..956932f 100644 --- a/Workspace/Siman-Common/src/org/splat/kernel/MismatchException.java +++ b/Workspace/Siman-Common/src/org/splat/kernel/MismatchException.java @@ -1,19 +1,31 @@ package org.splat.kernel; +import org.splat.exception.BusinessException; + /** - * + * MismatchException exception. * @author Daniel Brunier-Coulin * @copyright OPEN CASCADE 2012 */ -public class MismatchException extends Exception { +public class MismatchException extends BusinessException { + /** + * Version id for serialization. + */ private static final long serialVersionUID = 366699682058153984L; + /** + * Create a MismatchException. + */ public MismatchException() { super(); } + /** + * Create a MismatchException. + * @param message the error message. + */ public MismatchException(final String message) { super(message); } diff --git a/Workspace/Siman-Common/src/org/splat/kernel/MissedPropertyException.java b/Workspace/Siman-Common/src/org/splat/kernel/MissedPropertyException.java index c038200..1b17436 100644 --- a/Workspace/Siman-Common/src/org/splat/kernel/MissedPropertyException.java +++ b/Workspace/Siman-Common/src/org/splat/kernel/MissedPropertyException.java @@ -1,15 +1,25 @@ package org.splat.kernel; + +import org.splat.exception.BusinessException; + /** - * + * Exception thrown when the property is missed. * @author Daniel Brunier-Coulin * @copyright OPEN CASCADE 2012 */ -public class MissedPropertyException extends Exception { +public class MissedPropertyException extends BusinessException { + /** + * Version id for serialization. + */ private static final long serialVersionUID = -4459708372517969441L; - public MissedPropertyException (String message) { + /** + * Create a MissedPropertyException. + * @param message the error message. + */ + public MissedPropertyException (final String message) { super(message); } } \ No newline at end of file diff --git a/Workspace/Siman-Common/src/org/splat/kernel/MultiplyDefinedException.java b/Workspace/Siman-Common/src/org/splat/kernel/MultiplyDefinedException.java index 708cf45..3dd4807 100644 --- a/Workspace/Siman-Common/src/org/splat/kernel/MultiplyDefinedException.java +++ b/Workspace/Siman-Common/src/org/splat/kernel/MultiplyDefinedException.java @@ -1,19 +1,31 @@ package org.splat.kernel; +import org.splat.exception.BusinessException; + /** - * + * Exception thrown when the property is multiply defined. * @author Daniel Brunier-Coulin * @copyright OPEN CASCADE 2012 */ -public class MultiplyDefinedException extends Exception { +public class MultiplyDefinedException extends BusinessException { + /** + * Version id for serialization. + */ private static final long serialVersionUID = 3551033092059904168L; + /** + * Create a MultiplyDefinedException. + */ public MultiplyDefinedException() { super(); } + /** + * Create a MultiplyDefinedException. + * @param message the error message. + */ public MultiplyDefinedException(final String message) { super(message); } diff --git a/Workspace/Siman-Common/src/org/splat/kernel/NotApplicableException.java b/Workspace/Siman-Common/src/org/splat/kernel/NotApplicableException.java index ba5ea87..26b8116 100644 --- a/Workspace/Siman-Common/src/org/splat/kernel/NotApplicableException.java +++ b/Workspace/Siman-Common/src/org/splat/kernel/NotApplicableException.java @@ -1,15 +1,25 @@ package org.splat.kernel; + +import org.splat.exception.BusinessException; + /** - * + * NotApplicableException exception. * @author Daniel Brunier-Coulin * @copyright OPEN CASCADE 2012 */ -public class NotApplicableException extends Exception { +public class NotApplicableException extends BusinessException { + /** + * Version id for serialization. + */ private static final long serialVersionUID = -6255758696740565804L; - public NotApplicableException (String message) { + /** + * Create a NotApplicableException. + * @param message the error message. + */ + public NotApplicableException (final String message) { super(message); } } \ No newline at end of file -- 2.39.2