/** * @see org.eclipse.jetty.server.session.SessionDataMap#load(java.lang.String) */ @Override public SessionData load(String id) throws Exception { SessionData sd = _map.get(id); if (sd == null) return null; SessionData nsd = new SessionData(id,"","",System.currentTimeMillis(),System.currentTimeMillis(), System.currentTimeMillis(),0 ); nsd.copy(sd); return nsd; }
/** * @see org.eclipse.jetty.server.session.AbstractSessionDataStore#newSessionData(java.lang.String, long, long, long, long) */ @Override public SessionData newSessionData(String id, long created, long accessed, long lastAccessed, long maxInactiveMs) { return new SessionData(id, _context.getCanonicalContextPath(), _context.getVhost(), created, accessed, lastAccessed, maxInactiveMs); }
/** * @see org.eclipse.jetty.server.session.SessionDataStore#newSessionData(java.lang.String, long, long, long, long) */ @Override public SessionData newSessionData(String id, long created, long accessed, long lastAccessed, long maxInactiveMs) { return new SessionData(id, _context.getCanonicalContextPath(), _context.getVhost(), created, accessed, lastAccessed, maxInactiveMs); }
@Override public SessionData read(ObjectDataInput in) throws IOException { String id = in.readUTF(); String contextPath = in.readUTF(); String vhost = in.readUTF(); long accessed = in.readLong(); long lastAccessed = in.readLong(); long created = in.readLong(); long cookieSet = in.readLong(); String lastNode = in.readUTF(); long expiry = in.readLong(); long maxInactiveMs = in.readLong(); SessionData sd = new SessionData(id, contextPath, vhost, created, accessed, lastAccessed, maxInactiveMs); ByteArrayInputStream bais = new ByteArrayInputStream(in.readByteArray()); try (ClassLoadingObjectInputStream ois = new ClassLoadingObjectInputStream(bais)) { SessionData.deserializeAttributes(sd, ois); } catch(ClassNotFoundException e) { throw new IOException(e); } sd.setCookieSet(cookieSet); sd.setLastNode(lastNode); sd.setExpiry(expiry); return sd; }
PlaceHolderSession phs = new PlaceHolderSession (_handler, new SessionData(id, null, null,0,0,0,0)); Lock phsLock = phs.lock(); Session s = doPutIfAbsent(id, phs);