| 1 |
package org.astrogrid.samp.hub; |
| 2 |
|
| 3 |
import java.util.Map; |
| 4 |
|
| 5 |
/** |
| 6 |
* Specifies restrictions on the message types that may be sent in |
| 7 |
* a particular context. |
| 8 |
* In general if null is used in place of a MessageRestriction object, |
| 9 |
* the understanding is that no restrictions apply. |
| 10 |
* |
| 11 |
* @author Mark Taylor |
| 12 |
* @since 23 Nov 2011 |
| 13 |
*/ |
| 14 |
public interface MessageRestriction { |
| 15 |
|
| 16 |
/** |
| 17 |
* Indicates whether a message covered by a given MType subscription |
| 18 |
* may be sent. |
| 19 |
* |
| 20 |
* @param mtype the MType string to be sent |
| 21 |
* @param subsInfo the annotation map corresponding to the MType |
| 22 |
* subscription (the value from the Subscriptions map |
| 23 |
* corresponding to the <code>mtype</code> key) |
| 24 |
* @return true if the message may be sent, false if it is blocked |
| 25 |
*/ |
| 26 |
boolean permitSend( String mtype, Map subsInfo ); |
| 27 |
} |