design document for protection service which includes the high level

architecture of protection service, the class-diagram and some sequence
diagrams for several typical scenarios.

Change-Id: I4c7c37a71a2beb1e63807d3c15e3a5931febde0d
Closes-bug: #1529199
This commit is contained in:
yinweiishere 2015-12-25 16:26:55 +08:00 committed by yinwei
parent 7273d222cb
commit e6453811d9
3 changed files with 133 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -0,0 +1,133 @@
@startuml
title ProtectionService Class Diagram
class RpcServer {
-endpoints: []Manager_Class
-target: messaging.Target
}
class ProtectionManager << (S,#FF7700) Singleton >>{
+rpc_call_protect(): void { backup_plan}
+rpc_call_restore(): void { checkpoint, restore_target, ...}
+rpc_call_list_plugins(): []Plugin {list_options}
+rpc_call_show_plugin():Plugin {plugin_id}
+rpc_call_list_checkpoints(): []Checkpoints {list_options}
+rpc_call_show_checkpoint(): Checkpoint {provider_id, checkpoint_id}
+rpc_call_delete_checkpoint():void {provider_id, checkpoint_id}
+rpc_call_list_bank_plugins():[]BankPlugins {list_options}
+rpc_call_get_bank_plugin():BankPlugin {bank_plugin_id}
+rpc_call_create_provider(): String {plugins, bank_plugin}
+rpc_call_update_provider():void {provider_id, **kwargs}
+rpc_call_list_providers():[]Providers {list_options}
+rpc_call_delete_provider():void {provider_id}
+rpc_call_get_provider():Provider {provider_id}
-flow_engine: WorkFlow_Engine
}
RpcServer*-right->ProtectionManager:has one as endpoint
class ProtectionPlugin << (S,#FF7700) Singleton >>{
+list_plugins(): []Plugin {list_options}
+show_plugin():Plugin {plugin_id}
-init():void {conf_file}
-plugins:[]Plugin
}
ProtectionManager*-down->ProtectionPlugins:has a
class Checkpoints << (S,#FF7700) Singleton >>{
-checkpoint_serializer: CheckpointSerializer
+list_checkpoints(): []Checkpoints {list_options}
+show_checkpoint(): Checkpoint {provider_id, checkpoint_id}
+delete_checkpoint():void {provider_id, checkpoint_id}
+create_checkpoint(): Checkpoint {plan}
+update_checkpoint(): void {checkpoint, **kwargs}
+update_protection_definition() :void {checkpoint, resource, **kwargs}
}
ProtectionManager*-right->Checkpoints:has a
class GraphFlow {
flow :[] Task
}
ProtectionManager -up-> GraphFlow:create one flow per rpc_call
class CreateCheckpointTask extends Task {
-backup_plan:BackupPlan
+create_checkpoint: void {}
}
GraphFlow "1"*-up->"1" CreateCheckpointTask:has
class ResourceProtectTask extends Task{
-protect_resource: Resource
-plugin: ProtectionPlugin
+protect():void {}
}
GraphFlow "1"*-up->"many" ResourceProtectTask:has
class CheckpointStatusCheckTask extends Task{
-checkpoint:Checkpoint
+check(): void {checkpoint}
}
GraphFlow "1"*-up->"1" CheckpointStatusCheckTask :has
Class CheckpointSerializer {
+serialize():[]String {encoding_format, checkpoint}
+deserialize():Checkpoint {[]String {encoding_format}}
}
Checkpoints*-up->CheckpointSerializer:has a
class ProtectionPlugin {
-protectable_type:String
-schema:[]String
+get_protecatble_type(): Protectable_type {}
+get_schema(): []String {enconding_format}
+protect():String {protectable}
+restore():void {checkpoint,target,...}
}
ProtectionPlugins"1" *-down->"many" ProtectionPlugin:has
class BankPlugins {
+list_bank_plugins():[]BankPlugins {list_options}
+get_bank_plugin():BankPlugin {bank_plugin_id}
-init(): void {conf_file}
bank_plugins:[]BankPlugin
}
ProtectionManager*-down->BankPlugins:has a
class BankPlugin {
-endpoint: URL
+aquire_obj_lock(): void {TBD}
+release_obj_lock(): void {TBD}
+put():void {key, value}
+get():[]String {key}
+delete():void {key}
+list():[]<key, value> {prefix, delimiter, limits, marker,...}
}
BankPlugins"1"*-down->"many"BankPlugin:has
class Providers{
+create_provider(): String {plugins, bank_plugin}
+update_provider():void {provider_id, **kwargs}
+list_providers():[]Providers {list_options}
+delete_provider():void {provider_id}
+get_provider():Provider {provider_id}
}
ProtectionManager*-down->Providers:has a
@enduml