class RemoteOperations implements SessionOperations {

    public SessionInfo refresh(Session session, boolean reset) throws SessionException {
        SessionID sessionID = session.getID();
        if (debug.messageEnabled()) {
            debug.message(MessageFormat.format(
                    "Remote fetch SessionInfo for {0}\n" +
                    "Reset: {1}",
                    sessionID,
                    reset));
        }

        SessionRequest sreq = new SessionRequest(SessionRequest.GetSession, sessionID.toString(), reset);
        SessionResponse sres = requests.sendRequestWithRetry(session.getSessionServiceURL(), sreq, session);

        if (sres.getException() != null) {
            throw new SessionException(SessionBundle.rbName,
                    INVALID_SESSION_STATE, null);
        }

        List<SessionInfo> infos = sres.getSessionInfo();
        if (infos.size() != 1) {
            throw new SessionException(SessionBundle.rbName,
                    UNEXPECTED_SESSION, null);
        }
        return infos.get(0);
    }

    @Inject public  RemoteOperations(@Named(SessionConstants.SESSION_DEBUG) Debug debug, Requests requests);

}