Interface DataFilter

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  DataFilter.AbortException
      Aborts the filtering of the message data.
    • Method Summary

      Modifier and Type Method Description
      java.lang.Object filter​(ServerSession session, ServerChannel channel, java.lang.Object data)
      Modifies the given message data.
    • Method Detail

      • filter

        java.lang.Object filter​(ServerSession session,
                                ServerChannel channel,
                                java.lang.Object data)
                         throws DataFilter.AbortException

        Modifies the given message data.

        Returning null or throwing DataFilter.AbortException results in the message processing being interrupted and the message itself discarded.

        If the returned object is different (as returned by the != operator) from the data parameter then it is set as the new message data via Message.Mutable.setData(Object).

        Parameters:
        session - the ServerSession that sends the data
        channel - the channel the data is being sent on
        data - the data being sent
        Returns:
        the transformed data or null if the message should be ignored
        Throws:
        DataFilter.AbortException - to abort the filtering of the data