/** * */ package it.polito.elite.dog.addons.storage; import java.util.Date; import java.util.Map; import java.util.Set; /** * @author bonino * */ public interface EventStore { /** * Gets all the measures generated by a given device in the time frame * between startDate and endDate using pagination * * @param deviceURI * the deviceURI as a{@link String} * @param startDate * the start date * @param endDate * the end date * @param startCount * the starting count * @param nResults * the number of results to provide back */ public EventDataStreamSet getAllDeviceParametricNotifications( String deviceURI, Date startDate, Date endDate, int startCount, int nResults); /** * Gets all the events generated by a given device in the time frame between * startDate and endDate using pagination * * @param deviceURI * the deviceURI as a{@link String} * @param startDate * the start date * @param endDate * the end date * @param startCount * the starting count * @param nResults * the number of results to provide back * @param aggregated * true if events should be aggregated in a single event stream, * false to get one event stream for each notification type */ public EventDataStreamSet getAllDeviceNonParametricNotifications( String deviceURI, Date startDate, Date endDate, int startCount, int nResults, boolean aggregated); /** * Gets all the measures corresponding to the given notification (including * any restricting parameter, e.g., phaseId=1) in the time frame between * startDate and endDate, using pagination. * * @param deviceURI * The deviceURI as a{@link String} * @param notificationName * The name of the notification for which measures must be * retrieved * @param notificationParams * The parameter values needed to further specify which * notification must be matched, * <code>paramname1-paramvalue1/paramname2-paramvalue2/</code>; * @param startDate * The start date. * @param endDate * The end date. * @param startCount * The starting count * @param nResults * The number of results to provide back */ public EventDataStream getSpecificDeviceParametricNotifications( String deviceURI, String notificationName, String notificationParams, Date startDate, Date endDate, int startCount, int nResults); /** * Gets all the events corresponding to the given notification in the time * frame between startDate and endDate, using pagination. * * @param deviceURI * The deviceURI as a{@link String} * @param notificationName * The name of the notification for which measures must be * retrieved * @param notificationParams * The parameter values needed to further specify which * notification must be matched, * <code>paramname1-paramvalue1/paramname2-paramvalue2/</code>; * @param startDate * The start date. * @param endDate * The end date. * @param startCount * The starting count * @param nResults * The number of results to provide back */ public EventDataStream getSpecificDeviceNonParametricNotifications( String deviceURI, String notificationName, Date startDate, Date endDate, int startCount, int nResults); /** * Gets all the events corresponding to the given set of notifications, * aggregated as a single event stream, in the time frame between startDate * and endDate, using pagination. * * @param deviceURI * The deviceURI as a{@link String} * @param notificationNames * The names of the notifications for which events must be * retrieved * @param startDate * The start date. * @param endDate * The end date. * @param startCount * The starting count. * @param nResults * The number of results to provide back. * @return */ public EventDataStream getSpecificDeviceNonParametricNotifications( String deviceURI, Set<String> notificationNames, String eventStreamName, Date startDate, Date endDate, int startCount, int nResults); /** * Gets all the events corresponding to the each set of notifications in the * given map, aggregated as a single event stream, in the time frame between * startDate and endDate, using pagination * * @param deviceURI * @param notificationNames * @param startDate * @param endDate * @param startCount * @param nResults * @return */ public EventDataStreamSet getSpecificDeviceNonParametricNotifications( String deviceURI, Map<String, Set<String>> notificationNames, Date startDate, Date endDate, int startCount, int nResults); /** * Gets all the events carrying a measure generated by a given device in the * time frame between startDate and endDate using pagination * * @param deviceURI * the deviceURI as a{@link String} * @param startDate * the start date * @param endDate * the end date * @param startCount * the starting count * @param nResults * the number of results to provide back */ public EventDataStreamSet getAllDeviceContinuousStates(String deviceUri, Date startDate, Date endDate, int startCount, int nResults); /** * Gets all the events carrying a discrete value generated by a given device * in the time frame between startDate and endDate using pagination * * @param deviceURI * the deviceURI as a{@link String} * @param startDate * the start date * @param endDate * the end date * @param startCount * the starting count * @param nResults * the number of results to provide back */ public EventDataStreamSet getAllDeviceDiscreteStates(String deviceUri, Date startDate, Date endDate, int startCount, int nResults, boolean aggregated); /** * Gets all the events corresponding to the given notification (continuous) * including any restricting parameter, e.g., phaseId=1, in the time frame * between startDate and endDate, using pagination. * * @param deviceURI * The deviceURI as a{@link String} * @param notificationName * The name of the notification for which events must be * retrieved * @param notificationParams * The parameter values needed to further specify which * notification must be matched, * <code>paramname1-paramvalue1/paramname2-paramvalue2/</code>; * @param startDate * The start date. * @param endDate * The end date. * @param startCount * The starting count * @param nResults * The number of results to provide back */ public EventDataStream getSpecificDeviceContinuousStates(String deviceURI, String notificationName, String notificationParams, Date startDate, Date endDate, int startCount, int nResults); /** * Gets all the events corresponding to the given notification (discrete) * with no parameters in the time frame between startDate and endDate, using * pagination. * * @param deviceURI * The deviceURI as a{@link String} * @param stateName * The name of the notification for which events must be * retrieved * @param notificationParams * The parameter values needed to further specify which * notification must be matched, * <code>paramname1-paramvalue1/paramname2-paramvalue2/</code>; * @param startDate * The start date. * @param endDate * The end date. * @param startCount * The starting count * @param nResults * The number of results to provide back */ public EventDataStream getSpecificDeviceDiscreteStates(String deviceURI, String stateName, Date startDate, Date endDate, int startCount, int nResults); /** * Inserts in the continuous notifications store the set of notifications * contained in the given {@link EventDataStreamSet} * * @param notificationsSet */ public void insertParametricNotifications( EventDataStreamSet notificationsSet); /** * Inserts in the discrete notifications store the set of notifications * contained in the given {@link EventDataStreamSet} * * @param notificationSet */ public void insertNonParametricNotifications(EventDataStreamSet notificationSet); /** * Inserts in the continuous states store the set of states * contained in the given {@link EventDataStreamSet} * @param stateSet */ public void insertContinuousStates(EventDataStreamSet stateSet); /** * Inserts in the discrete states store the set of states * contained in the given {@link EventDataStreamSet} * @param stateSet */ public void insertDiscreteStates(EventDataStreamSet stateSet); }