Service Application: AWS Part 3

Objective: Creating A Search Callback System in Unity

In the previous post,we finished up with the ability to save case files to AWS S3. Now we need to be able to to search for a case using the SearchPanel (shown above), download the file and render it back to the user.

To get started we will try and get a list of all the case files stored in the bucket(I say list but it’s really just going to log each case to the console).

We set up the method and call it when the pressing the FIND CASE # button on the main menu(all shown below). This will be moved into the search panel but for now, it’s an empty call without a case number so this is just to get it working.

We found two cases, shown above after pressing the button (cases are saved using random numbers and not sequenced).

Now that we have a reply with case files, time to test the search function. First we get the GetCaseList to take a string input for the case number. Next we create a string for the target case and take that input. Then we simple check each case key from the response to see if one matches and log the case with case number was found. We have moved from the main menu find case button and now use the Search Panel search button and pass the input field value for the case number using the SearchPanel script and ProcessInfo method.

Now that we can get the list and check for the case, some small refactoring to keep things clean. We import the namespace System.Linq to use Linq to prevent logging all objects and just check for the target case.

Next we check if the case has been found and if so use the S3Client to make a call using the bucket name and target case name to run into a series of steps. We check that the response stream is not null then create a byte array for the data. Following this we create and use a StreamReader to read the response. We then use a MemorySteam which gets written to the byte array. We then use another MemorySteam that takes the data(byte array) and using a BinaryFormatter deserialize the fetched case data which gets converted into the active case.

Finally calling the onComplete callback which triggers moving to the SelectPanel from the ProcessInfo method on the SearchPanel.

--

--

--

Developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Magento Cloud Performance Test 2020

What is Log4J Vulnerability

3 Billion Devices Run Java

Azure build timely updates on Teams channel

Local Deploy to Multiple Emulators and Simulators with Cake

A Git Workflow Using Rebase

What is a Power Query and how to use it

What is a Power Query and how to use it?

Part 3/7 of Python-MongoDB Tutorial Series For Data Scientists

Bits and Bytes of Computer (Google IT Support’s Second Course) Overview

The TCP/IP Five-Layer Network Model

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Simon Leen

Simon Leen

Developer

More from Medium

Load data into Amazon Cloud

CyberArk Application Access Manager (AAM) — How to enable Windows Authentication for Load Balanced…

Picard — Make it so meme

Using TwitchLib to Create a Twitch Chat Bot — Part 2

Integrating Tauk into your Appium Python tests