started task 7
This commit is contained in:
75
.vscode/launch.json
vendored
Normal file
75
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "Run Client (Task 1)",
|
||||||
|
"request": "launch",
|
||||||
|
"cwd": "${workspaceFolder}/week3_TinsaeGhilay/Task 1",
|
||||||
|
"mainClass": "client.Client",
|
||||||
|
"console": "integratedTerminal"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "Run ComputeEngine (Task 1)",
|
||||||
|
"request": "launch",
|
||||||
|
"cwd": "${workspaceFolder}/week3_TinsaeGhilay/Task 1",
|
||||||
|
"mainClass": "engine.ComputeEngine",
|
||||||
|
"console": "integratedTerminal"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "Run Server (Task 2)",
|
||||||
|
"request": "launch",
|
||||||
|
"cwd": "${workspaceFolder}/week3_TinsaeGhilay/Task 2",
|
||||||
|
"mainClass": "server.Server",
|
||||||
|
"preLaunchTask": "build-task2",
|
||||||
|
"console": "integratedTerminal"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "Run Client (Task 2)",
|
||||||
|
"request": "launch",
|
||||||
|
"cwd": "${workspaceFolder}/week3_TinsaeGhilay/Task 2",
|
||||||
|
"mainClass": "client.Client",
|
||||||
|
"preLaunchTask": "build-task2",
|
||||||
|
"console": "integratedTerminal"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "Run Server (Task 5)",
|
||||||
|
"request": "launch",
|
||||||
|
"cwd": "${workspaceFolder}/week3_TinsaeGhilay/Task 5",
|
||||||
|
"mainClass": "server.Server",
|
||||||
|
"preLaunchTask": "build-task5",
|
||||||
|
"console": "integratedTerminal"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "Run Client (Task 5)",
|
||||||
|
"request": "launch",
|
||||||
|
"cwd": "${workspaceFolder}/week3_TinsaeGhilay/Task 5",
|
||||||
|
"mainClass": "client.Client",
|
||||||
|
"preLaunchTask": "build-task5",
|
||||||
|
"console": "integratedTerminal"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "Run HelloWorldServer (Task 7/example)",
|
||||||
|
"request": "launch",
|
||||||
|
"cwd": "${workspaceFolder}/week3_TinsaeGhilay/Task 7/example",
|
||||||
|
"projectName": "example",
|
||||||
|
"mainClass": "org.tinsae.grpc.server.HelloWorldServer",
|
||||||
|
"console": "integratedTerminal"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "Run HelloWorldClient (Task 7/example)",
|
||||||
|
"request": "launch",
|
||||||
|
"cwd": "${workspaceFolder}/week3_TinsaeGhilay/Task 7/example",
|
||||||
|
"projectName": "example",
|
||||||
|
"mainClass": "org.tinsae.grpc.client.HelloWorldClient",
|
||||||
|
"console": "integratedTerminal"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
29
.vscode/tasks.json
vendored
Normal file
29
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "build-task2",
|
||||||
|
"type": "shell",
|
||||||
|
"options": {
|
||||||
|
"cwd": "${workspaceFolder}/week3_TinsaeGhilay/Task 2"
|
||||||
|
},
|
||||||
|
"command": "mkdir -p out && javac -cp \"lib/*\" -d out $(find src -name \"*.java\")",
|
||||||
|
"group": "build",
|
||||||
|
"problemMatcher": [
|
||||||
|
"$javac"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "build-task5",
|
||||||
|
"type": "shell",
|
||||||
|
"options": {
|
||||||
|
"cwd": "${workspaceFolder}/week3_TinsaeGhilay/Task 5"
|
||||||
|
},
|
||||||
|
"command": "mkdir -p out && javac -d out $(find src -name \"*.java\")",
|
||||||
|
"group": "build",
|
||||||
|
"problemMatcher": [
|
||||||
|
"$javac"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -24,6 +24,21 @@
|
|||||||
java -cp "out:lib/*" client.Client
|
java -cp "out:lib/*" client.Client
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Server commands:
|
||||||
|
```java
|
||||||
|
// list of valid commands
|
||||||
|
private String[] commands = {
|
||||||
|
"add",
|
||||||
|
"subtract",
|
||||||
|
"multiply",
|
||||||
|
"divide",
|
||||||
|
"mod",
|
||||||
|
"power",
|
||||||
|
"root",
|
||||||
|
"exit"
|
||||||
|
};
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
### inspecting packets using wireshark.
|
### inspecting packets using wireshark.
|
||||||
***
|
***
|
||||||
|
|||||||
Binary file not shown.
BIN
week3_TinsaeGhilay/Task 2/out/client/InputHandler.class
Normal file
BIN
week3_TinsaeGhilay/Task 2/out/client/InputHandler.class
Normal file
Binary file not shown.
BIN
week3_TinsaeGhilay/Task 2/out/server/Executor.class
Normal file
BIN
week3_TinsaeGhilay/Task 2/out/server/Executor.class
Normal file
Binary file not shown.
Binary file not shown.
@@ -39,23 +39,43 @@ public class Client {
|
|||||||
XmlRpcClient client = new XmlRpcClient();
|
XmlRpcClient client = new XmlRpcClient();
|
||||||
client.setConfig(config);
|
client.setConfig(config);
|
||||||
|
|
||||||
|
InputHandler handler = new InputHandler();
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
// create parameters to be sent to server method in a vector
|
// create parameters to be sent to server method in a vector
|
||||||
// and populate it
|
// and populate it
|
||||||
Vector params = new Vector();
|
Vector params = new Vector();
|
||||||
|
|
||||||
int a = validateInput(scanner);
|
// get two integers from user
|
||||||
int b = validateInput(scanner);
|
// promptForInt returns null if user wants to exit
|
||||||
|
Integer a = handler.promptForInt(scanner);
|
||||||
|
if (a == null) { // user wants to exit
|
||||||
|
notifyExit();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Integer b = handler.promptForInt(scanner);
|
||||||
|
if (b == null) { // user wants to exit
|
||||||
|
notifyExit();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// get command from user
|
||||||
|
String command = handler.promptForCommand(scanner);
|
||||||
|
if (command.equals("exit")) { // user wants to exit
|
||||||
|
notifyExit();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// add parameters to vector
|
||||||
params.addElement(Integer.valueOf(a));
|
params.addElement(Integer.valueOf(a));
|
||||||
params.addElement(Integer.valueOf(b));
|
params.addElement(Integer.valueOf(b));
|
||||||
// make the remote method call
|
// make the remote method call
|
||||||
// the result of the remot call must be an Object
|
// the result of the remot call must be an Object
|
||||||
// and be casted to the appropriate type
|
// and be casted to the appropriate type
|
||||||
Object result = client.execute("sample.add", params);
|
Object result = client.execute("calculator." + command, params);
|
||||||
// process the result
|
// process the result
|
||||||
int sum = ((Integer) result).intValue();
|
int sum = ((Integer) result).intValue();
|
||||||
System.out.println("The sum is: " + sum);
|
System.out.println("The " + handler.mapCommand(command) + " of " + a + " and " + b + " is: " + sum);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,19 +84,8 @@ public class Client {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int validateInput(Scanner scanner) {
|
private static void notifyExit() {
|
||||||
int number;
|
System.out.println("Exit command received. Exiting...");
|
||||||
while (true) {
|
|
||||||
System.out.print("Enter an integer: ");
|
|
||||||
if (scanner.hasNextInt()) {
|
|
||||||
number = scanner.nextInt();
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
System.out.println("Invalid input. Please enter a valid integer.");
|
|
||||||
scanner.next();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
127
week3_TinsaeGhilay/Task 2/src/client/InputHandler.java
Normal file
127
week3_TinsaeGhilay/Task 2/src/client/InputHandler.java
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
package client;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* InputHandler class
|
||||||
|
*
|
||||||
|
* @author Tinsae Ghilay
|
||||||
|
* for handling user inputs
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
public class InputHandler {
|
||||||
|
|
||||||
|
// list of valid commands
|
||||||
|
private String[] commands = {
|
||||||
|
"add",
|
||||||
|
"subtract",
|
||||||
|
"multiply",
|
||||||
|
"divide",
|
||||||
|
"mod",
|
||||||
|
"power",
|
||||||
|
"root",
|
||||||
|
"exit"
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* method to prompt user for a valid integer
|
||||||
|
*
|
||||||
|
* @param scanner Scanner object for user input
|
||||||
|
* @return valid integer input from user
|
||||||
|
*/
|
||||||
|
public Integer promptForInt(Scanner scanner) {
|
||||||
|
Integer number;
|
||||||
|
while (true) {
|
||||||
|
System.out.print("Enter an integer: ");
|
||||||
|
if (scanner.hasNextInt()) {
|
||||||
|
number = scanner.nextInt();
|
||||||
|
scanner.nextLine(); // consume the newline
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
String command = scanner.nextLine();
|
||||||
|
// check if user wants to exit and return null
|
||||||
|
if (command.equalsIgnoreCase("exit")) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
System.out.println("Invalid input. Please enter a valid integer.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* method to prompt user for a valid command
|
||||||
|
*
|
||||||
|
* @param scanner Scanner object for user input
|
||||||
|
* @return valid command input from user
|
||||||
|
*/
|
||||||
|
public String promptForCommand(Scanner scanner) {
|
||||||
|
System.out.print("Enter command (add, subtract, multiply, divide, mod, power, root, exit): ");
|
||||||
|
while (true) {
|
||||||
|
String command = scanner.nextLine().trim().toLowerCase();
|
||||||
|
if (isValidCommand(command)) {
|
||||||
|
return command;
|
||||||
|
} else {
|
||||||
|
System.out.print("Invalid command. Please enter a valid command: ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* helper method to check if command is valid
|
||||||
|
*
|
||||||
|
* @param command
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private boolean isValidCommand(String command) {
|
||||||
|
return Arrays.asList(commands).contains(command.toLowerCase());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getter for commands
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String[] getCommands() {
|
||||||
|
return commands;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getter for command at index
|
||||||
|
*
|
||||||
|
* @param index
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getCommand(int index) {
|
||||||
|
return commands[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* method to map user command to result term
|
||||||
|
*
|
||||||
|
* @param command
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String mapCommand(String command) {
|
||||||
|
switch (command.toLowerCase()) {
|
||||||
|
case "add":
|
||||||
|
return "sum";
|
||||||
|
case "subtract":
|
||||||
|
return "difference";
|
||||||
|
case "multiply":
|
||||||
|
return "product";
|
||||||
|
case "divide":
|
||||||
|
return "quotient";
|
||||||
|
case "mod":
|
||||||
|
return "mod";
|
||||||
|
case "power":
|
||||||
|
return "power";
|
||||||
|
case "root":
|
||||||
|
return "root";
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
91
week3_TinsaeGhilay/Task 2/src/server/Executor.java
Normal file
91
week3_TinsaeGhilay/Task 2/src/server/Executor.java
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
package server;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Executor class for XML-RPC communication
|
||||||
|
*
|
||||||
|
* @author Tinsae Ghilay
|
||||||
|
* based on tutorial from
|
||||||
|
* https://www.tutorialspoint.com/xml-rpc/xml_rpc_examples.htm
|
||||||
|
*/
|
||||||
|
public class Executor {
|
||||||
|
|
||||||
|
// define methods that can be called remotely
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sum of two integers
|
||||||
|
*
|
||||||
|
* @param x
|
||||||
|
* @param y
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Integer add(Integer x, Integer y) {
|
||||||
|
return Integer.valueOf(x + y);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* difference of two integers x - y
|
||||||
|
*
|
||||||
|
* @param x
|
||||||
|
* @param y
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Integer subtract(Integer x, Integer y) {
|
||||||
|
return Integer.valueOf(x - y);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* product of two integers
|
||||||
|
*
|
||||||
|
* @param x
|
||||||
|
* @param y
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Integer multiply(Integer x, Integer y) {
|
||||||
|
return Integer.valueOf(x * y);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* division of two integers x/y
|
||||||
|
*
|
||||||
|
* @param x
|
||||||
|
* @param y
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Double divide(Integer x, Integer y) {
|
||||||
|
return Double.valueOf((double) x / y);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* modulus of two integers
|
||||||
|
*
|
||||||
|
* @param x
|
||||||
|
* @param y
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Integer mod(Integer x, Integer y) {
|
||||||
|
return Integer.valueOf(x % y);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* power of two integers x^y
|
||||||
|
*
|
||||||
|
* @param x
|
||||||
|
* @param y
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Integer power(Integer x, Integer y) {
|
||||||
|
return Integer.valueOf((int) Math.pow(x, y));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* root of two integers X√Y
|
||||||
|
*
|
||||||
|
* @param x
|
||||||
|
* @param y
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Integer root(Integer x, Integer y) {
|
||||||
|
return Integer.valueOf((int) Math.pow(x, 1.0 / y));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -24,20 +24,24 @@ public class Server {
|
|||||||
|
|
||||||
// start XML-RPC server at port 8080
|
// start XML-RPC server at port 8080
|
||||||
WebServer server = new WebServer(8080);
|
WebServer server = new WebServer(8080);
|
||||||
|
|
||||||
XmlRpcServer xmlRpcServer = server.getXmlRpcServer();
|
XmlRpcServer xmlRpcServer = server.getXmlRpcServer();
|
||||||
|
|
||||||
PropertyHandlerMapping phm = new PropertyHandlerMapping();
|
PropertyHandlerMapping phm = new PropertyHandlerMapping();
|
||||||
phm.addHandler("sample", Server.class);
|
|
||||||
|
phm.addHandler("calculator", Executor.class);
|
||||||
|
|
||||||
xmlRpcServer.setHandlerMapping(phm);
|
xmlRpcServer.setHandlerMapping(phm);
|
||||||
|
|
||||||
server.start();
|
server.start();
|
||||||
|
|
||||||
System.out.println(TAG + ": Server started successfully.");
|
System.out.println(TAG + ": Server started successfully.");
|
||||||
|
|
||||||
System.out.println("Accepting requests. (Halt program to stop.)");
|
System.out.println("Accepting requests. (Halt program to stop.)");
|
||||||
|
|
||||||
} catch (Exception e) { // catch exceptions if problems occur
|
} catch (Exception e) { // catch exceptions if problems occur
|
||||||
System.err.println(TAG + ": " + e.getMessage());
|
System.err.println(TAG + ": " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer sum(Integer x, Integer y) {
|
|
||||||
return Integer.valueOf(x + y);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
week3_TinsaeGhilay/Task 3/out/client/Client.class
Normal file
BIN
week3_TinsaeGhilay/Task 3/out/client/Client.class
Normal file
Binary file not shown.
BIN
week3_TinsaeGhilay/Task 3/out/hello/Hello.class
Normal file
BIN
week3_TinsaeGhilay/Task 3/out/hello/Hello.class
Normal file
Binary file not shown.
BIN
week3_TinsaeGhilay/Task 3/out/server/Server.class
Normal file
BIN
week3_TinsaeGhilay/Task 3/out/server/Server.class
Normal file
Binary file not shown.
41
week3_TinsaeGhilay/Task 3/src/client/Client.java
Normal file
41
week3_TinsaeGhilay/Task 3/src/client/Client.java
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
package client;
|
||||||
|
|
||||||
|
// Client/Client.java class represents the client that has to relay on the Hello engine
|
||||||
|
// to perform tasks remotely.
|
||||||
|
// it needs the Hello interface from Hello package
|
||||||
|
import hello.Hello;
|
||||||
|
|
||||||
|
// it also needs those to access the registry,
|
||||||
|
// so it can get remote object reference of the server
|
||||||
|
import java.rmi.registry.LocateRegistry;
|
||||||
|
import java.rmi.registry.Registry;
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
public class Client {
|
||||||
|
private Client() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
// normally, the address of the server is passed here on the command line as an
|
||||||
|
// argument
|
||||||
|
// we get that address from args[0] if provided, else we use null for localhost
|
||||||
|
String host = (args.length < 1) ? null : args[0];
|
||||||
|
String name = "Hello";
|
||||||
|
|
||||||
|
try (Scanner scanner = new Scanner(System.in);) {
|
||||||
|
|
||||||
|
// get the registry from host(server)
|
||||||
|
Registry registry = LocateRegistry.getRegistry(host);
|
||||||
|
|
||||||
|
// look up the remote object by name in the registry
|
||||||
|
// stub is the a reference to the remote object
|
||||||
|
Hello stub = (Hello) registry.lookup(name);
|
||||||
|
String response = stub.sayHello();
|
||||||
|
System.out.println("response: " + response);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.err.println("Client exception: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
week3_TinsaeGhilay/Task 3/src/hello/Hello.java
Normal file
12
week3_TinsaeGhilay/Task 3/src/hello/Hello.java
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
package hello;
|
||||||
|
|
||||||
|
import java.rmi.Remote;
|
||||||
|
import java.rmi.RemoteException;
|
||||||
|
|
||||||
|
// this interface extends the interface "java.rmi.Remote"
|
||||||
|
// so its methods can be invoked from another Java virtual machine
|
||||||
|
public interface Hello extends Remote {
|
||||||
|
|
||||||
|
// say hello method, This is a repeat of task 1(done as part of learning RMI)
|
||||||
|
String sayHello() throws RemoteException;
|
||||||
|
}
|
||||||
56
week3_TinsaeGhilay/Task 3/src/server/Server.java
Normal file
56
week3_TinsaeGhilay/Task 3/src/server/Server.java
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
|
||||||
|
package server;
|
||||||
|
|
||||||
|
import java.rmi.RemoteException;
|
||||||
|
import java.rmi.registry.LocateRegistry;
|
||||||
|
import java.rmi.registry.Registry;
|
||||||
|
import java.rmi.server.UnicastRemoteObject;
|
||||||
|
|
||||||
|
// needs the compute and task interfaces from compute package
|
||||||
|
// define constructor for each
|
||||||
|
// and provide an implementation for each remote method in the remote interfaces
|
||||||
|
import hello.Hello;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The implementation of the Compute interface for the compute engine.
|
||||||
|
* it has to declare the remote class to be implemented (in this case Compute
|
||||||
|
* (implements it)
|
||||||
|
*/
|
||||||
|
public class Server implements Hello {
|
||||||
|
|
||||||
|
public Server() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String sayHello() throws RemoteException {
|
||||||
|
return "Hello, world!";
|
||||||
|
}
|
||||||
|
|
||||||
|
// entry
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
// the code provided on the tutorial was deprecated.
|
||||||
|
// so google led me to
|
||||||
|
// [this](https://docs.oracle.com/javase/8/docs/technotes/guides/rmi/hello/hello-world.html#create)
|
||||||
|
try {
|
||||||
|
String name = "Hello";
|
||||||
|
// create remote object that provides service (server).
|
||||||
|
Hello server = new Server();
|
||||||
|
|
||||||
|
// and export remote object to java RMI runtime
|
||||||
|
// so it may receive remote incoming calls
|
||||||
|
Hello stub = (Hello) UnicastRemoteObject.exportObject(server, 0);
|
||||||
|
// the register the remote object with java RMI registry
|
||||||
|
// the registry is a name service that allows clients get a reference of remote
|
||||||
|
// objects
|
||||||
|
// once a remote object is registered, callers can look up the object by name
|
||||||
|
// and obtain its remote object reference
|
||||||
|
Registry registry = LocateRegistry.getRegistry();
|
||||||
|
registry.rebind(name, stub);
|
||||||
|
System.out.println("Server bound");
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.err.println("Server exception: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
week3_TinsaeGhilay/Task 4/out/client/Client.class
Normal file
BIN
week3_TinsaeGhilay/Task 4/out/client/Client.class
Normal file
Binary file not shown.
BIN
week3_TinsaeGhilay/Task 4/out/compute/Compute.class
Normal file
BIN
week3_TinsaeGhilay/Task 4/out/compute/Compute.class
Normal file
Binary file not shown.
BIN
week3_TinsaeGhilay/Task 4/out/server/Server.class
Normal file
BIN
week3_TinsaeGhilay/Task 4/out/server/Server.class
Normal file
Binary file not shown.
44
week3_TinsaeGhilay/Task 4/src/client/Client.java
Normal file
44
week3_TinsaeGhilay/Task 4/src/client/Client.java
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
package client;
|
||||||
|
|
||||||
|
// Client/Client.java class represents the client that has to relay on the Hello engine
|
||||||
|
// to perform tasks remotely.
|
||||||
|
// it needs the Hello interface from Hello package
|
||||||
|
import compute.Compute;
|
||||||
|
|
||||||
|
// it also needs those to access the registry,
|
||||||
|
// so it can get remote object reference of the server
|
||||||
|
import java.rmi.registry.LocateRegistry;
|
||||||
|
import java.rmi.registry.Registry;
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
public class Client {
|
||||||
|
private Client() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
// normally, the address of the server is passed here on the command line as an
|
||||||
|
// argument
|
||||||
|
// we get that address from args[0] if provided, else we use null for localhost
|
||||||
|
String host = (args.length < 1) ? null : args[0];
|
||||||
|
|
||||||
|
try (Scanner scanner = new Scanner(System.in);) {
|
||||||
|
|
||||||
|
// get the registry from host(server)
|
||||||
|
Registry registry = LocateRegistry.getRegistry(host);
|
||||||
|
|
||||||
|
// look up the remote object by name in the registry
|
||||||
|
// stub is the a reference to the remote object
|
||||||
|
Compute stub = (Compute) registry.lookup(Compute.SERVICE_NAME);
|
||||||
|
boolean isAuthenticated = stub.authenticate();
|
||||||
|
if (isAuthenticated) {
|
||||||
|
System.out.println("Client authenticated successfully. Door opens.");
|
||||||
|
} else {
|
||||||
|
System.out.println("Client authentication failed. Door remains closed.");
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.err.println("Client exception: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
13
week3_TinsaeGhilay/Task 4/src/compute/Compute.java
Normal file
13
week3_TinsaeGhilay/Task 4/src/compute/Compute.java
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
package compute;
|
||||||
|
|
||||||
|
import java.rmi.Remote;
|
||||||
|
import java.rmi.RemoteException;
|
||||||
|
|
||||||
|
// this interface extends the interface "java.rmi.Remote"
|
||||||
|
// so its methods can be invoked from another Java virtual machine
|
||||||
|
public interface Compute extends Remote {
|
||||||
|
static final String SERVICE_NAME = "authenticator";
|
||||||
|
|
||||||
|
// say hello method, This is a repeat of task 1(done as part of learning RMI)
|
||||||
|
boolean authenticate() throws RemoteException;
|
||||||
|
}
|
||||||
65
week3_TinsaeGhilay/Task 4/src/server/Server.java
Normal file
65
week3_TinsaeGhilay/Task 4/src/server/Server.java
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
|
||||||
|
package server;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Server implementation for the Compute interface
|
||||||
|
* @author Tinsae Ghilay
|
||||||
|
*
|
||||||
|
* mimics an authentication service for some client to access a secure resource
|
||||||
|
* (mocked as a door that opens or remains closed based on authentication result)
|
||||||
|
* verification is done randomly for demo purposes
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.rmi.RemoteException;
|
||||||
|
import java.rmi.registry.LocateRegistry;
|
||||||
|
import java.rmi.registry.Registry;
|
||||||
|
import java.rmi.server.UnicastRemoteObject;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
// needs the compute and task interfaces from compute package
|
||||||
|
// define constructor for each
|
||||||
|
// and provide an implementation for each remote method in the remote interfaces
|
||||||
|
import compute.Compute;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The implementation of the Compute interface for the compute engine.
|
||||||
|
* it has to declare the remote class to be implemented (in this case Compute
|
||||||
|
* (implements it)
|
||||||
|
*/
|
||||||
|
public class Server implements Compute {
|
||||||
|
|
||||||
|
public Server() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean authenticate() throws RemoteException {
|
||||||
|
return new Random().nextBoolean();
|
||||||
|
}
|
||||||
|
|
||||||
|
// entry
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
// the code provided on the tutorial was deprecated.
|
||||||
|
// so google led me to
|
||||||
|
// [this](https://docs.oracle.com/javase/8/docs/technotes/guides/rmi/hello/hello-world.html#create)
|
||||||
|
try {
|
||||||
|
// create remote object that provides service (server).
|
||||||
|
Compute server = new Server();
|
||||||
|
|
||||||
|
// and export remote object to java RMI runtime
|
||||||
|
// so it may receive remote incoming calls
|
||||||
|
Compute stub = (Compute) UnicastRemoteObject.exportObject(server, 0);
|
||||||
|
// the register the remote object with java RMI registry
|
||||||
|
// the registry is a name service that allows clients get a reference of remote
|
||||||
|
// objects
|
||||||
|
// once a remote object is registered, callers can look up the object by name
|
||||||
|
// and obtain its remote object reference
|
||||||
|
Registry registry = LocateRegistry.createRegistry(1099);
|
||||||
|
registry.rebind(Compute.SERVICE_NAME, stub);
|
||||||
|
System.out.println("Server bound");
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.err.println("Server exception: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
70
week3_TinsaeGhilay/Task 7/example/pom.xml
Normal file
70
week3_TinsaeGhilay/Task 7/example/pom.xml
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>org.tinsae.grpc</groupId>
|
||||||
|
<artifactId>example</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.grpc</groupId>
|
||||||
|
<artifactId>grpc-netty-shaded</artifactId>
|
||||||
|
<version>1.49.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.grpc</groupId>
|
||||||
|
<artifactId>grpc-protobuf</artifactId>
|
||||||
|
<version>1.49.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.grpc</groupId>
|
||||||
|
<artifactId>grpc-stub</artifactId>
|
||||||
|
<version>1.49.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency> <!-- necessary for Java 9+ -->
|
||||||
|
<groupId>org.apache.tomcat</groupId>
|
||||||
|
<artifactId>annotations-api</artifactId>
|
||||||
|
<version>6.0.53</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<extensions>
|
||||||
|
<extension>
|
||||||
|
<groupId>kr.motd.maven</groupId>
|
||||||
|
<artifactId>os-maven-plugin</artifactId>
|
||||||
|
<version>1.6.2</version>
|
||||||
|
</extension>
|
||||||
|
</extensions>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.xolstice.maven.plugins</groupId>
|
||||||
|
<artifactId>protobuf-maven-plugin</artifactId>
|
||||||
|
<version>0.6.1</version>
|
||||||
|
<configuration>
|
||||||
|
<protocArtifact>com.google.protobuf:protoc:3.21.1:exe:${os.detected.classifier}</protocArtifact>
|
||||||
|
<pluginId>grpc-java</pluginId>
|
||||||
|
<skip>true</skip>
|
||||||
|
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.49.0:exe:${os.detected.classifier}</pluginArtifact>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>compile</goal>
|
||||||
|
<goal>compile-custom</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,567 @@
|
|||||||
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
// source: HelloWorldServiceProtos.proto
|
||||||
|
|
||||||
|
package org.tinsae.grpc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* The response message containing the response
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* Protobuf type {@code org.tinsae.grpc.HelloReply}
|
||||||
|
*/
|
||||||
|
public final class HelloReply extends
|
||||||
|
com.google.protobuf.GeneratedMessageV3 implements
|
||||||
|
// @@protoc_insertion_point(message_implements:org.tinsae.grpc.HelloReply)
|
||||||
|
HelloReplyOrBuilder {
|
||||||
|
private static final long serialVersionUID = 0L;
|
||||||
|
// Use HelloReply.newBuilder() to construct.
|
||||||
|
private HelloReply(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
|
||||||
|
super(builder);
|
||||||
|
}
|
||||||
|
private HelloReply() {
|
||||||
|
message_ = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
@SuppressWarnings({"unused"})
|
||||||
|
protected java.lang.Object newInstance(
|
||||||
|
UnusedPrivateParameter unused) {
|
||||||
|
return new HelloReply();
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public final com.google.protobuf.UnknownFieldSet
|
||||||
|
getUnknownFields() {
|
||||||
|
return this.unknownFields;
|
||||||
|
}
|
||||||
|
private HelloReply(
|
||||||
|
com.google.protobuf.CodedInputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
this();
|
||||||
|
if (extensionRegistry == null) {
|
||||||
|
throw new java.lang.NullPointerException();
|
||||||
|
}
|
||||||
|
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
|
||||||
|
com.google.protobuf.UnknownFieldSet.newBuilder();
|
||||||
|
try {
|
||||||
|
boolean done = false;
|
||||||
|
while (!done) {
|
||||||
|
int tag = input.readTag();
|
||||||
|
switch (tag) {
|
||||||
|
case 0:
|
||||||
|
done = true;
|
||||||
|
break;
|
||||||
|
case 10: {
|
||||||
|
java.lang.String s = input.readStringRequireUtf8();
|
||||||
|
|
||||||
|
message_ = s;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
if (!parseUnknownField(
|
||||||
|
input, unknownFields, extensionRegistry, tag)) {
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||||
|
throw e.setUnfinishedMessage(this);
|
||||||
|
} catch (com.google.protobuf.UninitializedMessageException e) {
|
||||||
|
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
|
||||||
|
} catch (java.io.IOException e) {
|
||||||
|
throw new com.google.protobuf.InvalidProtocolBufferException(
|
||||||
|
e).setUnfinishedMessage(this);
|
||||||
|
} finally {
|
||||||
|
this.unknownFields = unknownFields.build();
|
||||||
|
makeExtensionsImmutable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static final com.google.protobuf.Descriptors.Descriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return org.tinsae.grpc.HelloWorldServiceProtos.internal_static_org_tinsae_grpc_HelloReply_descriptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
|
internalGetFieldAccessorTable() {
|
||||||
|
return org.tinsae.grpc.HelloWorldServiceProtos.internal_static_org_tinsae_grpc_HelloReply_fieldAccessorTable
|
||||||
|
.ensureFieldAccessorsInitialized(
|
||||||
|
org.tinsae.grpc.HelloReply.class, org.tinsae.grpc.HelloReply.Builder.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final int MESSAGE_FIELD_NUMBER = 1;
|
||||||
|
private volatile java.lang.Object message_;
|
||||||
|
/**
|
||||||
|
* <code>string message = 1;</code>
|
||||||
|
* @return The message.
|
||||||
|
*/
|
||||||
|
@java.lang.Override
|
||||||
|
public java.lang.String getMessage() {
|
||||||
|
java.lang.Object ref = message_;
|
||||||
|
if (ref instanceof java.lang.String) {
|
||||||
|
return (java.lang.String) ref;
|
||||||
|
} else {
|
||||||
|
com.google.protobuf.ByteString bs =
|
||||||
|
(com.google.protobuf.ByteString) ref;
|
||||||
|
java.lang.String s = bs.toStringUtf8();
|
||||||
|
message_ = s;
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>string message = 1;</code>
|
||||||
|
* @return The bytes for message.
|
||||||
|
*/
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.ByteString
|
||||||
|
getMessageBytes() {
|
||||||
|
java.lang.Object ref = message_;
|
||||||
|
if (ref instanceof java.lang.String) {
|
||||||
|
com.google.protobuf.ByteString b =
|
||||||
|
com.google.protobuf.ByteString.copyFromUtf8(
|
||||||
|
(java.lang.String) ref);
|
||||||
|
message_ = b;
|
||||||
|
return b;
|
||||||
|
} else {
|
||||||
|
return (com.google.protobuf.ByteString) ref;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private byte memoizedIsInitialized = -1;
|
||||||
|
@java.lang.Override
|
||||||
|
public final boolean isInitialized() {
|
||||||
|
byte isInitialized = memoizedIsInitialized;
|
||||||
|
if (isInitialized == 1) return true;
|
||||||
|
if (isInitialized == 0) return false;
|
||||||
|
|
||||||
|
memoizedIsInitialized = 1;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public void writeTo(com.google.protobuf.CodedOutputStream output)
|
||||||
|
throws java.io.IOException {
|
||||||
|
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) {
|
||||||
|
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, message_);
|
||||||
|
}
|
||||||
|
unknownFields.writeTo(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public int getSerializedSize() {
|
||||||
|
int size = memoizedSize;
|
||||||
|
if (size != -1) return size;
|
||||||
|
|
||||||
|
size = 0;
|
||||||
|
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) {
|
||||||
|
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, message_);
|
||||||
|
}
|
||||||
|
size += unknownFields.getSerializedSize();
|
||||||
|
memoizedSize = size;
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public boolean equals(final java.lang.Object obj) {
|
||||||
|
if (obj == this) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!(obj instanceof org.tinsae.grpc.HelloReply)) {
|
||||||
|
return super.equals(obj);
|
||||||
|
}
|
||||||
|
org.tinsae.grpc.HelloReply other = (org.tinsae.grpc.HelloReply) obj;
|
||||||
|
|
||||||
|
if (!getMessage()
|
||||||
|
.equals(other.getMessage())) return false;
|
||||||
|
if (!unknownFields.equals(other.unknownFields)) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public int hashCode() {
|
||||||
|
if (memoizedHashCode != 0) {
|
||||||
|
return memoizedHashCode;
|
||||||
|
}
|
||||||
|
int hash = 41;
|
||||||
|
hash = (19 * hash) + getDescriptor().hashCode();
|
||||||
|
hash = (37 * hash) + MESSAGE_FIELD_NUMBER;
|
||||||
|
hash = (53 * hash) + getMessage().hashCode();
|
||||||
|
hash = (29 * hash) + unknownFields.hashCode();
|
||||||
|
memoizedHashCode = hash;
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static org.tinsae.grpc.HelloReply parseFrom(
|
||||||
|
java.nio.ByteBuffer data)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloReply parseFrom(
|
||||||
|
java.nio.ByteBuffer data,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloReply parseFrom(
|
||||||
|
com.google.protobuf.ByteString data)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloReply parseFrom(
|
||||||
|
com.google.protobuf.ByteString data,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloReply parseFrom(byte[] data)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloReply parseFrom(
|
||||||
|
byte[] data,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloReply parseFrom(java.io.InputStream input)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseWithIOException(PARSER, input);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloReply parseFrom(
|
||||||
|
java.io.InputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloReply parseDelimitedFrom(java.io.InputStream input)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseDelimitedWithIOException(PARSER, input);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloReply parseDelimitedFrom(
|
||||||
|
java.io.InputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloReply parseFrom(
|
||||||
|
com.google.protobuf.CodedInputStream input)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseWithIOException(PARSER, input);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloReply parseFrom(
|
||||||
|
com.google.protobuf.CodedInputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder newBuilderForType() { return newBuilder(); }
|
||||||
|
public static Builder newBuilder() {
|
||||||
|
return DEFAULT_INSTANCE.toBuilder();
|
||||||
|
}
|
||||||
|
public static Builder newBuilder(org.tinsae.grpc.HelloReply prototype) {
|
||||||
|
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder toBuilder() {
|
||||||
|
return this == DEFAULT_INSTANCE
|
||||||
|
? new Builder() : new Builder().mergeFrom(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected Builder newBuilderForType(
|
||||||
|
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||||
|
Builder builder = new Builder(parent);
|
||||||
|
return builder;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* The response message containing the response
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* Protobuf type {@code org.tinsae.grpc.HelloReply}
|
||||||
|
*/
|
||||||
|
public static final class Builder extends
|
||||||
|
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
|
||||||
|
// @@protoc_insertion_point(builder_implements:org.tinsae.grpc.HelloReply)
|
||||||
|
org.tinsae.grpc.HelloReplyOrBuilder {
|
||||||
|
public static final com.google.protobuf.Descriptors.Descriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return org.tinsae.grpc.HelloWorldServiceProtos.internal_static_org_tinsae_grpc_HelloReply_descriptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
|
internalGetFieldAccessorTable() {
|
||||||
|
return org.tinsae.grpc.HelloWorldServiceProtos.internal_static_org_tinsae_grpc_HelloReply_fieldAccessorTable
|
||||||
|
.ensureFieldAccessorsInitialized(
|
||||||
|
org.tinsae.grpc.HelloReply.class, org.tinsae.grpc.HelloReply.Builder.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Construct using org.tinsae.grpc.HelloReply.newBuilder()
|
||||||
|
private Builder() {
|
||||||
|
maybeForceBuilderInitialization();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Builder(
|
||||||
|
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||||
|
super(parent);
|
||||||
|
maybeForceBuilderInitialization();
|
||||||
|
}
|
||||||
|
private void maybeForceBuilderInitialization() {
|
||||||
|
if (com.google.protobuf.GeneratedMessageV3
|
||||||
|
.alwaysUseFieldBuilders) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder clear() {
|
||||||
|
super.clear();
|
||||||
|
message_ = "";
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.Descriptor
|
||||||
|
getDescriptorForType() {
|
||||||
|
return org.tinsae.grpc.HelloWorldServiceProtos.internal_static_org_tinsae_grpc_HelloReply_descriptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public org.tinsae.grpc.HelloReply getDefaultInstanceForType() {
|
||||||
|
return org.tinsae.grpc.HelloReply.getDefaultInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public org.tinsae.grpc.HelloReply build() {
|
||||||
|
org.tinsae.grpc.HelloReply result = buildPartial();
|
||||||
|
if (!result.isInitialized()) {
|
||||||
|
throw newUninitializedMessageException(result);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public org.tinsae.grpc.HelloReply buildPartial() {
|
||||||
|
org.tinsae.grpc.HelloReply result = new org.tinsae.grpc.HelloReply(this);
|
||||||
|
result.message_ = message_;
|
||||||
|
onBuilt();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder clone() {
|
||||||
|
return super.clone();
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder setField(
|
||||||
|
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||||
|
java.lang.Object value) {
|
||||||
|
return super.setField(field, value);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder clearField(
|
||||||
|
com.google.protobuf.Descriptors.FieldDescriptor field) {
|
||||||
|
return super.clearField(field);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder clearOneof(
|
||||||
|
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
|
||||||
|
return super.clearOneof(oneof);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder setRepeatedField(
|
||||||
|
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||||
|
int index, java.lang.Object value) {
|
||||||
|
return super.setRepeatedField(field, index, value);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder addRepeatedField(
|
||||||
|
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||||
|
java.lang.Object value) {
|
||||||
|
return super.addRepeatedField(field, value);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||||
|
if (other instanceof org.tinsae.grpc.HelloReply) {
|
||||||
|
return mergeFrom((org.tinsae.grpc.HelloReply)other);
|
||||||
|
} else {
|
||||||
|
super.mergeFrom(other);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder mergeFrom(org.tinsae.grpc.HelloReply other) {
|
||||||
|
if (other == org.tinsae.grpc.HelloReply.getDefaultInstance()) return this;
|
||||||
|
if (!other.getMessage().isEmpty()) {
|
||||||
|
message_ = other.message_;
|
||||||
|
onChanged();
|
||||||
|
}
|
||||||
|
this.mergeUnknownFields(other.unknownFields);
|
||||||
|
onChanged();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public final boolean isInitialized() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder mergeFrom(
|
||||||
|
com.google.protobuf.CodedInputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
org.tinsae.grpc.HelloReply parsedMessage = null;
|
||||||
|
try {
|
||||||
|
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
||||||
|
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||||
|
parsedMessage = (org.tinsae.grpc.HelloReply) e.getUnfinishedMessage();
|
||||||
|
throw e.unwrapIOException();
|
||||||
|
} finally {
|
||||||
|
if (parsedMessage != null) {
|
||||||
|
mergeFrom(parsedMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private java.lang.Object message_ = "";
|
||||||
|
/**
|
||||||
|
* <code>string message = 1;</code>
|
||||||
|
* @return The message.
|
||||||
|
*/
|
||||||
|
public java.lang.String getMessage() {
|
||||||
|
java.lang.Object ref = message_;
|
||||||
|
if (!(ref instanceof java.lang.String)) {
|
||||||
|
com.google.protobuf.ByteString bs =
|
||||||
|
(com.google.protobuf.ByteString) ref;
|
||||||
|
java.lang.String s = bs.toStringUtf8();
|
||||||
|
message_ = s;
|
||||||
|
return s;
|
||||||
|
} else {
|
||||||
|
return (java.lang.String) ref;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>string message = 1;</code>
|
||||||
|
* @return The bytes for message.
|
||||||
|
*/
|
||||||
|
public com.google.protobuf.ByteString
|
||||||
|
getMessageBytes() {
|
||||||
|
java.lang.Object ref = message_;
|
||||||
|
if (ref instanceof String) {
|
||||||
|
com.google.protobuf.ByteString b =
|
||||||
|
com.google.protobuf.ByteString.copyFromUtf8(
|
||||||
|
(java.lang.String) ref);
|
||||||
|
message_ = b;
|
||||||
|
return b;
|
||||||
|
} else {
|
||||||
|
return (com.google.protobuf.ByteString) ref;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>string message = 1;</code>
|
||||||
|
* @param value The message to set.
|
||||||
|
* @return This builder for chaining.
|
||||||
|
*/
|
||||||
|
public Builder setMessage(
|
||||||
|
java.lang.String value) {
|
||||||
|
if (value == null) {
|
||||||
|
throw new NullPointerException();
|
||||||
|
}
|
||||||
|
|
||||||
|
message_ = value;
|
||||||
|
onChanged();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>string message = 1;</code>
|
||||||
|
* @return This builder for chaining.
|
||||||
|
*/
|
||||||
|
public Builder clearMessage() {
|
||||||
|
|
||||||
|
message_ = getDefaultInstance().getMessage();
|
||||||
|
onChanged();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>string message = 1;</code>
|
||||||
|
* @param value The bytes for message to set.
|
||||||
|
* @return This builder for chaining.
|
||||||
|
*/
|
||||||
|
public Builder setMessageBytes(
|
||||||
|
com.google.protobuf.ByteString value) {
|
||||||
|
if (value == null) {
|
||||||
|
throw new NullPointerException();
|
||||||
|
}
|
||||||
|
checkByteStringIsUtf8(value);
|
||||||
|
|
||||||
|
message_ = value;
|
||||||
|
onChanged();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public final Builder setUnknownFields(
|
||||||
|
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||||
|
return super.setUnknownFields(unknownFields);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public final Builder mergeUnknownFields(
|
||||||
|
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||||
|
return super.mergeUnknownFields(unknownFields);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(builder_scope:org.tinsae.grpc.HelloReply)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(class_scope:org.tinsae.grpc.HelloReply)
|
||||||
|
private static final org.tinsae.grpc.HelloReply DEFAULT_INSTANCE;
|
||||||
|
static {
|
||||||
|
DEFAULT_INSTANCE = new org.tinsae.grpc.HelloReply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static org.tinsae.grpc.HelloReply getDefaultInstance() {
|
||||||
|
return DEFAULT_INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final com.google.protobuf.Parser<HelloReply>
|
||||||
|
PARSER = new com.google.protobuf.AbstractParser<HelloReply>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public HelloReply parsePartialFrom(
|
||||||
|
com.google.protobuf.CodedInputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return new HelloReply(input, extensionRegistry);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public static com.google.protobuf.Parser<HelloReply> parser() {
|
||||||
|
return PARSER;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Parser<HelloReply> getParserForType() {
|
||||||
|
return PARSER;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public org.tinsae.grpc.HelloReply getDefaultInstanceForType() {
|
||||||
|
return DEFAULT_INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
// source: HelloWorldServiceProtos.proto
|
||||||
|
|
||||||
|
package org.tinsae.grpc;
|
||||||
|
|
||||||
|
public interface HelloReplyOrBuilder extends
|
||||||
|
// @@protoc_insertion_point(interface_extends:org.tinsae.grpc.HelloReply)
|
||||||
|
com.google.protobuf.MessageOrBuilder {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>string message = 1;</code>
|
||||||
|
* @return The message.
|
||||||
|
*/
|
||||||
|
java.lang.String getMessage();
|
||||||
|
/**
|
||||||
|
* <code>string message = 1;</code>
|
||||||
|
* @return The bytes for message.
|
||||||
|
*/
|
||||||
|
com.google.protobuf.ByteString
|
||||||
|
getMessageBytes();
|
||||||
|
}
|
||||||
@@ -0,0 +1,567 @@
|
|||||||
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
// source: HelloWorldServiceProtos.proto
|
||||||
|
|
||||||
|
package org.tinsae.grpc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* The request message containing the user's name
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* Protobuf type {@code org.tinsae.grpc.HelloRequest}
|
||||||
|
*/
|
||||||
|
public final class HelloRequest extends
|
||||||
|
com.google.protobuf.GeneratedMessageV3 implements
|
||||||
|
// @@protoc_insertion_point(message_implements:org.tinsae.grpc.HelloRequest)
|
||||||
|
HelloRequestOrBuilder {
|
||||||
|
private static final long serialVersionUID = 0L;
|
||||||
|
// Use HelloRequest.newBuilder() to construct.
|
||||||
|
private HelloRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
|
||||||
|
super(builder);
|
||||||
|
}
|
||||||
|
private HelloRequest() {
|
||||||
|
name_ = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
@SuppressWarnings({"unused"})
|
||||||
|
protected java.lang.Object newInstance(
|
||||||
|
UnusedPrivateParameter unused) {
|
||||||
|
return new HelloRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public final com.google.protobuf.UnknownFieldSet
|
||||||
|
getUnknownFields() {
|
||||||
|
return this.unknownFields;
|
||||||
|
}
|
||||||
|
private HelloRequest(
|
||||||
|
com.google.protobuf.CodedInputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
this();
|
||||||
|
if (extensionRegistry == null) {
|
||||||
|
throw new java.lang.NullPointerException();
|
||||||
|
}
|
||||||
|
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
|
||||||
|
com.google.protobuf.UnknownFieldSet.newBuilder();
|
||||||
|
try {
|
||||||
|
boolean done = false;
|
||||||
|
while (!done) {
|
||||||
|
int tag = input.readTag();
|
||||||
|
switch (tag) {
|
||||||
|
case 0:
|
||||||
|
done = true;
|
||||||
|
break;
|
||||||
|
case 10: {
|
||||||
|
java.lang.String s = input.readStringRequireUtf8();
|
||||||
|
|
||||||
|
name_ = s;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
if (!parseUnknownField(
|
||||||
|
input, unknownFields, extensionRegistry, tag)) {
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||||
|
throw e.setUnfinishedMessage(this);
|
||||||
|
} catch (com.google.protobuf.UninitializedMessageException e) {
|
||||||
|
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
|
||||||
|
} catch (java.io.IOException e) {
|
||||||
|
throw new com.google.protobuf.InvalidProtocolBufferException(
|
||||||
|
e).setUnfinishedMessage(this);
|
||||||
|
} finally {
|
||||||
|
this.unknownFields = unknownFields.build();
|
||||||
|
makeExtensionsImmutable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static final com.google.protobuf.Descriptors.Descriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return org.tinsae.grpc.HelloWorldServiceProtos.internal_static_org_tinsae_grpc_HelloRequest_descriptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
|
internalGetFieldAccessorTable() {
|
||||||
|
return org.tinsae.grpc.HelloWorldServiceProtos.internal_static_org_tinsae_grpc_HelloRequest_fieldAccessorTable
|
||||||
|
.ensureFieldAccessorsInitialized(
|
||||||
|
org.tinsae.grpc.HelloRequest.class, org.tinsae.grpc.HelloRequest.Builder.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final int NAME_FIELD_NUMBER = 1;
|
||||||
|
private volatile java.lang.Object name_;
|
||||||
|
/**
|
||||||
|
* <code>string name = 1;</code>
|
||||||
|
* @return The name.
|
||||||
|
*/
|
||||||
|
@java.lang.Override
|
||||||
|
public java.lang.String getName() {
|
||||||
|
java.lang.Object ref = name_;
|
||||||
|
if (ref instanceof java.lang.String) {
|
||||||
|
return (java.lang.String) ref;
|
||||||
|
} else {
|
||||||
|
com.google.protobuf.ByteString bs =
|
||||||
|
(com.google.protobuf.ByteString) ref;
|
||||||
|
java.lang.String s = bs.toStringUtf8();
|
||||||
|
name_ = s;
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>string name = 1;</code>
|
||||||
|
* @return The bytes for name.
|
||||||
|
*/
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.ByteString
|
||||||
|
getNameBytes() {
|
||||||
|
java.lang.Object ref = name_;
|
||||||
|
if (ref instanceof java.lang.String) {
|
||||||
|
com.google.protobuf.ByteString b =
|
||||||
|
com.google.protobuf.ByteString.copyFromUtf8(
|
||||||
|
(java.lang.String) ref);
|
||||||
|
name_ = b;
|
||||||
|
return b;
|
||||||
|
} else {
|
||||||
|
return (com.google.protobuf.ByteString) ref;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private byte memoizedIsInitialized = -1;
|
||||||
|
@java.lang.Override
|
||||||
|
public final boolean isInitialized() {
|
||||||
|
byte isInitialized = memoizedIsInitialized;
|
||||||
|
if (isInitialized == 1) return true;
|
||||||
|
if (isInitialized == 0) return false;
|
||||||
|
|
||||||
|
memoizedIsInitialized = 1;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public void writeTo(com.google.protobuf.CodedOutputStream output)
|
||||||
|
throws java.io.IOException {
|
||||||
|
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
|
||||||
|
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
|
||||||
|
}
|
||||||
|
unknownFields.writeTo(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public int getSerializedSize() {
|
||||||
|
int size = memoizedSize;
|
||||||
|
if (size != -1) return size;
|
||||||
|
|
||||||
|
size = 0;
|
||||||
|
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
|
||||||
|
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
|
||||||
|
}
|
||||||
|
size += unknownFields.getSerializedSize();
|
||||||
|
memoizedSize = size;
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public boolean equals(final java.lang.Object obj) {
|
||||||
|
if (obj == this) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!(obj instanceof org.tinsae.grpc.HelloRequest)) {
|
||||||
|
return super.equals(obj);
|
||||||
|
}
|
||||||
|
org.tinsae.grpc.HelloRequest other = (org.tinsae.grpc.HelloRequest) obj;
|
||||||
|
|
||||||
|
if (!getName()
|
||||||
|
.equals(other.getName())) return false;
|
||||||
|
if (!unknownFields.equals(other.unknownFields)) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public int hashCode() {
|
||||||
|
if (memoizedHashCode != 0) {
|
||||||
|
return memoizedHashCode;
|
||||||
|
}
|
||||||
|
int hash = 41;
|
||||||
|
hash = (19 * hash) + getDescriptor().hashCode();
|
||||||
|
hash = (37 * hash) + NAME_FIELD_NUMBER;
|
||||||
|
hash = (53 * hash) + getName().hashCode();
|
||||||
|
hash = (29 * hash) + unknownFields.hashCode();
|
||||||
|
memoizedHashCode = hash;
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static org.tinsae.grpc.HelloRequest parseFrom(
|
||||||
|
java.nio.ByteBuffer data)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloRequest parseFrom(
|
||||||
|
java.nio.ByteBuffer data,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloRequest parseFrom(
|
||||||
|
com.google.protobuf.ByteString data)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloRequest parseFrom(
|
||||||
|
com.google.protobuf.ByteString data,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloRequest parseFrom(byte[] data)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloRequest parseFrom(
|
||||||
|
byte[] data,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloRequest parseFrom(java.io.InputStream input)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseWithIOException(PARSER, input);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloRequest parseFrom(
|
||||||
|
java.io.InputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloRequest parseDelimitedFrom(java.io.InputStream input)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseDelimitedWithIOException(PARSER, input);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloRequest parseDelimitedFrom(
|
||||||
|
java.io.InputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloRequest parseFrom(
|
||||||
|
com.google.protobuf.CodedInputStream input)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseWithIOException(PARSER, input);
|
||||||
|
}
|
||||||
|
public static org.tinsae.grpc.HelloRequest parseFrom(
|
||||||
|
com.google.protobuf.CodedInputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder newBuilderForType() { return newBuilder(); }
|
||||||
|
public static Builder newBuilder() {
|
||||||
|
return DEFAULT_INSTANCE.toBuilder();
|
||||||
|
}
|
||||||
|
public static Builder newBuilder(org.tinsae.grpc.HelloRequest prototype) {
|
||||||
|
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder toBuilder() {
|
||||||
|
return this == DEFAULT_INSTANCE
|
||||||
|
? new Builder() : new Builder().mergeFrom(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected Builder newBuilderForType(
|
||||||
|
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||||
|
Builder builder = new Builder(parent);
|
||||||
|
return builder;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* The request message containing the user's name
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* Protobuf type {@code org.tinsae.grpc.HelloRequest}
|
||||||
|
*/
|
||||||
|
public static final class Builder extends
|
||||||
|
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
|
||||||
|
// @@protoc_insertion_point(builder_implements:org.tinsae.grpc.HelloRequest)
|
||||||
|
org.tinsae.grpc.HelloRequestOrBuilder {
|
||||||
|
public static final com.google.protobuf.Descriptors.Descriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return org.tinsae.grpc.HelloWorldServiceProtos.internal_static_org_tinsae_grpc_HelloRequest_descriptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
|
internalGetFieldAccessorTable() {
|
||||||
|
return org.tinsae.grpc.HelloWorldServiceProtos.internal_static_org_tinsae_grpc_HelloRequest_fieldAccessorTable
|
||||||
|
.ensureFieldAccessorsInitialized(
|
||||||
|
org.tinsae.grpc.HelloRequest.class, org.tinsae.grpc.HelloRequest.Builder.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Construct using org.tinsae.grpc.HelloRequest.newBuilder()
|
||||||
|
private Builder() {
|
||||||
|
maybeForceBuilderInitialization();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Builder(
|
||||||
|
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||||
|
super(parent);
|
||||||
|
maybeForceBuilderInitialization();
|
||||||
|
}
|
||||||
|
private void maybeForceBuilderInitialization() {
|
||||||
|
if (com.google.protobuf.GeneratedMessageV3
|
||||||
|
.alwaysUseFieldBuilders) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder clear() {
|
||||||
|
super.clear();
|
||||||
|
name_ = "";
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.Descriptor
|
||||||
|
getDescriptorForType() {
|
||||||
|
return org.tinsae.grpc.HelloWorldServiceProtos.internal_static_org_tinsae_grpc_HelloRequest_descriptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public org.tinsae.grpc.HelloRequest getDefaultInstanceForType() {
|
||||||
|
return org.tinsae.grpc.HelloRequest.getDefaultInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public org.tinsae.grpc.HelloRequest build() {
|
||||||
|
org.tinsae.grpc.HelloRequest result = buildPartial();
|
||||||
|
if (!result.isInitialized()) {
|
||||||
|
throw newUninitializedMessageException(result);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public org.tinsae.grpc.HelloRequest buildPartial() {
|
||||||
|
org.tinsae.grpc.HelloRequest result = new org.tinsae.grpc.HelloRequest(this);
|
||||||
|
result.name_ = name_;
|
||||||
|
onBuilt();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder clone() {
|
||||||
|
return super.clone();
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder setField(
|
||||||
|
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||||
|
java.lang.Object value) {
|
||||||
|
return super.setField(field, value);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder clearField(
|
||||||
|
com.google.protobuf.Descriptors.FieldDescriptor field) {
|
||||||
|
return super.clearField(field);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder clearOneof(
|
||||||
|
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
|
||||||
|
return super.clearOneof(oneof);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder setRepeatedField(
|
||||||
|
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||||
|
int index, java.lang.Object value) {
|
||||||
|
return super.setRepeatedField(field, index, value);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder addRepeatedField(
|
||||||
|
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||||
|
java.lang.Object value) {
|
||||||
|
return super.addRepeatedField(field, value);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||||
|
if (other instanceof org.tinsae.grpc.HelloRequest) {
|
||||||
|
return mergeFrom((org.tinsae.grpc.HelloRequest)other);
|
||||||
|
} else {
|
||||||
|
super.mergeFrom(other);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder mergeFrom(org.tinsae.grpc.HelloRequest other) {
|
||||||
|
if (other == org.tinsae.grpc.HelloRequest.getDefaultInstance()) return this;
|
||||||
|
if (!other.getName().isEmpty()) {
|
||||||
|
name_ = other.name_;
|
||||||
|
onChanged();
|
||||||
|
}
|
||||||
|
this.mergeUnknownFields(other.unknownFields);
|
||||||
|
onChanged();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public final boolean isInitialized() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder mergeFrom(
|
||||||
|
com.google.protobuf.CodedInputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
org.tinsae.grpc.HelloRequest parsedMessage = null;
|
||||||
|
try {
|
||||||
|
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
||||||
|
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||||
|
parsedMessage = (org.tinsae.grpc.HelloRequest) e.getUnfinishedMessage();
|
||||||
|
throw e.unwrapIOException();
|
||||||
|
} finally {
|
||||||
|
if (parsedMessage != null) {
|
||||||
|
mergeFrom(parsedMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private java.lang.Object name_ = "";
|
||||||
|
/**
|
||||||
|
* <code>string name = 1;</code>
|
||||||
|
* @return The name.
|
||||||
|
*/
|
||||||
|
public java.lang.String getName() {
|
||||||
|
java.lang.Object ref = name_;
|
||||||
|
if (!(ref instanceof java.lang.String)) {
|
||||||
|
com.google.protobuf.ByteString bs =
|
||||||
|
(com.google.protobuf.ByteString) ref;
|
||||||
|
java.lang.String s = bs.toStringUtf8();
|
||||||
|
name_ = s;
|
||||||
|
return s;
|
||||||
|
} else {
|
||||||
|
return (java.lang.String) ref;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>string name = 1;</code>
|
||||||
|
* @return The bytes for name.
|
||||||
|
*/
|
||||||
|
public com.google.protobuf.ByteString
|
||||||
|
getNameBytes() {
|
||||||
|
java.lang.Object ref = name_;
|
||||||
|
if (ref instanceof String) {
|
||||||
|
com.google.protobuf.ByteString b =
|
||||||
|
com.google.protobuf.ByteString.copyFromUtf8(
|
||||||
|
(java.lang.String) ref);
|
||||||
|
name_ = b;
|
||||||
|
return b;
|
||||||
|
} else {
|
||||||
|
return (com.google.protobuf.ByteString) ref;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>string name = 1;</code>
|
||||||
|
* @param value The name to set.
|
||||||
|
* @return This builder for chaining.
|
||||||
|
*/
|
||||||
|
public Builder setName(
|
||||||
|
java.lang.String value) {
|
||||||
|
if (value == null) {
|
||||||
|
throw new NullPointerException();
|
||||||
|
}
|
||||||
|
|
||||||
|
name_ = value;
|
||||||
|
onChanged();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>string name = 1;</code>
|
||||||
|
* @return This builder for chaining.
|
||||||
|
*/
|
||||||
|
public Builder clearName() {
|
||||||
|
|
||||||
|
name_ = getDefaultInstance().getName();
|
||||||
|
onChanged();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>string name = 1;</code>
|
||||||
|
* @param value The bytes for name to set.
|
||||||
|
* @return This builder for chaining.
|
||||||
|
*/
|
||||||
|
public Builder setNameBytes(
|
||||||
|
com.google.protobuf.ByteString value) {
|
||||||
|
if (value == null) {
|
||||||
|
throw new NullPointerException();
|
||||||
|
}
|
||||||
|
checkByteStringIsUtf8(value);
|
||||||
|
|
||||||
|
name_ = value;
|
||||||
|
onChanged();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public final Builder setUnknownFields(
|
||||||
|
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||||
|
return super.setUnknownFields(unknownFields);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public final Builder mergeUnknownFields(
|
||||||
|
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||||
|
return super.mergeUnknownFields(unknownFields);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(builder_scope:org.tinsae.grpc.HelloRequest)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(class_scope:org.tinsae.grpc.HelloRequest)
|
||||||
|
private static final org.tinsae.grpc.HelloRequest DEFAULT_INSTANCE;
|
||||||
|
static {
|
||||||
|
DEFAULT_INSTANCE = new org.tinsae.grpc.HelloRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static org.tinsae.grpc.HelloRequest getDefaultInstance() {
|
||||||
|
return DEFAULT_INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final com.google.protobuf.Parser<HelloRequest>
|
||||||
|
PARSER = new com.google.protobuf.AbstractParser<HelloRequest>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public HelloRequest parsePartialFrom(
|
||||||
|
com.google.protobuf.CodedInputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return new HelloRequest(input, extensionRegistry);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public static com.google.protobuf.Parser<HelloRequest> parser() {
|
||||||
|
return PARSER;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Parser<HelloRequest> getParserForType() {
|
||||||
|
return PARSER;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public org.tinsae.grpc.HelloRequest getDefaultInstanceForType() {
|
||||||
|
return DEFAULT_INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
// source: HelloWorldServiceProtos.proto
|
||||||
|
|
||||||
|
package org.tinsae.grpc;
|
||||||
|
|
||||||
|
public interface HelloRequestOrBuilder extends
|
||||||
|
// @@protoc_insertion_point(interface_extends:org.tinsae.grpc.HelloRequest)
|
||||||
|
com.google.protobuf.MessageOrBuilder {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>string name = 1;</code>
|
||||||
|
* @return The name.
|
||||||
|
*/
|
||||||
|
java.lang.String getName();
|
||||||
|
/**
|
||||||
|
* <code>string name = 1;</code>
|
||||||
|
* @return The bytes for name.
|
||||||
|
*/
|
||||||
|
com.google.protobuf.ByteString
|
||||||
|
getNameBytes();
|
||||||
|
}
|
||||||
@@ -0,0 +1,291 @@
|
|||||||
|
package org.tinsae.grpc;
|
||||||
|
|
||||||
|
import static io.grpc.MethodDescriptor.generateFullMethodName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* The greeting service definition
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@javax.annotation.Generated(
|
||||||
|
value = "by gRPC proto compiler (version 1.49.0)",
|
||||||
|
comments = "Source: HelloWorldServiceProtos.proto")
|
||||||
|
@io.grpc.stub.annotations.GrpcGenerated
|
||||||
|
public final class HelloWorldServiceGrpc {
|
||||||
|
|
||||||
|
private HelloWorldServiceGrpc() {}
|
||||||
|
|
||||||
|
public static final String SERVICE_NAME = "org.tinsae.grpc.HelloWorldService";
|
||||||
|
|
||||||
|
// Static method descriptors that strictly reflect the proto.
|
||||||
|
private static volatile io.grpc.MethodDescriptor<org.tinsae.grpc.HelloRequest,
|
||||||
|
org.tinsae.grpc.HelloReply> getSayHelloMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "sayHello",
|
||||||
|
requestType = org.tinsae.grpc.HelloRequest.class,
|
||||||
|
responseType = org.tinsae.grpc.HelloReply.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<org.tinsae.grpc.HelloRequest,
|
||||||
|
org.tinsae.grpc.HelloReply> getSayHelloMethod() {
|
||||||
|
io.grpc.MethodDescriptor<org.tinsae.grpc.HelloRequest, org.tinsae.grpc.HelloReply> getSayHelloMethod;
|
||||||
|
if ((getSayHelloMethod = HelloWorldServiceGrpc.getSayHelloMethod) == null) {
|
||||||
|
synchronized (HelloWorldServiceGrpc.class) {
|
||||||
|
if ((getSayHelloMethod = HelloWorldServiceGrpc.getSayHelloMethod) == null) {
|
||||||
|
HelloWorldServiceGrpc.getSayHelloMethod = getSayHelloMethod =
|
||||||
|
io.grpc.MethodDescriptor.<org.tinsae.grpc.HelloRequest, org.tinsae.grpc.HelloReply>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "sayHello"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
org.tinsae.grpc.HelloRequest.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
org.tinsae.grpc.HelloReply.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new HelloWorldServiceMethodDescriptorSupplier("sayHello"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getSayHelloMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new async stub that supports all call types for the service
|
||||||
|
*/
|
||||||
|
public static HelloWorldServiceStub newStub(io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<HelloWorldServiceStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<HelloWorldServiceStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public HelloWorldServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new HelloWorldServiceStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return HelloWorldServiceStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
|
||||||
|
*/
|
||||||
|
public static HelloWorldServiceBlockingStub newBlockingStub(
|
||||||
|
io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<HelloWorldServiceBlockingStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<HelloWorldServiceBlockingStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public HelloWorldServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new HelloWorldServiceBlockingStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return HelloWorldServiceBlockingStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new ListenableFuture-style stub that supports unary calls on the service
|
||||||
|
*/
|
||||||
|
public static HelloWorldServiceFutureStub newFutureStub(
|
||||||
|
io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<HelloWorldServiceFutureStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<HelloWorldServiceFutureStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public HelloWorldServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new HelloWorldServiceFutureStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return HelloWorldServiceFutureStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* The greeting service definition
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public static abstract class HelloWorldServiceImplBase implements io.grpc.BindableService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void sayHello(org.tinsae.grpc.HelloRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<org.tinsae.grpc.HelloReply> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSayHelloMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
|
||||||
|
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
|
||||||
|
.addMethod(
|
||||||
|
getSayHelloMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
org.tinsae.grpc.HelloRequest,
|
||||||
|
org.tinsae.grpc.HelloReply>(
|
||||||
|
this, METHODID_SAY_HELLO)))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* The greeting service definition
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public static final class HelloWorldServiceStub extends io.grpc.stub.AbstractAsyncStub<HelloWorldServiceStub> {
|
||||||
|
private HelloWorldServiceStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected HelloWorldServiceStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new HelloWorldServiceStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void sayHello(org.tinsae.grpc.HelloRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<org.tinsae.grpc.HelloReply> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getSayHelloMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* The greeting service definition
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public static final class HelloWorldServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<HelloWorldServiceBlockingStub> {
|
||||||
|
private HelloWorldServiceBlockingStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected HelloWorldServiceBlockingStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new HelloWorldServiceBlockingStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public org.tinsae.grpc.HelloReply sayHello(org.tinsae.grpc.HelloRequest request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getSayHelloMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* The greeting service definition
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public static final class HelloWorldServiceFutureStub extends io.grpc.stub.AbstractFutureStub<HelloWorldServiceFutureStub> {
|
||||||
|
private HelloWorldServiceFutureStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected HelloWorldServiceFutureStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new HelloWorldServiceFutureStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<org.tinsae.grpc.HelloReply> sayHello(
|
||||||
|
org.tinsae.grpc.HelloRequest request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getSayHelloMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final int METHODID_SAY_HELLO = 0;
|
||||||
|
|
||||||
|
private static final class MethodHandlers<Req, Resp> implements
|
||||||
|
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
|
||||||
|
private final HelloWorldServiceImplBase serviceImpl;
|
||||||
|
private final int methodId;
|
||||||
|
|
||||||
|
MethodHandlers(HelloWorldServiceImplBase serviceImpl, int methodId) {
|
||||||
|
this.serviceImpl = serviceImpl;
|
||||||
|
this.methodId = methodId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
@java.lang.SuppressWarnings("unchecked")
|
||||||
|
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||||
|
switch (methodId) {
|
||||||
|
case METHODID_SAY_HELLO:
|
||||||
|
serviceImpl.sayHello((org.tinsae.grpc.HelloRequest) request,
|
||||||
|
(io.grpc.stub.StreamObserver<org.tinsae.grpc.HelloReply>) responseObserver);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
@java.lang.SuppressWarnings("unchecked")
|
||||||
|
public io.grpc.stub.StreamObserver<Req> invoke(
|
||||||
|
io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||||
|
switch (methodId) {
|
||||||
|
default:
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static abstract class HelloWorldServiceBaseDescriptorSupplier
|
||||||
|
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
|
||||||
|
HelloWorldServiceBaseDescriptorSupplier() {}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
|
||||||
|
return org.tinsae.grpc.HelloWorldServiceProtos.getDescriptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
|
||||||
|
return getFileDescriptor().findServiceByName("HelloWorldService");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class HelloWorldServiceFileDescriptorSupplier
|
||||||
|
extends HelloWorldServiceBaseDescriptorSupplier {
|
||||||
|
HelloWorldServiceFileDescriptorSupplier() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class HelloWorldServiceMethodDescriptorSupplier
|
||||||
|
extends HelloWorldServiceBaseDescriptorSupplier
|
||||||
|
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
|
||||||
|
private final String methodName;
|
||||||
|
|
||||||
|
HelloWorldServiceMethodDescriptorSupplier(String methodName) {
|
||||||
|
this.methodName = methodName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
|
||||||
|
return getServiceDescriptor().findMethodByName(methodName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||||
|
|
||||||
|
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||||
|
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||||
|
if (result == null) {
|
||||||
|
synchronized (HelloWorldServiceGrpc.class) {
|
||||||
|
result = serviceDescriptor;
|
||||||
|
if (result == null) {
|
||||||
|
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
|
||||||
|
.setSchemaDescriptor(new HelloWorldServiceFileDescriptorSupplier())
|
||||||
|
.addMethod(getSayHelloMethod())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.tinsae.grpc;
|
||||||
|
|
||||||
|
import io.grpc.stub.StreamObserver;
|
||||||
|
|
||||||
|
public class HelloWorldServiceImpl extends
|
||||||
|
HelloWorldServiceGrpc.HelloWorldServiceImplBase {
|
||||||
|
@Override
|
||||||
|
public void sayHello(HelloRequest req, StreamObserver<HelloReply> responseObserver) {
|
||||||
|
|
||||||
|
System.out.println("Hello! Received: " + req.getName());
|
||||||
|
|
||||||
|
System.out.println("Sending back: Hello " + req.getName());
|
||||||
|
|
||||||
|
HelloReply reply = HelloReply.newBuilder().setMessage("Hello " + req.getName()).build();
|
||||||
|
|
||||||
|
responseObserver.onNext(reply);
|
||||||
|
|
||||||
|
responseObserver.onCompleted();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
// source: HelloWorldServiceProtos.proto
|
||||||
|
|
||||||
|
package org.tinsae.grpc;
|
||||||
|
|
||||||
|
public final class HelloWorldServiceProtos {
|
||||||
|
private HelloWorldServiceProtos() {}
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistryLite registry) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistry registry) {
|
||||||
|
registerAllExtensions(
|
||||||
|
(com.google.protobuf.ExtensionRegistryLite) registry);
|
||||||
|
}
|
||||||
|
static final com.google.protobuf.Descriptors.Descriptor
|
||||||
|
internal_static_org_tinsae_grpc_HelloRequest_descriptor;
|
||||||
|
static final
|
||||||
|
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
|
internal_static_org_tinsae_grpc_HelloRequest_fieldAccessorTable;
|
||||||
|
static final com.google.protobuf.Descriptors.Descriptor
|
||||||
|
internal_static_org_tinsae_grpc_HelloReply_descriptor;
|
||||||
|
static final
|
||||||
|
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
|
internal_static_org_tinsae_grpc_HelloReply_fieldAccessorTable;
|
||||||
|
|
||||||
|
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return descriptor;
|
||||||
|
}
|
||||||
|
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
descriptor;
|
||||||
|
static {
|
||||||
|
java.lang.String[] descriptorData = {
|
||||||
|
"\n\035HelloWorldServiceProtos.proto\022\017org.tin" +
|
||||||
|
"sae.grpc\"\034\n\014HelloRequest\022\014\n\004name\030\001 \001(\t\"\035" +
|
||||||
|
"\n\nHelloReply\022\017\n\007message\030\001 \001(\t2[\n\021HelloWo" +
|
||||||
|
"rldService\022F\n\010sayHello\022\035.org.tinsae.grpc" +
|
||||||
|
".HelloRequest\032\033.org.tinsae.grpc.HelloRep" +
|
||||||
|
"lyB,\n\017org.tinsae.grpcB\027HelloWorldService" +
|
||||||
|
"ProtosP\001b\006proto3"
|
||||||
|
};
|
||||||
|
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
.internalBuildGeneratedFileFrom(descriptorData,
|
||||||
|
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||||
|
});
|
||||||
|
internal_static_org_tinsae_grpc_HelloRequest_descriptor =
|
||||||
|
getDescriptor().getMessageTypes().get(0);
|
||||||
|
internal_static_org_tinsae_grpc_HelloRequest_fieldAccessorTable = new
|
||||||
|
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||||
|
internal_static_org_tinsae_grpc_HelloRequest_descriptor,
|
||||||
|
new java.lang.String[] { "Name", });
|
||||||
|
internal_static_org_tinsae_grpc_HelloReply_descriptor =
|
||||||
|
getDescriptor().getMessageTypes().get(1);
|
||||||
|
internal_static_org_tinsae_grpc_HelloReply_fieldAccessorTable = new
|
||||||
|
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||||
|
internal_static_org_tinsae_grpc_HelloReply_descriptor,
|
||||||
|
new java.lang.String[] { "Message", });
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(outer_class_scope)
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package org.tinsae.grpc.client;
|
||||||
|
|
||||||
|
import org.tinsae.grpc.HelloReply;
|
||||||
|
import org.tinsae.grpc.HelloRequest;
|
||||||
|
import org.tinsae.grpc.HelloWorldServiceGrpc;
|
||||||
|
import io.grpc.ManagedChannel;
|
||||||
|
import io.grpc.ManagedChannelBuilder;
|
||||||
|
|
||||||
|
public class HelloWorldClient {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost",
|
||||||
|
8080)
|
||||||
|
.usePlaintext()
|
||||||
|
.build();
|
||||||
|
|
||||||
|
HelloWorldServiceGrpc.HelloWorldServiceBlockingStub stub = HelloWorldServiceGrpc.newBlockingStub(channel);
|
||||||
|
|
||||||
|
HelloRequest request = HelloRequest.newBuilder().setName("Andrea").build();
|
||||||
|
|
||||||
|
HelloReply response = stub.sayHello(request);
|
||||||
|
|
||||||
|
System.out.println("Response: " + response.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package org.tinsae.grpc.server;
|
||||||
|
|
||||||
|
import org.tinsae.grpc.HelloWorldServiceImpl;
|
||||||
|
import io.grpc.Server;
|
||||||
|
import io.grpc.ServerBuilder;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class HelloWorldServer {
|
||||||
|
public static void main(String[] args) throws IOException,
|
||||||
|
InterruptedException {
|
||||||
|
Server server = ServerBuilder.forPort(8080)
|
||||||
|
.addService(new HelloWorldServiceImpl())
|
||||||
|
.build();
|
||||||
|
server.start();
|
||||||
|
System.out.println("Server started...");
|
||||||
|
server.awaitTermination();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
option java_multiple_files = true;
|
||||||
|
option java_package = "org.tinsae.grpc";
|
||||||
|
option java_outer_classname = "HelloWorldServiceProtos";
|
||||||
|
|
||||||
|
package org.tinsae.grpc;
|
||||||
|
|
||||||
|
// The greeting service definition
|
||||||
|
service HelloWorldService {
|
||||||
|
rpc sayHello ( HelloRequest) returns ( HelloReply);
|
||||||
|
}
|
||||||
|
|
||||||
|
// The request message containing the user's name
|
||||||
|
message HelloRequest {
|
||||||
|
string name = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The response message containing the response
|
||||||
|
message HelloReply {
|
||||||
|
string message = 1;
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
|
|||||||
|
artifactId=example
|
||||||
|
groupId=org.tinsae.grpc
|
||||||
|
version=1.0-SNAPSHOT
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
org/tinsae/grpc/HelloReply$1.class
|
||||||
|
org/tinsae/grpc/HelloWorldServiceGrpc$HelloWorldServiceFileDescriptorSupplier.class
|
||||||
|
org/tinsae/grpc/HelloWorldServiceGrpc$3.class
|
||||||
|
org/tinsae/grpc/client/HelloWorldClient.class
|
||||||
|
org/tinsae/grpc/HelloRequestOrBuilder.class
|
||||||
|
org/tinsae/grpc/HelloWorldServiceGrpc$HelloWorldServiceImplBase.class
|
||||||
|
org/tinsae/grpc/HelloWorldServiceGrpc$1.class
|
||||||
|
org/tinsae/grpc/HelloRequest.class
|
||||||
|
org/tinsae/grpc/HelloWorldServiceGrpc$HelloWorldServiceMethodDescriptorSupplier.class
|
||||||
|
org/tinsae/grpc/server/HelloWorldServer.class
|
||||||
|
org/tinsae/grpc/HelloWorldServiceGrpc$HelloWorldServiceBaseDescriptorSupplier.class
|
||||||
|
org/tinsae/grpc/HelloRequest$1.class
|
||||||
|
org/tinsae/grpc/HelloReplyOrBuilder.class
|
||||||
|
org/tinsae/grpc/HelloWorldServiceGrpc$MethodHandlers.class
|
||||||
|
org/tinsae/grpc/HelloWorldServiceProtos.class
|
||||||
|
org/tinsae/grpc/HelloWorldServiceImpl.class
|
||||||
|
org/tinsae/grpc/HelloWorldServiceGrpc.class
|
||||||
|
org/tinsae/grpc/HelloWorldServiceGrpc$HelloWorldServiceStub.class
|
||||||
|
org/tinsae/grpc/HelloReply$Builder.class
|
||||||
|
org/tinsae/grpc/HelloRequest$Builder.class
|
||||||
|
org/tinsae/grpc/HelloWorldServiceGrpc$HelloWorldServiceBlockingStub.class
|
||||||
|
org/tinsae/grpc/HelloWorldServiceGrpc$2.class
|
||||||
|
org/tinsae/grpc/HelloWorldServiceGrpc$HelloWorldServiceFutureStub.class
|
||||||
|
org/tinsae/grpc/HelloReply.class
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
/home/tgk/Repos/Trusted/DistributedSystems/week3_TinsaeGhilay/Task 7/example/src/main/java/org/tinsae/grpc/HelloReply.java
|
||||||
|
/home/tgk/Repos/Trusted/DistributedSystems/week3_TinsaeGhilay/Task 7/example/src/main/java/org/tinsae/grpc/HelloReplyOrBuilder.java
|
||||||
|
/home/tgk/Repos/Trusted/DistributedSystems/week3_TinsaeGhilay/Task 7/example/src/main/java/org/tinsae/grpc/HelloRequest.java
|
||||||
|
/home/tgk/Repos/Trusted/DistributedSystems/week3_TinsaeGhilay/Task 7/example/src/main/java/org/tinsae/grpc/HelloRequestOrBuilder.java
|
||||||
|
/home/tgk/Repos/Trusted/DistributedSystems/week3_TinsaeGhilay/Task 7/example/src/main/java/org/tinsae/grpc/HelloWorldServiceGrpc.java
|
||||||
|
/home/tgk/Repos/Trusted/DistributedSystems/week3_TinsaeGhilay/Task 7/example/src/main/java/org/tinsae/grpc/HelloWorldServiceImpl.java
|
||||||
|
/home/tgk/Repos/Trusted/DistributedSystems/week3_TinsaeGhilay/Task 7/example/src/main/java/org/tinsae/grpc/HelloWorldServiceProtos.java
|
||||||
|
/home/tgk/Repos/Trusted/DistributedSystems/week3_TinsaeGhilay/Task 7/example/src/main/java/org/tinsae/grpc/client/HelloWorldClient.java
|
||||||
|
/home/tgk/Repos/Trusted/DistributedSystems/week3_TinsaeGhilay/Task 7/example/src/main/java/org/tinsae/grpc/server/HelloWorldServer.java
|
||||||
7
week3_TinsaeGhilay/solutions.txt
Normal file
7
week3_TinsaeGhilay/solutions.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
Exercise 1: not mandatory
|
||||||
|
Exercise 2: done 100%
|
||||||
|
Exercise 3: done 100%
|
||||||
|
Exercise 4: not mandatory
|
||||||
|
Exercise 5: done 100%
|
||||||
|
Exercise 6: not mandatory
|
||||||
|
Exercise 7: done 100%
|
||||||
Reference in New Issue
Block a user