Package com.lpvs.service
Class LPVSGitHubConnectionService
java.lang.Object
com.lpvs.service.LPVSGitHubConnectionService
Service class for managing connections to the GitHub API.
It provides methods to connect to the GitHub API with the specified login and authentication token.
-
Constructor Summary
ConstructorsConstructorDescriptionLPVSGitHubConnectionService
(String GITHUB_LOGIN, String GITHUB_AUTH_TOKEN, String GITHUB_API_URL, LPVSExitHandler exitHandler) Constructs an instance of LPVSGitHubConnectionService with the specified properties and exit handler. -
Method Summary
Modifier and TypeMethodDescriptionorg.kohsuke.github.GitHub
Connects to the GitHub API based on the configured login, authentication token, and API URL.void
Sets the GitHub authentication token from the environment variable if available.
-
Constructor Details
-
LPVSGitHubConnectionService
@Autowired public LPVSGitHubConnectionService(@Value("${github.login}") String GITHUB_LOGIN, @Value("${github.token}") String GITHUB_AUTH_TOKEN, @Value("${github.api.url}") String GITHUB_API_URL, LPVSExitHandler exitHandler) Constructs an instance of LPVSGitHubConnectionService with the specified properties and exit handler.- Parameters:
GITHUB_LOGIN
- GitHub login username.GITHUB_AUTH_TOKEN
- GitHub authentication token.GITHUB_API_URL
- GitHub API URL for connecting to a GitHub Enterprise instance.exitHandler
- Handler for exiting the application.
-
-
Method Details
-
connectToGitHubApi
Connects to the GitHub API based on the configured login, authentication token, and API URL.- Returns:
- GitHub instance for interacting with the GitHub API.
- Throws:
IOException
- if an error occurs during the GitHub connection.
-
setGithubTokenFromEnv
public void setGithubTokenFromEnv()Sets the GitHub authentication token from the environment variable if available.
-