Class FilterEvent

  • All Implemented Interfaces:
    Serializable

    public class FilterEvent
    extends EventObject
    This class is used by the SmartInspectListener.onFilter event of the SmartInspect class.

    This class consists of only three class members. At first we have the getPacket method, which returns the packet which caused the event. Then there are the getCancel and setCancel methods which can be used to cancel the processing of certain packets. For more information, please refer to the SmartInspectListener.onFilter documentation.

    This class is fully threadsafe.

    See Also:
    Serialized Form
    • Constructor Detail

      • FilterEvent

        public FilterEvent​(Object source,
                           Packet packet)
        Creates and initializes a FilterEvent instance.
        Parameters:
        source - The object which fired the event.
        packet - The packet which caused the event.
    • Method Detail

      • getPacket

        public Packet getPacket()
        Returns the packet which caused the event.
        Returns:
        The packet which caused the event.
      • getCancel

        public boolean getCancel()
        Indicates if processing of the current packet should be cancelled or not.

        For more information, please refer to the documentation of the setCancel method or the SmartInspectListener.onFilter event of the SmartInspect class.

        Returns:
        True if processing of the current packet should be cancelled and false otherwise.
      • setCancel

        public void setCancel​(boolean cancel)
        This method can be used to cancel the processing of certain packets during the SmartInspectListener.onFilter event of the SmartInspect class. For more information on how to use this method, please refer to the SmartInspectListener.onFilter event documentation.
        Parameters:
        cancel - Specifies if processing of the current packet should be cancelled or not.