Class AhpHostOptions
java.lang.Object
com.github.copilot.AhpHostOptions
Options for in-process AHP hosting. Select at least one transport explicitly;
no local listener is started by default. Factories must return the exact
session registered on the owning client with the requested identity and
settings. Release callbacks end a participation, not the application's
session lifetime.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the creation callback.Gets the GitHub Mission Control transport settings.Gets the local WebSocket transport settings.Gets the exit callback.Gets the release callback.Gets the resume callback.Sets the application creation callback.setGithubEnvironment(HostGitHubEnvironmentOptions githubEnvironment) Enables or disables GitHub Mission Control hosting.setLocalServer(HostLocalServerOptions localServer) Enables or disables the local WebSocket transport.setOnExit(Function<AhpHostExit, CompletableFuture<Void>> callback) Sets the listener exit callback.setOnSessionReleased(Function<CopilotSession, CompletableFuture<Void>> callback) Sets the participation-release callback.Sets the application resume callback.
-
Constructor Details
-
AhpHostOptions
public AhpHostOptions()Creates options without a transport. Set a local server, a GitHub environment, or both before starting the host.
-
-
Method Details
-
getLocalServer
Gets the local WebSocket transport settings.- Returns:
- the settings, or
nullwhen local hosting is disabled
-
setLocalServer
Enables or disables the local WebSocket transport.- Parameters:
localServer- local settings, ornullto disable local hosting- Returns:
- these options
-
getGithubEnvironment
Gets the GitHub Mission Control transport settings.- Returns:
- the settings, or
nullwhen GitHub hosting is disabled
-
setGithubEnvironment
Enables or disables GitHub Mission Control hosting.- Parameters:
githubEnvironment- settings with a required name and compute ID, ornull- Returns:
- these options
-
getCreateSession
Gets the creation callback.- Returns:
- the application creation callback, or
null
-
setCreateSession
public AhpHostOptions setCreateSession(Function<AhpSessionCreateRequest, CompletableFuture<CopilotSession>> callback) Sets the application creation callback.- Parameters:
callback- application creation callback- Returns:
- these options
-
getResumeSession
Gets the resume callback.- Returns:
- the application resume callback, or
null
-
setResumeSession
public AhpHostOptions setResumeSession(Function<AhpSessionResumeRequest, CompletableFuture<CopilotSession>> callback) Sets the application resume callback.- Parameters:
callback- application resume callback- Returns:
- these options
-
getOnSessionReleased
Gets the release callback.- Returns:
- the participation-release callback, or
null
-
setOnSessionReleased
public AhpHostOptions setOnSessionReleased(Function<CopilotSession, CompletableFuture<Void>> callback) Sets the participation-release callback.- Parameters:
callback- callback receiving the exact factory result once- Returns:
- these options
-
getOnExit
Gets the exit callback.- Returns:
- the listener exit callback, or
null
-
setOnExit
Sets the listener exit callback.- Parameters:
callback- callback receiving the listener's final outcome once- Returns:
- these options
-