Commits

Olemis Lang committed 50567c4

Simelo Hacks: UML diagrams for Trac XmlRpcPlugin 1.0.0

  • Participants

Comments (0)

Files changed (8)

File diagrams/XmlRpcPlugin/1.0.0/overview-client.uml

+@startuml
+
+title Arquitectura RPC - Cliente
+center footer Hecho con <b>PlantUml</b> 
+
+object "Enlace físico" as netw
+
+package Cliente #E0ECFF {
+	package "Aplicación" #DDF8CC {
+		object "Aplicación\ncliente" as c
+		object "Servicio1\nClient stub" as cs {
+			proc1(x)
+			proc2(y): z
+			}
+	}
+	package "Bindings" #FEFEFE {
+		object "WS-Security" as ws <<optional>> 
+		object "WS-Reliability" as wr <<optional>>
+	}
+	package "Protocolos" #DDF8CC {
+		object "JSON-RPC" as cjrpc
+		object "XML-RPC" as cxrpc
+		object "SOAP" as csoap
+		object "Hessian" as ch
+	}
+	package "Transporte" #DDF8CC {
+		object "XMPP" as cxmpp
+		object "HTTP" as chttp
+		object "TCP" as ctcp
+		object "SMTP" as csmtp
+	}
+	object "Petición\nHTTP" as req {
+		body = Mensaje
+	}
+	object "Mensaje\nCliente" as cmsg {
+		proc = Servicio1.proc1
+	}
+	object "Protocolos\nde red" as cprotos
+
+	c -> cs : (1) proc1(x)
+	cs ---> cxrpc: (2)
+	cs ..> ws: (2')
+	ws ..> csoap: (2'')
+	cxrpc ..> cmsg: (3)
+	cmsg ..> chttp
+	chttp ..> req: (4)
+	req ..> cprotos
+	cprotos --> netw: (5)
+	netw ---> cprotos: (18)
+	cprotos ---> chttp: (19) Respuesta\nHTTP
+	chttp ---> cxrpc: (20) Mensaje Servidor
+	cxrpc ---> cs: (21)
+	cs ...> c: (22) Resultado
+}
+
+@enduml

File diagrams/XmlRpcPlugin/1.0.0/overview-server.uml

+@startuml
+
+title Arquitectura RPC - Servidor 
+center footer Hecho con <b>PlantUml</b> 
+
+object "Enlace físico" as netw
+
+package Servidor #E0ECFF {
+	package "Servicios" #DDF8CC {
+		object "Servicio1" as s1 {
+			proc1(x)
+			proc2(y): z
+			}
+		object "Servicio2" as s2 {
+			proc1(x): y
+			proc2: z
+			}
+	}
+	object "RPC\nDispatcher" as disp
+	package "Server Bindings" #FEFEFE {
+		object "WS-Security" as sws <<optional>>
+		object "WS-Reliability" as swr <<optional>>
+	}
+	package "Server stubs" #DDF8CC {
+		object "JSON-RPC" as sjrpc
+		object "XML-RPC" as sxrpc
+		object "SOAP" as ssoap
+		object "Hessian" as sh
+	}
+	object "Respuesta\nHTTP" as resp
+	object "Mensaje\nServidor" as smsg
+	object "Resultado" as result
+	package "Servidor RPC" #DDF8CC {
+		object "Servicio\nRPC" as srpc
+	}
+	package "Servidor de\naplicación" #DDF8CC {
+		object Apache
+		object IIS
+		object Twisted
+	}
+	object "Protocolos\nde red" as sprotos
+
+	sprotos -> netw: (17)
+	Apache --> sprotos: (16)
+	resp ..> Apache
+	srpc ..> resp: (15)
+	smsg ..> srpc
+	sxrpc ..> smsg: (14)
+	result ..> sxrpc: (13)
+	s1 ..> result: (12) 
+	disp --> s1: (11) proc1(x)
+	sxrpc --> disp: (10)
+	sxrpc ..> sws: (10')
+	sws ...> disp: (10'')
+	srpc --> sxrpc: (9) Mensaje Cliente
+	Apache --> srpc: (8) 
+	sprotos --> Apache: (7) Petición HTTP
+	netw --> sprotos: (6)
+}
+
+@enduml

File diagrams/XmlRpcPlugin/1.0.0/overview.uml

+@startuml
+
+title Arquitectura RPC
+center footer Hecho con <b>PlantUml</b> 
+
+object "Enlace físico" as netw
+
+package Cliente #E0ECFF {
+	package "Aplicación" #DDF8CC {
+		object "Aplicación\ncliente" as c
+		object "Servicio1\nClient stub" as cs {
+			proc1(x)
+			proc2(y): z
+			}
+	}
+	package "Bindings" #FEFEFE {
+		object "WS-Security" as ws <<optional>> 
+		object "WS-Reliability" as wr <<optional>>
+	}
+	package "Protocolos" #DDF8CC {
+		object "JSON-RPC" as cjrpc
+		object "XML-RPC" as cxrpc
+		object "SOAP" as csoap
+		object "Hessian" as ch
+	}
+	package "Transporte" #DDF8CC {
+		object "XMPP" as cxmpp
+		object "HTTP" as chttp
+		object "TCP" as ctcp
+		object "SMTP" as csmtp
+	}
+	object "Petición\nHTTP" as req {
+		body = Mensaje
+	}
+	object "Mensaje\nCliente" as cmsg {
+		proc = Servicio1.proc1
+	}
+	object "Protocolos\nde red" as cprotos
+
+	c -> cs : (1) proc1(x)
+	cs ---> cxrpc: (2)
+	cs ..> ws: (2')
+	ws ..> csoap: (2'')
+	cxrpc ..> cmsg: (3)
+	cmsg ..> chttp
+	chttp ..> req: (4)
+	req ..> cprotos
+	cprotos --> netw: (5)
+	netw ---> cprotos: (18)
+	cprotos ---> chttp: (19) Respuesta\nHTTP
+	chttp ---> cxrpc: (20) Mensaje Servidor
+	cxrpc ---> cs: (21)
+	cs ...> c: (22) Resultado
+}
+
+package Servidor #E0ECFF {
+	package "Servicios" #DDF8CC {
+		object "Servicio1" as s1 {
+			proc1(x)
+			proc2(y): z
+			}
+		object "Servicio2" as s2 {
+			proc1(x): y
+			proc2: z
+			}
+	}
+	object "RPC\nDispatcher" as disp
+	package "Server Bindings" #FEFEFE {
+		object "WS-Security" as sws <<optional>>
+		object "WS-Reliability" as swr <<optional>>
+	}
+	package "Server stubs" #DDF8CC {
+		object "JSON-RPC" as sjrpc
+		object "XML-RPC" as sxrpc
+		object "SOAP" as ssoap
+		object "Hessian" as sh
+	}
+	object "Respuesta\nHTTP" as resp
+	object "Mensaje\nServidor" as smsg
+	object "Resultado" as result
+	package "Servidor RPC" #DDF8CC {
+		object "Servicio\nRPC" as srpc
+	}
+	package "Servidor de\naplicación" #DDF8CC {
+		object Apache
+		object IIS
+		object Twisted
+	}
+	object "Protocolos\nde red" as sprotos
+
+	sprotos -> netw: (17)
+	Apache --> sprotos: (16)
+	resp ..> Apache
+	srpc ..> resp: (15)
+	smsg ..> srpc
+	sxrpc ..> smsg: (14)
+	result ..> sxrpc: (13)
+	s1 ..> result: (12) 
+	disp --> s1: (11)
+	sxrpc --> disp: (10)
+	sxrpc ..> sws: (10')
+	sws ...> disp: (10'')
+	srpc --> sxrpc: (9) Mensaje Cliente
+	Apache --> srpc: (8) 
+	sprotos --> Apache: (7) Petición HTTP
+	netw --> sprotos: (6)
+}
+
+@enduml

File diagrams/XmlRpcPlugin/1.0.0/rpc_match.uml

+
+@startuml
+
+skinparam sequenceParticipantFontSize 19
+skinparam sequenceArrowFontSize 19
+
+title Procesamiento de peticiones RPC - parte 1
+center footer Hecho con <b>PlantUML</b>. Autor <i>Olemis Lang</i>
+
+participant "XMLRPCWeb" as web
+participant ":\nIRPCProtocol" as auxproto
+participant "protocol:\nIRPCProtocol" as proto
+participant "req:\nRequest" as req
+participant "req.args:\ndict" as args
+
+autonumber "<b>0.</b> "
+[-> web : match_request(req)
+activate web
+web -> req : get_header('Content-Type')
+activate req
+web <-- req: content_type
+deactivate req
+web -> req : path_info
+activate req
+web <-- req: path_info
+deactivate req
+web -> auxproto: rpc_match()
+activate auxproto
+web <-- auxproto: nomatch
+deactivate auxproto
+web -> nomatch: match_path(nomatch[0][0])
+activate nomatch
+web <-- nomatch: False
+deactivate nomatch
+web -> nomatch: match_path(nomatch[1][0])
+activate nomatch
+web <-- nomatch: False
+deactivate nomatch
+web -> proto: rpc_match()
+activate proto
+web <-- proto: [(p_path, p_type)]
+deactivate proto
+web -> matchok: match_path(p_path)
+activate matchok
+web <-- matchok: True
+deactivate matchok
+web -> matchok: content_type.startswith(p_type)
+activate matchok
+web <-- matchok: True
+deactivate matchok
+web -> args: __setitem__('protocol', protocol)
+activate args
+[<-- web: True
+deactivate args
+deactivate web
+
+@enduml

File diagrams/XmlRpcPlugin/1.0.0/rpc_process.uml

+
+@startuml
+
+skinparam sequenceParticipantFontSize 25
+skinparam sequenceArrowFontSize 25
+skinparam noteFontSize 25
+
+title Procesamiento de peticiones RPC
+center footer Hecho con <b>PlantUML</b>. Autor <i>Olemis Lang</i>
+footbox off
+
+participant "protocol:\nIRPCProtocol" as proto
+participant "RPCWeb" as web
+participant "req.args:\ndict" as args
+participant "req.perm:\nPermission\nSystem" as perm
+participant "rpcreq:\ndict" as rpcreq
+'participant "XMLRPCSystem" as sys
+'participant "method:\nMethod" as method
+'participant "req:\nRequest" as req
+
+autonumber "<b>0. </b> "
+[-> web: process_request(req)
+activate web
+web -> args: __getitem__('protocol')
+activate args
+web <-- args: protocol
+deactivate args
+web -> web: _rpc_process(req,\n        protocol,\n        content_type)
+activate web
+web -> proto: parse_rpc_request(req,\n        content_type)
+activate proto
+create rpcreq
+proto -> rpcreq: dict()
+note right of proto: Protocol handler\nparses RPC message
+proto -> rpcreq: __setitem__('method', method_name)
+activate rpcreq
+proto -> rpcreq: __setitem__('args', (arg1, arg2))
+web <-- proto: rpcreq
+deactivate rpcreq
+deactivate proto
+web -> rpcreq: __setitem__('mimetype', content_type)
+activate rpcreq
+web -> perm: require('XML_RPC')
+deactivate rpcreq
+activate perm
+web <-- perm: True
+deactivate perm
+note left: User <b>MUST AT LEAST</b>\nhave <i>XML_RPC</i> permission.
+' web -> sys: get_method(method_name)
+' activate sys
+' create method
+' sys -> method
+' web <-- sys: method
+' deactivate sys
+' web -> method: __call__(req, (arg1, arg2))
+' activate method
+' note right of method: Call RPC method.\nFurther permissions\nchecked here.
+' alt Successful case
+' 	web <-- method: (result,)
+' 	web -> proto: send_rpc_result(req, result)
+' 	activate proto
+' else Known protocol or service exception
+' 	deactivate proto
+' 	autonumber 17 "<b>0. </b> "
+' 	web <-- method: exception
+' 	web -> proto: send_rpc_error(req, e)
+' 	activate proto 
+' else Unknown exception
+' 	deactivate proto 
+' 	autonumber 17 "<b>0. </b> "
+' 	web <-- method: exception
+' 	web -> web: _send_unknown_error(req, e)
+' 	activate web
+' 	web -> req: send_error(*args, status=HTTPInternalError.code)
+' 	activate req
+' 	deactivate web
+' end
+' destroy method
+' destroy rpcreq
+' deactivate web
+' deactivate web
+
+@enduml

File diagrams/XmlRpcPlugin/1.0.0/rpc_process_2.uml

+
+@startuml
+
+skinparam sequenceParticipantFontSize 25
+skinparam sequenceArrowFontSize 25
+skinparam noteFontSize 25
+skinparam sequenceGroupingFontSize 25
+
+title Procesamiento de peticiones RPC
+center footer Hecho con <b>PlantUML</b>. Autor <i>Olemis Lang</i>
+footbox off
+
+participant "protocol:\nIRPCProtocol" as proto
+participant "rpcreq:\ndict" as rpcreq
+participant "RPCWeb" as web
+'participant "req.args:\ndict" as args
+'participant "req.perm:\nPermission\nSystem" as perm
+participant "XMLRPCSystem" as sys
+participant "method:\nMethod" as method
+participant "req:\nRequest" as req
+
+autonumber 13 "<b>0. </b> "
+'[-> web: process_request(req)
+activate web
+'web -> args: __getitem__('protocol')
+'activate args
+'web <-- args: protocol
+'deactivate args
+'web -> web: _rpc_process(req,\n        protocol,\n        content_type)
+activate web
+'web -> proto: parse_rpc_request(req,\n        content_type)
+'activate proto
+'create rpcreq
+'proto -> rpcreq: dict()
+'note right of proto: Protocol handler\nparses RPC message
+'proto -> rpcreq: __setitem__('method', method_name)
+'activate rpcreq
+'proto -> rpcreq: __setitem__('args', (arg1, arg2))
+'web <-- proto: rpcreq
+'deactivate rpcreq
+'deactivate proto
+'web -> rpcreq: __setitem__('mimetype', content_type)
+'activate rpcreq
+'web -> perm: require('XML_RPC')
+'deactivate rpcreq
+'activate perm
+'web <-- perm: True
+'deactivate perm
+'note left: User <b>MUST AT LEAST</b>\nhave <i>XML_RPC</i> permission.
+web -> sys: get_method(\n        method_name)
+activate sys
+create method
+sys -> method
+web <-- sys: method
+deactivate sys
+web -> method: __call__(req, (arg1, arg2))
+activate method
+note right of method: Call RPC method.\nFurther permissions\nchecked here.
+alt Successful case
+	web <-- method: (result,)
+	web -> proto: send_rpc_result(\n       req,\n       result)
+	activate proto
+else Known protocol or service exception
+	deactivate proto
+	autonumber 17 "<b>0. </b> "
+	web <-- method: exception
+	web -> proto: send_rpc_error(\n       req, e)
+	activate proto 
+else Unknown exception
+	deactivate proto 
+	autonumber 17 "<b>0. </b> "
+	web <-- method: exception
+	web -> web: _send_unknown_error(req, e)
+	activate web
+	web -> req: send_error(*args, status=HTTPInternalError.code)
+	activate req
+	deactivate web
+end
+destroy method
+destroy rpcreq
+deactivate web
+deactivate web
+
+@enduml

File diagrams/XmlRpcPlugin/1.0.0/tracrpc_1.0.6.uml

+@startuml
+
+skinParam noteFontSize 19
+skinParam classFontSize 19
+skinParam classArrowFontSize 17
+skinParam classStereotypeFontSize 15
+
+namespace trac.core {
+	interface Interface {
+	}
+	class Component
+}
+
+namespace trac.perm {
+	 interface IPermissionRequestor
+}
+
+namespace tracrpc.api {
+	interface IXMLRPCHandler 
+	class XMLRPCSystem <<Dispatcher>>
+	
+	trac.core.Interface <|-- IXMLRPCHandler 
+	trac.core.Component <|-- XMLRPCSystem 
+	IXMLRPCHandler -- XMLRPCSystem: implements
+	IXMLRPCHandler "*" <--o "1" XMLRPCSystem: method_handlers
+	trac.perm.IPermissionRequestor -- XMLRPCSystem: implements 
+}
+
+namespace tracrpc.ticket {
+	class TicketRPC <<Service>>
+	TicketRPC -- tracrpc.api.IXMLRPCHandler
+}
+
+namespace tracrpc.web_ui {
+	class XMLRPCWeb <<ServerStub>> <<RPC Server>>
+	tracrpc.api.XMLRPCSystem <- XMLRPCWeb 
+}
+
+namespace tracrpc.wiki {
+	class WikiRPC <<Service>>
+	WikiRPC -- tracrpc.api.IXMLRPCHandler
+}
+
+note bottom of tracrpc.web_ui.XMLRPCWeb 
+	Handle XML-RPC calls from HTTP clients.
+	<color:red><b>Implements both XML-RPC 
+	<color:red><b>as well as JSON-RPC 
+end note
+
+note "Further handlers omitted." as N1 
+N1 .. tracrpc.ticket.TicketRPC
+N1 .. tracrpc.wiki.WikiRPC
+
+
+@enduml

File diagrams/XmlRpcPlugin/1.0.0/tracrpc_1.1.0.uml

+@startuml
+
+skinParam noteFontSize 19
+skinParam classFontSize 19
+skinParam classArrowFontSize 17
+skinParam classAttributeFontSize 17
+skinParam classStereotypeFontSize 15
+
+namespace trac.core {
+	interface Interface
+	class Component
+}
+
+namespace trac.perm {
+	 interface IPermissionRequestor
+}
+
+namespace tracrpc.api {
+	interface IXMLRPCHandler 
+	class XMLRPCSystem <<Dispatcher>>
+	interface IRPCProtocol {
+		rpc_info()
+		rpc_match()
+		parse_rpc_request(request, content_type)
+		send_rpc_result(request, result)
+		send_rpc_error(request, exception)
+	}
+	
+	trac.core.Interface <|-- IXMLRPCHandler 
+	trac.core.Component <|-- XMLRPCSystem 
+	trac.core.Interface <|--- IRPCProtocol 
+	IXMLRPCHandler -- XMLRPCSystem: implements
+	IXMLRPCHandler "     *" <--o "1" XMLRPCSystem: method_handlers
+	XMLRPCSystem -- trac.perm.IPermissionRequestor: implements 
+}
+
+namespace tracrpc.web_ui {
+	class XMLRPCWeb <<RPC Server>>
+	tracrpc.api.XMLRPCSystem <- XMLRPCWeb
+	tracrpc.api.IRPCProtocol "  *" <---- "     1" XMLRPCWeb: protocols
+}
+
+namespace tracrpc.json_rpc #E0ECFF {
+	class JsonRpcProtocol <<ServerStub>>
+	
+	tracrpc.api.IRPCProtocol ---- JsonRpcProtocol: implements
+}
+
+namespace tracrpc.xml_rpc #E0ECFF {
+	class XmlRpcProtocol <<ServerStub>> 
+	
+	tracrpc.api.IRPCProtocol ------ XmlRpcProtocol: implements 
+}
+
+package TracRpcProtocols #C3D9FF {
+	
+	namespace tracrpcext._amf #DDF8CC {
+		class AMFProtocol  <<ServerStub>>
+		
+		AMFProtocol -- tracrpc.api.IRPCProtocol: implements
+	}
+	
+	namespace tracrpcext._hessian #DDF8CC {
+		class HessianProtocol <<ServerStub>> 
+		
+		HessianProtocol -- tracrpc.api.IRPCProtocol: implements 
+	}
+}
+@enduml