- 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
Modifier and TypeFieldDescriptionstatic final GitHubConnector
Default implementation used when connector is not set by user.static final GitHubConnector
Stub 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 aGitHubConnectorRequest
to open an HTTP connection and retrieve a raw response. They then return a class that extendsGitHubConnectorResponse
corresponding their response data. Clients should not implement their ownGitHubConnectorRequest
. TheGitHubConnectorRequest
provided 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
-