Package org.kohsuke.github.internal
Class GitHubConnectorHttpConnectorAdapter
java.lang.Object
org.kohsuke.github.internal.GitHubConnectorHttpConnectorAdapter
- All Implemented Interfaces:
GitHubConnector,HttpConnector
public final class GitHubConnectorHttpConnectorAdapter
extends Object
implements GitHubConnector, HttpConnector
Adapts an HttpConnector to be usable as GitHubConnector.
For internal use only.
- Author:
- Liam Newman
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classInitial response information supplied when a response is received but before the body is processed. -
Field Summary
Fields inherited from interface org.kohsuke.github.connector.GitHubConnector
DEFAULT, OFFLINEFields inherited from interface org.kohsuke.github.HttpConnector
DEFAULT, OFFLINE -
Constructor Summary
ConstructorsConstructorDescriptionGitHubConnectorHttpConnectorAdapter(HttpConnector httpConnector) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic GitHubConnectoradapt(HttpConnector connector) Creates a GitHubConnector for an HttpConnector.Opens a connection to the given URL.send(GitHubConnectorRequest request) Sends a request and retrieves a raw response for processing.
-
Constructor Details
-
GitHubConnectorHttpConnectorAdapter
Constructor.- Parameters:
httpConnector- the HttpConnector to be adapted.
-
-
Method Details
-
adapt
Creates a GitHubConnector for an HttpConnector. If a well-known static HttpConnector is passed, a corresponding static GitHubConnector is returned.- Parameters:
connector- the HttpConnector to be adapted.- Returns:
- a GitHubConnector that calls into the provided HttpConnector.
-
connect
Description copied from interface:HttpConnectorOpens a connection to the given URL.- Specified by:
connectin interfaceHttpConnector- Parameters:
url- the url- Returns:
- the http url connection
- Throws:
IOException- the io exception
-
send
Description copied from interface:GitHubConnectorSends a request and retrieves a raw response for processing. Implementers ofGitHubConnector.send(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 ofGitHubConnector.send(GitHubConnectorRequest)should be passed to the constructor ofGitHubConnectorResponse.- Specified by:
sendin interfaceGitHubConnector- Parameters:
request- the request data to be sent.- Returns:
- a GitHubConnectorResponse for the request
- Throws:
IOException- if there is an I/O error
-