-
Notifications
You must be signed in to change notification settings - Fork 0
/
Node.java
30 lines (23 loc) · 871 Bytes
/
Node.java
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
import java.util.*;
import java.io.*;
import java.net.*;
/*
* Node is the interface for the classes Publisher, Broker, Consumer.
* All instances of classes that extend this have access to all the
* ports/ip that each Publisher/Broker uses.
*/
public interface Node {
public static final String ip = "0.0.0.0"; // ADD YOUR IP HERE
public static final int FIRSTPUBLISHER = 4321;
public static final int SECONDPUBLISHER = 3421;
public static final int THIRDPUBLISHER = 5000;
public static final int FIRSTBROKER = 4000;
public static final int SECONDBROKER = 5555;
public static final int THIRDBROKER = 5984;
public static List<Broker> brokers = new ArrayList<>();
public void init(int port) throws UnknownHostException, IOException;
public List<Broker> getBrokers();
public void connect();
public void disconnect();
public void updateNodes();
}