nl.surfnet.coin.selfservice.dao.impl
Class StatisticDaoImpl

java.lang.Object
  extended by nl.surfnet.coin.selfservice.dao.impl.StatisticDaoImpl
All Implemented Interfaces:
StatisticDao

@Repository
public class StatisticDaoImpl
extends Object
implements StatisticDao

SQL implementation for the statistic service


Constructor Summary
StatisticDaoImpl()
           
 
Method Summary
 List<ChartSerie> convertStatResultsToChartSeries(List<StatResult> statResults)
          The SQL query returns a single row per date/Service provider combination.
static Calendar convertToGmt(Calendar cal)
          Get a converted Calendar in which the timezone difference has been added.

Input: 0:00:00 CEST
Output: 2:00:00 CEST
 List<ChartSerie> getLoginsPerSpPerDay(String idpEntityId, String spEntityId)
          Makes a List of login data for a specific Service Provider got the Identity Provider
 org.springframework.jdbc.core.RowMapper<StatResult> mapRowsToStatResult()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatisticDaoImpl

public StatisticDaoImpl()
Method Detail

getLoginsPerSpPerDay

public List<ChartSerie> getLoginsPerSpPerDay(String idpEntityId,
                                             String spEntityId)
Description copied from interface: StatisticDao
Makes a List of login data for a specific Service Provider got the Identity Provider

Specified by:
getLoginsPerSpPerDay in interface StatisticDao
Parameters:
idpEntityId - unique identifier of the Identity provider
spEntityId - unique identifier of the Service provider
Returns:
List of StatResult

mapRowsToStatResult

public org.springframework.jdbc.core.RowMapper<StatResult> mapRowsToStatResult()

convertStatResultsToChartSeries

public List<ChartSerie> convertStatResultsToChartSeries(List<StatResult> statResults)
The SQL query returns a single row per date/Service provider combination. For the ChartSerie we need one object per Service Provider with a list of dates. If on a day no logins were done for an SP, the SQL query returns no row. We need to insert a zero hits entry into the list of logins.

Parameters:
statResults - List of StatResult's (SQL row)
Returns:
List of ChartSerie (HighChart input)

convertToGmt

public static Calendar convertToGmt(Calendar cal)
Get a converted Calendar in which the timezone difference has been added.

Input: 0:00:00 CEST
Output: 2:00:00 CEST

Parameters:
cal - the original
Returns:
converted calendar


Copyright © 2012 SURFnet bv, The Netherlands. All Rights Reserved.