Search in sources :

Example 1 with ICredentialsProvider

use of org.eclipse.userstorage.spi.ICredentialsProvider in project epp.mpc by eclipse.

the class MarketplaceStorageService method getStorageCredentials.

private Credentials getStorageCredentials() {
    ICredentialsProvider provider = getStorage().getCredentialsProvider();
    if (provider == null) {
        return null;
    }
    IStorageService service = getStorage().getService();
    return provider.hasCredentials(service) ? provider.getCredentials(service) : null;
}
Also used : IStorageService(org.eclipse.userstorage.IStorageService) ICredentialsProvider(org.eclipse.userstorage.spi.ICredentialsProvider)

Example 2 with ICredentialsProvider

use of org.eclipse.userstorage.spi.ICredentialsProvider in project epp.mpc by eclipse.

the class MarketplaceDiscoveryStrategy method applyShellProvider.

protected void applyShellProvider() {
    IUserFavoritesService userFavoritesService = marketplaceService.getUserFavoritesService();
    if (userFavoritesService == null) {
        return;
    }
    IMarketplaceStorageService storageService = userFavoritesService.getStorageService();
    if (storageService == null) {
        return;
    }
    IStorage storage = storageService.getStorage();
    ICredentialsProvider credentialsProvider = storage.getCredentialsProvider();
    if (credentialsProvider instanceof EclipseOAuthCredentialsProvider) {
        ((EclipseOAuthCredentialsProvider) credentialsProvider).setShell(shellProvider);
    }
}
Also used : ICredentialsProvider(org.eclipse.userstorage.spi.ICredentialsProvider) IUserFavoritesService(org.eclipse.epp.mpc.core.service.IUserFavoritesService) IStorage(org.eclipse.userstorage.IStorage) EclipseOAuthCredentialsProvider(org.eclipse.userstorage.oauth.EclipseOAuthCredentialsProvider) IMarketplaceStorageService(org.eclipse.epp.mpc.core.service.IMarketplaceStorageService)

Aggregations

ICredentialsProvider (org.eclipse.userstorage.spi.ICredentialsProvider)2 IMarketplaceStorageService (org.eclipse.epp.mpc.core.service.IMarketplaceStorageService)1 IUserFavoritesService (org.eclipse.epp.mpc.core.service.IUserFavoritesService)1 IStorage (org.eclipse.userstorage.IStorage)1 IStorageService (org.eclipse.userstorage.IStorageService)1 EclipseOAuthCredentialsProvider (org.eclipse.userstorage.oauth.EclipseOAuthCredentialsProvider)1