darx
Interface NameServer

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
NameServerImpl

public interface NameServer
extends java.rmi.Remote

This is the global naming service's interface.
It provides the means for locating replication group leaders.


Field Summary
static int DEFAULT_PORT_NB
          The port number of the location of the centralized name server.
static java.lang.String DEFAULT_URL
          The URL of the location of the centralized name server.
static java.lang.String SERVICE_NAME
          The RMI identifier of the centralized name server.
 
Method Summary
 ReplicantInfo getLeaderOfTask(java.lang.String task_name)
          Returns the information necessary for obtaining the handle of the current leader of the given replication group.
 void register(ReplicantInfo new_replicant)
          Registers the info concerning a new replicant for a given task.
 ReplicantInfo selectAnotherLeader(ReplicantInfo old_leader)
          Selects a replicant as the new leader within its replication group info.
 void setLeaderOfTask(ReplicantInfo rep_info)
          Selects a replicant as the new leader within its replication group info.
 ReplicantInfo setLeaderOfTask(java.lang.String url, int port_nb, java.lang.String task_name)
          Selects a replicant as the new leader within its replication group info.
 ReplicantInfo unregister(java.lang.String task_name, java.lang.String url, int port_nb)
          Removes the info concerning a replicant for a given task.
 ReplicationGroupInfo unregisterGroup(java.lang.String task_name)
          Removes the info concerning a whole replication group for a given task.
 

Field Detail

DEFAULT_URL

static final java.lang.String DEFAULT_URL
The URL of the location of the centralized name server.

See Also:
Constant Field Values

DEFAULT_PORT_NB

static final int DEFAULT_PORT_NB
The port number of the location of the centralized name server.

See Also:
Constant Field Values

SERVICE_NAME

static final java.lang.String SERVICE_NAME
The RMI identifier of the centralized name server.

See Also:
Constant Field Values
Method Detail

getLeaderOfTask

ReplicantInfo getLeaderOfTask(java.lang.String task_name)
                              throws java.rmi.RemoteException,
                                     NoMoreReplicantsException,
                                     InexistentNameException
Returns the information necessary for obtaining the handle of the current leader of the given replication group.

Parameters:
task_name - the generic task name
Returns:
the info concerning the current replication group leader
Throws:
java.rmi.RemoteException
NoMoreReplicantsException
InexistentNameException

selectAnotherLeader

ReplicantInfo selectAnotherLeader(ReplicantInfo old_leader)
                                  throws java.rmi.RemoteException,
                                         NoMoreReplicantsException,
                                         InexistentNameException
Selects a replicant as the new leader within its replication group info. NB: this method implicitly assumes that the current leader is faulty; its information will consequently be removed from the group info.

Parameters:
old_leader - the info defining the leader to be replaced
Returns:
the info concerning the new replication group leader
Throws:
java.rmi.RemoteException
NoMoreReplicantsException
InexistentNameException

setLeaderOfTask

void setLeaderOfTask(ReplicantInfo rep_info)
                     throws InexistentNameException,
                            java.rmi.RemoteException,
                            UnknownReplicantException
Selects a replicant as the new leader within its replication group info. NB: no failure is assumed when using this method; the change in the leadership here is an explicit decision from the developer.

Parameters:
rep_info - the info concerning the replicant to be set as the new leader
Throws:
InexistentNameException
java.rmi.RemoteException
UnknownReplicantException

setLeaderOfTask

ReplicantInfo setLeaderOfTask(java.lang.String url,
                              int port_nb,
                              java.lang.String task_name)
                              throws InexistentNameException,
                                     java.rmi.RemoteException,
                                     UnknownReplicantException
Selects a replicant as the new leader within its replication group info. NB: no failure is assumed when using this method; the change in the leadership here is an explicit decision from the developer.

Parameters:
url - the host of the replicant to be set as new leader
port_nb - the port nb of the replicant to be set as new leader
task_name - the generic name of the concerned task
Throws:
InexistentNameException
java.rmi.RemoteException
UnknownReplicantException

register

void register(ReplicantInfo new_replicant)
              throws java.rmi.RemoteException,
                     InexistentNameException
Registers the info concerning a new replicant for a given task. If no replicant was previously registered, that is if there is no entry corresponding to the given task_name, the replication group info is created and the new replicant is assumed to be the group leader.

Parameters:
new_replicant - the replicant info to register
Throws:
java.rmi.RemoteException
InexistentNameException

unregister

ReplicantInfo unregister(java.lang.String task_name,
                         java.lang.String url,
                         int port_nb)
                         throws java.rmi.RemoteException,
                                UnknownReplicantException,
                                InexistentNameException
Removes the info concerning a replicant for a given task. The killed replicant MUST NOT be a leader; killing a task is implemented differently (see method pointer)

Parameters:
task_name - the name of the task to which the replicant belongs
url - the url of the server hosting the doomed replica
port_nb - the port nb of the server hosting the doomed replica
Throws:
java.rmi.RemoteException
UnknownReplicantException
InexistentNameException

unregisterGroup

ReplicationGroupInfo unregisterGroup(java.lang.String task_name)
                                     throws java.rmi.RemoteException,
                                            InexistentNameException
Removes the info concerning a whole replication group for a given task.

Parameters:
task_name - the name of the task being stopped
Returns:
the replication group information for the task being stopped
Throws:
java.rmi.RemoteException
InexistentNameException