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.config;
023
024import java.util.Map;
025
026/**
027 * An EventServiceConfiguration holds the configuration for {@link de.novanic.eventservice.client.event.service.EventService}.
028 * The time for a timeout and the min- and max-waiting-time can be configured.
029 * <br>
030 * <br> - Min waiting time - Listening should hold at least for min waiting time.
031 * <br> - Max waiting time - Listening shouldn't hold longer than max waiting time.
032 * <br> - Timeout time - Max time for a listen cycle. If the timeout time is exceeded, the client will be deregistered.
033 *
034 * @author sstrohschein
035 * <br>Date: 09.08.2008
036 * <br>Time: 23:17:26
037 */
038public interface EventServiceConfiguration
039{
040    /**
041     * Returns the description of the configuration (for example the location).
042     * @return configuration description
043     */
044    String getConfigDescription();
045
046    /**
047     * Returns the min waiting time. Listening should hold at least for min waiting time.
048     * @see de.novanic.eventservice.config.ConfigParameter#MIN_WAITING_TIME_TAG
049     * @return min waiting time
050     */
051    Integer getMinWaitingTime();
052
053    /**
054     * Returns the max waiting time. Listening shouldn't hold longer than max waiting time.
055     * @see de.novanic.eventservice.config.ConfigParameter#MAX_WAITING_TIME_TAG
056     * @return max waiting time
057     */
058    Integer getMaxWaitingTime();
059
060    /**
061     * Returns the timeout time. The timeout time is the max time for a listen cycle. If the timeout time is exceeded,
062     * the client will be deregistered.
063     * @see de.novanic.eventservice.config.ConfigParameter#TIMEOUT_TIME_TAG
064     * @return timeout time
065     */
066    Integer getTimeoutTime();
067
068    /**
069     * Returns the number of reconnect attempts to execute.
070     * @see de.novanic.eventservice.config.ConfigParameter#RECONNECT_ATTEMPT_COUNT_TAG
071     * @return reconnect attempt count
072     */
073    Integer getReconnectAttemptCount();
074
075    /**
076     * Returns the class name of the configured {@link de.novanic.eventservice.service.connection.id.ConnectionIdGenerator}.
077     * The {@link de.novanic.eventservice.service.connection.id.ConnectionIdGenerator} generates unique ids to identify the clients.
078     * @see de.novanic.eventservice.config.ConfigParameter#CONNECTION_ID_GENERATOR
079     * @return class name of the configured {@link de.novanic.eventservice.service.connection.id.ConnectionIdGenerator}
080     */
081    String getConnectionIdGeneratorClassName();
082
083    /**
084     * Returns the class name of the configured connection strategy (client side part).
085     * @see de.novanic.eventservice.config.ConfigParameter#CONNECTION_STRATEGY_CLIENT_CONNECTOR
086     * @return connection strategy (client side part)
087     */
088    String getConnectionStrategyClientConnectorClassName();
089
090    /**
091     * Returns the class name of the configured connection strategy (server side part).
092     * @see de.novanic.eventservice.config.ConfigParameter#CONNECTION_STRATEGY_SERVER_CONNECTOR
093     * @return connection strategy (server side part)
094     */
095    String getConnectionStrategyServerConnectorClassName();
096
097    /**
098     * Returns the configured encoding / charset for the connection strategy.
099     * @return configured encoding / charset
100     */
101    String getConnectionStrategyEncoding();
102
103    /**
104     * Returns the configured maximum amount of events which should be transferred to the client at once.
105     * @return configured maximum amount of events at once
106     */
107    Integer getMaxEvents();
108
109    /**
110     * Returns the configurations as a {@link java.util.Map} with {@link de.novanic.eventservice.config.ConfigParameter}
111     * instances as the key.
112     * @return {@link java.util.Map} with the configurations with {@link de.novanic.eventservice.config.ConfigParameter}
113     * instances as the key
114     */
115    Map<ConfigParameter, Object> getConfigMap();
116}