/** * Get new session class to be used in the doLoad() method. */ protected StandardSession getNewSession() { return new StandardSession(this); }
/** * Get new session class to be used in the doLoad() method. * @return a new session for use with this manager */ protected StandardSession getNewSession() { return new StandardSession(this); }
/** * Get new session class to be used in the doLoad() method. */ protected StandardSession getNewSession() { return new StandardSession(this); }
/** * Get new session class to be used in the doLoad() method. */ protected StandardSession getNewSession() { return new StandardSession(this); }
/** * Get new session class to be used in the doLoad() method. */ protected StandardSession getNewSession() { return new StandardSession(this); }
/** * Get new session class to be used in the doLoad() method. */ protected StandardSession getNewSession() { return new StandardSession(this); }
/** * Get new session class to be used in the doLoad() method. */ protected StandardSession getNewSession() { return new StandardSession(this); }
/** * Get new session class to be used in the doLoad() method. */ protected StandardSession getNewSession() { return new StandardSession(this); }
/** * Get new session class to be used in the doLoad() method. */ protected StandardSession getNewSession() { return new StandardSession(this); }
/** * Get new session class to be used in the doLoad() method. * @return a new session for use with this manager */ protected StandardSession getNewSession() { return new StandardSession(this); }
/** * Get new session class to be used in the doLoad() method. */ protected StandardSession getNewSession() { return new StandardSession(this); }
/** * Get new session class to be used in the doLoad() method. */ protected StandardSession getNewSession() { return new StandardSession(this); }
@Override public Session toSession(DynamoSessionItem sessionItem) { ObjectInputStream ois = null; try { ByteArrayInputStream fis = new ByteArrayInputStream(sessionItem.getSessionData().array()); ois = new CustomObjectInputStream(fis, classLoader); StandardSession session = new StandardSession(manager); session.readObjectData(ois); return session; } catch (Exception e) { throw new SessionConversionException("Unable to convert Dynamo storage representation to a Tomcat Session", e); } finally { IOUtils.closeQuietly(ois, null); } }
@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); }
@Test public void load() throws IOException { Session session = new StandardSession(this.manager); session.setId("test-id"); byte[] response = this.sessionSerializationUtils.serialize(session); when(this.jedisClient.get("test-id")).thenReturn(response); Session result = this.store.load("test-id"); assertEquals(session.getId(), result.getId()); }
@Test public void save() throws IOException { Session session = new StandardSession(this.manager); session.setId("test-id"); this.store.save(session); verify(this.jedisClient).set(getRedisSessionId(session), SESSIONS_KEY, this.sessionSerializationUtils.serialize(session), session.getMaxInactiveInterval()); }