Search in sources :

Example 1 with SecretProvider

use of com.robertsanek.util.SecretProvider in project core by z1lc.

the class ParentModule method habitEtlWill.

@Provides
@Named("will")
HabitEtl habitEtlWill(Injector injector) {
    SecretProvider secretProvider = injector.getInstance(SecretProvider.class);
    HabitEtl habitEtl = new HabitEtl() {

        @Override
        public String getUsername() {
            return secretProvider.getSecret(SecretType.TOODLEDO_WILL_USERNAME);
        }

        @Override
        public String getPassword() {
            return secretProvider.getSecret(SecretType.TOODLEDO_WILL_PASSWORD);
        }
    };
    injector.injectMembers(habitEtl);
    return habitEtl;
}
Also used : HabitEtl(com.robertsanek.data.etl.remote.scrape.toodledo.HabitEtl) SecretProvider(com.robertsanek.util.SecretProvider) Named(com.google.inject.name.Named) Provides(com.google.inject.Provides)

Example 2 with SecretProvider

use of com.robertsanek.util.SecretProvider in project core by z1lc.

the class ParentModule method habitRepEtlWill.

@Provides
@Named("will")
HabitRepEtl habitRepEtlWill(Injector injector) {
    SecretProvider secretProvider = injector.getInstance(SecretProvider.class);
    HabitRepEtl habitRepEtl = new HabitRepEtl() {

        @Override
        public String getUsername() {
            return secretProvider.getSecret(SecretType.TOODLEDO_WILL_USERNAME);
        }

        @Override
        public String getPassword() {
            return secretProvider.getSecret(SecretType.TOODLEDO_WILL_PASSWORD);
        }
    };
    injector.injectMembers(habitRepEtl);
    return habitRepEtl;
}
Also used : HabitRepEtl(com.robertsanek.data.etl.remote.scrape.toodledo.HabitRepEtl) SecretProvider(com.robertsanek.util.SecretProvider) Named(com.google.inject.name.Named) Provides(com.google.inject.Provides)

Aggregations

Provides (com.google.inject.Provides)2 Named (com.google.inject.name.Named)2 SecretProvider (com.robertsanek.util.SecretProvider)2 HabitEtl (com.robertsanek.data.etl.remote.scrape.toodledo.HabitEtl)1 HabitRepEtl (com.robertsanek.data.etl.remote.scrape.toodledo.HabitRepEtl)1