Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Instructions To prepare you for this assignment, read the module 3 content and follow the embedded learning activities. Read the following scenario: As a continuation of the previous assignment,...

1 answer below »
Instructions
To prepare you for this assignment, read the module 3 content and follow the embedded learning activities.
Read the following scenario:
As a continuation of the previous assignment, review the following scenario. Code&Code is a small company dedicated to Software Development. Their engineering team to which you belong, is working on writing a Web Application as an MVP for a new customer.
The code name for this App is “Loggy”, which is meant to offer functionality for a personal journal where users can log their daily activities through text, voice and video.
You have moved forward a few weeks ahead and have finished the core functionality. The challenge you have in front of you now, is to perform additional actions to attachments such as, automatic translation, transcoding, automatic closed captioning. These actions are triggered once the media file is uploaded.
As an initial step, you must create the skeleton of the back-end service for performing the automatic closed captioning under these assumptions:
The closed captioning is performed through an external service (AWS or GCloud).
There should be an internal controller that:
Receives the recordings to be processed from a requeste
Sends the recordings to the external service
Receives its response
Updates the recoding with the resulting closed captioning; and
Responds back to the requeste
The recordings can be processed simultaneously, but there is a limit of only 5 concu
ent processes that can be handled by the sender.
Therefore, there should be a queue that will act as a buffer for the overhead.
Once the recording is processed, the external service responds with a callback, therefore a listener should be ready to receive that request and update the object with a text file containing the strings for the closed captioning.
Only audio and video can be processed.
The processing time depends of the length of the recording.
Task
Main class
Write a Main class that you will use as the simulator for testing you Classes
Closed-captioning controlle
Write the class that will simulate the recording to be processed, which contains an id, the media, a length and the strings for closed captioning.
Write a class that will be the actual controller (or spooler).
Write a class that will act as the worker for processing closed captioning though an external service
Implement the queue and callback actions
Submission
Your submission should include:
Java code of your final solution.
Report of your observations on the changes you had to do to your code while following the recommended steps. Add snippets of code to the report to show intermediate steps.
Remember that although the scenario and resulting model may be used for future activities, the main goal is to practice what you have learned in this module, so do not be wo
ied about finding the perfect solution for this case. And keep in mind that System.out.println() will be enough for the purposes of illustrating your model.
Answered 1 days After Nov 27, 2022

Solution

Aditi answered on Nov 28 2022
37 Votes
Assignment
public class Main {

public static void main(String[] args) {
ClosedCaptioningController controller = new ClosedCaptioningController();
Recording recording = new Recording(1, "media", 10, "strings for closed captioning");
controller.processRecording(recording);

}

}
public class ClosedCaptioningController {

private static final int MAX_CONCURRENT_PROCESSES = 5;

private Queue queue;

public ClosedCaptioningController() {

this.queue = new LinkedList
();

}

public void processRecording(Recording recording) {
if (queue.size() == MAX_CONCURRENT_PROCESSES) {
while (queue.size() == MAX_CONCURRENT_PROCESSES) {

try {

Thread.sleep(1000);

} catch (Inte
uptedException e) {
}

}

}
queue.add(recording);
new Thread(new Runnable() {

@Ove
ide

public void run() {
queue.remove(recording);
ClosedCaptioningWorker worker = new ClosedCaptioningWorker();
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here