org.exoplatform.platform.gadget.services.LoginHistory
Class LoginHistoryServiceImpl

java.lang.Object
  extended by org.exoplatform.platform.gadget.services.LoginHistory.LoginHistoryServiceImpl
All Implemented Interfaces:
LoginHistoryService, org.picocontainer.Startable

public class LoginHistoryServiceImpl
extends Object
implements LoginHistoryService, org.picocontainer.Startable

Created by The eXo Platform SARL Author : Tung Vu Minh tungvm@exoplatform.com Apr 21, 2011 6:19:21 PM


Field Summary
 
Fields inherited from interface org.exoplatform.platform.gadget.services.LoginHistory.LoginHistoryService
ALL_USERS
 
Constructor Summary
LoginHistoryServiceImpl(org.exoplatform.services.jcr.RepositoryService repositoryService)
          Init LoginHistoryServiceImpl with RepositoryService from the container.
 
Method Summary
 void addConfiguration(LoginHistoryPlugin plugin)
          Apply configurations from service's xml
 void addLoginHistoryEntry(String userId, long loginTime)
          Add an entry to user login history
protected  void createHomeNode()
          Create exo:LoginHistoryHome node.
 long getLastLogin(String userId)
          Get user's last login time
 List<LastLoginBean> getLastLogins(int numItems, String userIdFilter)
          Get last logins
 List<LoginCounterBean> getLoginCountPerDaysInRange(String userId, long fromDate, long toDate)
          Get user's login count per days in range [fromDate..toDate]
 List<LoginCounterBean> getLoginCountPerDaysInWeek(String userId, long week)
          Get user login count per days in given week
 List<LoginCounterBean> getLoginCountPerMonthsInYear(String userId, long year)
          Get user login count per months in given year
 List<LoginCounterBean> getLoginCountPerWeeksInMonths(String userId, long fromMonth, int numOfMonths)
          Get user login count per weeks in given month
 List<LoginHistoryBean> getLoginHistory(String userId, long fromTime, long toTime)
          Get user login history
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoginHistoryServiceImpl

public LoginHistoryServiceImpl(org.exoplatform.services.jcr.RepositoryService repositoryService)
Init LoginHistoryServiceImpl with RepositoryService from the container.

Parameters:
repositoryService -
Method Detail

start

public void start()
Specified by:
start in interface org.picocontainer.Startable

stop

public void stop()
Specified by:
stop in interface org.picocontainer.Startable

createHomeNode

protected void createHomeNode()
                       throws javax.jcr.RepositoryException
Create exo:LoginHistoryHome node.

Throws:
javax.jcr.RepositoryException

addConfiguration

public void addConfiguration(LoginHistoryPlugin plugin)
Apply configurations from service's xml


getLastLogin

public long getLastLogin(String userId)
                  throws Exception
Get user's last login time

Specified by:
getLastLogin in interface LoginHistoryService
Throws:
Exception

getLastLogins

public List<LastLoginBean> getLastLogins(int numItems,
                                         String userIdFilter)
                                  throws Exception
Get last logins

Specified by:
getLastLogins in interface LoginHistoryService
Parameters:
numItems -
Returns:
List of last login entries
Throws:
Exception

addLoginHistoryEntry

public void addLoginHistoryEntry(String userId,
                                 long loginTime)
                          throws Exception
Add an entry to user login history

Specified by:
addLoginHistoryEntry in interface LoginHistoryService
Parameters:
userId -
loginTime -
Throws:
Exception

getLoginHistory

public List<LoginHistoryBean> getLoginHistory(String userId,
                                              long fromTime,
                                              long toTime)
                                       throws Exception
Get user login history

Specified by:
getLoginHistory in interface LoginHistoryService
Parameters:
userId -
Returns:
List of login history entries in range [fromTime..toTime] of user
Throws:
Exception

getLoginCountPerDaysInRange

public List<LoginCounterBean> getLoginCountPerDaysInRange(String userId,
                                                          long fromDate,
                                                          long toDate)
                                                   throws Exception
Get user's login count per days in range [fromDate..toDate]

Throws:
Exception

getLoginCountPerDaysInWeek

public List<LoginCounterBean> getLoginCountPerDaysInWeek(String userId,
                                                         long week)
                                                  throws Exception
Get user login count per days in given week

Specified by:
getLoginCountPerDaysInWeek in interface LoginHistoryService
Throws:
Exception

getLoginCountPerWeeksInMonths

public List<LoginCounterBean> getLoginCountPerWeeksInMonths(String userId,
                                                            long fromMonth,
                                                            int numOfMonths)
                                                     throws Exception
Get user login count per weeks in given month

Specified by:
getLoginCountPerWeeksInMonths in interface LoginHistoryService
Throws:
Exception

getLoginCountPerMonthsInYear

public List<LoginCounterBean> getLoginCountPerMonthsInYear(String userId,
                                                           long year)
                                                    throws Exception
Get user login count per months in given year

Specified by:
getLoginCountPerMonthsInYear in interface LoginHistoryService
Throws:
Exception


Copyright © 2013 eXo Platform SAS. All Rights Reserved.