Toggle navigation
Home
com.google.common.cache.Cache to com.google.common.cache.LoadingCache
No. of Instances - 2
No. of Commits - 2
No. of Projects - {'dropwizard'}
Hierarchy/Composition: T_SUPER_R
Primitive Info: -
NameSpace: External -> External
Mapping:
Add or Remove Method invocation
CacheBuilder.<String,SingularityUserPermissionsResponse>newBuilder().expireAfterWrite(webhookAuthConfiguration.getCacheValidationMs(),TimeUnit.MILLISECONDS).build()
to
CacheBuilder.<String,SingularityUserPermissionsResponse>newBuilder().refreshAfterWrite(webhookAuthConfiguration.getCacheValidationMs(),TimeUnit.MILLISECONDS).build(new CacheLoader<String,SingularityUserPermissionsResponse>(){ @Override public SingularityUserPermissionsResponse load( String authHeaderVaule) throws Exception { return verifyUncached(authHeaderVaule); } @Override public ListenableFuture<SingularityUserPermissionsResponse> reload( String authHeaderVaule, SingularityUserPermissionsResponse oldVaule){ return ListenableFutureTask.create(() -> { try { return verifyUncached(authHeaderVaule); } catch ( Throwable t) { return oldVaule; } } ); } } )
builder.recordStats().build()
to
builder.recordStats().build(new CacheLoader<C,Optional<P>>(){ @Override public Optional<P> load( C key) throws Exception { cacheMisses.mark(); final Optional<P> optPrincipal=authenticator.authenticate(key); if (!optPrincipal.isPresent()) { throw new InvalidCredentialsException(); } return optPrincipal; } } )
builder.recordStats().build()
to
builder.recordStats().build(new CacheLoader<ImmutablePair<P,String>,Boolean>(){ @Override public Boolean load( ImmutablePair<P,String> key) throws Exception { cacheMisses.mark(); return underlying.authorize(key.left,key.right); } } )
Rename Method invocation
getIfPresent
to
get
cleanUp
to
invalidateAll
getIfPresent
to
get
getIfPresent
to
getUnchecked
Update argument list (Method invocation)
get
to
get