| 1 |
package org.astrogrid.samp.hub; |
| 2 |
|
| 3 |
import java.util.List; |
| 4 |
import java.util.Map; |
| 5 |
import org.astrogrid.samp.Metadata; |
| 6 |
import org.astrogrid.samp.RegInfo; |
| 7 |
import org.astrogrid.samp.Response; |
| 8 |
import org.astrogrid.samp.Subscriptions; |
| 9 |
import org.astrogrid.samp.client.CallableClient; |
| 10 |
import org.astrogrid.samp.client.HubConnection; |
| 11 |
import org.astrogrid.samp.client.SampException; |
| 12 |
|
| 13 |
/** |
| 14 |
* HubConnection implementation that delegates all calls to a base instance. |
| 15 |
* |
| 16 |
* @author Mark Taylor |
| 17 |
* @since 3 Feb 2011 |
| 18 |
*/ |
| 19 |
class WrapperHubConnection implements HubConnection { |
| 20 |
|
| 21 |
private final HubConnection base_; |
| 22 |
|
| 23 |
/** |
| 24 |
* Constructor. |
| 25 |
* |
| 26 |
* @param base hub connection to which all calls are delegated |
| 27 |
*/ |
| 28 |
public WrapperHubConnection( HubConnection base ) { |
| 29 |
base_ = base; |
| 30 |
} |
| 31 |
|
| 32 |
public RegInfo getRegInfo() { |
| 33 |
return base_.getRegInfo(); |
| 34 |
} |
| 35 |
|
| 36 |
public void setCallable( CallableClient client ) throws SampException { |
| 37 |
base_.setCallable( client ); |
| 38 |
} |
| 39 |
|
| 40 |
public void ping() throws SampException { |
| 41 |
base_.ping(); |
| 42 |
} |
| 43 |
|
| 44 |
public void unregister() throws SampException { |
| 45 |
base_.unregister(); |
| 46 |
} |
| 47 |
|
| 48 |
public void declareMetadata( Map meta ) throws SampException { |
| 49 |
base_.declareMetadata( meta ); |
| 50 |
} |
| 51 |
|
| 52 |
public Metadata getMetadata( String clientId ) throws SampException { |
| 53 |
return base_.getMetadata( clientId ); |
| 54 |
} |
| 55 |
|
| 56 |
public void declareSubscriptions( Map subs ) throws SampException { |
| 57 |
base_.declareSubscriptions( subs ); |
| 58 |
} |
| 59 |
|
| 60 |
public Subscriptions getSubscriptions( String clientId ) |
| 61 |
throws SampException { |
| 62 |
return base_.getSubscriptions( clientId ); |
| 63 |
} |
| 64 |
|
| 65 |
public String[] getRegisteredClients() throws SampException { |
| 66 |
return base_.getRegisteredClients(); |
| 67 |
} |
| 68 |
|
| 69 |
public Map getSubscribedClients( String mtype ) throws SampException { |
| 70 |
return base_.getSubscribedClients( mtype ); |
| 71 |
} |
| 72 |
|
| 73 |
public void notify( String recipientId, Map msg ) throws SampException { |
| 74 |
base_.notify( recipientId, msg ); |
| 75 |
} |
| 76 |
|
| 77 |
public List notifyAll( Map msg ) throws SampException { |
| 78 |
return base_.notifyAll( msg ); |
| 79 |
} |
| 80 |
|
| 81 |
public String call( String recipientId, String msgTag, Map msg ) |
| 82 |
throws SampException { |
| 83 |
return base_.call( recipientId, msgTag, msg ); |
| 84 |
} |
| 85 |
|
| 86 |
public Map callAll( String msgTag, Map msg ) throws SampException { |
| 87 |
return base_.callAll( msgTag, msg ); |
| 88 |
} |
| 89 |
|
| 90 |
public Response callAndWait( String recipientId, Map msg, int timeout ) |
| 91 |
throws SampException { |
| 92 |
return base_.callAndWait( recipientId, msg, timeout ); |
| 93 |
} |
| 94 |
|
| 95 |
public void reply( String msgId, Map response ) throws SampException { |
| 96 |
base_.reply( msgId, response ); |
| 97 |
} |
| 98 |
} |