Class GithubConsumerServiceImpl
java.lang.Object
io.meeds.gamification.github.services.impl.GithubConsumerServiceImpl
- All Implemented Interfaces:
GithubConsumerService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckGitHubTokenStatus(String token) Check gitHub personal access tokenvoidclear remote webhook entities cachecreateWebhook(String organizationName, String[] triggers, String accessToken) create github organization hook.deleteWebhook(WebHook webHook) delete gitHub webhookforceUpdateWebhook(WebHook webHook) Force Update WebhookretrieveOrganizationRepos(WebHook webHook, int page, int perPage, String keyword) Retrieve available github organization repositories.retrieveRemoteOrganization(long organizationId, String accessToken) Retrieve available github organization info.retrieveRemoteOrganization(String organizationName, String accessToken) Retrieve available github organization info.
-
Constructor Details
-
GithubConsumerServiceImpl
-
-
Method Details
-
createWebhook
public WebHook createWebhook(String organizationName, String[] triggers, String accessToken) throws IllegalAccessException Description copied from interface:GithubConsumerServicecreate github organization hook.- Specified by:
createWebhookin interfaceGithubConsumerService- Parameters:
organizationName- github organization nameaccessToken- gitHub personal access token- Throws:
IllegalAccessException- when user is not authorized to create github webhook
-
deleteWebhook
Description copied from interface:GithubConsumerServicedelete gitHub webhook- Specified by:
deleteWebhookin interfaceGithubConsumerService- Parameters:
webHook- github webHook
-
forceUpdateWebhook
Description copied from interface:GithubConsumerServiceForce Update Webhook- Specified by:
forceUpdateWebhookin interfaceGithubConsumerService- Parameters:
webHook- webHook- Returns:
- response status
-
retrieveRemoteOrganization
public RemoteOrganization retrieveRemoteOrganization(String organizationName, String accessToken) throws org.exoplatform.commons.exception.ObjectNotFoundException Description copied from interface:GithubConsumerServiceRetrieve available github organization info.- Specified by:
retrieveRemoteOrganizationin interfaceGithubConsumerService- Parameters:
organizationName- gitHub organization nameaccessToken- gitHub personal access token- Returns:
RemoteOrganization- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the github organization identified by its technical name is not found
-
retrieveOrganizationRepos
public List<RemoteRepository> retrieveOrganizationRepos(WebHook webHook, int page, int perPage, String keyword) Description copied from interface:GithubConsumerServiceRetrieve available github organization repositories.- Specified by:
retrieveOrganizationReposin interfaceGithubConsumerService- Parameters:
webHook- webHookpage- pageperPage- perPagekeyword- to search in repositories title- Returns:
ListofRemoteRepository
-
retrieveRemoteOrganization
Description copied from interface:GithubConsumerServiceRetrieve available github organization info.- Specified by:
retrieveRemoteOrganizationin interfaceGithubConsumerService- Parameters:
organizationId- gitHub organization remote IdaccessToken- gitHub personal access token- Returns:
RemoteOrganization
-
checkGitHubTokenStatus
Description copied from interface:GithubConsumerServiceCheck gitHub personal access token- Specified by:
checkGitHubTokenStatusin interfaceGithubConsumerService- Parameters:
token- gitHub personal access token- Returns:
TokenStatus
-
clearCache
public void clearCache()Description copied from interface:GithubConsumerServiceclear remote webhook entities cache- Specified by:
clearCachein interfaceGithubConsumerService
-