public IClarifySessionUsage GetUsage()
        {
            var validSessions = new List<ClarifySessionUser>();
            var inValidSessions = new List<ClarifySessionUser>();

            var sessionsByUserDictionary = _clarifySessionCache.SessionsByUsername;

            _logger.LogDebug("Building clarify session usage report from {0} items in the cache.".ToFormat(sessionsByUserDictionary.Count));

            foreach (var username in sessionsByUserDictionary.Keys)
            {
                var session = sessionsByUserDictionary[username];
                var sessionUser = new ClarifySessionUser { SessionId = session.Id, Username = session.UserName };
                if (IsSessionValid(session))
                    validSessions.Add(sessionUser);
                else
                {
                    inValidSessions.Add(sessionUser);
                }
            }

            _logger.LogDebug("Found {0} sessions and {1} invalid sessions (now ejected) in the cache.".ToFormat(validSessions.Count, inValidSessions.Count));

            return new ClarifySessionUsage(validSessions, inValidSessions);
        }
        public IClarifySessionUsage GetUsage()
        {
            var validSessions   = new List <ClarifySessionUser>();
            var inValidSessions = new List <ClarifySessionUser>();

            var sessionsByUserDictionary = _clarifySessionCache.SessionsByUsername;

            _logger.LogDebug("Building clarify session usage report from {0} items in the cache.".ToFormat(sessionsByUserDictionary.Count));

            foreach (var username in sessionsByUserDictionary.Keys)
            {
                var session     = sessionsByUserDictionary[username];
                var sessionUser = new ClarifySessionUser {
                    SessionId = session.Id, Username = session.UserName
                };
                if (_clarifyApplication.IsSessionValid(session.Id))
                {
                    validSessions.Add(sessionUser);
                }
                else
                {
                    inValidSessions.Add(sessionUser);
                }
            }

            _logger.LogDebug("Found {0} sessions and {1} invalid sessions (now ejected) in the cache.".ToFormat(validSessions.Count, inValidSessions.Count));

            return(new ClarifySessionUsage(validSessions, inValidSessions));
        }