@startuml
participant "Event\nService" as event
participant IRIS
database "Transfer\nArea" as transfer
participant "Metadata\nCollection\nService" as MCS
database "Metadata\nDatabase" as MDB
participant "Metadata\nAccess\nService" as MAS
participant "Detector Data\nCopy Service" as DDCS
participant "Science Data\nStorage Service" as SDSS
database "Summit\nPermanent\nStore" as store
participant "Science Data\nAccess Service" as SDAS
database "Data\nInformation\nDatabase" as DIB
participant "Migration\nService" as MS
database "HQ Store" as hq
database "CAOM Database" as caom
database "Cloud\nStorage" as cloud
IRIS -> event : publish observe event
event -> MCS : receive observe event
event -> MCS : collect metadata
MCS -> MDB : write snapshot
IRIS -> IRIS: exposures taken
IRIS -> event : publish observe event
event -> MCS : receive observe event
event -> MCS : collect metadata
MCS -> MDB : write snapshot
IRIS -> transfer : write data w/\nminimal header
DDCS -> MAS : query for metadata
MAS -> MDB : retrieve snapshot
MAS -> MAS: create FITS header
MAS -> DDCS : return FITS header
DDCS -> transfer : read data
DDCS -> SDSS : create DIB entry
SDSS -> DIB : create entry with path and URI
SDSS -> DDCS : return path and URI
DDCS -> store : copy file from transfer\narea to summit storage path
DDCS -> MAS : query for FITS header
MAS -> DDCS : return FITS header
DDCS -> store: update file with full header
DDCS -> event: publish observe event
DDCS -> SDSS: update DIB entry
SDSS -> MAS: query for metadata
MAS -> SDSS: return metadata
SDSS -> DIB: update entry with metadata
DDCS -> VIZ: publish image
MS -> SDAS: request list of new file(s)
SDAS -> DIB: query for list of new file(s)
DIB -> SDAS: return list of new file(s)
SDAS -> MS: send list of new file(s) to migrate
MS -> SDAS: request download of new file(s)
SDAS -> MS: send new file(s)
MS -> hq: store new file(s)
hq -> MS: return new\nfile location(s)
MS -> caom: update with CAOM\nmodels for new file(s)
MS -> cloud: copy file(s)
cloud -> MS : return file location(s)
MS -> caom: update CAOM models with\ncloud file location(s)
@enduml