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;
023
024import de.novanic.eventservice.client.event.Event;
025import de.novanic.eventservice.client.event.filter.EventFilter;
026import de.novanic.eventservice.client.event.domain.Domain;
027
028/**
029 * EventExecutorService can be used to add events via the server side.
030 *
031 * @author sstrohschein
032 * <br>Date: 20.07.2008
033 * <br>Time: 14:26:53
034 */
035public interface EventExecutorService
036{
037    /**
038     * Checks if the user is registered for event listening.
039     * @return true when the user is listening, otherwise false
040     */
041    boolean isUserRegistered();
042
043    /**
044     * Checks if the user is registered for event listening.
045     * @param aDomain domain to check the registration for the user
046     * @return true when the user is listening, otherwise false
047     */
048    boolean isUserRegistered(Domain aDomain);
049
050    /**
051     * Adds an event for all users
052     * @param aDomain the domain to add the event
053     * @param anEvent event to add
054     */
055    void addEvent(Domain aDomain, Event anEvent);
056
057    /**
058     * Adds an event for a specific user
059     * @param anEvent event to add
060     */
061    void addEventUserSpecific(Event anEvent);
062
063    /**
064     * Changes the {@link de.novanic.eventservice.client.event.filter.EventFilter} for the user-domain combination.
065     * The {@link de.novanic.eventservice.client.event.filter.EventFilter} can be removed with the method
066     * {@link de.novanic.eventservice.service.EventExecutorService#removeEventFilter(de.novanic.eventservice.client.event.domain.Domain)}
067     * or when that method is called with NULL as the {@link de.novanic.eventservice.client.event.filter.EventFilter}
068     * parameter value.
069     * @param aDomain domain to set the {@link de.novanic.eventservice.client.event.filter.EventFilter} (user-domain combination)
070     * @param anEventFilter new {@link de.novanic.eventservice.client.event.filter.EventFilter}
071     */
072    void setEventFilter(Domain aDomain, EventFilter anEventFilter);
073
074    /**
075     * Returns the EventFilter for the user domain combination.
076     * @param aDomain domain
077     * @return EventFilter for the domain
078     */
079    EventFilter getEventFilter(Domain aDomain);
080
081    /**
082     * Removes the {@link de.novanic.eventservice.client.event.filter.EventFilter} of the domain.
083     * @param aDomain domain to drop the {@link de.novanic.eventservice.client.event.filter.EventFilter} from
084     */
085    void removeEventFilter(Domain aDomain);
086}