Reference no: EM132164086
Network and Distributed Computing Assignment -
Your task in this assignment is to implement four distinct applications. Two applications will be architected in a microservice-based manner running in separate web apps on the same instance of Apache Tomcat. Two applications will be command-line applications consuming the endpoints exposed by the micro services.
Application 1 - Identity Service
The identity service provides user authorisation. It will expose two endpoints. It should be deployed to the context path 'identity'.
The first endpoint is named Login. It exposes two methods:
- String login(String username, String password)
- Boolean logout(String key)
The second endpoint is named Authorisation. It will expose one method:
- Boolean authorise(String key)
Application 2 - Currency Service
The currency service manages all aspects of currency listing and conversion. It will expose two endpoints. It should be deployed to the context path 'currency'.
The first endpoint is named Conversion. It will expose three methods:
- String[] listRates()
- Double rate Of(String from CurrencyCode, String to CurrencyCode)
- Double convert(String fromCurrencyCode, String toCurrencyCode, Double amount)
The second endpoint is named Admin. It will expose eight methods:
- Boolean addCurrency(String sessionKey, String currencyCode)
- Boolean removeCurrency(String sessionKey, String currencyCode)
- String[] listCurrencies(String sessionKey)
- String[] conversionsFor(String sessionKey, String currencyCode)
- Boolean addRate(String sessionKey, String fromCurrencyCode, String toCurrencyCode, Double conversionRate)
- Boolean updateRate(String sessionKey, String fromCurrencyCode, String toCurrencyCode, Double rate)
- Boolean removeRate(String sessionKey, String fromCurrencyCode, String toCurrencyCode)
- String[] listRates(String sessionKey)
Application 3 - Admin Client
The Admin Client is a command line application which allows an administrator to manage the Conversion Service. It will consume services offered by the Admin endpoint. It must be implemented in a Java class called 'AdminClient'. Do not place this class in a package!
The functionality of the Admin Client mirrors the functionality offered by the Admin endpoint. It is simply exposing it through a terminal interface. However, the client must facilitate the ability for a user to authenticate with the Identity Service, and hence pass the session key to all calls to the Admin endpoint.
Application 4 - Conversion Client
The Conversion Client is a command line application which allows a user to calculate currency conversions. It will consume services offered by the Conversion endpoint. It must be implemented in a Java class called 'CurrencyClient'. Do not place this class in a package!
The application does not require a user to login, all functionality is unrestricted. The application will present the user with a prompt. This is a free-form text prompt. The user may type one of 4 commands at the prompt, supplying all required parameters. After a command is executed, the application will return to the prompt.
If an invalid command is supplied, the application will present an error and return to the prompt.
Attachment:- Assignment Files.rar