package com.atlassian.bitbucket.ssh.command;

import javax.annotation.Nonnull;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Optional;

/**
 * Describes a factory for parsing commands and creating {@link SshCommand} instances to run them.
 */
public interface SshCommandFactory {

    @Nonnull
    Optional<SshCommand> create(@Nonnull String command, @Nonnull InputStream stdin,
                                @Nonnull OutputStream stdout, @Nonnull OutputStream stderr);

    boolean supports(@Nonnull String command);
}
