Package org.kohsuke.github.connector
Interface GitHubConnector
-
- All Known Implementing Classes:
GitHubConnectorHttpConnectorAdapter,HttpClientGitHubConnector,OkHttpGitHubConnector
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface GitHubConnector
Interface for customizing HTTP request behaviors or using any HTTP client library for interacting with GitHub.- Author:
- Liam Newman
-
-
Field Summary
Fields Modifier and Type Field Description static GitHubConnectorDEFAULTDefault implementation used when connector is not set by user.static GitHubConnectorOFFLINEStub implementation that is always off-line.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GitHubConnectorResponsesend(GitHubConnectorRequest connectorRequest)Sends a request and retrieves a raw response for processing.
-
-
-
Field Detail
-
DEFAULT
static final GitHubConnector DEFAULT
Default implementation used when connector is not set by user. This callsDefaultGitHubConnector.create()to get the default connector instance. The output of that method may differ depending on Java version and system properties.- See Also:
DefaultGitHubConnector#create()
-
OFFLINE
static final GitHubConnector OFFLINE
Stub implementation that is always off-line. This connector currently usesGitHubConnectorHttpConnectorAdapterto maintain backward compatibility as much as possible.
-
-
Method Detail
-
send
GitHubConnectorResponse send(GitHubConnectorRequest connectorRequest) throws IOException
Sends a request and retrieves a raw response for processing. Implementers ofsend(GitHubConnectorRequest)process the information from aGitHubConnectorRequestto open an HTTP connection and retrieve a raw response. They then return a class that extendsGitHubConnectorResponsecorresponding their response data. Clients should not implement their ownGitHubConnectorRequest. TheGitHubConnectorRequestprovided by the caller ofsend(GitHubConnectorRequest)should be passed to the constructor ofGitHubConnectorResponse.- Parameters:
connectorRequest- the request data to be sent.- Returns:
- a GitHubConnectorResponse for the request
- Throws:
IOException- if there is an I/O error
-
-