Updating deployment README with local deployment workflow updates
@@ -7,14 +7,14 @@ Represents the json document which contains the desired state for the device
# Startup
1. [***DeploymentService***](/src/main/java/com/aws/iot/evergreen/deployment/DeploymentService.java) starts as an
-evergreen service and initializes [***IotJobsHelper***](/src/main/java/com/aws/iot/evergreen/deployment/IotJobsHelper) and initiates the connection to AWS Iot via the
-*IotJobsHelper*
-2. *IotJobsHelper* connects to AWS Iot cloud and subscribes to the Iot jobs mqtt topics. *IotJobsHelper* and
-*DeploymentService* communicate via a Queue.
+evergreen service and initializes [***IotJobsHelper***](/src/main/java/com/aws/iot/evergreen/deployment/IotJobsHelper.java).
+2. *IotJobsHelper* connects to AWS Iot cloud and subscribes to the Iot jobs mqtt topics.
+3. As part of dependency injection, DeploymentService also initializes a Queue called *DeploymentsQueue*, which holds
+*Deployment* objects. *IotJobsHelper* and *DeploymentService* communicate via the *DeploymentsQueue*.
# Workflow
## Successful deployment via IotJobs
-1. [***IotJobsHelper***](/src/main/java/com/aws/iot/evergreen/deployment/IotJobsHelper) receives notification when
+1. [***IotJobsHelper***](/src/main/java/com/aws/iot/evergreen/deployment/IotJobsHelper.java) receives notification when
- A new job is created in cloud.
- A job is completed (FAILED/SUCCEEDED)
- A job is cancelled
@@ -25,10 +25,11 @@ the chronological order of creation of jobs in cloud. Cancellation of a job in c
list. If a device is processing a job (with job id "1"), it means the status of this job is IN_PROGRESS. If the
device requests for next pending job at this time then it will receive job with JobId "1"
3. Upon receiving a QUEUED job document helper creates the *Deployment* object and passes it to *DeploymentService*
+via the *DeploymentsQueue*
4. *DeploymentService* polls the queue and upon receiving a Deployment, starts processing the deployment and stores
-the id of the deployment it is currently processing
-5. *DeploymentService* waits for the deployment to get completed and then updates the status of the job in the cloud.
- Service only processes one deployment at a time
+the id and type (IOT_JOBS) of the deployment it is currently processing
+5. *DeploymentService* waits for the deployment to get completed and then invokes [***DeploymentStatusKeeper***](/src/main/java/com/aws/iot/evergreen/deployment/DeploymentStatusKeeper.java)
+to update the status of the job in the cloud. Service only processes one deployment at a time
## Cancellation of deployment via IotJobs
1. For cancellation of any job which was not yet processed by device does not require any action from device
@@ -36,5 +37,14 @@ the id of the deployment it is currently processing
request the next pending job and will get either the next job in list or an empty list (if nothing is there)
3. Device then identifies that the current job "Job1" has been cancelled and attempts to cancel the ongoing "Job1"
+## Successful deployment via LOCAL
+1. [***LocalDeploymentListener***](/src/main/java/com/aws/iot/evergreen/deployment/LocalDeploymentListener.java)
+receives
+the instruction from CLI to create a deployment. Upon getting such instruction *LocalDeploymentListener* create a
+*Deployment* object and put it in *DeploymentsQueue*
+2. *DeploymentService* polls the queue and upon receiving a Deployment, starts processing the deployment and stores
+ the id and type (LOCAL) of the deployment it is currently processing
+3. *DeploymentService* waits for the deployment to get completed and then invokes [***DeploymentStatusKeeper***](/src/main/java/com/aws/iot/evergreen/deployment/DeploymentStatusKeeper.java)
+to update the status of the job. Currently *DeploymentStatusKeeper* does not do anything for LOCAL deployment types
