1. Homepage
  2. Programming
  3. ACP Assignment 2 Specifications (Programming Task)

ACP Assignment 2 Specifications (Programming Task)

Engage in a Conversation
ACPJavaThe University of Edinburgh

ACP Assignment 2 Specifications (Programming Task) CourseNana.COM

18.02.2024 CourseNana.COM

In this assignment you are supposed to implement a service which provides several endpoints to communicate with other services / Kafka. CourseNana.COM

The auto-marker will call your endpoints using POST. CourseNana.COM

Scenario: / list CourseNana.COM

Your main tasks can be summarized as follows (no changes from assignment 1): CourseNana.COM

  1. Create a Java-REST-Service CourseNana.COM

  2. Place the service in a docker image CourseNana.COM

- amd64 as target architecture – not arm64 (this is relevant for the Mac users!) CourseNana.COM

3. save the docker image in a file called acp_submission_image.tar (it is in TAR format anyhow) CourseNana.COM

ACP Assignment 2 Specifications (Programming Task) CourseNana.COM

  1. place the file acp_submission_image.tar into your root directory of your solution our directory would look something like this CourseNana.COM

    acp_submission_2 CourseNana.COM

    acp_submission_image.tar CourseNana.COM

    src (the Java sources...) main CourseNana.COM

    ... ... CourseNana.COM

  2. Create a ZIP file of your solution directory CourseNana.COM

  3. upload the ZIP as your submission in Learn CourseNana.COM

General information: CourseNana.COM

All connection information to connect to Kafka will be passed into the endpoints using a list of key-values as JSON in the BOD of the request. The topics are passed in the URL CourseNana.COM

Info: Due to this passing as JSON in the body, we have no classical ET methods, only POST, as ET is not intended to carry any payload in the body of the request CourseNana.COM

o The properties used in all Kafka-examples we did are of type Properties (h ps //docs.oracle.com/javase/8/docs/api/java/util/Properties.html) CourseNana.COM

o A property is in principle only a collection of key – value pairs and this is what you will receive int the request. An array of key – value pairs CourseNana.COM

           [
              { “key” : “value” },
              { “key” : “value” }

] CourseNana.COM

As an example this could look like CourseNana.COM

           [
              { “bootstrap.servers”: “...server address...” },
              { “sasl.jaas.config” : “...config / connect string...” },
              { “security.protocol” : “SASL_SSL” },
              { “sasl.mechanism” : “PLAIN” },
              { “group.id” : “...group identifier...” },

ACP Assignment 2 Specifications (Programming Task) CourseNana.COM

{ “storage.server” : “...base url of storage server...” } ] CourseNana.COM

The last entry is new, only needed for the storage service and not present in every request.
Only requests where the storage service is to be used, will have this entry. CourseNana.COM

o So, you must read your standard properties and apply the passed in ones (overwrite) your loaded ones to be ready for the access
This way, you can always test in your local environment with just your defaults (and pass in an empty array – so no overrides happen) and during testing, you will receive the necessary information
CourseNana.COM

For the storage services you can assume h p //acp-
storage.a urewebsites.net/
as a base address. This is hosted on a small instance, so sometimes the requests can be slow. CourseNana.COM

ou can test using e.g. curl h ps //acp-storage.a urewebsites.net/list/blob to list all existing BLOB records CourseNana.COM

o All JSON passed in will be always in the syntactical correct format, so you can ignore error handling there. What you still have to check is that the data gives you a proper connection and no wrong address or invalid user / password is passed (so classical flow errors in an application). CourseNana.COM

  • Parameters given as {...} in the task will be replaced at runtime with the corresponding value. So, for the first task readTopic/{topicName} could become readTopic/topic123 CourseNana.COM

  • Every writing to a Kafka topic should use your student id as key CourseNana.COM

  • The points after a task are the maximum achievable points for the individual task CourseNana.COM

  • 200 shall be returned for all OK operations, 400 for problems and 500 only in case you did not catch an exception – which will cause a penalty in points, as exceptions are to be caught by you and only 400 returned. CourseNana.COM

    The auto-marker will not force to produce 500 codes, yet should a 500 arise this is a clear indicator that you didn’t catch an exception... CourseNana.COM

    The provided and used storage service has additional features: CourseNana.COM

    Write data to a BLOB CourseNana.COM

    https://acp-storage.azurewebsites.net/write/blob
    

ACP Assignment 2 Specifications (Programming Task) CourseNana.COM

List all BLOBs CourseNana.COM

https://acp-storage.azurewebsites.net/list/blob
Read the data structure from the BLOB
https://acp-storage.azurewebsites.net/read/blob/ba20ea3b-aa49-439f-bea6-cee55be6bc7b

ACP Assignment 2 Specifications (Programming Task) CourseNana.COM

The REST-Service has to provide the following endpoints (all POST): CourseNana.COM

  • (4) readTopic/{topicName}
    Return the data read from the topic {topicName} as a String from the service CourseNana.COM

  • (4) writeTopic/{topicName}/{data} Write the data {data} to topic {topicName} CourseNana.COM

  • (7) transformMessage/{readTopic}/{writeTopic}
    Read String data from {readTopic}, convert to uppercase and write to {writeTopic} CourseNana.COM

  • (9) store/{readTopic}/{writeTopic} CourseNana.COM

    • -  Read String data from {readTopic} CourseNana.COM

    • -  Write it to a BLOB using the storage service (passed in in the properties) where the actual URL to use is composed of baseUrl + /write/blob CourseNana.COM

      For this to succeed the BOD of the request has to have the following JSON object CourseNana.COM

              {
                 "uid": "your student id",
      
                 "datasetName": "whatever you want",
      
                 "data": "the data read from {readTopic}"
              }
      
    • -  The storage service returns a UUID (not a string!) as result, which you have to CourseNana.COM

    • -  write to {writeTopic} CourseNana.COM

  • (11) retrieve/{writeTopic}/{uuid}
    Read the BLOB for the passed UUID and write the entire JSON structure into the topic CourseNana.COM

    using your student id as key
    The last request is the most complex one. On a logical level this would work out like
    CourseNana.COM

    • -  Read data from topic ABC -> “XXX” CourseNana.COM

    • -  Write the data as a BLOB and get the UUID for the BLOB CourseNana.COM

    • -  Write the UUID to a topic using your student id as key and the UUID as value CourseNana.COM

ACP Assignment 2 Specifications (Programming Task) CourseNana.COM

The following should be considered when implementing the REST-service: CourseNana.COM

  • Do proper checking for URLs, data, etc. Don’t handle anything not accurate (you will receive error data and requests!) CourseNana.COM

  • our endpoint names have to match the specification CourseNana.COM

  • Storing data in a REST service either has to be done on a per session, or (as not CourseNana.COM

    differently specified) could be done on a global basis. Up to you. CourseNana.COM

  • Test your endpoints using a tool like Postman or curl. Plain Chrome / Firefox, etc. will CourseNana.COM

    do equally for the ET operations CourseNana.COM

  • The filename for the docker image file has to be exactly as defined as well as the CourseNana.COM

    location of it in the ZIP-file. Should you be in doubt, use copy & paste to get the name right CourseNana.COM

    Should you need help: CourseNana.COM

See the literature links in Week 3, 4 and 5. ou should find most information there CourseNana.COM

Marking: CourseNana.COM

This programming task has a maximum mark of 35 / 100 points in relation to the entire ACP mark for the course (essay task will be 30 / 100 in relation to the entire ACP mark for assignment 2). CourseNana.COM

The marks will be allocated purely on auto-tests based on the following criteria CourseNana.COM

Proper runnable docker image Proper behavior (functionality) Proper error handling
Proper status codes CourseNana.COM

Should you fail to provide a runnable docker image according to the specification or provide no source code in the submission, no marking will be possible, and you will receive 0 points. CourseNana.COM

Additional information sources CourseNana.COM

h ps //www.codejava.net/frameworks/spring-boot/file-download-upload-rest-api- examples CourseNana.COM

If you cannot find an answer to your question, please post it on Piazza, though try CourseNana.COM

finding it yourself first, please (as we have only limited capacity) CourseNana.COM

Disclaimer: We will not able to answer last minute questions right before the deadline, so CourseNana.COM

please make sure you start the assignment in good time CourseNana.COM

ACP Assignment 2 Specifications (Programming Task) CourseNana.COM

CourseNana.COM

h ps //d one.com/articles/java-springboot-rest-api-to-uploaddownload-file-on
h ps //medium.com/techinpieces/how-to-upload-files-using-rest-service-with-java- CourseNana.COM

jersey-jax-rs-on-tomcat-847dc0e6a179 CourseNana.COM

ACP Assignment 2 Specifications (Programming Task)  CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
ACP代写,Java代写,The University of Edinburgh代写,ACP代编,Java代编,The University of Edinburgh代编,ACP代考,Java代考,The University of Edinburgh代考,ACPhelp,Javahelp,The University of Edinburghhelp,ACP作业代写,Java作业代写,The University of Edinburgh作业代写,ACP编程代写,Java编程代写,The University of Edinburgh编程代写,ACPprogramming help,Javaprogramming help,The University of Edinburghprogramming help,ACPassignment help,Javaassignment help,The University of Edinburghassignment help,ACPsolution,Javasolution,The University of Edinburghsolution,