| 1 |
package org.astrogrid.samp.hub; |
| 2 |
|
| 3 |
import java.io.IOException; |
| 4 |
import java.util.List; |
| 5 |
import org.astrogrid.samp.client.ClientProfile; |
| 6 |
|
| 7 |
/** |
| 8 |
* Defines a hub profile. |
| 9 |
* This profile allows registration and deregistration of clients to |
| 10 |
* a given provider of hub connections, using some profile-specific |
| 11 |
* transport and authentication arrangements. |
| 12 |
* Multiple profiles may be attached to a single connection supplier |
| 13 |
* at any time, and may be started and stopped independently of each other. |
| 14 |
* The connection supplier is typically a hub service running in the same |
| 15 |
* JVM, but may also be a client-side connection to a hub. |
| 16 |
* A profile should be able to undergo multiple start/stop cycles. |
| 17 |
* |
| 18 |
* @author Mark Taylor |
| 19 |
* @since 31 Jan 2011 |
| 20 |
*/ |
| 21 |
public interface HubProfile extends ProfileToken { |
| 22 |
|
| 23 |
/** |
| 24 |
* Starts this profile's activity allowing access to a given supplier of |
| 25 |
* hub connections. |
| 26 |
* |
| 27 |
* @param profile object which can provide hub connections |
| 28 |
*/ |
| 29 |
void start( ClientProfile profile ) throws IOException; |
| 30 |
|
| 31 |
/** |
| 32 |
* Indicates whether this profile is currently running. |
| 33 |
* |
| 34 |
* @return true iff profile is running |
| 35 |
*/ |
| 36 |
boolean isRunning(); |
| 37 |
|
| 38 |
/** |
| 39 |
* Ends this profile's activity on behalf of the hub. |
| 40 |
* Any resources associated with the profile should be released. |
| 41 |
* This does not include messaging registered clients about profile |
| 42 |
* termination; that should be taken care of by the user of this profile. |
| 43 |
*/ |
| 44 |
void stop() throws IOException; |
| 45 |
|
| 46 |
/** |
| 47 |
* Returns the name of this profile. |
| 48 |
* |
| 49 |
* @return profile name, usually one word |
| 50 |
*/ |
| 51 |
public String getProfileName(); |
| 52 |
} |