Package org.apache.guacamole.protocol
Class FilteredGuacamoleWriter
java.lang.Object
org.apache.guacamole.protocol.FilteredGuacamoleWriter
- All Implemented Interfaces:
GuacamoleWriter
GuacamoleWriter which applies a given GuacamoleFilter to observe or alter
all written instructions. Instructions may also be dropped or denied by
the filter.
-
Constructor Summary
ConstructorsConstructorDescriptionFilteredGuacamoleWriter
(GuacamoleWriter writer, GuacamoleFilter filter) Wraps the given GuacamoleWriter, applying the given filter to all written instructions. -
Method Summary
Modifier and TypeMethodDescriptionvoid
write
(char[] chunk) Writes the entire given array of characters to the Guacamole instruction stream.void
write
(char[] chunk, int offset, int length) Writes a portion of the given array of characters to the Guacamole instruction stream.void
writeInstruction
(GuacamoleInstruction instruction) Writes the given fully parsed instruction to the Guacamole instruction stream.
-
Constructor Details
-
FilteredGuacamoleWriter
Wraps the given GuacamoleWriter, applying the given filter to all written instructions. Future writes will only write instructions which pass the filter.- Parameters:
writer
- The GuacamoleWriter to wrap.filter
- The filter which dictates which instructions are written, and how.
-
-
Method Details
-
write
Description copied from interface:GuacamoleWriter
Writes a portion of the given array of characters to the Guacamole instruction stream. The portion must contain only complete Guacamole instructions.- Specified by:
write
in interfaceGuacamoleWriter
- Parameters:
chunk
- An array of characters containing Guacamole instructions.offset
- The start offset of the portion of the array to write.length
- The length of the portion of the array to write.- Throws:
GuacamoleException
- If an error occurred while writing the portion of the array specified.
-
write
Description copied from interface:GuacamoleWriter
Writes the entire given array of characters to the Guacamole instruction stream. The array must consist only of complete Guacamole instructions.- Specified by:
write
in interfaceGuacamoleWriter
- Parameters:
chunk
- An array of characters consisting only of complete Guacamole instructions.- Throws:
GuacamoleException
- If an error occurred while writing the the specified array.
-
writeInstruction
Description copied from interface:GuacamoleWriter
Writes the given fully parsed instruction to the Guacamole instruction stream.- Specified by:
writeInstruction
in interfaceGuacamoleWriter
- Parameters:
instruction
- The Guacamole instruction to write.- Throws:
GuacamoleException
- If an error occurred while writing the instruction.
-