Search in sources :

Example 6 with UserPreferenceRtdb

use of com.pratilipi.data.type.UserPreferenceRtdb in project pratilipi by Pratilipi.

the class RtdbAccessorWithMemcache method getUserPreference.

// PREFERENCE Table
@Override
public UserPreferenceRtdb getUserPreference(Long userId) throws UnexpectedServerException {
    if (userId == null)
        return null;
    UserPreferenceRtdb userPref = memcache.get(_getUserPreferenceMemcacheId(userId));
    if (userPref == null) {
        userPref = rtdbAccessor.getUserPreference(userId);
        memcache.put(_getUserPreferenceMemcacheId(userId), userPref, expirationDeltaMinutes);
    }
    return userPref;
}
Also used : UserPreferenceRtdb(com.pratilipi.data.type.UserPreferenceRtdb)

Aggregations

UserPreferenceRtdb (com.pratilipi.data.type.UserPreferenceRtdb)6 ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)3 HashSet (java.util.HashSet)3 UnexpectedServerException (com.pratilipi.common.exception.UnexpectedServerException)2 DataAccessor (com.pratilipi.data.DataAccessor)2 BlobEntry (com.pratilipi.data.type.BlobEntry)2 Email (com.pratilipi.data.type.Email)2 User (com.pratilipi.data.type.User)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 Gson (com.google.gson.Gson)1 JsonElement (com.google.gson.JsonElement)1 JsonObject (com.google.gson.JsonObject)1 Get (com.pratilipi.api.annotation.Get)1 GenericResponse (com.pratilipi.api.shared.GenericResponse)1 RtdbAccessor (com.pratilipi.data.RtdbAccessor)1 Task (com.pratilipi.taskqueue.Task)1 DateFormat (java.text.DateFormat)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1