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