= SessionLogEntryRepository
:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Provides supporting functionality for querying xref:refguide:extensions:index/sessionlog/applib/dom/SessionLogEntry.adoc[SessionLogEntry] entities.

== API

[source,java]
.SessionLogEntryRepository.java
----
interface SessionLogEntryRepository {
  void logoutAllSessions(Timestamp logoutTimestamp)
  SessionLogEntry create(String username, UUID sessionGuid, String httpSessionId, SessionSubscriber.CausedBy causedBy, Timestamp timestamp)
  Optional<SessionLogEntry> findBySessionGuid(UUID sessionGuid)
  Optional<SessionLogEntry> findByHttpSessionId(String httpSessionId)
  List<SessionLogEntry> findByUsername(String username)
  List<SessionLogEntry> findByUsernameAndFromAndTo(String username, LocalDate from, LocalDate to)
  List<SessionLogEntry> findByFromAndTo(LocalDate from, LocalDate to)
  List<SessionLogEntry> findByUsernameAndStrictlyBefore(String username, Timestamp from)
  List<SessionLogEntry> findByUsernameAndStrictlyAfter(String username, Timestamp from)
  List<SessionLogEntry> findActiveSessions()
  List<SessionLogEntry> findRecentByUsername(String username)
  List<SessionLogEntry> findAll()     // <.>
  void removeAll()     // <.>
}
----

<.> xref:#findAll_[findAll()]
+
--
for testing purposes only
--
<.> xref:#removeAll_[removeAll()]
+
--
for testing purposes only
--

== Members

[#findAll_]
=== findAll()

for testing purposes only

[#removeAll_]
=== removeAll()

for testing purposes only
