class RedisSessionRepository implements SessionRepository {

  static String extractSessionId(String body) {
    int beginIndex = body.lastIndexOf(':') + 1;
    String sessionId = body.substring(beginIndex);

    int braceOpening = sessionId.indexOf('{');
    if (braceOpening >= 0) {
      int braceClosing = sessionId.indexOf('}', braceOpening + 1);
      if (braceClosing > braceOpening) {
        int idLen = sessionId.length();
        StringBuilder sb = new StringBuilder(idLen - 2); // NOSONAR
        if (braceOpening > 0) {
          sb.append(sessionId, 0, braceOpening);
        }
        sb.append(sessionId, braceOpening + 1, braceClosing).append(sessionId, braceClosing + 1, idLen);
        sessionId = sb.toString();
      }
    }
    return sessionId;
  }

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

}