Search in sources :

Example 1 with AbstractClient

use of ProducerDummy.Client.AbstractClient in project amos2022ss02-audit-chain by amosproj.

the class main method main.

public static void main(String[] args) throws IOException, TimeoutException, InterruptedException, ClassNotFoundException, NoSuchAlgorithmException, InvalidKeyException {
    String filepath = Paths.get("src", "main", "java", "ProducerDummy").toString();
    String filename = "config.properties";
    Path config_path = Paths.get(System.getProperty("user.dir"), filepath, filename);
    Properties p = new Properties();
    FileReader reader = new FileReader(config_path.toString());
    p.load(reader);
    String HOST = p.getProperty("HOST");
    int PORT = Integer.parseInt(p.getProperty("PORT"));
    String USER = p.getProperty("USERNAME");
    String PASSWORD = p.getProperty("PASSWORD");
    String queue_name = "FAKE";
    AbstractClient client = new AggregateClient(HOST, PORT, USER, PASSWORD, queue_name);
    client.start();
    return;
}
Also used : Path(java.nio.file.Path) AbstractClient(ProducerDummy.Client.AbstractClient) FileReader(java.io.FileReader) AggregateClient(ProducerDummy.Client.AggregateClient) Properties(java.util.Properties)

Example 2 with AbstractClient

use of ProducerDummy.Client.AbstractClient in project amos2022ss02-audit-chain by amosproj.

the class main method main.

public static void main(String[] args) throws IOException, TimeoutException {
    String filepath = Paths.get("src", "main", "java", "ConsumerDummy").toString();
    String filename = "config.properties";
    Path config_path = Paths.get(System.getProperty("user.dir"), filepath, filename);
    Properties p = new Properties();
    FileReader reader = new FileReader(config_path.toString());
    p.load(reader);
    String HOST = p.getProperty("HOST");
    int PORT = Integer.parseInt(p.getProperty("PORT"));
    String USER = p.getProperty("USERNAME");
    String PASSWORD = p.getProperty("PASSWORD");
    String queue_name = "FAKE";
    AbstractClient client = new AggregateConsumerClient(HOST, PORT, USER, PASSWORD, queue_name);
    client.start();
    return;
}
Also used : Path(java.nio.file.Path) AbstractClient(ProducerDummy.Client.AbstractClient) FileReader(java.io.FileReader) Properties(java.util.Properties)

Aggregations

AbstractClient (ProducerDummy.Client.AbstractClient)2 FileReader (java.io.FileReader)2 Path (java.nio.file.Path)2 Properties (java.util.Properties)2 AggregateClient (ProducerDummy.Client.AggregateClient)1