| 1 |
package org.astrogrid.samp.xmlrpc; |
| 2 |
|
| 3 |
import java.io.IOException; |
| 4 |
import java.net.URL; |
| 5 |
import java.util.List; |
| 6 |
|
| 7 |
/** |
| 8 |
* Interface for a client which can make XML-RPC calls for SAMP. |
| 9 |
* The method parameters and return values must be of SAMP-compatible types, |
| 10 |
* that is only Strings, Lists, and String-keyed Maps are allowed in |
| 11 |
* the data structures. |
| 12 |
* |
| 13 |
* @author Mark Taylor |
| 14 |
* @since 22 Aug 2008 |
| 15 |
*/ |
| 16 |
public interface SampXmlRpcClient { |
| 17 |
|
| 18 |
/** |
| 19 |
* Makes a synchronous call, waiting for the response and returning |
| 20 |
* the result. |
| 21 |
* |
| 22 |
* @param method XML-RPC method name |
| 23 |
* @param params parameters for XML-RPC call (SAMP-compatible) |
| 24 |
* @return XML-RPC call return value (SAMP-compatible) |
| 25 |
*/ |
| 26 |
Object callAndWait( String method, List params ) throws IOException; |
| 27 |
|
| 28 |
/** |
| 29 |
* Sends a call, but does not wait around for the response. |
| 30 |
* If possible, this method should complete quickly. |
| 31 |
* |
| 32 |
* <p>NOTE: it seems to be difficult to implement this method in a |
| 33 |
* way which is faster than {@link #callAndWait} but does not cause |
| 34 |
* problems elsewhere (incomplete HTTP responses). It is probably |
| 35 |
* a good idea to avoid using it if possible. |
| 36 |
* |
| 37 |
* @param method XML-RPC method name |
| 38 |
* @param params parameters for XML-RPC call (SAMP-compatible) |
| 39 |
*/ |
| 40 |
void callAndForget( String method, List params ) throws IOException; |
| 41 |
} |