Class PassiveScanController

    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clearQueue()
      Empties the passive scan queue without passively scanning the messages.
      int getArrangeableListenerOrder()
      Gets the order of when this listener should be notified.
      PassiveScanTask getOldestRunningTask()  
      protected int getRecordsToScan()  
      java.util.List<PassiveScanTask> getRunningTasks()  
      boolean onHttpRequestSend​(HttpMessage msg)
      Notifies the listener that a new request was received from the client and is ready to be forwarded to the server.
      boolean onHttpResponseReceive​(HttpMessage msg)
      Notifies the listener that a new response was received from the server and is ready to be forwarded to the client.
      void run()  
      void setSession​(Session session)  
      protected void shutdown()  
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • setSession

        public void setSession​(Session session)
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
      • getRecordsToScan

        protected int getRecordsToScan()
      • shutdown

        protected void shutdown()
      • getRunningTasks

        public java.util.List<PassiveScanTask> getRunningTasks()
      • clearQueue

        public void clearQueue()
        Empties the passive scan queue without passively scanning the messages. Currently running rules will run to completion but new rules will only be run when new messages are added to the queue.
        Since:
        2.12.0
      • getArrangeableListenerOrder

        public int getArrangeableListenerOrder()
        Description copied from interface: ArrangeableProxyListener
        Gets the order of when this listener should be notified.

        The listeners are ordered in a natural order, the greater the order the later it will be notified.

        Note: If two or more listeners have the same order, the order that those listeners will be notified is undefined.

        Specified by:
        getArrangeableListenerOrder in interface ArrangeableProxyListener
        Returns:
        an int with the value of the order that this listener should be notified about
      • onHttpRequestSend

        public boolean onHttpRequestSend​(HttpMessage msg)
        Description copied from interface: ProxyListener
        Notifies the listener that a new request was received from the client and is ready to be forwarded to the server.

        The HttpMessage msg can be modified, if the response is set it will be used instead of forwarding the request to the server. If the return value is true the message may be forwarded and the following listeners will be notified, if the value is false the message will not be forwarded and no more listeners will be notified.

        Note: In the presence of more than one listener there are no guarantees that:

        • the HttpMessage msg is equal to the one forwarded to the server, as the following listeners may modify it;
        • the response set is the one forwarded to the client, as the following listeners may clear or modify it;
        • the message will really be forwarded to the server, even if the return value is true, as the following listeners may return false.
        Specified by:
        onHttpRequestSend in interface ProxyListener
        Parameters:
        msg - the HttpMessage that may be forwarded to the server
        Returns:
        true if the message should be forwarded to the server, false otherwise
      • onHttpResponseReceive

        public boolean onHttpResponseReceive​(HttpMessage msg)
        Description copied from interface: ProxyListener
        Notifies the listener that a new response was received from the server and is ready to be forwarded to the client.

        The HttpMessage msg can be modified (only the response should be modified). If the return value is true the message may be forwarded and the following listeners will be notified, if the value is false the message will not be forwarded and no more listeners will be notified.

        Note: In the presence of more than one listener there are no guarantees that:

        • the HttpMessage msg is equal to the one forwarded to the client, as the following listeners may modify it;
        • the message will really be forwarded to the client, even if the return value is true, as the following listeners may return false.
        Specified by:
        onHttpResponseReceive in interface ProxyListener
        Parameters:
        msg - the HttpMessage that may be forwarded to the client
        Returns:
        true if the message should be forwarded to the client, false otherwise