Class PayloadFilter

java.lang.Object
ca.uqac.lif.cep.Processor
ca.uqac.lif.cep.SynchronousProcessor
netp.PayloadFilter
All Implemented Interfaces:
ca.uqac.lif.cep.Contextualizable, ca.uqac.lif.cep.Duplicable, ca.uqac.lif.cep.DuplicableProcessor

public class PayloadFilter extends ca.uqac.lif.cep.SynchronousProcessor
Discards packets from an input trace based on the content of its payload. User can specify a byte[] or hex string as filter value, and only packets containing that exact sequence of bytes pass through the filter.
  • Nested Class Summary

    Nested classes/interfaces inherited from class ca.uqac.lif.cep.SynchronousProcessor

    ca.uqac.lif.cep.SynchronousProcessor.InputPushable, ca.uqac.lif.cep.SynchronousProcessor.OutputPullable

    Nested classes/interfaces inherited from class ca.uqac.lif.cep.Processor

    ca.uqac.lif.cep.Processor.InternalProcessorState
  • Field Summary

    Fields inherited from class ca.uqac.lif.cep.SynchronousProcessor

    m_inputPushables, m_outputPullables, m_tempQueue

    Fields inherited from class ca.uqac.lif.cep.Processor

    m_context, m_hasBeenNotifiedOfEndOfTrace, m_inputArity, m_inputPullables, m_inputQueues, m_notifiedEndOfTraceDownstream, m_outputArity, m_outputPushables, m_outputQueues, MAX_PULL_RETRIES, s_versionString
  • Constructor Summary

    Constructors
    Constructor
    Description
    Instantiates a default filter that allows all packets through
  • Method Summary

    Modifier and Type
    Method
    Description
    ca.uqac.lif.cep.Processor
     
    protected boolean
    compute(Object[] inputs, Queue<Object[]> outputs)
     
    ca.uqac.lif.cep.Processor
    duplicate(boolean with_state)
     
    boolean
    setFilter(byte[] filter)
    Sets the filter from a byte sequence.
    boolean
    Sets the filter from a hex value in string form.

    Methods inherited from class ca.uqac.lif.cep.SynchronousProcessor

    getPullableOutput, getPushableInput

    Methods inherited from class ca.uqac.lif.cep.Processor

    allNotifiedEndOfTrace, allNull, copyInputQueue, copyOutputQueue, duplicate, duplicateInto, equals, getAt, getContext, getContext, getEmptyQueue, getId, getInputArity, getInputQueue, getInputType, getInputTypesFor, getOutputArity, getOutputQueue, getOutputType, getPullableInput, getPullableOutput, getPushableInput, getPushableOutput, hashCode, leftShift, newContext, onEndOfTrace, or, or, or, printState, readState, reset, rightShift, setContext, setContext, setPullableInput, setPushableOutput, start, startAll, stop, stopAll

    Methods inherited from class Object

    finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PayloadFilter

      public PayloadFilter()
      Instantiates a default filter that allows all packets through
  • Method Details

    • setFilter

      public boolean setFilter(String hex)
      Sets the filter from a hex value in string form.
      Parameters:
      hex - Hex value of the filter (eg. "2D45")
      Returns:
      true if string parsing was successful, false otherwise
    • setFilter

      public boolean setFilter(byte[] filter)
      Sets the filter from a byte sequence.
      Parameters:
      filter - Byte sequence
      Returns:
      true if the affectation was successful
    • compute

      protected boolean compute(Object[] inputs, Queue<Object[]> outputs)
      Specified by:
      compute in class ca.uqac.lif.cep.SynchronousProcessor
    • clone

      public ca.uqac.lif.cep.Processor clone()
      Overrides:
      clone in class Object
    • duplicate

      public ca.uqac.lif.cep.Processor duplicate(boolean with_state)
      Specified by:
      duplicate in interface ca.uqac.lif.cep.Duplicable
      Specified by:
      duplicate in class ca.uqac.lif.cep.Processor