class CTSOperations implements SessionOperations {

    public SessionInfo refresh(Session session, boolean reset) throws SessionException {
        if (reset) {
            // all write operations should be delegated to the home server
            return remote.refresh(session, reset);
        } else {
            // handle read operations via CTS if possible
            SessionID sessionID = session.getID();
            try {
                InternalSession internalSession = readToken(sessionID);
                return sessionInfoFactory.getSessionInfo(internalSession, sessionID);
            } catch (ReadFailedSessionException e) {
                return remote.refresh(session, reset);
            }
        }
    }

    @Inject public  CTSOperations(CTSPersistentStore cts, SessionAdapter adapter,
                         TokenIdFactory idFactory, SessionInfoFactory sessionInfoFactory,
                         SessionService sessionService, RemoteOperations remote,
                         @Named(SessionConstants.SESSION_DEBUG) Debug debug);

}