Medias CRUD (Create ReadUpdateDelete)UserUserWebUIWebUIOrchestraOrchestraStorageStorageLoginGET /user/login (auth d@f.com:pass)Get user from MongoDBOK 200{"status"=200"value"={"_id": "<uuid>", "name": "David Fischer", ...}}'Successfull login'Medias Tabloop[every N seconds (AJAX)]GET /media (auth d@f.com:pass)Get medias from MongoDBOK 200{"status"=200,"value"=[{"_id": "<uuid>", "user_id": "<uuid>", ...}, ...]}<< Show/update medias list >>Add a media (with upload form, file transfer not shown)<< copy file into uploads path >><< operation terminated >>POST /media (auth d@f.com:pass){"uri": "glusterfs://...", "metadata": {"title": "Tabby"}, ...}<< check if file exist + rename & move it to medias path >><< operation terminated >>Save media (not the content (!)) to MongoDBOK 200{"status"=200,"value"={"_id": "<uuid_of_media>", "status": "READY", ...}}<< Flash info message'The media "Tabby" has been added.' >>Download a media<< read file from medias path >><< chunk 1/N of the file >><< chunk 2/N of the file >><< chunk N/N of the file >><< end of file >>alt[if auth. user is media's author (user._id == media.user_id)]Remove a mediaDELETE (auth d@f.com:pass) /media/id/<uuid_of_media>Set media status=DELETED into MongoDB<< delete file from medias path >><< operation terminated >>OK 200{"status"=200,"value"="The media \"Hotel Transylvania\" has been deleted."}<< Flash info message'The media "Hotel Transylvania" has been deleted.' >>
@startuml
skin BlueModern
title Medias CRUD (Create Read <s>Update</s> Delete)
actor User
participant "WebUI" as W
participant "Orchestra" as O
participant "Storage" as S
'participant "Transform" as T
'participant "Publisher" as P
User -> W: Login
activate W
W -> O: GET /user/login (auth d@f.com:pass)
activate O
O -> O: Get user from MongoDB
O --> W: <b>OK 200</b> {"status"=200\n "value"={"_id": "<uuid>", "name": "David Fischer", ...}}
deactivate O
W --> User: 'Successfull login'
deactivate W
User -> W: Medias Tab
activate W
loop every N seconds (AJAX)
W -> O: GET /media (auth d@f.com:pass)
activate O
O -> O: Get medias from MongoDB
O --> W: <b>OK 200</b> {"status"=200,\n "value"=[{"_id": "<uuid>", "user_id": "<uuid>", ...}, ...]}
deactivate O
W --> User: << Show/update medias list >>
end
deactivate W
User -> W: Add a media (with upload form, file transfer not shown)
activate W
W -> S: << copy file into uploads path >>
activate S
S --> W: << operation terminated >>
deactivate S
W -> O: POST /media (auth d@f.com:pass)\n {"uri": "glusterfs://...", "metadata": {"title": "Tabby"}, ...}
activate O
O -> S: << check if file exist + rename & move it to medias path >>
activate S
S --> O: << operation terminated >>
deactivate S
O -> O: Save media (not the content (!)) to MongoDB
O --> W: <b>OK 200</b> {"status"=200,\n "value"={"_id": "<uuid_of_media>", "status": "READY", ...}}
deactivate O
W --> User: << Flash info message\n'The media "Tabby" has been added.' >>
deactivate W
User -> W: Download a media
activate W
W -> S: << read file from medias path >>
activate S
W --> User: << chunk 1/N of the file >>
W --> User: << chunk 2/N of the file >>
W --> User: << chunk N/N of the file >>
S --> W: << end of file >>
deactivate S
deactivate W
alt if auth. user is media's author (user._id == media.user_id)
User -> W: Remove a media
activate W
activate O
W -> O: DELETE (auth d@f.com:pass) /media/id/<uuid_of_media>
O -> O: Set media status=DELETED into MongoDB
O -> S: << delete file from medias path >>
activate S
S --> O: << operation terminated >>
deactivate S
O --> W: <b>OK 200</b> {"status"=200,\n "value"="The media \\"Hotel Transylvania\\" has been deleted."}
deactivate O
W --> User: << Flash info message\n'The media "Hotel Transylvania" has been deleted.' >>
deactivate W
end
@enduml
@startuml
title Dodawanie service
actor UI #red
box "Kontroler" #LightBlue
control kontroler
database kontrolerDB
end box
box "Monitor" #DarkSalmon
control monitor
database monitorDB
end box
autonumber
UI -> kontroler: POST /service
kontroler -> kontroler: Walidacja danych
alt dane poprawne
kontroler -> kontrolerDB: dodaj do bazy
kontroler -> monitor: POST /service
monitor -> monitor: Walidacja danych
alt dane poprane
monitor -> monitorDB: Dodaj do bazy
monitor --> kontroler: status 201
kontroler --> UI: status 201
else dane niepoprawne
monitor -> kontroler: status 400
kontroler --> UI: status 400
end
else danie niepoprawne
kontroler --> UI: status 400
end
@enduml
SEQUENCE DIAGRAM
5911127250698240
PlayerPlayerSimonSimonUserUserDatabaseDatabaseStart Gameloop[while ! end of game]Show SequenceSelect SequenceSend Score
SEQUENCE DIAGRAM
5916087803707392
PlayerPlayerSimonSimonUserUserDatabaseDatabaseStart Gameloop[while ! end of game]Show SequenceSelect SequenceSend Score
@startuml
Player -> Simon: Start Game
loop while ! end of game
Simon -> User: Show Sequence
Player -> Simon: Select Sequence
end
User -> Database: Send Score
@enduml
@startuml
== init ==
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
== repeat ==
Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
@enduml
SEQUENCE DIAGRAM
5940593679138816
bStarting processing25% done50% done100% doneDone with processing
SEQUENCE DIAGRAM
5956742756171776
bStarting processing25% done50% done100% doneDone with processing
@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
@enduml
SEQUENCE DIAGRAM
5960606347689984
clientclienthttp_serverhttp_serverapplicationapplicationHTTP request with header,Transfer-encoding: Chunkedalt[default]loopHTTP chunkconcatenate chunkinto message bodyHTTP last chunkrequest received(is_chunked)response[chunk received callback]request received(is_chunked)loopHTTP chunkchunk receivedHTTP last chunkchunk received(is_last)responseHTTP response
SEQUENCE DIAGRAM
5965928349040640
clientclienthttp_serverhttp_serverapplicationapplicationHTTP request with header,Transfer-encoding: Chunkedalt[default]loopHTTP chunkconcatenate chunkinto message bodyHTTP last chunkrequest received(is_chunked)response[chunk received callback]request received(is_chunked)loopHTTP chunkchunk receivedHTTP last chunkchunk received(is_last)responseHTTP response
@startuml
skinparam backgroundColor #EEEBDC
actor 使用者
participant "頭等艙" as A
participant "第二類" as B
participant "最後一堂課" as 別的東西
使用者 -> A: 完成這項工作
activate A
A -> B: 創建請求
activate B
B -> 別的東西: 創建請求
activate 別的東西
別的東西 --> B: 這項工作完成
destroy 別的東西
B --> A: 請求創建
deactivate B
A --> 使用者: 做完
deactivate A
@enduml
@startuml
actor Utilisateur as user
participant "formSign.js" as form <<Contrôleur formulaire>>
participant "Sign.java" as controler <<(C,#ADD1B2) Contrôleur formulaire>>
participant "SoapEmailValidation.java" as soap <<(C,#ADD1B2) validation email>>
participant "web service" as webservice <<Web Service EmailValidate.net>>
participant "Mails.java" as email <<(C,#ADD1B2) Email>>
box "Application Web" #LightBlue
participant form
end box
box "Serveur Play" #LightGreen
participant controler
participant soap
participant email
end box
box "Web Service" #LightRed
participant webservice
end box
user -> form : submitSignUp()
form -> form : getParameters()
form -> form : result = checkFields()
alt result
form -> controler : formSignUp(email,name,pwd)
controler -> controler : result = checkFields()
alt result
controler -> soap : checkEmail(email)
activate controler
soap -> webservice : HTTP SOAP request
webservice --> soap : HTTP SOAP reply
soap --> controler : return result
deactivate controler
alt result && !User.findUser(email)
controler -> controler : User user = new User(email, name,pwd).save()
controler -> email : welcolme(user)
controler --> form : renderJSON(0)
form --> user : display information
else !result || User.findUser(email)
controler --> form : renderJSON(1)
form --> user : display error
end
else !result
controler --> form : renderJSON(1)
form --> user : display error
end
else !result
form --> user : display error
end
@enduml
@startuml
skinparam backgroundColor #EEEBDC
skinparam sequenceArrowColor DeepSkyBlue
skinparam sequenceParticipantBorderColor DeepSkyBlue
skinparam sequenceActorBorderColor DeepSkyBlue
skinparam sequenceLifeLineBorderColor blue
actor User
participant "First Class" as A
participant "Second Class" as B
participant "Last Class" as C
User -> A: DoMoreWork
activate A
@enduml
SEQUENCE DIAGRAM
6000713020735488
AliceAliceBobBobrefinithellorefThis can be onseveral lines
SEQUENCE DIAGRAM
6005008524902400
AliceAliceBobBobrefinithellorefThis can be onseveral lines
@startuml
participant Alice
actor Bob
ref over Alice, Bob : init
Alice -> Bob : hello
ref over Bob
This can be on
several lines
end ref
@enduml
SEQUENCE DIAGRAM
6005008524902400
Przyk³adowa sekwencja ¿ycia systemuUIUIkontrolerkontrolermonitormonitorcheckercheckerhosthost1get probles2no problems3CPU service for host4chceck cpu565%6OK 65%7zapisuje do bazy8get problem9no problems10CPU service for host11check cpu1296%13CRITICAL 96%14zapisuje do bazy15problem16synchronizacja17dane18zapisz w bazie19zapisane od <timestamp>20wyczysc baze21get problem22CPU problem on host23get service details, CPU on hostalt[jeœli wiêcej ni¿ 30 sekund od ostatniej synchronizacji]24synchronizacja25dane26zapis do bazy27zapisane do <timestamp>28wyczyœæ bazê29details30CPU service for host31chceck cpu3235%33OK 35%34zapisuje do bazy35dodaj service memory do hsot36zapisz w bazie37dodaj service do host38zapisz do bazy39dodane40get problem41no problems42CPU service for host43chceck cpu44memory service for host45chceck memory4635%47100MB/512MB48OK 35%49OK 128MB/512MB, 25%50zapisuje do bazy51zapisuje do bazyRR52CPU service for host53chceck cpu54memory service for host55chceck memory5695%57500MB/512MB58get problem59no problems60CRITICAL 95%61CRITICAL 500MB/512MB, 95%62zapisuje do bazy63zapisuje do bazy64problem65synchronizacjatutaj be³kot synchronizacyjny66poblembrak synchronizacji poniewa¿ < 30 sekund od ostatniej67get problem68CPU problem on host,memory problem on host69CPU problem acknolwdge70get problem71memory problem on hostbrak aktywnoœci u¿ytkownika przez 5 minut72wymuszenie synchronizacjibe³kot synchronizacyjny
SEQUENCE DIAGRAM
6008745683320832
Przyk³adowa sekwencja ¿ycia systemuUIUIkontrolerkontrolermonitormonitorcheckercheckerhosthost1get probles2no problems3CPU service for host4chceck cpu565%6OK 65%7zapisuje do bazy8get problem9no problems10CPU service for host11check cpu1296%13CRITICAL 96%14zapisuje do bazy15problem16synchronizacja17dane18zapisz w bazie19zapisane od <timestamp>20wyczysc baze21get problem22CPU problem on host23get service details, CPU on hostalt[jeœli wiêcej ni¿ 30 sekund od ostatniej synchronizacji]24synchronizacja25dane26zapis do bazy27zapisane do <timestamp>28wyczyœæ bazê29details30CPU service for host31chceck cpu3235%33OK 35%34zapisuje do bazy35dodaj service memory do hsot36zapisz w bazie37dodaj service do host38zapisz do bazy39dodane40get problem41no problems42CPU service for host43chceck cpu44memory service for host45chceck memory4635%47100MB/512MB48OK 35%49OK 128MB/512MB, 25%50zapisuje do bazy51zapisuje do bazyRR52CPU service for host53chceck cpu54memory service for host55chceck memory5695%57500MB/512MB58get problem59no problems60CRITICAL 95%61CRITICAL 500MB/512MB, 95%62zapisuje do bazy63zapisuje do bazy64problem65synchronizacjatutaj be³kot synchronizacyjny66poblembrak synchronizacji poniewa¿ < 30 sekund od ostatniej67get problem68CPU problem on host,memory problem on host69CPU problem acknolwdge70get problem71memory problem on hostbrak aktywnoœci u¿ytkownika przez 5 minut72wymuszenie synchronizacjibe³kot synchronizacyjny
@startuml
autonumber
title Przyk³adowa sekwencja ¿ycia systemu
actor UI #red
control kontroler
control monitor
entity checker
entity host
UI -> kontroler: get probles
kontroler -> UI: no problems
monitor -> checker: CPU service for host
checker -> host: chceck cpu
host --> checker: 65%
checker --> monitor: OK 65%
monitor -> monitor: zapisuje do bazy
UI -> kontroler: get problem
kontroler -> UI: no problems
monitor -> checker: CPU service for host
checker -> host: check cpu
host --> checker: 96%
checker --> monitor: CRITICAL 96%
monitor -> monitor: zapisuje do bazy
monitor -> kontroler: problem
kontroler -> monitor: synchronizacja
monitor -> kontroler: dane
kontroler -> kontroler: zapisz w bazie
kontroler --> monitor: zapisane od <timestamp>
monitor -> monitor: wyczysc baze
UI -> kontroler: get problem
kontroler --> UI: CPU problem on host
UI -> kontroler: get service details, CPU on host
alt jeœli wiêcej ni¿ 30 sekund od ostatniej synchronizacji
kontroler -> monitor: synchronizacja
monitor -> kontroler: dane
kontroler -> kontroler: zapis do bazy
kontroler -> monitor: zapisane do <timestamp>
monitor -> monitor: wyczyœæ bazê
end
kontroler --> UI: details
monitor -> checker: CPU service for host
checker -> host: chceck cpu
host --> checker: 35%
checker --> monitor: OK 35%
monitor -> monitor: zapisuje do bazy
UI -> kontroler: dodaj service memory do hsot
kontroler -> kontroler: zapisz w bazie
kontroler -> monitor: dodaj service do host
monitor -> monitor: zapisz do bazy
kontroler -> UI: dodane
UI -> kontroler: get problem
kontroler --> UI: no problems
monitor -> checker: CPU service for host
checker -> host: chceck cpu
monitor -> checker: memory service for host
checker -> host: chceck memory
host --> checker: 35%
host --> checker: 100MB/512MB
checker --> monitor: OK 35%
checker --> monitor: OK 128MB/512MB, 25%
monitor -> monitor: zapisuje do bazy
monitor -> monitor: zapisuje do bazyRR
monitor -> checker: CPU service for host
checker -> host: chceck cpu
monitor -> checker: memory service for host
checker -> host: chceck memory
host --> checker: 95%
host --> checker: 500MB/512MB
UI -> kontroler: get problem
kontroler --> UI: no problems
checker --> monitor: CRITICAL 95%
checker --> monitor: CRITICAL 500MB/512MB, 95%
monitor -> monitor: zapisuje do bazy
monitor -> monitor: zapisuje do bazy
monitor -> kontroler: problem
kontroler -> monitor: synchronizacja
note right of kontroler
tutaj be³kot synchronizacyjny
end note
monitor -> kontroler: poblem
note right of kontroler
brak synchronizacji poniewa¿ < 30 sekund od ostatniej
end note
UI -> kontroler: get problem
kontroler --> UI: CPU problem on host,\nmemory problem on host
UI -> kontroler: CPU problem acknolwdge
UI -> kontroler: get problem
kontroler --> UI: memory problem on host
== brak aktywnoœci u¿ytkownika przez 5 minut ==
kontroler -> monitor: wymuszenie synchronizacji
note right of kontroler
be³kot synchronizacyjny
end note
@enduml
@startuml
alice -> bob: hello
note left: this is a first note
bob -> alice: ok
note right: this is another note
bob -> bob: i am thinking
note left
a note
can also defined
on several lines
end note
@enduml
SEQUENCE DIAGRAM
6046223567945728
Socket Disonnection Sequenceserver or clientserver or clientconnectionconnectionsocket_adaptorsocket_adaptorasio.socketasio.socketconnection open for transmission and receptionaltshutdowndisconnectalt[ssl]shutdownasync_shutdownssl shutdown responseThe ssl socket_adaptor ignoresthe ssl shutdown responseasync_writeThe write will fail with errorSSL_R_PROTOCOL_IS_SHUTDOWNwrite_callback[tcp]shutdownshutdowndisconnectedThe tcp socket_adaptor waitsfor the tcp socket to disconnectwrite_callbackThe tcp socket_adaptor sendseof to signal disconnecteddisconnected
SEQUENCE DIAGRAM
6050233993658368
Socket Disonnection Sequenceserver or clientserver or clientconnectionconnectionsocket_adaptorsocket_adaptorasio.socketasio.socketconnection open for transmission and receptionaltshutdowndisconnectalt[ssl]shutdownasync_shutdownssl shutdown responseThe ssl socket_adaptor ignoresthe ssl shutdown responseasync_writeThe write will fail with errorSSL_R_PROTOCOL_IS_SHUTDOWNwrite_callback[tcp]shutdownshutdowndisconnectedThe tcp socket_adaptor waitsfor the tcp socket to disconnectwrite_callbackThe tcp socket_adaptor sendseof to signal disconnecteddisconnected
@startuml
'Copyright (c) 2013-2015 Ken Barker
title Socket Disonnection Sequence
'autonumber
actor "server or client"
... connection open for transmission and reception ...
alt
"server or client" -> connection : shutdown
else
connection <- socket_adaptor: disconnect
end alt
alt ssl
connection -> socket_adaptor : shutdown
socket_adaptor -> asio.socket : async_shutdown
socket_adaptor <- asio.socket : ssl shutdown response
note left
The ssl socket_adaptor ignores
the ssl shutdown response
end note
socket_adaptor -> asio.socket : async_write
note left
The write will fail with error
SSL_R_PROTOCOL_IS_SHUTDOWN
end note
connection <- asio.socket : write_callback
else tcp
connection -> socket_adaptor : shutdown
socket_adaptor -> asio.socket : shutdown
socket_adaptor <- asio.socket : disconnected
note left
The tcp socket_adaptor waits
for the tcp socket to disconnect
end note
connection <- socket_adaptor : write_callback
note right
The tcp socket_adaptor sends
eof to signal disconnected
end note
end alt
"server or client" <- connection : disconnected
@enduml
@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
@enduml