Class TroubleListenerAdapter
java.lang.Object
com.tccc.kos.commons.core.service.trouble.TroubleListenerAdapter
- All Implemented Interfaces:
TroubleAware,TroubleListener
Simple implementation TroubleListener which allows selective callbacks
to be overridden as needed.
- Since:
- 1.0
- Version:
- 2022-09-18
-
Constructor Summary
ConstructorsConstructorDescriptionTroubleListenerAdapter(TroubleMatcher matcher) Create a new listener with the specified matcher. -
Method Summary
Modifier and TypeMethodDescriptionReturn the matcher to use with this listener.voidonTroubleAdded(Trouble trouble) Called when a trouble is added.voidonTroubleRemoved(Trouble trouble) Called when a trouble is removed.voidonTroubleResolved(Trouble trouble, boolean success) Called when a trouble completes resolve processing whether it is successful or not.
-
Constructor Details
-
TroubleListenerAdapter
Create a new listener with the specified matcher. Only troubles that match the matcher will be forwarded to the various callbacks.- Parameters:
matcher- the matcher to use
-
-
Method Details
-
onTroubleAdded
Description copied from interface:TroubleAwareCalled when a trouble is added.- Specified by:
onTroubleAddedin interfaceTroubleAware- Parameters:
trouble- the trouble being added
-
onTroubleResolved
Description copied from interface:TroubleAwareCalled when a trouble completes resolve processing whether it is successful or not.- Specified by:
onTroubleResolvedin interfaceTroubleAware- Parameters:
trouble- the trouble being resolvedsuccess- true if resolved successfully
-
onTroubleRemoved
Description copied from interface:TroubleAwareCalled when a trouble is removed.- Specified by:
onTroubleRemovedin interfaceTroubleAware- Parameters:
trouble- the trouble being removed
-
getMatcher
Description copied from interface:TroubleListenerReturn the matcher to use with this listener. Only troubles that match this matcher will be forwarded to the TroubleAware callbacks.- Specified by:
getMatcherin interfaceTroubleListener
-