Package org.apache.guacamole.protocol
Class FilteredGuacamoleReader
- java.lang.Object
- 
- org.apache.guacamole.protocol.FilteredGuacamoleReader
 
- 
- All Implemented Interfaces:
- GuacamoleReader
 
 public class FilteredGuacamoleReader extends Object implements GuacamoleReader GuacamoleReader which applies a given GuacamoleFilter to observe or alter all read instructions. Instructions may also be dropped or denied by the filter.
- 
- 
Constructor SummaryConstructors Constructor Description FilteredGuacamoleReader(GuacamoleReader reader, GuacamoleFilter filter)Wraps the given GuacamoleReader, applying the given filter to all read instructions.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanavailable()Returns whether instruction data is available for reading.char[]read()Reads at least one complete Guacamole instruction, returning a buffer containing one or more complete Guacamole instructions and no incomplete Guacamole instructions.GuacamoleInstructionreadInstruction()Reads exactly one complete Guacamole instruction and returns the fully parsed instruction.
 
- 
- 
- 
Constructor Detail- 
FilteredGuacamoleReaderpublic FilteredGuacamoleReader(GuacamoleReader reader, GuacamoleFilter filter) Wraps the given GuacamoleReader, applying the given filter to all read instructions. Future reads will return only instructions which pass the filter.- Parameters:
- reader- The GuacamoleReader to wrap.
- filter- The filter which dictates which instructions are read, and how.
 
 
- 
 - 
Method Detail- 
availablepublic boolean available() throws GuacamoleExceptionDescription copied from interface:GuacamoleReaderReturns whether instruction data is available for reading. Note that this does not guarantee an entire instruction is available. If a full instruction is not available, this function can return true, and a call to read() will still block.- Specified by:
- availablein interface- GuacamoleReader
- Returns:
- true if instruction data is available for reading, false otherwise.
- Throws:
- GuacamoleException- If an error occurs while checking for available data.
 
 - 
readpublic char[] read() throws GuacamoleExceptionDescription copied from interface:GuacamoleReaderReads at least one complete Guacamole instruction, returning a buffer containing one or more complete Guacamole instructions and no incomplete Guacamole instructions. This function will block until at least one complete instruction is available.- Specified by:
- readin interface- GuacamoleReader
- Returns:
- A buffer containing at least one complete Guacamole instruction, or null if no more instructions are available for reading.
- Throws:
- GuacamoleException- If an error occurs while reading from the stream.
 
 - 
readInstructionpublic GuacamoleInstruction readInstruction() throws GuacamoleException Description copied from interface:GuacamoleReaderReads exactly one complete Guacamole instruction and returns the fully parsed instruction.- Specified by:
- readInstructionin interface- GuacamoleReader
- Returns:
- The next complete instruction from the stream, fully parsed, or null if no more instructions are available for reading.
- Throws:
- GuacamoleException- If an error occurs while reading from the stream, or if the instruction cannot be parsed.
 
 
- 
 
-