
com.vii.brillien.kernel.axiom.atomic.Commander Maven / Gradle / Ivy
/*
* Copyright (c) 2012 Imre Fazekas.
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of the Brillien nor the names of its
* terms and concepts may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package com.vii.brillien.kernel.axiom.atomic;
import com.vii.brillien.kernel.BrillienException;
import com.vii.brillien.kernel.axiom.transport.Communication;
import java.util.List;
import java.util.Map;
/**
* Commander is a central management object in Brillien. Features:
* - maintain and manage all Presence instance in the running system
* - common interface for all Presence object to able to collect information about other Presence objects
* - registration-based Presence management
*
* The Commander object is a Unit, so Brillien is a Commander object graph and every Commander object may contain any Presence object, a Commander as well in fact. However, this would signify a very-very complex system. In most cases, a single Liaison is sufficient for all purposes.
*/
public interface Commander extends Flow
{
/**
* Registers a Presence. It is performed after loading a component from the deployment directory.
* @param Presence class reference for the Presence type
* @param generic type representing the Presence origin
* @return name of the Presence component
*/
String registerPresence( Class Presence, String apiVersion ) throws BrillienException;
/**
* Registers a Presence with the given name. It is performed after loading a component from the deployment directory.
* @param PresenceName class name of the presence to be used
* @param Presence class reference for the Presence type
* @param generic type representing the Presence origin
* @return name of the Presence component
*/
String registerPresence(String PresenceName, Class Presence, String apiVersion) throws BrillienException;
/**
* Makes a presence "clone". An already registered presence will be registered with a new name, thus reusing entity. Name must be unique.
* @param Presence class reference for the Presence type
* @param cloneName name of the clone
* @param generic type representing the Presence origin
* @return name of the Presence component
*/
String registerPresence( Class Presence, String cloneName, String apiVersion ) throws BrillienException;
/**
* Makes a presence "clone". An already registered presence will be registered with a new name, thus reusing entity. The Presence type will be identified by its publishing name. Name must be unique.
* @param originalName name of the original Presence
* @param cloneName name of the clone
* @return name of the Presence component
*/
String registerPresence( String originalName, String cloneName, String apiVersion ) throws BrillienException;
/**
* Unregisters a Presence by its name.
* @param PresenceName presence to be unregistered
*/
void unregisterPresence( String PresenceName, String apiVersion ) throws BrillienException;
/**
* @return the list of published components
*/
Map> getPresenceNames() throws BrillienException;
/**
* Tells whether a Presence with the given name exists
* @param name name of the presence
*/
boolean hasPresence( String name );
/**
* Get the Presence Manager of a default version Presence type by its name
* @param name name of the Presence type
* @return Presence Manager of the given Presence type
*/
PresenceManager getPresenceManagerOf( String name ) throws BrillienException;
/**
* Get the Presence Manager of a Presence type by its name
* @param name name of the Presence type
* @param version version of the Presence type
* @return Presence Manager of the given Presence type
*/
PresenceManager getPresenceManagerOf( String name, String apiVersion ) throws BrillienException;
/**
* Tells whether the given presence is a system-level presence or not
*/
boolean isSystemPresence( String presenceName ) throws BrillienException;
/**
* Tells whether the given presence is a system-level presence or not
*/
boolean isSystemPresence( String presenceName, String apiVersion ) throws BrillienException;
/**
* Sets the name of the Presence providing SSO functionality
*/
void setSSOPresenceName( String PresenceName );
/**
* Sets the name of the Presence providing SSO functionality
*/
void setApyKeyPresenceName( String PresenceName );
void shutDown();
}