@Override
    public void writeInstruction(GuacamoleInstruction instruction) throws GuacamoleException {

        // Write instruction only if not dropped
        GuacamoleInstruction filteredInstruction = filter.filter(instruction);
        if (filteredInstruction != null)
            writer.writeInstruction(filteredInstruction);

    }
Wraps the given GuacamoleWriter, applying the given filter to all written 
instructions. Future writes will only write instructions which pass
the filter.

@param writer The GuacamoleWriter to wrap.
@param filter The filter which dictates which instructions are written,
              and how.
guacamole-common/src/main/java/org/apache/guacamole/protocol/FilteredGuacamoleWriter.java