Changeset View
Changeset View
Standalone View
Standalone View
docs/images/deposit-update-chart.uml
@startuml | @startuml | ||||
participant CLIENT as "SWORD client\n(eg. HAL)" | participant CLIENT as "SWORD client\n(eg. HAL)" | ||||
participant DEPOSIT as "swh-deposit" | participant DEPOSIT as "swh-deposit" | ||||
participant DEPOSIT_STORAGE as "deposit storage" | participant DEPOSIT_DATABASE as "deposit database" | ||||
activate CLIENT | activate CLIENT | ||||
activate DEPOSIT | activate DEPOSIT | ||||
activate DEPOSIT_STORAGE | activate DEPOSIT_DATABASE | ||||
CLIENT ->> DEPOSIT: POST /1/<collection-name>/\nHEADER In-Progress: true | CLIENT ->> DEPOSIT: POST /1/<collection-name>/\nHEADER In-Progress: true | ||||
DEPOSIT ->> DEPOSIT_STORAGE: check authentication | DEPOSIT ->> DEPOSIT_DATABASE: check authentication | ||||
DEPOSIT_STORAGE -->> DEPOSIT: return ok (if client exists and credentials ok) | DEPOSIT_DATABASE -->> DEPOSIT: return ok (if client exists and credentials ok) | ||||
DEPOSIT -->> CLIENT: return 201, <deposit receipt> | DEPOSIT -->> CLIENT: return 201, <deposit receipt> | ||||
CLIENT -> DEPOSIT: POST/PUT /1/<collection-name>/<deposit-id>/media/\nPOST/PUT /1/<collection-name>/<deposit-id>/metadata/ | CLIENT -> DEPOSIT: POST/PUT /1/<collection-name>/<deposit-id>/media/\nPOST/PUT /1/<collection-name>/<deposit-id>/metadata/ | ||||
DEPOSIT ->> DEPOSIT_STORAGE: check authentication | DEPOSIT ->> DEPOSIT_DATABASE: check authentication | ||||
DEPOSIT_STORAGE -->> DEPOSIT: return ok | DEPOSIT_DATABASE -->> DEPOSIT: return ok | ||||
DEPOSIT ->> DEPOSIT_STORAGE: check inputs() | DEPOSIT ->> DEPOSIT_DATABASE: check inputs() | ||||
alt status is 'partial' | alt status is 'partial' | ||||
DEPOSIT_STORAGE -->> DEPOSIT: return ok | DEPOSIT_DATABASE -->> DEPOSIT: return ok | ||||
alt HEADER: In-Progress = true | alt HEADER: In-Progress = true | ||||
DEPOSIT ->> DEPOSIT_STORAGE: add-or-replace-data-and-update-status('partial') | DEPOSIT ->> DEPOSIT_DATABASE: add-or-replace-data-and-update-status('partial') | ||||
else HEADER: In-Progress = false | else HEADER: In-Progress = false | ||||
DEPOSIT ->> DEPOSIT_STORAGE: add-or-replace-data-and-update-status('deposited') | DEPOSIT ->> DEPOSIT_DATABASE: add-or-replace-data-and-update-status('deposited') | ||||
end | end | ||||
DEPOSIT_STORAGE -->> DEPOSIT: return ok | DEPOSIT_DATABASE -->> DEPOSIT: return ok | ||||
DEPOSIT -->> CLIENT: return 204 | DEPOSIT -->> CLIENT: return 204 | ||||
else status is not partial | else status is not partial | ||||
DEPOSIT_STORAGE -->> DEPOSIT: return ko | DEPOSIT_DATABASE -->> DEPOSIT: return ko | ||||
DEPOSIT -->> CLIENT: return 400, "You can only act on deposit with status partial" | DEPOSIT -->> CLIENT: return 400, "You can only act on deposit with status partial" | ||||
end | end | ||||
@enduml | @enduml |