public void init (final RestService service, final Long sessionId, final String username, final String password) throws ServiceException { this.service = service; this.sessionId = sessionId; touch(); authentify(username, password); }
public void init (final RestService service, final Long sessionId, final String username, final String password) throws ServiceException { super.init(service, sessionId, username, password); this.sessionServerKey = ""+this.hashCode()+SESSION_SERVER_SUFFIX; }
final String[] headers) touch(); if (evalRequest(action, key, headers)) return;
public static String printSessions (final java.util.Map sessions) { StringBuffer sb = new StringBuffer(); sb.append("\n[\n "); java.util.Iterator it = sessions.keySet().iterator(); while (it.hasNext()) { Long sessionId = (Long)it.next(); RestSession session = (RestSession)sessions.get(sessionId); sb.append(" "); sb.append(sessionId); sb.append(" : "); sb.append(new java.util.Date(session.getLastUsed())); if (it.hasNext()) { sb.append(",\n"); } } sb.append("\n]\n"); return sb.toString(); }
session.handle(key, headers);
(RestSession)this.sessions.get(sessionId); final long delta = now - session.getLastUsed();
protected RestSession newRestSession (final Long sessionId, final String username, final String password) throws Exception { final Class clazz = Class.forName(this.restSessionClassName); final RestSession session = (RestSession)clazz.newInstance(); session.init (this, sessionId, username, password); log.debug("newRestSession() ok."); return session; }