public class OAuth2AppInstallationServiceImpl extends AbstractAppInstallationService implements OAuth2AppInstallationService
Modifier and Type | Field and Description |
---|---|
private OAuth2Service |
oauth2Service |
appInstallationRepositoryProvider, officialAppRepositoryProvider
Constructor and Description |
---|
OAuth2AppInstallationServiceImpl(javax.inject.Provider<AppInstallationRepository> appInstallationRepositoryProvider,
javax.inject.Provider<OfficialAppRepository> officialAppRepositoryProvider,
OAuth2Service oauth2Service) |
Modifier and Type | Method and Description |
---|---|
private AppInstallationOAuth2Entity |
doPrepareExistingInstallation(AppInstallationOAuth2Entity appInstallation,
java.util.Set<java.lang.String> scopes,
OfficialApp officialApp) |
private AppInstallationOAuth2Entity |
doPrepareInitialInstallation(GUID shopGUID,
OfficialApp officialApp,
java.util.Set<java.lang.String> scopes) |
protected AppInstallationEntity |
doUninstall(AppInstallationEntity appInstallation) |
AppInstallationToken |
finalizeInstallation(GUID shopGUID,
OfficialApp officialApp,
OAuth2Credentials credentials) |
java.util.List<OfficialApp> |
getInstalledAppsByScope(GUID shopGUID,
java.lang.String scope) |
AppInstallationOAuth2Entity |
prepareInstallation(GUID shopGUID,
OfficialApp officialApp,
java.util.Set<java.lang.String> scopes)
For OAuth2 apps the installation procedure follows the OAuth2 flow:
|
void |
purge(GUID developerId,
OfficialApp officialApp) |
void |
terminateAllInstallationsOf(OfficialApp officialApp) |
findPreviousAppInstallation, getAppInstallation, getAppInstallationActions, getAppsByInstallationState, save, uninstall, validateAppInstallationState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAppInstallation, getAppInstallationActions, getAppsByInstallationState, uninstall
private final OAuth2Service oauth2Service
@Inject public OAuth2AppInstallationServiceImpl(javax.inject.Provider<AppInstallationRepository> appInstallationRepositoryProvider, javax.inject.Provider<OfficialAppRepository> officialAppRepositoryProvider, OAuth2Service oauth2Service)
public AppInstallationOAuth2Entity prepareInstallation(@NotNull GUID shopGUID, @NotNull OfficialApp officialApp, @NotNull java.util.Set<java.lang.String> scopes)
It creates an AppInstallationEntity for an OfficialApp in a shop in a AppInstallationState.PENDING state. If the AppInstallationEntity exists already it will throw AppInstallationException, unless its status is pending. In this case the authorization code timestamp is updated instead.
Part of OAuth2 authorization flow.
prepareInstallation
in interface OAuth2AppInstallationService
AppInstallationException
- If the the official app type is not installable. If there is
already an installed apppublic AppInstallationToken finalizeInstallation(@NotNull GUID shopGUID, @NotNull OfficialApp officialApp, @NotNull OAuth2Credentials credentials)
finalizeInstallation
in interface OAuth2AppInstallationService
protected AppInstallationEntity doUninstall(AppInstallationEntity appInstallation)
doUninstall
in class AbstractAppInstallationService
private AppInstallationOAuth2Entity doPrepareInitialInstallation(GUID shopGUID, OfficialApp officialApp, java.util.Set<java.lang.String> scopes)
private AppInstallationOAuth2Entity doPrepareExistingInstallation(AppInstallationOAuth2Entity appInstallation, java.util.Set<java.lang.String> scopes, OfficialApp officialApp)
public void terminateAllInstallationsOf(OfficialApp officialApp)
terminateAllInstallationsOf
in interface AppInstallationService
terminateAllInstallationsOf
in interface OAuth2AppInstallationService
public java.util.List<OfficialApp> getInstalledAppsByScope(GUID shopGUID, java.lang.String scope)
getInstalledAppsByScope
in interface OAuth2AppInstallationService
public void purge(GUID developerId, OfficialApp officialApp)
purge
in interface OAuth2AppInstallationService