- All Known Implementing Classes:
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.
Interface for customizing HTTP request behaviors or using any HTTP client library for interacting with GitHub.
- Author:
- Liam Newman
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final GitHubConnectorDefault implementation used when connector is not set by user.static final GitHubConnectorStub implementation that is always off-line. -
Method Summary
Modifier and TypeMethodDescriptionsend(GitHubConnectorRequest connectorRequest) Sends a request and retrieves a raw response for processing.
-
Field Details
-
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:
-
OFFLINE
Stub implementation that is always off-line.
-
-
Method Details
-
send
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
-