Cyberduck Mountain Duck CLI

Changeset 43673


Ignore:
Timestamp:
Jan 10, 2018 12:37:04 PM (5 months ago)
Author:
dkocher
Message:

Preload CDN configurations. Fix #10184.

Location:
shelves/10.01.2018
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • shelves/10.01.2018

    • Property subgit:lock changed from commit:9f1d1633fbfc17bf052570f283e706ae6f46c52e timestamp:2018-01-10T12:49:03.660 to commit:0e977af219c3978772bc1433347caee37b9a4619 timestamp:2018-01-10T12:49:05.325
  • shelves/10.01.2018/s3/src/main/java/ch/cyberduck/core/s3/S3Session.java

    r43627 r43673  
    2828import ch.cyberduck.core.ListService;
    2929import ch.cyberduck.core.LoginCallback;
     30import ch.cyberduck.core.PasswordCallback;
    3031import ch.cyberduck.core.Path;
    3132import ch.cyberduck.core.PathAttributes;
     
    3637import ch.cyberduck.core.analytics.QloudstatAnalyticsProvider;
    3738import ch.cyberduck.core.auth.AWSSessionCredentialsRetriever;
     39import ch.cyberduck.core.cdn.Distribution;
    3840import ch.cyberduck.core.cdn.DistributionConfiguration;
     41import ch.cyberduck.core.cloudfront.CloudFrontDistributionConfigurationPreloader;
    3942import ch.cyberduck.core.cloudfront.WebsiteCloudFrontDistributionConfiguration;
    4043import ch.cyberduck.core.exception.AccessDeniedException;
     
    5558import ch.cyberduck.core.preferences.PreferencesFactory;
    5659import ch.cyberduck.core.proxy.ProxyFinder;
     60import ch.cyberduck.core.shared.DelegatingSchedulerFeature;
    5761import ch.cyberduck.core.shared.DisabledBulkFeature;
    5862import ch.cyberduck.core.ssl.DefaultX509KeyManager;
     
    7377import org.jets3t.service.security.ProviderCredentials;
    7478
     79import java.util.Collections;
    7580import java.util.EnumSet;
     81import java.util.Map;
    7682
    7783public class S3Session extends HttpSession<RequestEntityRestStorageService> {
     
    8187        = PreferencesFactory.get();
    8288
    83     private DistributionConfiguration cdn
    84         = new WebsiteCloudFrontDistributionConfiguration(this, trust, key);
    85 
    8689    private Versioning versioning
    8790        = new S3VersioningFeature(this, new S3AccessControlListFeature(this));
     91
     92    private Map<Path, Distribution> distributions = Collections.emptyMap();
    8893
    8994    private S3Protocol.AuthenticationHeaderSignatureVersion authenticationHeaderSignatureVersion
     
    354359        }
    355360        if(type == DistributionConfiguration.class) {
    356             return (T) cdn;
     361            return (T) new WebsiteCloudFrontDistributionConfiguration(this, distributions, trust, key);
    357362        }
    358363        if(type == UrlProvider.class) {
     
    388393            return (T) new S3VersionIdProvider(this);
    389394        }
     395        if(type == Scheduler.class) {
     396            return (T) new DelegatingSchedulerFeature(
     397                new CloudFrontDistributionConfigurationPreloader(this) {
     398                    @Override
     399                    public Map<Path, Distribution> operate(final PasswordCallback callback, final Path container) throws BackgroundException {
     400                        return distributions = super.operate(callback, container);
     401                    }
     402                }
     403            );
     404        }
    390405        return super._getFeature(type);
    391406    }
Note: See TracChangeset for help on using the changeset viewer.
swiss made software