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_STORAGE as "deposit storage" | ||||
activate CLIENT | activate CLIENT | ||||
activate DEPOSIT | activate DEPOSIT | ||||
activate DEPOSIT_STORAGE | activate DEPOSIT_STORAGE | ||||
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_STORAGE: check authentication | ||||
DEPOSIT_STORAGE -->> DEPOSIT: return ok (if client exists and credentials ok) | DEPOSIT_STORAGE -->> DEPOSIT: return ok (if client exists and credentials ok) | ||||
DEPOSIT -->> CLIENT: return 201, <deposit receipt> | DEPOSIT -->> CLIENT: return 201, <deposit receipt> | ||||
loop while status is 'partial' | |||||
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_STORAGE: check authentication | ||||
DEPOSIT_STORAGE -->> DEPOSIT: return ok | DEPOSIT_STORAGE -->> DEPOSIT: return ok | ||||
DEPOSIT ->> DEPOSIT_STORAGE: check inputs() | DEPOSIT ->> DEPOSIT_STORAGE: check inputs() | ||||
DEPOSIT_STORAGE -->> DEPOSIT: return ok | |||||
alt status is 'partial' | |||||
DEPOSIT_STORAGE -->> 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_STORAGE: 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('ready') | DEPOSIT ->> DEPOSIT_STORAGE: add-or-replace-data-and-update-status('deposited') | ||||
end | end | ||||
DEPOSIT_STORAGE -->> DEPOSIT: return ok | DEPOSIT_STORAGE -->> DEPOSIT: return ok | ||||
DEPOSIT -->> CLIENT: return 204 | |||||
else status is not partial | |||||
DEPOSIT_STORAGE -->> DEPOSIT: return ko | |||||
DEPOSIT -->> CLIENT: return 400, "You can only act on deposit with status partial" | |||||
end | end | ||||
DEPOSIT -->> CLIENT: return 201, <deposit receipt>\nreturn 204 | |||||
@enduml | @enduml |