sbean.setCreationTime(new Date(session.getCreationTime())); sbean.setLastAccessTime(new Date(session.getLastAccessedTime())); sbean.setMaxIdleTime(session.getMaxInactiveInterval() * 1000); sbean.setManagerType(session.getManager().getClass().getName());
/** * Sessions with a negative max inactive time never expire */ private static boolean canSessionExpire(Session session) { return session.getMaxInactiveInterval() > 0; }
@Override public Comparable<Integer> getComparableObject(Session session) { return Integer.valueOf(session.getMaxInactiveInterval()); } };
@Override public Comparable<Date> getComparableObject(Session session) { return new Date(session.getMaxInactiveInterval()); } };
@Override public Comparable<Date> getComparableObject(Session session) { return new Date(session.getMaxInactiveInterval()); } };
@Override public Comparable<Date> getComparableObject(Session session) { return new Date(session.getMaxInactiveInterval()); } };
@Override public Comparable<Integer> getComparableObject(Session session) { return Integer.valueOf(session.getMaxInactiveInterval()); } };
@Override public Comparable<Integer> getComparableObject(Session session) { return Integer.valueOf(session.getMaxInactiveInterval()); } };
@Override public Comparable<Date> getComparableObject(Session session) { return new Date(session.getMaxInactiveInterval()); } };
/** * Any sessions whose access time is older than the cutoff time are considered inactive, those * with access time after the cutoff time are still active */ private static long getInactiveCutoffTime(Session session) { return System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(session.getMaxInactiveInterval(), TimeUnit.SECONDS); }
private boolean isSessionTimedOut(Session session) { return (session.getMaxInactiveInterval() > 0) && (System.currentTimeMillis() - session.getLastAccessedTime() >= session.getMaxInactiveInterval() * 1000); }
public static long getTTLForSession(Session in_session) { try { long diffMilliSeconds = (1000*in_session.getMaxInactiveInterval()) - (System.currentTimeMillis() - in_session.getThisAccessedTime()); return diffMilliSeconds; } catch (IllegalStateException ise) { //ignore: invalidated session return -1; } }
public static long getTTLForSession(Session in_session) { try { long diffMilliSeconds = (1000*in_session.getMaxInactiveInterval()) - (System.currentTimeMillis() - in_session.getThisAccessedTime()); return diffMilliSeconds; } catch (IllegalStateException ise) { //ignore: invalidated session return -1; } }
public static long getTTLForSession(Session in_session) { try { long diffMilliSeconds = (1000*in_session.getMaxInactiveInterval()) - (System.currentTimeMillis() - in_session.getThisAccessedTime()); return diffMilliSeconds; } catch (IllegalStateException ise) { //ignore: invalidated session return -1; } }
public static long getTTLForSession(Session in_session) { try { long diffMilliSeconds = (1000*in_session.getMaxInactiveInterval()) - (System.currentTimeMillis() - in_session.getThisAccessedTime()); return diffMilliSeconds; } catch (IllegalStateException ise) { //ignore: invalidated session return -1; } }
public static long getTTLForSession(Session in_session) { try { long diffMilliSeconds = (1000*in_session.getMaxInactiveInterval()) - (System.currentTimeMillis() - in_session.getThisAccessedTime()); return diffMilliSeconds; } catch (IllegalStateException ise) { //ignore: invalidated session return -1; } }
public static long getTTLForSession(Session in_session) { try { long diffMilliSeconds = (1000*in_session.getMaxInactiveInterval()) - (System.currentTimeMillis() - in_session.getThisAccessedTime()); return diffMilliSeconds; } catch (IllegalStateException ise) { //ignore: invalidated session return -1; } }
public static long getTTLForSession(Session in_session) { try { long diffMilliSeconds = (1000*in_session.getMaxInactiveInterval()) - (System.currentTimeMillis() - in_session.getThisAccessedTime()); return diffMilliSeconds; } catch (IllegalStateException ise) { //ignore: invalidated session return -1; } }
public static long getTTLForSession(Session in_session) { try { long diffMilliSeconds = (1000*in_session.getMaxInactiveInterval()) - (System.currentTimeMillis() - in_session.getThisAccessedTime()); return diffMilliSeconds; } catch (IllegalStateException ise) { //ignore: invalidated session return -1; } }
@Test public void saveJedisConnectionException() throws UnsupportedEncodingException { Session session = new StandardSession(this.manager); session.setId("test-id"); doThrow(new JedisConnectionException("test-message")) .when(this.jedisClient) .set(anyString(), anyString(), any((byte[].class)), eq(session.getMaxInactiveInterval())); this.store.save(session); }