
org.mobicents.cluster.MobicentsCluster Maven / Gradle / Ivy
/*
* JBoss, Home of Professional Open Source
* Copyright 2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.mobicents.cluster;
import java.util.List;
import org.jgroups.Address;
import org.mobicents.cache.MobicentsCache;
import org.mobicents.cluster.cache.ClusteredCacheData;
import org.mobicents.cluster.cache.ClusteredCacheDataIndexingHandler;
/**
*
* @author martins
*
*/
public interface MobicentsCluster {
/**
* Adds the specified fail over listener.
* @param listener
*/
public boolean addFailOverListener(FailOverListener listener);
/**
* Removes the specified fail over listener.
* @param listener
* @return
*/
public boolean removeFailOverListener(FailOverListener listener);
/**
* Adds the specified data removal listener.
* @param listener
*/
public boolean addDataRemovalListener(DataRemovalListener listener);
/**
* Removes the specified data removal listener.
* @param listener
* @return
*/
public boolean removeDataRemovalListener(DataRemovalListener listener);
/**
* Retrieves the local address of the cluster node.
* @return
*/
public Address getLocalAddress();
/**
* Retrieves the members of the cluster.
* @return
*/
public List getClusterMembers();
/**
* Indicates if the local node is the head of the cluster. If true it is safe to asume that we can perform cluster wide operations.
* @return
*/
public boolean isHeadMember();
/**
* Method to determine if this node is single node in the cluster.
*
* @return
* - true - cache mode is local || clusterMembers == 1
*
-
*
- false - otherwise
*
-
*
*/
public boolean isSingleMember();
/**
*
* @return the restcomm cache controlled by the cluster
*/
public MobicentsCache getMobicentsCache();
/**
* Retrieves the handler to manage cluster indexing of {@link ClusteredCacheData}
* @return
*/
public ClusteredCacheDataIndexingHandler getClusteredCacheDataIndexingHandler();
/**
* Starts the cluster. This should only be invoked when all listeners are
* added, and when all classes needed to deserialize data in a running
* cluster are visible (somehow).
*/
public void startCluster();
/**
* Indicates if the cluster is running or not.
* @return
*/
public boolean isStarted();
/**
* Stops the cluster.
*/
public void stopCluster();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy