siffer 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. data/Rakefile +2 -2
  2. data/doc/rdoc/classes/Siffer.html +253 -368
  3. data/doc/rdoc/classes/Siffer/Agent.html +169 -288
  4. data/doc/rdoc/classes/Siffer/Container.html +158 -279
  5. data/doc/rdoc/classes/Siffer/Messages.html +79 -139
  6. data/doc/rdoc/classes/Siffer/Messages/Ack.html +109 -210
  7. data/doc/rdoc/classes/Siffer/Messages/Acl.html +78 -155
  8. data/doc/rdoc/classes/Siffer/Messages/Error.html +151 -242
  9. data/doc/rdoc/classes/Siffer/Messages/Message.html +227 -351
  10. data/doc/rdoc/classes/Siffer/Messages/Message/Header.html +102 -176
  11. data/doc/rdoc/classes/Siffer/Messages/Register.html +147 -250
  12. data/doc/rdoc/classes/Siffer/Messages/RequestBody.html +177 -292
  13. data/doc/rdoc/classes/Siffer/Messages/Status.html +149 -262
  14. data/doc/rdoc/classes/Siffer/Messaging.html +204 -323
  15. data/doc/rdoc/classes/Siffer/Protocol.html +246 -380
  16. data/doc/rdoc/classes/Siffer/Protocol/NonPostRequest.html +53 -110
  17. data/doc/rdoc/classes/Siffer/Protocol/UnknownPath.html +53 -110
  18. data/doc/rdoc/classes/Siffer/Registration.html +243 -383
  19. data/doc/rdoc/classes/Siffer/Request.html +97 -203
  20. data/doc/rdoc/classes/Siffer/RequestLogger.html +102 -204
  21. data/doc/rdoc/classes/Siffer/Response.html +85 -176
  22. data/doc/rdoc/classes/Siffer/Server.html +150 -236
  23. data/doc/rdoc/created.rid +1 -1
  24. data/doc/rdoc/files/LICENSE.html +75 -128
  25. data/doc/rdoc/files/README_rdoc.html +130 -183
  26. data/doc/rdoc/files/lib/siffer/agent_rb.html +49 -0
  27. data/doc/rdoc/files/lib/siffer/container_rb.html +57 -0
  28. data/doc/rdoc/files/lib/siffer/messages/ack_rb.html +49 -0
  29. data/doc/rdoc/files/lib/siffer/messages/acl_rb.html +49 -0
  30. data/doc/rdoc/files/lib/siffer/messages/error_rb.html +49 -0
  31. data/doc/rdoc/files/lib/siffer/messages/message_rb.html +49 -0
  32. data/doc/rdoc/files/lib/siffer/messages/register_rb.html +49 -0
  33. data/doc/rdoc/files/lib/siffer/messages/request_body_rb.html +49 -0
  34. data/doc/rdoc/files/lib/siffer/messages/status_rb.html +49 -0
  35. data/doc/rdoc/files/lib/siffer/messages_rb.html +63 -0
  36. data/doc/rdoc/files/lib/siffer/messaging_rb.html +49 -0
  37. data/doc/rdoc/files/lib/siffer/protocol_rb.html +49 -0
  38. data/doc/rdoc/files/lib/siffer/registration_rb.html +49 -0
  39. data/doc/rdoc/files/lib/siffer/request_logger_rb.html +49 -0
  40. data/doc/rdoc/files/lib/siffer/request_rb.html +49 -0
  41. data/doc/rdoc/files/lib/siffer/response_rb.html +49 -0
  42. data/doc/rdoc/files/lib/siffer/server_rb.html +49 -0
  43. data/doc/rdoc/files/lib/siffer_rb.html +62 -113
  44. data/doc/rdoc/fr_class_index.html +25 -47
  45. data/doc/rdoc/fr_file_index.html +39 -46
  46. data/doc/rdoc/fr_method_index.html +4539 -96
  47. data/doc/rdoc/index.html +14 -23
  48. data/doc/rdoc/rdoc-style.css +314 -203
  49. data/lib/siffer.rb +6 -6
  50. data/lib/{agent.rb → siffer/agent.rb} +5 -3
  51. data/lib/{container.rb → siffer/container.rb} +3 -5
  52. data/lib/siffer/messages.rb +7 -0
  53. data/lib/{messages → siffer/messages}/ack.rb +0 -0
  54. data/lib/{messages → siffer/messages}/acl.rb +0 -0
  55. data/lib/{messages → siffer/messages}/error.rb +0 -0
  56. data/lib/{messages → siffer/messages}/message.rb +0 -0
  57. data/lib/{messages → siffer/messages}/register.rb +0 -0
  58. data/lib/{messages → siffer/messages}/request_body.rb +0 -0
  59. data/lib/{messages → siffer/messages}/status.rb +0 -0
  60. data/lib/{messaging.rb → siffer/messaging.rb} +8 -5
  61. data/lib/{protocol.rb → siffer/protocol.rb} +37 -32
  62. data/lib/{registration.rb → siffer/registration.rb} +2 -2
  63. data/lib/siffer/request.rb +28 -0
  64. data/lib/{request_logger.rb → siffer/request_logger.rb} +8 -7
  65. data/lib/{response.rb → siffer/response.rb} +1 -1
  66. data/lib/{server.rb → siffer/server.rb} +5 -3
  67. data/spec/agent_spec.rb +6 -11
  68. data/spec/container_spec.rb +2 -2
  69. data/spec/default_agent +1 -1
  70. data/spec/messaging_spec.rb +3 -6
  71. data/spec/protocol_spec.rb +27 -26
  72. data/spec/registration_spec.rb +2 -2
  73. data/spec/request_logger_spec.rb +22 -9
  74. data/spec/request_spec.rb +15 -0
  75. data/spec/response_spec.rb +2 -2
  76. data/spec/server_spec.rb +0 -5
  77. data/spec/spec_helper.rb +9 -0
  78. metadata +40 -38
  79. data/doc/rdoc/files/lib/agent_rb.html +0 -101
  80. data/doc/rdoc/files/lib/container_rb.html +0 -108
  81. data/doc/rdoc/files/lib/messages/ack_rb.html +0 -101
  82. data/doc/rdoc/files/lib/messages/acl_rb.html +0 -101
  83. data/doc/rdoc/files/lib/messages/error_rb.html +0 -101
  84. data/doc/rdoc/files/lib/messages/message_rb.html +0 -101
  85. data/doc/rdoc/files/lib/messages/register_rb.html +0 -101
  86. data/doc/rdoc/files/lib/messages/request_body_rb.html +0 -101
  87. data/doc/rdoc/files/lib/messages/status_rb.html +0 -101
  88. data/doc/rdoc/files/lib/messages_rb.html +0 -114
  89. data/doc/rdoc/files/lib/messaging_rb.html +0 -101
  90. data/doc/rdoc/files/lib/protocol_rb.html +0 -101
  91. data/doc/rdoc/files/lib/registration_rb.html +0 -101
  92. data/doc/rdoc/files/lib/request_logger_rb.html +0 -101
  93. data/doc/rdoc/files/lib/request_rb.html +0 -101
  94. data/doc/rdoc/files/lib/response_rb.html +0 -101
  95. data/doc/rdoc/files/lib/server_rb.html +0 -101
  96. data/lib/messages.rb +0 -7
  97. data/lib/request.rb +0 -25
@@ -1,111 +1,54 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Class: Siffer::Protocol::NonPostRequest</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Class</strong></td>
53
- <td class="class-name-in-header">Siffer::Protocol::NonPostRequest</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../../files/lib/protocol_rb.html">
59
- lib/protocol.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- <tr class="top-aligned-row">
66
- <td><strong>Parent:</strong></td>
67
- <td>
68
- Exception
69
- </td>
70
- </tr>
71
- </table>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html lang='en'>
3
+ <head>
4
+ <title>Class: Siffer::Protocol::NonPostRequest [Siffer == h3o(software) SIF]</title>
5
+ <meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
6
+ <link href='../../.././rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
7
+ <script type='text/javascript'>
8
+ //<![CDATA[
9
+ function popupCode(url) {
10
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
11
+ }
12
+
13
+ function toggleCode(id) {
14
+ var code = document.getElementById(id)
15
+
16
+ code.style.display = code.style.display != 'block' ? 'block' : 'none'
17
+ return true
18
+ }
19
+
20
+ // Make codeblocks hidden by default
21
+ document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
22
+ //]]>
23
+ </script>
24
+ </head>
25
+ <body class='page'>
26
+ <div class='class' id='wrapper'>
27
+ <div class='header'>
28
+ <h1 class='name'>
29
+ <span class='type'>Class</span>
30
+ Siffer::Protocol::NonPostRequest
31
+ </h1>
32
+ <ol class='paths'>
33
+ <li>
34
+ <a href="../../../files/lib/siffer/protocol_rb.html">lib/siffer/protocol.rb</a>
35
+ </li>
36
+ </ol>
37
+ <div class='parent'>
38
+ Parent:
39
+ <strong>Exception</strong>
40
+ </div>
41
+ </div>
42
+ <div id='content'>
43
+ <div id='text'>
44
+ <div id='section'>
45
+ </div>
46
+ </div>
47
+ </div>
48
+ <div id='footer-push'></div>
72
49
  </div>
73
- <!-- banner header -->
74
-
75
- <div id="bodyContent">
76
-
77
-
78
-
79
- <div id="contextContent">
80
-
81
-
82
-
83
- </div>
84
-
85
-
86
- </div>
87
-
88
-
89
- <!-- if includes -->
90
-
91
- <div id="section">
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
- <!-- if method_list -->
101
-
102
-
103
- </div>
104
-
105
-
106
- <div id="validator-badges">
107
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
108
- </div>
109
-
110
- </body>
111
- </html>
50
+ <div id='footer'>
51
+ <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
52
+ </div>
53
+ </body>
54
+ </html>
@@ -1,111 +1,54 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Class: Siffer::Protocol::UnknownPath</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Class</strong></td>
53
- <td class="class-name-in-header">Siffer::Protocol::UnknownPath</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../../files/lib/protocol_rb.html">
59
- lib/protocol.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- <tr class="top-aligned-row">
66
- <td><strong>Parent:</strong></td>
67
- <td>
68
- Exception
69
- </td>
70
- </tr>
71
- </table>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html lang='en'>
3
+ <head>
4
+ <title>Class: Siffer::Protocol::UnknownPath [Siffer == h3o(software) SIF]</title>
5
+ <meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
6
+ <link href='../../.././rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
7
+ <script type='text/javascript'>
8
+ //<![CDATA[
9
+ function popupCode(url) {
10
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
11
+ }
12
+
13
+ function toggleCode(id) {
14
+ var code = document.getElementById(id)
15
+
16
+ code.style.display = code.style.display != 'block' ? 'block' : 'none'
17
+ return true
18
+ }
19
+
20
+ // Make codeblocks hidden by default
21
+ document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
22
+ //]]>
23
+ </script>
24
+ </head>
25
+ <body class='page'>
26
+ <div class='class' id='wrapper'>
27
+ <div class='header'>
28
+ <h1 class='name'>
29
+ <span class='type'>Class</span>
30
+ Siffer::Protocol::UnknownPath
31
+ </h1>
32
+ <ol class='paths'>
33
+ <li>
34
+ <a href="../../../files/lib/siffer/protocol_rb.html">lib/siffer/protocol.rb</a>
35
+ </li>
36
+ </ol>
37
+ <div class='parent'>
38
+ Parent:
39
+ <strong>Exception</strong>
40
+ </div>
41
+ </div>
42
+ <div id='content'>
43
+ <div id='text'>
44
+ <div id='section'>
45
+ </div>
46
+ </div>
47
+ </div>
48
+ <div id='footer-push'></div>
72
49
  </div>
73
- <!-- banner header -->
74
-
75
- <div id="bodyContent">
76
-
77
-
78
-
79
- <div id="contextContent">
80
-
81
-
82
-
83
- </div>
84
-
85
-
86
- </div>
87
-
88
-
89
- <!-- if includes -->
90
-
91
- <div id="section">
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
- <!-- if method_list -->
101
-
102
-
103
- </div>
104
-
105
-
106
- <div id="validator-badges">
107
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
108
- </div>
109
-
110
- </body>
111
- </html>
50
+ <div id='footer'>
51
+ <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
52
+ </div>
53
+ </body>
54
+ </html>
@@ -1,391 +1,251 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Module: Siffer::Registration</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Module</strong></td>
53
- <td class="class-name-in-header">Siffer::Registration</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/registration_rb.html">
59
- lib/registration.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- </table>
66
- </div>
67
- <!-- banner header -->
68
-
69
- <div id="bodyContent">
70
-
71
-
72
-
73
- <div id="contextContent">
74
-
75
- <div id="description">
76
- <p>
77
- The <a href="Registration.html">Registration</a> module manages Register
78
- message types and processes registration requests.
79
- </p>
80
-
81
- </div>
82
-
83
-
84
- </div>
85
-
86
- <div id="method-list">
87
- <h3 class="section-bar">Methods</h3>
88
-
89
- <div class="name-list">
90
- <a href="#M000041">check_for_registration</a>&nbsp;&nbsp;
91
- <a href="#M000040">process_registration</a>&nbsp;&nbsp;
92
- <a href="#M000042">register</a>&nbsp;&nbsp;
93
- <a href="#M000047">registered?</a>&nbsp;&nbsp;
94
- <a href="#M000046">validate_max_buffer_size</a>&nbsp;&nbsp;
95
- <a href="#M000044">validate_permission</a>&nbsp;&nbsp;
96
- <a href="#M000043">validate_source_id</a>&nbsp;&nbsp;
97
- <a href="#M000045">validate_version</a>&nbsp;&nbsp;
98
- </div>
99
- </div>
100
-
101
- </div>
102
-
103
-
104
- <!-- if includes -->
105
- <div id="includes">
106
- <h3 class="section-bar">Included Modules</h3>
107
-
108
- <div id="includes-list">
109
- <span class="include-name"><a href="Messages.html">Siffer::Messages</a></span>
110
- </div>
111
- </div>
112
-
113
- <div id="section">
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
- <!-- if method_list -->
123
- <div id="methods">
124
- <h3 class="section-bar">Public Instance methods</h3>
125
-
126
- <div id="method-M000041" class="method-detail">
127
- <a name="M000041"></a>
128
-
129
- <div class="method-heading">
130
- <a href="#M000041" class="method-signature">
131
- <span class="method-name">check_for_registration</span><span class="method-args">()</span>
132
- </a>
133
- </div>
134
-
135
- <div class="method-description">
136
- <p>
137
- Parses the request body with RequestBody to determine if the the request is
138
- a registration message. If it is or if the source is already registered it
139
- passes through, otherwise raises AgentNotRegistered exception.
140
- </p>
141
- <p><a class="source-toggle" href="#"
142
- onclick="toggleCode('M000041-source');return false;">[Source]</a></p>
143
- <div class="method-source-code" id="M000041-source">
144
- <pre>
145
- <span class="ruby-comment cmt"># File lib/registration.rb, line 25</span>
146
- 25: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">check_for_registration</span>
147
- 26: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">register?</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">registered?</span>(<span class="ruby-ivar">@request</span>.<span class="ruby-identifier">message</span>.<span class="ruby-identifier">source_id</span>)
148
- 27: <span class="ruby-identifier">raise</span> <span class="ruby-constant">AgentNotRegistered</span>
149
- 28: <span class="ruby-keyword kw">end</span>
150
- 29: <span class="ruby-keyword kw">end</span>
151
- </pre>
152
- </div>
153
- </div>
154
- </div>
155
-
156
- <div id="method-M000040" class="method-detail">
157
- <a name="M000040"></a>
158
-
159
- <div class="method-heading">
160
- <a href="#M000040" class="method-signature">
161
- <span class="method-name">process_registration</span><span class="method-args">()</span>
162
- </a>
163
- </div>
164
-
165
- <div class="method-description">
166
- <p>
167
- The request (message) is processed for registration requests.
168
- </p>
169
- <p><a class="source-toggle" href="#"
170
- onclick="toggleCode('M000040-source');return false;">[Source]</a></p>
171
- <div class="method-source-code" id="M000040-source">
172
- <pre>
173
- <span class="ruby-comment cmt"># File lib/registration.rb, line 12</span>
174
- 12: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_registration</span>
175
- 13: <span class="ruby-keyword kw">begin</span>
176
- 14: <span class="ruby-identifier">check_for_registration</span>
177
- 15: <span class="ruby-identifier">register</span>
178
- 16: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">AgentNotRegistered</span>
179
- 17: <span class="ruby-identifier">error_response</span>(<span class="ruby-value">4</span>,<span class="ruby-value">9</span>)
180
- 18: <span class="ruby-keyword kw">end</span>
181
- 19: <span class="ruby-keyword kw">end</span>
182
- </pre>
183
- </div>
184
- </div>
185
- </div>
186
-
187
- <div id="method-M000042" class="method-detail">
188
- <a name="M000042"></a>
189
-
190
- <div class="method-heading">
191
- <a href="#M000042" class="method-signature">
192
- <span class="method-name">register</span><span class="method-args">()</span>
193
- </a>
194
- </div>
195
-
196
- <div class="method-description">
197
- <p>
198
- Process the message for registration by validating:
199
- </p>
200
- <ul>
201
- <li>source_id
202
-
203
- </li>
204
- <li>permissions to <a href="Registration.html#M000042">register</a> with ZIS
205
-
206
- </li>
207
- <li>version compatibility
208
-
209
- </li>
210
- <li>buffer size compatibility
211
-
212
- </li>
213
- </ul>
214
- <p>
215
- If all validations pass the registration is stored by the ZIS and the agent
216
- is added to the list of agents available to the zone.
217
- </p>
218
- <p><a class="source-toggle" href="#"
219
- onclick="toggleCode('M000042-source');return false;">[Source]</a></p>
220
- <div class="method-source-code" id="M000042-source">
221
- <pre>
222
- <span class="ruby-comment cmt"># File lib/registration.rb, line 38</span>
223
- 38: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">register</span>
224
- 39: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">register?</span>
225
- 40: <span class="ruby-ivar">@registration</span> = <span class="ruby-constant">Register</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-ivar">@request</span>.<span class="ruby-identifier">body</span>)
226
- 41: <span class="ruby-identifier">validate_source_id</span>
227
- 42: <span class="ruby-identifier">validate_permission</span>
228
- 43: <span class="ruby-identifier">validate_version</span>
229
- 44: <span class="ruby-identifier">validate_max_buffer_size</span>
230
- 45: <span class="ruby-comment cmt"># ignore the fact we haven't stored away any registration information !!!!!!</span>
231
- 46: <span class="ruby-comment cmt"># ignore the fact we haven't even built a data model for objects and permissions for the acl !!!!!</span>
232
- 47: <span class="ruby-identifier">ack</span> = <span class="ruby-constant">Ack</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">original</span>, <span class="ruby-identifier">:status</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Status</span>.<span class="ruby-identifier">success</span>(<span class="ruby-constant">Acl</span>.<span class="ruby-identifier">new</span>))
233
- 48: <span class="ruby-ivar">@response</span> = <span class="ruby-constant">Response</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">ack</span>)
234
- 49: <span class="ruby-keyword kw">end</span>
235
- 50: <span class="ruby-keyword kw">end</span>
236
- </pre>
237
- </div>
238
- </div>
239
- </div>
240
-
241
- <div id="method-M000047" class="method-detail">
242
- <a name="M000047"></a>
243
-
244
- <div class="method-heading">
245
- <a href="#M000047" class="method-signature">
246
- <span class="method-name">registered?</span><span class="method-args">(agent)</span>
247
- </a>
248
- </div>
249
-
250
- <div class="method-description">
251
- <p>
252
- Returns true if the agent is included in the list of Agents previously
253
- registered.
254
- </p>
255
- <p><a class="source-toggle" href="#"
256
- onclick="toggleCode('M000047-source');return false;">[Source]</a></p>
257
- <div class="method-source-code" id="M000047-source">
258
- <pre>
259
- <span class="ruby-comment cmt"># File lib/registration.rb, line 82</span>
260
- 82: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">registered?</span>(<span class="ruby-identifier">agent</span>)
261
- 83: <span class="ruby-identifier">agents</span>.<span class="ruby-identifier">has_key?</span> <span class="ruby-identifier">agent</span>
262
- 84: <span class="ruby-keyword kw">end</span>
263
- </pre>
264
- </div>
265
- </div>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html lang='en'>
3
+ <head>
4
+ <title>Module: Siffer::Registration [Siffer == h3o(software) SIF]</title>
5
+ <meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
6
+ <link href='../.././rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
7
+ <script type='text/javascript'>
8
+ //<![CDATA[
9
+ function popupCode(url) {
10
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
11
+ }
12
+
13
+ function toggleCode(id) {
14
+ var code = document.getElementById(id)
15
+
16
+ code.style.display = code.style.display != 'block' ? 'block' : 'none'
17
+ return true
18
+ }
19
+
20
+ // Make codeblocks hidden by default
21
+ document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
22
+ //]]>
23
+ </script>
24
+ </head>
25
+ <body class='page'>
26
+ <div class='class' id='wrapper'>
27
+ <div class='header'>
28
+ <h1 class='name'>
29
+ <span class='type'>Module</span>
30
+ Siffer::Registration
31
+ </h1>
32
+ <ol class='paths'>
33
+ <li>
34
+ <a href="../../files/lib/siffer/registration_rb.html">lib/siffer/registration.rb</a>
35
+ </li>
36
+ </ol>
266
37
  </div>
267
-
268
- <div id="method-M000046" class="method-detail">
269
- <a name="M000046"></a>
270
-
271
- <div class="method-heading">
272
- <a href="#M000046" class="method-signature">
273
- <span class="method-name">validate_max_buffer_size</span><span class="method-args">()</span>
274
- </a>
275
- </div>
276
-
277
- <div class="method-description">
278
- <p>
279
- Validates the registration buffer size is greater than the minimum buffer
280
- set by the ZIS.
281
- </p>
282
- <p><a class="source-toggle" href="#"
283
- onclick="toggleCode('M000046-source');return false;">[Source]</a></p>
284
- <div class="method-source-code" id="M000046-source">
285
- <pre>
286
- <span class="ruby-comment cmt"># File lib/registration.rb, line 74</span>
287
- 74: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_max_buffer_size</span>
288
- 75: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@registration</span>.<span class="ruby-identifier">max_buffer</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">min_buffer</span>
289
- 76: <span class="ruby-identifier">error_response</span>(<span class="ruby-value">5</span>,<span class="ruby-value">6</span>)
290
- 77: <span class="ruby-keyword kw">end</span>
291
- 78: <span class="ruby-keyword kw">end</span>
292
- </pre>
38
+ <div id='content'>
39
+ <div id='text'>
40
+ <div id='description'>
41
+ <p>
42
+ The <a href="Registration.html">Registration</a> module manages Register
43
+ message types and processes registration requests.
44
+ </p>
293
45
  </div>
294
- </div>
295
- </div>
296
-
297
- <div id="method-M000044" class="method-detail">
298
- <a name="M000044"></a>
299
-
300
- <div class="method-heading">
301
- <a href="#M000044" class="method-signature">
302
- <span class="method-name">validate_permission</span><span class="method-args">()</span>
303
- </a>
304
- </div>
305
-
306
- <div class="method-description">
307
- <p>
308
- We need to check for permissions previously assigned for this agent
309
- (possibly from Central Admin).
310
- </p>
311
- <p><a class="source-toggle" href="#"
312
- onclick="toggleCode('M000044-source');return false;">[Source]</a></p>
313
- <div class="method-source-code" id="M000044-source">
314
- <pre>
315
- <span class="ruby-comment cmt"># File lib/registration.rb, line 60</span>
316
- 60: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_permission</span>
317
- 61: <span class="ruby-keyword kw">end</span>
318
- </pre>
46
+ <div id='method-list'>
47
+ <h2>Methods</h2>
48
+ <h3>public instance</h3>
49
+ <ol>
50
+ <li><a href="#M000042">check_for_registration</a></li>
51
+ <li><a href="#M000041">process_registration</a></li>
52
+ <li><a href="#M000043">register</a></li>
53
+ <li><a href="#M000048">registered?</a></li>
54
+ <li><a href="#M000047">validate_max_buffer_size</a></li>
55
+ <li><a href="#M000045">validate_permission</a></li>
56
+ <li><a href="#M000044">validate_source_id</a></li>
57
+ <li><a href="#M000046">validate_version</a></li>
58
+ </ol>
319
59
  </div>
320
- </div>
321
- </div>
322
-
323
- <div id="method-M000043" class="method-detail">
324
- <a name="M000043"></a>
325
-
326
- <div class="method-heading">
327
- <a href="#M000043" class="method-signature">
328
- <span class="method-name">validate_source_id</span><span class="method-args">()</span>
329
- </a>
330
- </div>
331
-
332
- <div class="method-description">
333
- <p>
334
- We may not do anything here - will we pre-permit sources to register? We
335
- could possibly call the Central Admin to qualify the source there?
336
- </p>
337
- <p><a class="source-toggle" href="#"
338
- onclick="toggleCode('M000043-source');return false;">[Source]</a></p>
339
- <div class="method-source-code" id="M000043-source">
340
- <pre>
341
- <span class="ruby-comment cmt"># File lib/registration.rb, line 54</span>
342
- 54: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_source_id</span>
343
- 55: <span class="ruby-keyword kw">end</span>
344
- </pre>
60
+ <div id='context'>
61
+ <div id='includes'>
62
+ <h2>Included modules</h2>
63
+ <ol>
64
+ <li><a href="Messages.html">Siffer::Messages</a></li>
65
+ </ol>
66
+ </div>
345
67
  </div>
346
- </div>
347
- </div>
348
-
349
- <div id="method-M000045" class="method-detail">
350
- <a name="M000045"></a>
351
-
352
- <div class="method-heading">
353
- <a href="#M000045" class="method-signature">
354
- <span class="method-name">validate_version</span><span class="method-args">()</span>
355
- </a>
356
- </div>
357
-
358
- <div class="method-description">
359
- <p>
360
- Currently only validating that the registration version matches identically
361
- to the SIF version implemented by <a href="../Siffer.html">Siffer</a>.
362
- TODO: This will need refinement to provide broader version support.
363
- </p>
364
- <p><a class="source-toggle" href="#"
365
- onclick="toggleCode('M000045-source');return false;">[Source]</a></p>
366
- <div class="method-source-code" id="M000045-source">
367
- <pre>
368
- <span class="ruby-comment cmt"># File lib/registration.rb, line 66</span>
369
- 66: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_version</span>
370
- 67: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@registration</span>.<span class="ruby-identifier">version</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">Siffer</span>.<span class="ruby-identifier">sif_version</span>
371
- 68: <span class="ruby-identifier">error_response</span>(<span class="ruby-value">5</span>,<span class="ruby-value">4</span>,<span class="ruby-node">&quot;Unsupported version: #{@registration.version}&quot;</span>)
372
- 69: <span class="ruby-keyword kw">end</span>
373
- 70: <span class="ruby-keyword kw">end</span>
374
- </pre>
68
+ <div id='section'>
69
+ <div id='methods'>
70
+ <h2>Public instance methods</h2>
71
+ <div class='public-instance method' id='method-M000042'>
72
+ <a name='M000042'> </a>
73
+ <div class='synopsis'>
74
+ <span class='name'>check_for_registration</span>
75
+ <span class='arguments'>()</span>
76
+ </div>
77
+ <div class='description'>
78
+ <p>
79
+ Parses the request body with RequestBody to determine if the the request is
80
+ a registration message. If it is or if the source is already registered it
81
+ passes through, otherwise raises AgentNotRegistered exception.
82
+ </p>
83
+ </div>
84
+ <div class='source'>
85
+ <a class='source-toggle' href='#' onclick="toggleCode('M000042-source'); return false">
86
+ [show source]
87
+ </a>
88
+ <pre id='M000042-source'> <span class="ruby-comment cmt"># File lib/siffer/registration.rb, line 25</span>&#x000A;25: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">check_for_registration</span> &#x000A;26: <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">register?</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">registered?</span>(<span class="ruby-ivar">@request</span>.<span class="ruby-identifier">message</span>.<span class="ruby-identifier">source_id</span>)&#x000A;27: <span class="ruby-identifier">raise</span> <span class="ruby-constant">AgentNotRegistered</span>&#x000A;28: <span class="ruby-keyword kw">end</span>&#x000A;29: <span class="ruby-keyword kw">end</span></pre>
89
+ </div>
90
+ </div>
91
+ <div class='public-instance method' id='method-M000041'>
92
+ <a name='M000041'> </a>
93
+ <div class='synopsis'>
94
+ <span class='name'>process_registration</span>
95
+ <span class='arguments'>()</span>
96
+ </div>
97
+ <div class='description'>
98
+ <p>
99
+ The request (message) is processed for registration requests.
100
+ </p>
101
+ </div>
102
+ <div class='source'>
103
+ <a class='source-toggle' href='#' onclick="toggleCode('M000041-source'); return false">
104
+ [show source]
105
+ </a>
106
+ <pre id='M000041-source'> <span class="ruby-comment cmt"># File lib/siffer/registration.rb, line 12</span>&#x000A;12: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_registration</span>&#x000A;13: <span class="ruby-keyword kw">begin</span>&#x000A;14: <span class="ruby-identifier">check_for_registration</span>&#x000A;15: <span class="ruby-identifier">register</span>&#x000A;16: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">AgentNotRegistered</span>&#x000A;17: <span class="ruby-identifier">error_response</span>(<span class="ruby-value">4</span>,<span class="ruby-value">9</span>)&#x000A;18: <span class="ruby-keyword kw">end</span>&#x000A;19: <span class="ruby-keyword kw">end</span></pre>
107
+ </div>
108
+ </div>
109
+ <div class='public-instance method' id='method-M000043'>
110
+ <a name='M000043'> </a>
111
+ <div class='synopsis'>
112
+ <span class='name'>register</span>
113
+ <span class='arguments'>()</span>
114
+ </div>
115
+ <div class='description'>
116
+ <p>
117
+ Process the message for registration by validating:
118
+ </p>
119
+ <ul>
120
+ <li>source_id
121
+
122
+ </li>
123
+ <li>permissions to register with ZIS
124
+
125
+ </li>
126
+ <li>version compatibility
127
+
128
+ </li>
129
+ <li>buffer size compatibility
130
+
131
+ </li>
132
+ </ul>
133
+ <p>
134
+ If all validations pass the registration is stored by the ZIS and the agent
135
+ is added to the list of agents available to the zone.
136
+ </p>
137
+ </div>
138
+ <div class='source'>
139
+ <a class='source-toggle' href='#' onclick="toggleCode('M000043-source'); return false">
140
+ [show source]
141
+ </a>
142
+ <pre id='M000043-source'> <span class="ruby-comment cmt"># File lib/siffer/registration.rb, line 38</span>&#x000A;38: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">register</span>&#x000A;39: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">register?</span>&#x000A;40: <span class="ruby-ivar">@registration</span> = <span class="ruby-constant">Register</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-ivar">@request</span>.<span class="ruby-identifier">body</span>)&#x000A;41: <span class="ruby-identifier">validate_source_id</span>&#x000A;42: <span class="ruby-identifier">validate_permission</span>&#x000A;43: <span class="ruby-identifier">validate_version</span>&#x000A;44: <span class="ruby-identifier">validate_max_buffer_size</span>&#x000A;45: <span class="ruby-comment cmt"># ignore the fact we haven't stored away any registration information !!!!!!</span>&#x000A;46: <span class="ruby-comment cmt"># ignore the fact we haven't even built a data model for objects and permissions for the acl !!!!!</span>&#x000A;47: <span class="ruby-identifier">ack</span> = <span class="ruby-constant">Ack</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">original</span>, <span class="ruby-identifier">:status</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Status</span>.<span class="ruby-identifier">success</span>(<span class="ruby-constant">Acl</span>.<span class="ruby-identifier">new</span>))&#x000A;48: <span class="ruby-ivar">@response</span> = <span class="ruby-constant">Response</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">ack</span>)&#x000A;49: <span class="ruby-keyword kw">end</span>&#x000A;50: <span class="ruby-keyword kw">end</span></pre>
143
+ </div>
144
+ </div>
145
+ <div class='public-instance method' id='method-M000048'>
146
+ <a name='M000048'> </a>
147
+ <div class='synopsis'>
148
+ <span class='name'>registered?</span>
149
+ <span class='arguments'>(agent)</span>
150
+ </div>
151
+ <div class='description'>
152
+ <p>
153
+ Returns true if the agent is included in the list of Agents previously
154
+ registered.
155
+ </p>
156
+ </div>
157
+ <div class='source'>
158
+ <a class='source-toggle' href='#' onclick="toggleCode('M000048-source'); return false">
159
+ [show source]
160
+ </a>
161
+ <pre id='M000048-source'> <span class="ruby-comment cmt"># File lib/siffer/registration.rb, line 82</span>&#x000A;82: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">registered?</span>(<span class="ruby-identifier">agent</span>)&#x000A;83: <span class="ruby-identifier">agents</span>.<span class="ruby-identifier">has_key?</span> <span class="ruby-identifier">agent</span>&#x000A;84: <span class="ruby-keyword kw">end</span></pre>
162
+ </div>
163
+ </div>
164
+ <div class='public-instance method' id='method-M000047'>
165
+ <a name='M000047'> </a>
166
+ <div class='synopsis'>
167
+ <span class='name'>validate_max_buffer_size</span>
168
+ <span class='arguments'>()</span>
169
+ </div>
170
+ <div class='description'>
171
+ <p>
172
+ Validates the registration buffer size is greater than the minimum buffer
173
+ set by the ZIS.
174
+ </p>
175
+ </div>
176
+ <div class='source'>
177
+ <a class='source-toggle' href='#' onclick="toggleCode('M000047-source'); return false">
178
+ [show source]
179
+ </a>
180
+ <pre id='M000047-source'> <span class="ruby-comment cmt"># File lib/siffer/registration.rb, line 74</span>&#x000A;74: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_max_buffer_size</span>&#x000A;75: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@registration</span>.<span class="ruby-identifier">max_buffer</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">min_buffer</span>&#x000A;76: <span class="ruby-identifier">error_response</span>(<span class="ruby-value">5</span>,<span class="ruby-value">6</span>)&#x000A;77: <span class="ruby-keyword kw">end</span>&#x000A;78: <span class="ruby-keyword kw">end</span></pre>
181
+ </div>
182
+ </div>
183
+ <div class='public-instance method' id='method-M000045'>
184
+ <a name='M000045'> </a>
185
+ <div class='synopsis'>
186
+ <span class='name'>validate_permission</span>
187
+ <span class='arguments'>()</span>
188
+ </div>
189
+ <div class='description'>
190
+ <p>
191
+ We need to check for permissions previously assigned for this agent
192
+ (possibly from Central Admin).
193
+ </p>
194
+ </div>
195
+ <div class='source'>
196
+ <a class='source-toggle' href='#' onclick="toggleCode('M000045-source'); return false">
197
+ [show source]
198
+ </a>
199
+ <pre id='M000045-source'> <span class="ruby-comment cmt"># File lib/siffer/registration.rb, line 60</span>&#x000A;60: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_permission</span>&#x000A;61: <span class="ruby-keyword kw">end</span></pre>
200
+ </div>
201
+ </div>
202
+ <div class='public-instance method' id='method-M000044'>
203
+ <a name='M000044'> </a>
204
+ <div class='synopsis'>
205
+ <span class='name'>validate_source_id</span>
206
+ <span class='arguments'>()</span>
207
+ </div>
208
+ <div class='description'>
209
+ <p>
210
+ We may not do anything here - will we pre-permit sources to register? We
211
+ could possibly call the Central Admin to qualify the source there?
212
+ </p>
213
+ </div>
214
+ <div class='source'>
215
+ <a class='source-toggle' href='#' onclick="toggleCode('M000044-source'); return false">
216
+ [show source]
217
+ </a>
218
+ <pre id='M000044-source'> <span class="ruby-comment cmt"># File lib/siffer/registration.rb, line 54</span>&#x000A;54: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_source_id</span>&#x000A;55: <span class="ruby-keyword kw">end</span></pre>
219
+ </div>
220
+ </div>
221
+ <div class='public-instance method' id='method-M000046'>
222
+ <a name='M000046'> </a>
223
+ <div class='synopsis'>
224
+ <span class='name'>validate_version</span>
225
+ <span class='arguments'>()</span>
226
+ </div>
227
+ <div class='description'>
228
+ <p>
229
+ Currently only validating that the registration version matches identically
230
+ to the SIF version implemented by <a href="../Siffer.html">Siffer</a>.
231
+ TODO: This will need refinement to provide broader version support.
232
+ </p>
233
+ </div>
234
+ <div class='source'>
235
+ <a class='source-toggle' href='#' onclick="toggleCode('M000046-source'); return false">
236
+ [show source]
237
+ </a>
238
+ <pre id='M000046-source'> <span class="ruby-comment cmt"># File lib/siffer/registration.rb, line 66</span>&#x000A;66: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_version</span>&#x000A;67: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@registration</span>.<span class="ruby-identifier">version</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">Siffer</span>.<span class="ruby-identifier">sif_version</span>&#x000A;68: <span class="ruby-identifier">error_response</span>(<span class="ruby-value">5</span>,<span class="ruby-value">4</span>,<span class="ruby-node">&quot;Unsupported version: #{@registration.version}&quot;</span>)&#x000A;69: <span class="ruby-keyword kw">end</span>&#x000A;70: <span class="ruby-keyword kw">end</span></pre>
239
+ </div>
240
+ </div>
241
+ </div>
375
242
  </div>
376
243
  </div>
377
244
  </div>
378
-
379
-
245
+ <div id='footer-push'></div>
246
+ </div>
247
+ <div id='footer'>
248
+ <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
380
249
  </div>
381
-
382
-
383
- </div>
384
-
385
-
386
- <div id="validator-badges">
387
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
388
- </div>
389
-
390
- </body>
391
- </html>
250
+ </body>
251
+ </html>