All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.yamcs.tse.Interceptor Maven / Gradle / Ivy

There is a newer version: 5.10.9
Show newest version
package org.yamcs.tse;

import java.nio.charset.Charset;

import org.yamcs.tse.api.TseCommand;

public interface Interceptor {

    /**
     * Intercepts 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. * * @param 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. * @param bytes * The raw command (usually correspons to an encoded string) * @param encoding * String encoding */ default byte[] interceptCommand(TseCommand metadata, byte[] bytes, Charset encoding) { return bytes; } /** * Intercepts 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. * * @param 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. * @param bytes * The raw command response (usually corresponds to an encoded string) * @param encoding * Expected string encoding */ default byte[] interceptResponse(TseCommand metadata, byte[] bytes, Charset encoding) { return bytes; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy