org.ikasan.framework.error.service
Class DefaultErrorLoggingServiceImpl

java.lang.Object
  extended by org.ikasan.framework.error.service.DefaultErrorLoggingServiceImpl
All Implemented Interfaces:
ErrorLoggingService

public class DefaultErrorLoggingServiceImpl
extends Object
implements ErrorLoggingService

Default implementation of ErrorLoggingServiceImpl When logging error, simply persists a new instance of ErrorOccurrence and notifies listeners

Author:
Ikasan Development Team

Constructor Summary
DefaultErrorLoggingServiceImpl(ErrorOccurrenceDao errorOccurrenceDao, ExcludedEventDao excludedEventDao, URL baseUrl)
          Constructor
DefaultErrorLoggingServiceImpl(ErrorOccurrenceDao errorOccurrenceDao, ExcludedEventDao excludedEventDao, URL baseURl, ErrorOccurrenceListener errorOccurrenceListener)
          Constructor
DefaultErrorLoggingServiceImpl(ErrorOccurrenceDao errorOccurrenceDao, ExcludedEventDao excludedEventDao, URL baseUrl, List<ErrorOccurrenceListener> errorOccurrenceListeners)
          Constructor
 
Method Summary
 void addErrorOccurrenceListener(ErrorOccurrenceListener errorOccurrenceListener)
          Registers an ErrorOccurrenceListener as a listener for new ErrorOccurrence
 ErrorOccurrence getErrorOccurrence(long errorOccurrenceId)
          Retrieve an ErrorOccurrence specified by its Id
 List<ErrorOccurrence> getErrorOccurrences(String eventId)
          Returns all ErrorOccurrences for the event specified by its id
 PagedSearchResult<ErrorOccurrence> getErrors(int pageNo, int pageSize, String orderBy, boolean orderAscending, String moduleName, String flowName)
          Returns a paged listing of errors
 void housekeep()
          Causes all ErrorOccurrences that are deemed to be too old to be deleted
 void logError(Throwable throwable, String moduleName, String initiatorName, String actionTaken)
          Logs an Error caused before there was an Event
 void logError(Throwable throwable, String moduleName, String flowName, String flowElementName, Event currentEvent, String actionTaken)
          Logs an Error where there is an inflight Event involved in a Flow
 void removeErrorOccurrenceListener(ErrorOccurrenceListener errorOccurrenceListener)
          Deregisters an ErrorOccurrenceListener as a listener for new ErrorOccurrence
 void setErrorTimeToLiveDays(long errorTimeToLiveDays)
          Setter method for timeToLiveDays, allows default value to be overridden
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultErrorLoggingServiceImpl

public DefaultErrorLoggingServiceImpl(ErrorOccurrenceDao errorOccurrenceDao,
                                      ExcludedEventDao excludedEventDao,
                                      URL baseUrl)
Constructor

Parameters:
errorOccurrenceDao -
excludedEventDao -
baseUrl -

DefaultErrorLoggingServiceImpl

public DefaultErrorLoggingServiceImpl(ErrorOccurrenceDao errorOccurrenceDao,
                                      ExcludedEventDao excludedEventDao,
                                      URL baseUrl,
                                      List<ErrorOccurrenceListener> errorOccurrenceListeners)
Constructor

Parameters:
errorOccurrenceDao -
excludedEventDao -
baseUrl -
errorOccurrenceListeners -

DefaultErrorLoggingServiceImpl

public DefaultErrorLoggingServiceImpl(ErrorOccurrenceDao errorOccurrenceDao,
                                      ExcludedEventDao excludedEventDao,
                                      URL baseURl,
                                      ErrorOccurrenceListener errorOccurrenceListener)
Constructor

Parameters:
errorOccurrenceDao -
excludedEventDao -
baseURl -
errorOccurrenceListener -
Method Detail

logError

public void logError(Throwable throwable,
                     String moduleName,
                     String flowName,
                     String flowElementName,
                     Event currentEvent,
                     String actionTaken)
Description copied from interface: ErrorLoggingService
Logs an Error where there is an inflight Event involved in a Flow

Specified by:
logError in interface ErrorLoggingService

getErrors

public PagedSearchResult<ErrorOccurrence> getErrors(int pageNo,
                                                    int pageSize,
                                                    String orderBy,
                                                    boolean orderAscending,
                                                    String moduleName,
                                                    String flowName)
Description copied from interface: ErrorLoggingService
Returns a paged listing of errors

Specified by:
getErrors in interface ErrorLoggingService
Parameters:
pageNo - - 0 or greater, index into the list of all possible results
pageSize - - 0 or greater, no of errors to return on a page
Returns:
PagedSearchResult

logError

public void logError(Throwable throwable,
                     String moduleName,
                     String initiatorName,
                     String actionTaken)
Description copied from interface: ErrorLoggingService
Logs an Error caused before there was an Event

Specified by:
logError in interface ErrorLoggingService

getErrorOccurrence

public ErrorOccurrence getErrorOccurrence(long errorOccurrenceId)
Description copied from interface: ErrorLoggingService
Retrieve an ErrorOccurrence specified by its Id

Specified by:
getErrorOccurrence in interface ErrorLoggingService
Returns:
ErrorOccurrence

housekeep

public void housekeep()
Description copied from interface: ErrorLoggingService
Causes all ErrorOccurrences that are deemed to be too old to be deleted

Specified by:
housekeep in interface ErrorLoggingService

setErrorTimeToLiveDays

public void setErrorTimeToLiveDays(long errorTimeToLiveDays)
Setter method for timeToLiveDays, allows default value to be overridden

Parameters:
errorTimeToLiveDays -

getErrorOccurrences

public List<ErrorOccurrence> getErrorOccurrences(String eventId)
Description copied from interface: ErrorLoggingService
Returns all ErrorOccurrences for the event specified by its id

Specified by:
getErrorOccurrences in interface ErrorLoggingService
Returns:
List of ErrorOccurrences for the specified event

addErrorOccurrenceListener

public void addErrorOccurrenceListener(ErrorOccurrenceListener errorOccurrenceListener)
Description copied from interface: ErrorLoggingService
Registers an ErrorOccurrenceListener as a listener for new ErrorOccurrence

Specified by:
addErrorOccurrenceListener in interface ErrorLoggingService

removeErrorOccurrenceListener

public void removeErrorOccurrenceListener(ErrorOccurrenceListener errorOccurrenceListener)
Description copied from interface: ErrorLoggingService
Deregisters an ErrorOccurrenceListener as a listener for new ErrorOccurrence

Specified by:
removeErrorOccurrenceListener in interface ErrorLoggingService


Copyright © 2007-2012 Ikasan. All Rights Reserved.