public interface

SshScmRequestHandler

com.atlassian.bitbucket.scm.ssh.SshScmRequestHandler

Class Overview

Plugin point for handling SshScmRequests.

Summary

Public Methods
@Deprecated @Nonnull Optional<SshScmRequest> create(String command, InputStream stdin, OutputStream stdout, OutputStream stderr, ExitCodeCallback exitCodeCallback)
This method is deprecated. in 5.12 for removal in 6.0. Handlers should implement create(SshScmRequestContext) instead.
@Nonnull Optional<SshScmRequest> create(SshScmRequestContext context)
Returns an SshScmRequest if this handler can handle the supplied command string, or empty() otherwise.
boolean supports(String command)

Public Methods

@Deprecated @Nonnull public Optional<SshScmRequest> create (String command, InputStream stdin, OutputStream stdout, OutputStream stderr, ExitCodeCallback exitCodeCallback)

This method is deprecated.
in 5.12 for removal in 6.0. Handlers should implement create(SshScmRequestContext) instead.

Returns an SshScmRequest if this handler can handle the supplied command string, or empty() otherwise.

Parameters
command the command from the remote client (e.g. "git-upload-pack path/to/repository")
stdin the InputStream for reading from the remote client's stdin stream
stdout the OutputStream for writing to the remote client's stdout stream
stderr the OutputStream for writing to the remote client's stderr stream
exitCodeCallback used to set the exit code returned to the remote client (If the callback is not invoked a return code of 1 will be used)
Returns
  • an SshScmRequest if this handler supports the specified command, or empty() to indicate that this factory does not support the command
Throws
NoSuchRepositoryException if this handler supports the specified command, but the requested repository cannot be found
AuthorisationException if this handler the repository is not accessible

@Nonnull public Optional<SshScmRequest> create (SshScmRequestContext context)

Returns an SshScmRequest if this handler can handle the supplied command string, or empty() otherwise.

Parameters
context context describing the request, which can be used by the handler implementation to determine whether it supports the request or not
Returns
  • an SshScmRequest if this handler supports the specified command, or empty() to indicate that this factory does not support the command
Throws
NoSuchRepositoryException if this handler supports the specified command, but the requested repository cannot be found
AuthorisationException if this handler the repository is not accessible

public boolean supports (String command)

Parameters
command the command String passed from the remote SSH client (e.g. "git-upload-pack path/to/repository")
Returns
  • true if the handler supports the supplied command, false otherwise