Search in sources :

Example 6 with Subject

use of org.obiba.shiro.realm.ObibaRealm.Subject in project mica2 by obiba.

the class UserProfileService method getProfile.

public synchronized Subject getProfile(@NotNull String username, boolean cached) {
    if (!cached)
        return getProfile(username);
    ObibaRealm.Subject profile = subjectCache.getIfPresent(username);
    if (profile == null) {
        profile = getProfile(username);
        subjectCache.put(username, profile);
    }
    return profile;
}
Also used : ObibaRealm(org.obiba.shiro.realm.ObibaRealm) Subject(org.obiba.shiro.realm.ObibaRealm.Subject)

Aggregations

Subject (org.obiba.shiro.realm.ObibaRealm.Subject)6 NotNull (javax.validation.constraints.NotNull)2 ObibaRealm (org.obiba.shiro.realm.ObibaRealm)2 Strings (com.google.common.base.Strings)1 Cache (com.google.common.cache.Cache)1 CacheBuilder (com.google.common.cache.CacheBuilder)1 Lists (com.google.common.collect.Lists)1 Maps (com.google.common.collect.Maps)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 URLEncoder (java.net.URLEncoder)1 Arrays (java.util.Arrays)1 List (java.util.List)1 Map (java.util.Map)1 TimeUnit (java.util.concurrent.TimeUnit)1 Nullable (javax.annotation.Nullable)1 Inject (javax.inject.Inject)1 SecurityUtils (org.apache.shiro.SecurityUtils)1 DateTimeFormat (org.joda.time.format.DateTimeFormat)1 DateTimeFormatter (org.joda.time.format.DateTimeFormatter)1 AgateRestService (org.obiba.mica.core.service.AgateRestService)1