All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.yamcs.security.UserCache Maven / Gradle / Ivy

There is a newer version: 5.10.9
Show newest version
package org.yamcs.security;

import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;

public class UserCache {

    private Cache cache = CacheBuilder.newBuilder()
            .build();

    public User getUserFromCache(String username) {
        return cache.getIfPresent(username);
    }

    public void putUserInCache(User user) {
        cache.put(user.getName(), user);
    }

    public void removeUserFromCache(String username) {
        cache.invalidate(username);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy