001/*
002 * GWTEventService
003 * Copyright (c) 2011 and beyond, strawbill UG (haftungsbeschr?nkt)
004 *
005 * This is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU Lesser General Public License as
007 * published by the Free Software Foundation; either version 3 of
008 * the License, or (at your option) any later version.
009 * Other licensing for GWTEventService may also be possible on request.
010 * Please view the license.txt of the project for more information.
011 *
012 * This software is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * You should have received a copy of the GNU Lesser General Public
018 * License along with this software; if not, write to the Free
019 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021 */
022package de.novanic.eventservice.service.connection.strategy.connector;
023
024import de.novanic.eventservice.client.event.DomainEvent;
025import de.novanic.eventservice.service.EventServiceException;
026import de.novanic.eventservice.service.registry.user.UserInfo;
027
028import java.util.List;
029
030/**
031 * The {@link ConnectionStrategyServerConnector} listens for occurring events ({@link de.novanic.eventservice.client.event.Event})
032 * on the server side and has the task to prepare the transfer from the server side to the client side.
033 *
034 * The reason for the listen and transfer preparation within one single class is, that the {@link ConnectionStrategyServerConnector}
035 * should have the control about listening and transfer of the occurred events.
036 *
037 * @author sstrohschein
038 *         <br>Date: 15.03.2010
039 *         <br>Time: 23:02:32
040 */
041public interface ConnectionStrategyServerConnector
042{
043    /**
044     * Listens for occurring events (can be retrieved from the {@link de.novanic.eventservice.service.registry.user.UserInfo} with
045     * {@link de.novanic.eventservice.service.registry.user.UserInfo#retrieveEvents()}) and should prepare or transfer the retrieved events
046     * directly. The reason for the listen and transfer preparation within one single method is, that the {@link ConnectionStrategyServerConnector}
047     * should have the control about listening and transfer of the occurred events.
048     * @param aUserInfo {@link de.novanic.eventservice.service.registry.user.UserInfo} which holds new occurred events
049     * @return occurred events
050     * @throws EventServiceException
051     */
052    List<DomainEvent> listen(UserInfo aUserInfo) throws EventServiceException;
053}