View Javadoc
1   /***************************************************************************
2    * Copyright (C) 2003-2019 eXo Platform SAS.
3    *
4    * This program is free software; you can redistribute it and/or
5    * modify it under the terms of the GNU Affero General Public License
6    * as published by the Free Software Foundation; either version 3
7    * of the License, or (at your option) any later version.
8    *
9    * This program is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   * GNU General Public License for more details.
13   *
14   * You should have received a copy of the GNU General Public License
15   * along with this program; if not, see<http://www.gnu.org/licenses/>.
16   ***************************************************************************/
17  package org.exoplatform.platform.gadget.services.LoginHistory;
18  
19  import java.util.List;
20  import java.util.Set;
21  
22  /**
23   * Created by The eXo Platform SARL Author : Tung Vu Minh tungvm@exoplatform.com
24   * Apr 21, 2011 6:19:21 PM
25   */
26  
27  public interface LoginHistoryService {
28    String ALL_USERS = "AllUsers";
29    String EXO_AUDIT_LOGIN_ENABLED = "exo.audit.login.enabled";
30  
31    long getLastLogin(String userId) throws Exception;
32  
33    List<LastLoginBean> getLastLogins(int numLogins, String userIdFilter) throws Exception;
34  
35    void addLoginHistoryEntry(String userId, long loginTime) throws Exception;
36  
37    List<LoginHistoryBean> getLoginHistory(String userId, long fromTime, long toTime) throws Exception;
38  
39    Set<String> getLastUsersLogin(long fromTime) throws Exception;
40  
41    List<LoginCounterBean> getLoginCountPerDaysInWeek(String userId, long week) throws Exception;
42  
43    List<LoginCounterBean> getLoginCountPerWeeksInMonths(String userId, long fromMonth, int numOfMonths) throws Exception;
44  
45    List<LoginCounterBean> getLoginCountPerMonthsInYear(String userId, long year) throws Exception;
46  
47    long getBeforeLastLogin(String userId) throws Exception;
48  
49    boolean isEnabled();
50  }