-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathServer2ServerOperations.java
More file actions
70 lines (46 loc) · 1.88 KB
/
Copy pathServer2ServerOperations.java
File metadata and controls
70 lines (46 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import java.net.InetAddress;
import java.net.MulticastSocket;
/**
*
*
* @version 1.0 Jun 2018
* @author Amanda Camacho,
* Benjamin Amos <benjamin.oxi@gmail.com>
*/
// Creo que debe ser un hilo para que pueda estar siempre activo escuchando
public class Server2ServerOperations extends Thread{
private InetAddress ipMulticast;
private MulticastSocket socketMulticast;
private int port;
private int replicationNumber;
private int serverNumber=0; // Todavia no se si lo usaremos estatico o dinamico la cantidad de servidores
// no he pensado la k-tolerancia a fallas y cuales soportaremos(las bizantinas
// son las que tenemos que ver si se puede ), entonces pongo esta
// por siacaso lo hacemos dinamico
//No se que mas se puede necesitar
public Server2ServerOperations(int port, String ipMulticast,int replicationNumber, int serverNumber){
try{
// esto debera funcionar
this.port =port;
this.replicationNumber= replicationNumber;
this.ipMulticast=InetAddress.getByName(ipMulticast);
this.serverNumber=serverNumber;
this.socketMulticast= new MulticastSocket(port);
socketMulticast.joinGroup(this.ipMulticast);
}catch(Exception e){
System.out.println();
System.out.println("java.lang.Exception");
System.out.println(e);
}
}
// Esta funcion debe replicar un repo en todos los servidores de respaldo
public boolean replicateServers(Repo repoToDuplicate){
return true;
}
// este es como el clone
public Repo getRepo(Strin repoName){
}
public void run(){
System.out.println(" iniciando el hilo de las operaciones de servidor y servidor ");
}
}