ch.elca.el4j.services.monitoring.notification
Class PersistenceNotificationHelper

java.lang.Object
  extended by ch.elca.el4j.services.monitoring.notification.PersistenceNotificationHelper

public final class PersistenceNotificationHelper
extends Object

This class is used to notify on events which are persistence based.

Author:
Martin Zeltner (MZE)
File-location:
PersistenceNotificationHelper
Last check-in date:
2009-10-19 17:44:35 +0200 (Mo, 19. Okt 2009) by swismer for revision 3951

Method Summary
static void notifyDataIntegrityViolationFailure(String objectName)
          Same behaviour as call of method notifyDataIntegrityViolationFailure(null, String).
static void notifyDataIntegrityViolationFailure(String detailedMessage, String objectName)
          Notify violation of data integrity of an object.
static void notifyDataRetrievalFailure(String objectName)
          Same behaviour as call of method notifyDataRetrievalFailure(null, String).
static void notifyDataRetrievalFailure(String detailedMessage, String objectName)
          Method to log that an object does not exist.
static void notifyInsertionFailure(String objectName)
          Same behaviour as call of method notifyInsertionFailure(null, String).
static void notifyInsertionFailure(String detailedMessage, String objectName)
          Method to log that an object made problems while insertion.
static void notifyJdbcUpdateAffectedIncorrectNumberOfRows(String objectName, String sql, int expected, int actual)
          Same behaviour as call of method notifyOptimisticLockingFailure(null, String, String, int, int) .
static void notifyJdbcUpdateAffectedIncorrectNumberOfRows(String detailedMessage, String objectName, String sql, int expected, int actual)
          Method to log that the object could not be updated correctly.
static void notifyObjectRetrievalFailure(Class<?> entityClass, Object identifier, String objectName)
          Method to log that an object could not be retrieved.
static void notifyObjectRetrievalFailure(Class<?> entityClass, Object identifier, String objectName, String detailedMessage, Throwable cause)
          Method to log that an object could not be retrieved.
static void notifyOptimisticLockingFailure(String objectName)
          Same behaviour as call of method notifyOptimisticLockingFailure(null, String).
static void notifyOptimisticLockingFailure(String detailedMessage, String objectName, OptimisticLockingFailureException optionalException)
          Method to log that the object has already been modified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

notifyDataRetrievalFailure

public static void notifyDataRetrievalFailure(String detailedMessage,
                                              String objectName)
                                       throws DataRetrievalFailureException
Method to log that an object does not exist. This method will always throw an exception.

Parameters:
detailedMessage - Is the detailed message.
objectName - Is the name of the object.
Throws:
DataRetrievalFailureException - Will be thrown in every case.

notifyInsertionFailure

public static void notifyInsertionFailure(String detailedMessage,
                                          String objectName)
                                   throws InsertionFailureException
Method to log that an object made problems while insertion. This method will always throw an exception.

Parameters:
detailedMessage - Is the detailed message.
objectName - Is the name of the object.
Throws:
InsertionFailureException - Will be thrown in every case.

notifyDataIntegrityViolationFailure

public static void notifyDataIntegrityViolationFailure(String detailedMessage,
                                                       String objectName)
                                                throws DataIntegrityViolationException
Notify violation of data integrity of an object. Will always throw an exception.

Parameters:
detailedMessage - Is the detailed message.
objectName - Is the name of the object.
Throws:
DataIntegrityViolationException - Will be thrown in every case.

notifyOptimisticLockingFailure

public static void notifyOptimisticLockingFailure(String detailedMessage,
                                                  String objectName,
                                                  OptimisticLockingFailureException optionalException)
                                           throws OptimisticLockingFailureException
Method to log that the object has already been modified. This method will always throw an exception.

Parameters:
detailedMessage - Is the detailed message.
objectName - Is the name of the object.
optionalException - optionally returns the original OptimisticLockingFailureException (in order not to loose information)
Throws:
OptimisticLockingFailureException - Will be thrown in every case.

notifyObjectRetrievalFailure

public static void notifyObjectRetrievalFailure(Class<?> entityClass,
                                                Object identifier,
                                                String objectName)
                                         throws ObjectRetrievalFailureException
Method to log that an object could not be retrieved. This method will always throw an exception.

Parameters:
entityClass - The persistent class.
identifier - The ID of the object that should have been retrieved.
objectName - The name of the object.
Throws:
ObjectRetrievalFailureException

notifyObjectRetrievalFailure

public static void notifyObjectRetrievalFailure(Class<?> entityClass,
                                                Object identifier,
                                                String objectName,
                                                String detailedMessage,
                                                Throwable cause)
                                         throws ObjectRetrievalFailureException
Method to log that an object could not be retrieved. This method will always throw an exception.

Parameters:
entityClass - The persistent class.
identifier - The ID of the object that should have been retrieved.
objectName - The name of the object.
detailedMessage - A detailed message.
cause - The source of the exception.
Throws:
ObjectRetrievalFailureException

notifyJdbcUpdateAffectedIncorrectNumberOfRows

public static void notifyJdbcUpdateAffectedIncorrectNumberOfRows(String detailedMessage,
                                                                 String objectName,
                                                                 String sql,
                                                                 int expected,
                                                                 int actual)
                                                          throws JdbcUpdateAffectedIncorrectNumberOfRowsException
Method to log that the object could not be updated correctly. This method will always throw an exception.

Parameters:
detailedMessage - Is the detailed message.
objectName - Is the name of the object.
sql - Is the SQL we tried to execute.
expected - Is the expected number of rows affected.
actual - Is the actual number of rows affected.
Throws:
JdbcUpdateAffectedIncorrectNumberOfRowsException - Will be thrown in every case.

notifyDataRetrievalFailure

public static void notifyDataRetrievalFailure(String objectName)
                                       throws DataRetrievalFailureException
Same behaviour as call of method notifyDataRetrievalFailure(null, String).

Throws:
DataRetrievalFailureException
See Also:
notifyDataRetrievalFailure(String, String)

notifyInsertionFailure

public static void notifyInsertionFailure(String objectName)
                                   throws InsertionFailureException
Same behaviour as call of method notifyInsertionFailure(null, String).

Throws:
InsertionFailureException
See Also:
notifyInsertionFailure(String, String)

notifyDataIntegrityViolationFailure

public static void notifyDataIntegrityViolationFailure(String objectName)
                                                throws DataIntegrityViolationException
Same behaviour as call of method notifyDataIntegrityViolationFailure(null, String).

Throws:
DataIntegrityViolationException
See Also:
notifyDataIntegrityViolationFailure(String, String)

notifyOptimisticLockingFailure

public static void notifyOptimisticLockingFailure(String objectName)
                                           throws OptimisticLockingFailureException
Same behaviour as call of method notifyOptimisticLockingFailure(null, String).

Throws:
OptimisticLockingFailureException
See Also:
notifyOptimisticLockingFailure(String, String, OptimisticLockingFailureException)

notifyJdbcUpdateAffectedIncorrectNumberOfRows

public static void notifyJdbcUpdateAffectedIncorrectNumberOfRows(String objectName,
                                                                 String sql,
                                                                 int expected,
                                                                 int actual)
                                                          throws JdbcUpdateAffectedIncorrectNumberOfRowsException
Same behaviour as call of method notifyOptimisticLockingFailure(null, String, String, int, int) .

Throws:
JdbcUpdateAffectedIncorrectNumberOfRowsException
See Also:
notifyJdbcUpdateAffectedIncorrectNumberOfRows(String, String, String, int, int)


Copyright © 2005-2011 ELCA. All Rights Reserved.