org.opentripplanner.ext.datastore.gs.GsDataSourceModule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp Show documentation
Show all versions of otp Show documentation
The OpenTripPlanner multimodal journey planning system
package org.opentripplanner.ext.datastore.gs;
import dagger.Module;
import dagger.Provides;
import javax.annotation.Nullable;
import javax.inject.Singleton;
import org.opentripplanner.datastore.api.GoogleStorageDSRepository;
import org.opentripplanner.datastore.api.OtpDataStoreConfig;
import org.opentripplanner.datastore.base.DataSourceRepository;
import org.opentripplanner.util.OTPFeature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Module
public class GsDataSourceModule {
private static final Logger LOG = LoggerFactory.getLogger(GsDataSourceModule.class);
@Provides
@Singleton
@Nullable
@GoogleStorageDSRepository
DataSourceRepository provideGoogleStorageDataSourceRepository(OtpDataStoreConfig config) {
if (OTPFeature.GoogleCloudStorage.isOff()) {
return null;
}
LOG.info("Google Cloud Store Repository enabled - GS resources detected.");
return new GsDataSourceRepository(config.gsCredentials());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy