1 |
package appl.parallel.client; |
2 |
|
3 |
import java.awt.Rectangle; |
4 |
import java.rmi.Remote; |
5 |
import java.rmi.RemoteException; |
6 |
|
7 |
import appl.parallel.event.CommEvent; |
8 |
import appl.parallel.event.CommEventSink; |
9 |
import appl.parallel.server.PartitionDataServer; |
10 |
import appl.parallel.spmd.split.DataPartition; |
11 |
import appl.parallel.spmd.split.SplittableResource; |
12 |
|
13 |
/** |
14 |
* A {@link DataServer} shares resources over a network. For |
15 |
* {@link SplittableResource}s it allows also the retrieval of |
16 |
* {@link DataPartition}s. The data is retrieved using a unique id identifying |
17 |
* the resource. |
18 |
* |
19 |
* @author Dominik Appl |
20 |
*/ |
21 |
public interface DataServer extends Remote { |
22 |
|
23 |
/** |
24 |
* gets the data with the id of a SplittableRessource |
25 |
* |
26 |
* @param id |
27 |
* the {@link SplittableResource#getRootID() ID} of a the base |
28 |
* data |
29 |
* @param bounds |
30 |
* the bounds of the partition to retrieve (using global |
31 |
* coordinates) |
32 |
* @return the partition |
33 |
* @throws RemoteException |
34 |
*/ |
35 |
public DataPartition getPartition(int id, Rectangle bounds) |
36 |
throws RemoteException; |
37 |
|
38 |
/** |
39 |
* sets the data with the id of a SplittableRessource |
40 |
* |
41 |
* @param id |
42 |
* the {@link SplittableResource#getRootID() ID} of a the base |
43 |
* data |
44 |
* @param bounds |
45 |
* the location where the partition is to be updated (using |
46 |
* global coordinates) |
47 |
* @param updateData |
48 |
* the updateData (which may only a partitial update, depending |
49 |
* on the bounds set with the last parameter) |
50 |
* @throws RemoteException |
51 |
*/ |
52 |
public void updatePartition(int id, DataPartition updateData, |
53 |
Rectangle bounds) throws RemoteException; |
54 |
|
55 |
/** |
56 |
* Returns the whole Partition with the given ID |
57 |
* |
58 |
* @param id |
59 |
* the id of the partition |
60 |
* @return the partition |
61 |
* @throws RemoteException |
62 |
* if the connection to the server fails |
63 |
*/ |
64 |
public DataPartition getData(int id) throws RemoteException; |
65 |
|
66 |
/** |
67 |
* Adds a Partition to the server |
68 |
* |
69 |
* @param partition |
70 |
* the partition to add |
71 |
* @throws RemoteException |
72 |
*/ |
73 |
public void addData(DataPartition partition) throws RemoteException; |
74 |
|
75 |
/** |
76 |
* Removes the partition with the specified id. |
77 |
* |
78 |
* @param id |
79 |
* id of the partition to remove |
80 |
* @throws RemoteException |
81 |
*/ |
82 |
public void removeData(int id) throws RemoteException; |
83 |
|
84 |
} |