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

org.bidib.wizard.api.model.debug.DebugConnection Maven / Gradle / Ivy

There is a newer version: 2.0.25
Show newest version
package org.bidib.wizard.api.model.debug;

import org.bidib.jbidibc.messages.helpers.Context;
import org.bidib.wizard.api.model.common.LineEnding;
import org.bidib.wizard.api.model.connection.ConnectionState;

import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.functions.Action;
import io.reactivex.rxjava3.functions.Consumer;
import io.reactivex.rxjava3.subjects.Subject;

public interface DebugConnection {

    /**
     * Get the connection id of the connection.
     * 
     * @return the connection id
     */
    String getConnectionId();

    /**
     * Get the connection uri.
     * 
     * @return the uri
     */
    String getUri();

    /**
     * Get the current connection state.
     * 
     * @return the current connection state
     */
    ConnectionState getConnectionState();

    /**
     * Get the subject for received data events.
     * 
     * @return the subjectDataEvents
     */
    Subject getSubjectDataEvents();

    /**
     * Subscribe to debug data events.
     * 
     * @param onNext
     *            the data handler
     * @param onError
     *            the error handler
     * @param onComplete
     *            the complete action
     * @return the disposable
     */
    Disposable subscribeDataEvents(Consumer onNext, Consumer onError, Action onComplete);

    /**
     * Connect the connection to the configured uri.
     * 
     * @param context
     *            the context to provide additional params
     */
    void connect(final Context context);

    /**
     * Disconnect the connection if connected.
     */
    void disconnect();

    /**
     * @return the connection is connected
     */
    boolean isConnected();

    /**
     * Shutdown the connection and release all resources.
     */
    void shutdown();

    /**
     * Transmit the content.
     * 
     * @param content
     *            the content
     */
    void transmit(byte[] content);

    /**
     * Transmit the content.
     * 
     * @param content
     *            the content
     */
    void transmit(String content, LineEnding lineEnding);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy