private static void sendRequestToServer(int opt) throws RemoteException { String response = null; switch (opt) { case 1: { response = HashMap_Operations.put(); break; } case 2: { response = HashMap_Operations.get(); break; } case 3: { response = HashMap_Operations.delete(); break; } } ClientLogger.logEntry("INFO", "Response from server - " + response); System.out.println(response + "\n"); }
// create server stub and recursively get user input public static void createClientRequest(String sAddr) { // Creating the connection by creating server stub try { HashMap_Operations.createConnection(sAddr); } catch (MalformedURLException me) { ClientLogger.logEntry("SEVERE", "MalformedURLException - " + me); } catch (NotBoundException ne) { ClientLogger.logEntry("SEVERE", "NotBoundException - " + ne); } // Getting the user request and processing it System.out.println("\n-----CLIENT SERVICE INITIATED-----\n"); while (isContinue) { getUserRequest(); } System.out.println("\n-----CLIENT SERVICE TERMINATED-----\n"); }