Class TroubleListenerAdapter

java.lang.Object
com.tccc.kos.commons.core.service.trouble.TroubleListenerAdapter
All Implemented Interfaces:
TroubleAware, TroubleListener

public class TroubleListenerAdapter extends Object implements TroubleListener
Simple implementation TroubleListener which allows selective callbacks to be overridden as needed.
Since:
1.0
Version:
2022-09-18
  • Constructor Details

    • TroubleListenerAdapter

      public TroubleListenerAdapter(TroubleMatcher matcher)
      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

      public void onTroubleAdded(Trouble trouble)
      Description copied from interface: TroubleAware
      Called when a trouble is added.
      Specified by:
      onTroubleAdded in interface TroubleAware
      Parameters:
      trouble - the trouble being added
    • onTroubleResolved

      public void onTroubleResolved(Trouble trouble, boolean success)
      Description copied from interface: TroubleAware
      Called when a trouble completes resolve processing whether it is successful or not.
      Specified by:
      onTroubleResolved in interface TroubleAware
      Parameters:
      trouble - the trouble being resolved
      success - true if resolved successfully
    • onTroubleRemoved

      public void onTroubleRemoved(Trouble trouble)
      Description copied from interface: TroubleAware
      Called when a trouble is removed.
      Specified by:
      onTroubleRemoved in interface TroubleAware
      Parameters:
      trouble - the trouble being removed
    • getMatcher

      public TroubleMatcher getMatcher()
      Description copied from interface: TroubleListener
      Return the matcher to use with this listener. Only troubles that match this matcher will be forwarded to the TroubleAware callbacks.
      Specified by:
      getMatcher in interface TroubleListener