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.client.event.domain;
023
024/**
025 * The DomainFactory creates new Domains ({@link de.novanic.eventservice.client.event.domain.Domain}) with a name. The
026 * name should be unique to avoid 'collision' of events.
027 * @see de.novanic.eventservice.client.event.domain.Domain
028 *
029 * @author sstrohschein
030 * <br>Date: 15.08.2008
031 * <br>Time: 22:45:28
032 */
033public final class DomainFactory
034{
035    /**
036     * All unlisten events ({@link de.novanic.eventservice.client.event.listener.unlisten.UnlistenEvent}) will be registered to
037     * the UNLISTEN_DOMAIN.
038     */
039    public static final Domain UNLISTEN_DOMAIN = getDomain("service_unlisten_domain");
040
041    /**
042     * The {@link de.novanic.eventservice.client.event.domain.DomainFactory#USER_SPECIFIC_DOMAIN} is a special domain for
043     * user-specific events. User-specific events will be registered to that domain. This domain holds only events for
044     * the specified client / user and doesn't provide events for all users like all other domains.
045     * Technically the user-specific domain is implemented as a / the NULL-domain.
046     */
047    public static final Domain USER_SPECIFIC_DOMAIN = null;
048
049    private DomainFactory() {}
050
051    /**
052     * Creates a new {@link de.novanic.eventservice.client.event.domain.Domain} with a name. The name should be unique
053     * to avoid 'collision' of events.
054     * @param aDomainName unique domain name
055     * @return {@link de.novanic.eventservice.client.event.domain.Domain}
056     */
057    public static Domain getDomain(String aDomainName) {
058        return new DefaultDomain(aDomainName);
059    }
060}