| 1 |
package org.astrogrid.samp.hub; |
| 2 |
|
| 3 |
/** |
| 4 |
* Data structure for keeping track of clients currently registered with a hub. |
| 5 |
* |
| 6 |
* @author Mark Taylor |
| 7 |
* @since 15 Jul 2008 |
| 8 |
*/ |
| 9 |
public interface ClientSet { |
| 10 |
|
| 11 |
/** |
| 12 |
* Adds a new client to the set. |
| 13 |
* |
| 14 |
* @param client client to add |
| 15 |
*/ |
| 16 |
void add( HubClient client ); |
| 17 |
|
| 18 |
/** |
| 19 |
* Removes a client from the set. |
| 20 |
* |
| 21 |
* @param client client to remove |
| 22 |
*/ |
| 23 |
void remove( HubClient client ); |
| 24 |
|
| 25 |
/** |
| 26 |
* Returns the client in the set corresponding to a given public ID. |
| 27 |
* |
| 28 |
* @param publicId client public ID |
| 29 |
* @return client with id <code>publicId</code> if registered, or null |
| 30 |
*/ |
| 31 |
HubClient getFromPublicId( String publicId ); |
| 32 |
|
| 33 |
/** |
| 34 |
* Returns an array of all the currently contained clients. |
| 35 |
* |
| 36 |
* @return client list |
| 37 |
*/ |
| 38 |
HubClient[] getClients(); |
| 39 |
|
| 40 |
/** |
| 41 |
* Indicates whether a given client is currently a member of this set. |
| 42 |
* |
| 43 |
* @return true iff <code>client</code> is currently a member of this set |
| 44 |
*/ |
| 45 |
boolean containsClient( HubClient client ); |
| 46 |
} |