package com.atlassian.bitbucket.mesh.sidecar;

import javax.annotation.Nonnull;

/**
 * Used to communicate with Bitbucket Server when running in sidecar mode.
 * <p>
 * The primary purpose of this interface is to facilitate testing by decoupling sidecar-specific components
 * which send messages from how those messages are sent.
 */
public interface SidecarChannel {

    /**
     * Sends the provided message to Bitbucket Server.
     *
     * @param message the message to send
     */
    void send(@Nonnull String message);

    /**
     * Sends the provided key/value pair to Bitbucket Server.
     *
     * @param key   the key to send
     * @param value the value to send
     */
    void send(@Nonnull String key, @Nonnull String value);
}
