class RedisSessionRepository implements SessionRepository {

  @Override
  public void setSessionManager(final SessionManager sessionManager) {
    this.sessionManager = sessionManager;
    MetricRegistry metrics = sessionManager.getMetrics();
    if (metrics != null) {
      // Cleanup old metrics related to this namespace
      metrics.removeMatching(new MetricFilter() {
        @Override
        public boolean matches(String name, Metric metric) {
          return name.startsWith(name(RedisConfiguration.METRIC_PREFIX, "redis"));
        }
      });
      if (sticky) {
        failoverMetrics = metrics.meter(name(RedisConfiguration.METRIC_PREFIX, namespace, "redis", "failover"));
      }

      redis.startMonitoring(metrics);
    }
    expirationManager.startExpiredSessionsTask(sessionManager);
  }

  public  RedisSessionRepository(RedisFacade redis, String namespace, String owner, ExpirationStrategy strategy,
      boolean sticky);

}