Package org.yamcs.tse
Class LoggingInterceptor
- java.lang.Object
-
- org.yamcs.tse.LoggingInterceptor
-
- All Implemented Interfaces:
Interceptor
public class LoggingInterceptor extends Object implements Interceptor
An interceptor that does just logs both incoming and outgoing messags.
-
-
Constructor Summary
Constructors Constructor Description LoggingInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]interceptCommand(TseCommand metadata, byte[] bytes, Charset encoding)Intercepts a raw command just before passing it to driver-specific write logic.byte[]interceptResponse(TseCommand metadata, byte[] bytes, Charset encoding)Intercepts the response when it is provided by the driver-specific read logic.
-
-
-
Method Detail
-
interceptCommand
public byte[] interceptCommand(TseCommand metadata, byte[] bytes, Charset encoding)
Description copied from interface:InterceptorIntercepts a raw command just before passing it to driver-specific write logic.Usually this corresponds to an encoded string, for which the encoding is provided too.
- Specified by:
interceptCommandin interfaceInterceptor- Parameters:
metadata- Metadata about the command. Note that full information is only available if the command was issued through Yamcs. If instead an internal Telnet session was used, only the target instrument is known.bytes- The raw command (usually correspons to an encoded string)encoding- String encoding
-
interceptResponse
public byte[] interceptResponse(TseCommand metadata, byte[] bytes, Charset encoding)
Description copied from interface:InterceptorIntercepts the response when it is provided by the driver-specific read logic.This cannot be used for modifying how responses are delimited, because that's a responsibility of the driver.
- Specified by:
interceptResponsein interfaceInterceptor- Parameters:
metadata- Metadata about the command. Note that full information is only available if the command was issued through Yamcs. If instead an internal Telnet session was used, only the target instrument is known.bytes- The raw command response (usually corresponds to an encoded string)encoding- Expected string encoding
-
-