@Provides @Singleton @Memoized public Supplier<User> getCurrentUser(AtomicReference<AuthorizationException> authException, @Named(PROPERTY_SESSION_INTERVAL) long seconds, final GetCurrentUser getCurrentUser) { return MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.create(authException, getCurrentUser, seconds, TimeUnit.SECONDS); }
@Provides @Singleton protected Supplier<Map<String, ? extends Org>> provideOrgMapCache(@Named(PROPERTY_SESSION_INTERVAL) long seconds, final OrgMapSupplier supplier) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<Map<String, ? extends Org>>( authException, seconds, new Supplier<Map<String, ? extends Org>>() { @Override public Map<String, ? extends Org> get() { return supplier.get(); } }); }
public static <T> MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T> create( AtomicReference<AuthorizationException> authException, Supplier<T> delegate, long duration, TimeUnit unit) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T>(authException, delegate, duration, unit); }
/** * Creates a memoized supplier that calls the given callback each time values are loaded. */ public static <T> MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T> create( AtomicReference<AuthorizationException> authException, Supplier<T> delegate, long duration, TimeUnit unit, ValueLoadedCallback<T> valueLoadedCallback) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T>(authException, delegate, duration, unit, valueLoadedCallback); }
@Provides @Singleton @Memoized public Supplier<Map<String, Network>> listNetworks(AtomicReference<AuthorizationException> authException, @Named(PROPERTY_SESSION_INTERVAL) long seconds, final NetworksForCurrentUser networksForCurrentUser) { return MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.create(authException, networksForCurrentUser, seconds, TimeUnit.SECONDS); }
@Provides @Singleton protected Supplier<Map<URI, ? extends org.jclouds.vcloud.domain.VDC>> provideURIToVDC( @Named(PROPERTY_SESSION_INTERVAL) long seconds, final URItoVDC supplier) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<Map<URI, ? extends org.jclouds.vcloud.domain.VDC>>( authException, seconds, new Supplier<Map<URI, ? extends org.jclouds.vcloud.domain.VDC>>() { @Override public Map<URI, ? extends org.jclouds.vcloud.domain.VDC> get() { return supplier.get(); } }); }
public static <T> MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T> create( AtomicReference<AuthorizationException> authException, Supplier<T> delegate, long duration, TimeUnit unit) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T>(authException, delegate, duration, unit); }
@Provides @Singleton // TODO: we should eventually get rid of memoized as an annotation, as it is confusing @Memoized protected Supplier<Set<? extends Location>> memoizedLocationsSupplier( AtomicReference<AuthorizationException> authException, @Named(PROPERTY_SESSION_INTERVAL) long seconds, LocationsSupplier uncached) { return MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.create(authException, uncached, seconds, TimeUnit.SECONDS); }
@Provides @Singleton protected Supplier<Map<String, Map<String, ? extends org.jclouds.vcloud.domain.Catalog>>> provideOrgCatalogItemMapSupplierCache( @Named(PROPERTY_SESSION_INTERVAL) long seconds, final OrgCatalogSupplier supplier) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<Map<String, Map<String, ? extends org.jclouds.vcloud.domain.Catalog>>>( authException, seconds, new Supplier<Map<String, Map<String, ? extends org.jclouds.vcloud.domain.Catalog>>>() { @Override public Map<String, Map<String, ? extends org.jclouds.vcloud.domain.Catalog>> get() { return supplier.get(); } }); }
public static <T> MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T> create( AtomicReference<AuthorizationException> authException, Supplier<T> delegate, long duration, TimeUnit unit) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T>(authException, delegate, duration, unit); }
@Provides @Singleton @Memoized protected final Supplier<Set<? extends Hardware>> supplySizeCache(AtomicReference<AuthorizationException> authException, @Named(PROPERTY_SESSION_INTERVAL) long seconds, final Supplier<Set<? extends Hardware>> hardwareSupplier) { return MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.create(authException, hardwareSupplier, seconds, TimeUnit.SECONDS); }
@Provides @Singleton protected Supplier<Map<String, Map<String, ? extends org.jclouds.vcloud.domain.VDC>>> provideOrgVDCSupplierCache( @Named(PROPERTY_SESSION_INTERVAL) long seconds, final OrgVDCSupplier supplier) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<Map<String, Map<String, ? extends org.jclouds.vcloud.domain.VDC>>>( authException, seconds, new Supplier<Map<String, Map<String, ? extends org.jclouds.vcloud.domain.VDC>>>() { @Override public Map<String, Map<String, ? extends org.jclouds.vcloud.domain.VDC>> get() { return supplier.get(); } }); }
/** * Creates a memoized supplier that calls the given callback each time values are loaded. */ public static <T> MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T> create( AtomicReference<AuthorizationException> authException, Supplier<T> delegate, long duration, TimeUnit unit, ValueLoadedCallback<T> valueLoadedCallback) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T>(authException, delegate, duration, unit, valueLoadedCallback); }
@Provides @Singleton @Memoized protected Supplier<Set<? extends Hardware>> supplySizeCache(AtomicReference<AuthorizationException> authException, @Named(PROPERTY_SESSION_INTERVAL) long seconds, final Supplier<Set<? extends Hardware>> hardwareSupplier) { return MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.create(authException, hardwareSupplier, seconds, TimeUnit.SECONDS); }
@Provides @Singleton protected Supplier<Map<String, Map<String, Map<String, ? extends org.jclouds.vcloud.domain.CatalogItem>>>> provideOrgCatalogItemSupplierCache( @Named(PROPERTY_SESSION_INTERVAL) long seconds, final OrgCatalogItemSupplier supplier) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<Map<String, Map<String, Map<String, ? extends org.jclouds.vcloud.domain.CatalogItem>>>>( authException, seconds, new Supplier<Map<String, Map<String, Map<String, ? extends org.jclouds.vcloud.domain.CatalogItem>>>>() { @Override public Map<String, Map<String, Map<String, ? extends org.jclouds.vcloud.domain.CatalogItem>>> get() { return supplier.get(); } }); }
/** * Creates a memoized supplier that calls the given callback each time values are loaded. */ public static <T> MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T> create( AtomicReference<AuthorizationException> authException, Supplier<T> delegate, long duration, TimeUnit unit, ValueLoadedCallback<T> valueLoadedCallback) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T>(authException, delegate, duration, unit, valueLoadedCallback); }
@Provides @Singleton protected Supplier<Map<URI, VDC>> provideURIToVDC( @Named(PROPERTY_SESSION_INTERVAL) long seconds, AtomicReference<AuthorizationException> authException, URItoVDC supplier) { return MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.create(authException, supplier, seconds, TimeUnit.SECONDS); }
@Provides @org.jclouds.vcloud.endpoints.Org @Singleton protected Supplier<Map<String, ReferenceType>> provideVDCtoORG(@Named(PROPERTY_SESSION_INTERVAL) long seconds, final OrgNameToOrgSupplier supplier) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<Map<String, ReferenceType>>( authException, seconds, new Supplier<Map<String, ReferenceType>>() { @Override public Map<String, ReferenceType> get() { return supplier.get(); } }); }
public static <T> MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T> create( AtomicReference<AuthorizationException> authException, Supplier<T> delegate, long duration, TimeUnit unit) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T>(authException, delegate, duration, unit, new ValueLoadedCallback.NoOpCallback<T>()); }
@Provides @Singleton @Memoized public Supplier<Map<String, Network>> listNetworks(AtomicReference<AuthorizationException> authException, @Named(PROPERTY_SESSION_INTERVAL) long seconds, final NetworksForCurrentUser networksForCurrentUser) { return MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.create(authException, networksForCurrentUser, seconds, TimeUnit.SECONDS); }