org.astrogrid.samp.hub
Class HubClient

java.lang.Object
  extended byorg.astrogrid.samp.hub.HubClient
All Implemented Interfaces:
Client

public class HubClient
extends Object
implements Client

Represents a client registered with a hub.

Since:
15 Jul 2008
Author:
Mark Taylor

Constructor Summary
HubClient(Object privateKey, String publicId)
          Constructor.
 
Method Summary
 String getId()
          Returns the public identifier for this client.
 Metadata getMetadata()
          Returns the currently declared metadata for this client, if any.
 Object getPrivateKey()
          Returns this client's private key.
 Receiver getReceiver()
          Returns the receiveer which allows this client to receive callbacks.
 Map getSubscription(String mtype)
          Returns the subscription information for a given MType for this client.
 Subscriptions getSubscriptions()
          Returns the currently declared subscriptions for this client, if any.
 boolean isCallable()
          Indicates whether this client is callable.
 boolean isSubscribed(String mtype)
          Indicates whether this client is subscribed to a given MType.
 void setMetadata(Map meta)
          Sets this client's metadata map.
 void setReceiver(Receiver receiver)
          Sets the receiver which allows this client to receive callbacks.
 void setSubscriptions(Map subs)
          Sets this client's subscriptions list.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HubClient

public HubClient(Object privateKey,
                 String publicId)
Constructor.

Parameters:
privateKey - client private key
publicId - client public ID
Method Detail

getId

public String getId()
Description copied from interface: Client
Returns the public identifier for this client.

Specified by:
getId in interface Client
Returns:
public id

getMetadata

public Metadata getMetadata()
Description copied from interface: Client
Returns the currently declared metadata for this client, if any.

Specified by:
getMetadata in interface Client
Returns:
metadata object; may be null

getSubscriptions

public Subscriptions getSubscriptions()
Description copied from interface: Client
Returns the currently declared subscriptions for this client, if any.

Specified by:
getSubscriptions in interface Client
Returns:
subscriptions object; may be null

getPrivateKey

public Object getPrivateKey()
Returns this client's private key.

Returns:
private key

setMetadata

public void setMetadata(Map meta)
Sets this client's metadata map.

Parameters:
meta - metadata map

setSubscriptions

public void setSubscriptions(Map subs)
Sets this client's subscriptions list.

Parameters:
subs - subscriptions map

isSubscribed

public boolean isSubscribed(String mtype)
Indicates whether this client is subscribed to a given MType.

Parameters:
mtype - MType
Returns:
true iff subscribed to MType

getSubscription

public Map getSubscription(String mtype)
Returns the subscription information for a given MType for this client.

Parameters:
mtype - MType
Returns:
subscriptions map value for key mtype, or null if not subscribed

setReceiver

public void setReceiver(Receiver receiver)
Sets the receiver which allows this client to receive callbacks. If null is used, a no-op receiver is installed.

Parameters:
receiver - new receiver, or null

getReceiver

public Receiver getReceiver()
Returns the receiveer which allows this client to receive callbacks. It is never null.

Returns:
receiver

isCallable

public boolean isCallable()
Indicates whether this client is callable.

Returns:
true iff this client has a non-useless receiver installed

toString

public String toString()


Copyright © 2008 AstroGrid. All Rights Reserved.