1 /* 2 * Replica is published under the terms 3 * of the Apache Software License. 4 */ 5 package replica.group; 6 7 import java.util.List; 8 9 import replica.group.event.*; 10 11 /*** 12 * Interface for all service providers of group communications. 13 * 14 * @author Pedro Costa 15 * @author Helder Silva 16 * @since 19/Jan/2004 17 */ 18 public interface GroupManager { 19 20 // TODO lets see what services i should provide here ... 21 22 /*** 23 * Join a group. 24 */ 25 void joinGroup(); 26 27 /*** 28 * Leave the group. 29 * 30 */ 31 void leaveGroup(); 32 33 /*** 34 * @return the name of the group that this mnager, manages. 35 */ 36 String getGroupName(); 37 38 /*** 39 * @param groupName the name of the group to be managed. 40 */ 41 void setGroupName(String groupName); 42 43 /*** 44 * Return a view of the group. A list of the addresses of the group members. 45 * @return List of <code>Address<code>. 46 * @see {@link Address} 47 */ 48 List getGroupView(); 49 50 /*** 51 * Sends a unicast message to one address from the list of addresses returned 52 * by {@link #getGroupView()}. 53 * @param receiverAddress 54 * @param message 55 */ 56 void sendMessage(Address receiverAddress, Object message); 57 58 /*** 59 * Sends a message to members of the current view. 60 * @param message 61 */ 62 void sendMessage(Object message); 63 64 // TODO should i make a Message interface? 65 66 /*** 67 * Adds a listener for group messages: regular messages, view messages and suspicious 68 * messages. 69 */ 70 void addListener(GroupListener listener); 71 72 /*** 73 * Removes a listener from the listeners group manager list. 74 * 75 * @param listener the listener to remove. 76 */ 77 boolean removeListener( GroupListener listener); 78 79 /*** 80 * Return the local address. 81 * 82 * @return 83 */ 84 Address getLocalAddress(); 85 86 }

This page was automatically generated by Maven