2016-02-03 10:20:22 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2016 Red Hat, Inc. and/or its affiliates
|
|
|
|
* and other contributors as indicated by the @author tags.
|
|
|
|
*
|
|
|
|
* Licensed 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.
|
|
|
|
*/
|
|
|
|
|
2014-08-27 10:41:40 +00:00
|
|
|
package org.keycloak.events;
|
2014-03-25 10:36:15 +00:00
|
|
|
|
2015-05-28 12:35:31 +00:00
|
|
|
import java.util.Date;
|
2014-03-25 10:36:15 +00:00
|
|
|
import java.util.List;
|
2020-09-16 08:04:49 +00:00
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Stream;
|
2014-03-25 10:36:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author <a href="mailto:sthorger@redhat.com">Stian Thorgersen</a>
|
|
|
|
*/
|
|
|
|
public interface EventQuery {
|
|
|
|
|
2019-11-23 19:39:33 +00:00
|
|
|
EventQuery type(EventType... types);
|
2014-03-25 10:36:15 +00:00
|
|
|
|
2019-11-23 19:39:33 +00:00
|
|
|
EventQuery realm(String realmId);
|
2014-03-25 10:36:15 +00:00
|
|
|
|
2019-11-23 19:39:33 +00:00
|
|
|
EventQuery client(String clientId);
|
2014-03-25 10:36:15 +00:00
|
|
|
|
2019-11-23 19:39:33 +00:00
|
|
|
EventQuery user(String userId);
|
2014-03-25 10:36:15 +00:00
|
|
|
|
2019-11-23 19:39:33 +00:00
|
|
|
EventQuery fromDate(Date fromDate);
|
2015-03-05 14:46:16 +00:00
|
|
|
|
2019-11-23 19:39:33 +00:00
|
|
|
EventQuery toDate(Date toDate);
|
2015-03-05 14:46:16 +00:00
|
|
|
|
2019-11-23 19:39:33 +00:00
|
|
|
EventQuery ipAddress(String ipAddress);
|
2014-04-04 13:23:14 +00:00
|
|
|
|
2019-11-23 19:39:33 +00:00
|
|
|
EventQuery firstResult(int result);
|
2014-03-25 10:36:15 +00:00
|
|
|
|
2019-11-23 19:39:33 +00:00
|
|
|
EventQuery maxResults(int results);
|
2014-03-25 10:36:15 +00:00
|
|
|
|
2020-09-16 08:04:49 +00:00
|
|
|
/**
|
|
|
|
* @deprecated Use {@link #getResultStream() getResultStream} instead.
|
|
|
|
*/
|
|
|
|
@Deprecated
|
|
|
|
default List<Event> getResultList() {
|
|
|
|
return getResultStream().collect(Collectors.toList());
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns requested results that match given criteria as a stream.
|
|
|
|
* @return Stream of events
|
|
|
|
*/
|
|
|
|
Stream<Event> getResultStream();
|
2014-03-25 10:36:15 +00:00
|
|
|
}
|