siffer 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -2
- data/doc/rdoc/classes/Siffer.html +253 -368
- data/doc/rdoc/classes/Siffer/Agent.html +169 -288
- data/doc/rdoc/classes/Siffer/Container.html +158 -279
- data/doc/rdoc/classes/Siffer/Messages.html +79 -139
- data/doc/rdoc/classes/Siffer/Messages/Ack.html +109 -210
- data/doc/rdoc/classes/Siffer/Messages/Acl.html +78 -155
- data/doc/rdoc/classes/Siffer/Messages/Error.html +151 -242
- data/doc/rdoc/classes/Siffer/Messages/Message.html +227 -351
- data/doc/rdoc/classes/Siffer/Messages/Message/Header.html +102 -176
- data/doc/rdoc/classes/Siffer/Messages/Register.html +147 -250
- data/doc/rdoc/classes/Siffer/Messages/RequestBody.html +177 -292
- data/doc/rdoc/classes/Siffer/Messages/Status.html +149 -262
- data/doc/rdoc/classes/Siffer/Messaging.html +204 -323
- data/doc/rdoc/classes/Siffer/Protocol.html +246 -380
- data/doc/rdoc/classes/Siffer/Protocol/NonPostRequest.html +53 -110
- data/doc/rdoc/classes/Siffer/Protocol/UnknownPath.html +53 -110
- data/doc/rdoc/classes/Siffer/Registration.html +243 -383
- data/doc/rdoc/classes/Siffer/Request.html +97 -203
- data/doc/rdoc/classes/Siffer/RequestLogger.html +102 -204
- data/doc/rdoc/classes/Siffer/Response.html +85 -176
- data/doc/rdoc/classes/Siffer/Server.html +150 -236
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/LICENSE.html +75 -128
- data/doc/rdoc/files/README_rdoc.html +130 -183
- data/doc/rdoc/files/lib/siffer/agent_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/container_rb.html +57 -0
- data/doc/rdoc/files/lib/siffer/messages/ack_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/messages/acl_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/messages/error_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/messages/message_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/messages/register_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/messages/request_body_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/messages/status_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/messages_rb.html +63 -0
- data/doc/rdoc/files/lib/siffer/messaging_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/protocol_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/registration_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/request_logger_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/request_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/response_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/server_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer_rb.html +62 -113
- data/doc/rdoc/fr_class_index.html +25 -47
- data/doc/rdoc/fr_file_index.html +39 -46
- data/doc/rdoc/fr_method_index.html +4539 -96
- data/doc/rdoc/index.html +14 -23
- data/doc/rdoc/rdoc-style.css +314 -203
- data/lib/siffer.rb +6 -6
- data/lib/{agent.rb → siffer/agent.rb} +5 -3
- data/lib/{container.rb → siffer/container.rb} +3 -5
- data/lib/siffer/messages.rb +7 -0
- data/lib/{messages → siffer/messages}/ack.rb +0 -0
- data/lib/{messages → siffer/messages}/acl.rb +0 -0
- data/lib/{messages → siffer/messages}/error.rb +0 -0
- data/lib/{messages → siffer/messages}/message.rb +0 -0
- data/lib/{messages → siffer/messages}/register.rb +0 -0
- data/lib/{messages → siffer/messages}/request_body.rb +0 -0
- data/lib/{messages → siffer/messages}/status.rb +0 -0
- data/lib/{messaging.rb → siffer/messaging.rb} +8 -5
- data/lib/{protocol.rb → siffer/protocol.rb} +37 -32
- data/lib/{registration.rb → siffer/registration.rb} +2 -2
- data/lib/siffer/request.rb +28 -0
- data/lib/{request_logger.rb → siffer/request_logger.rb} +8 -7
- data/lib/{response.rb → siffer/response.rb} +1 -1
- data/lib/{server.rb → siffer/server.rb} +5 -3
- data/spec/agent_spec.rb +6 -11
- data/spec/container_spec.rb +2 -2
- data/spec/default_agent +1 -1
- data/spec/messaging_spec.rb +3 -6
- data/spec/protocol_spec.rb +27 -26
- data/spec/registration_spec.rb +2 -2
- data/spec/request_logger_spec.rb +22 -9
- data/spec/request_spec.rb +15 -0
- data/spec/response_spec.rb +2 -2
- data/spec/server_spec.rb +0 -5
- data/spec/spec_helper.rb +9 -0
- metadata +40 -38
- data/doc/rdoc/files/lib/agent_rb.html +0 -101
- data/doc/rdoc/files/lib/container_rb.html +0 -108
- data/doc/rdoc/files/lib/messages/ack_rb.html +0 -101
- data/doc/rdoc/files/lib/messages/acl_rb.html +0 -101
- data/doc/rdoc/files/lib/messages/error_rb.html +0 -101
- data/doc/rdoc/files/lib/messages/message_rb.html +0 -101
- data/doc/rdoc/files/lib/messages/register_rb.html +0 -101
- data/doc/rdoc/files/lib/messages/request_body_rb.html +0 -101
- data/doc/rdoc/files/lib/messages/status_rb.html +0 -101
- data/doc/rdoc/files/lib/messages_rb.html +0 -114
- data/doc/rdoc/files/lib/messaging_rb.html +0 -101
- data/doc/rdoc/files/lib/protocol_rb.html +0 -101
- data/doc/rdoc/files/lib/registration_rb.html +0 -101
- data/doc/rdoc/files/lib/request_logger_rb.html +0 -101
- data/doc/rdoc/files/lib/request_rb.html +0 -101
- data/doc/rdoc/files/lib/response_rb.html +0 -101
- data/doc/rdoc/files/lib/server_rb.html +0 -101
- data/lib/messages.rb +0 -7
- data/lib/request.rb +0 -25
@@ -1,182 +1,91 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
<
|
7
|
-
<
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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::Response</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/response_rb.html">
|
59
|
-
lib/response.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
|
-
Rack::Response
|
69
|
-
</td>
|
70
|
-
</tr>
|
71
|
-
</table>
|
72
|
-
</div>
|
73
|
-
<!-- banner header -->
|
74
|
-
|
75
|
-
<div id="bodyContent">
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
<div id="contextContent">
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
</div>
|
84
|
-
|
85
|
-
<div id="method-list">
|
86
|
-
<h3 class="section-bar">Methods</h3>
|
87
|
-
|
88
|
-
<div class="name-list">
|
89
|
-
<a href="#M000060">from</a>
|
90
|
-
<a href="#M000059">new</a>
|
91
|
-
</div>
|
92
|
-
</div>
|
93
|
-
|
94
|
-
</div>
|
95
|
-
|
96
|
-
|
97
|
-
<!-- if includes -->
|
98
|
-
|
99
|
-
<div id="section">
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
<!-- if method_list -->
|
109
|
-
<div id="methods">
|
110
|
-
<h3 class="section-bar">Public Class methods</h3>
|
111
|
-
|
112
|
-
<div id="method-M000060" class="method-detail">
|
113
|
-
<a name="M000060"></a>
|
114
|
-
|
115
|
-
<div class="method-heading">
|
116
|
-
<a href="#M000060" class="method-signature">
|
117
|
-
<span class="method-name">from</span><span class="method-args">(url,data)</span>
|
118
|
-
</a>
|
119
|
-
</div>
|
120
|
-
|
121
|
-
<div class="method-description">
|
122
|
-
<p><a class="source-toggle" href="#"
|
123
|
-
onclick="toggleCode('M000060-source');return false;">[Source]</a></p>
|
124
|
-
<div class="method-source-code" id="M000060-source">
|
125
|
-
<pre>
|
126
|
-
<span class="ruby-comment cmt"># File lib/response.rb, line 10</span>
|
127
|
-
10: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">from</span>(<span class="ruby-identifier">url</span>,<span class="ruby-identifier">data</span>)
|
128
|
-
11: <span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">url</span>)
|
129
|
-
12: <span class="ruby-keyword kw">begin</span>
|
130
|
-
13: <span class="ruby-identifier">response</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">start</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">host</span>,<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">port</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">http</span><span class="ruby-operator">|</span>
|
131
|
-
14: <span class="ruby-identifier">post</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Post</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span>, {})
|
132
|
-
15: <span class="ruby-identifier">post</span>.<span class="ruby-identifier">body</span> = (<span class="ruby-identifier">data</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value str">"read"</span>)) <span class="ruby-operator">?</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">read</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">data</span>
|
133
|
-
16: <span class="ruby-identifier">post</span>.<span class="ruby-identifier">content_type</span> = <span class="ruby-constant">Siffer</span><span class="ruby-operator">::</span><span class="ruby-constant">Messaging</span><span class="ruby-operator">::</span><span class="ruby-constant">MIME_TYPES</span>[<span class="ruby-value str">"appxml"</span>]
|
134
|
-
17: <span class="ruby-identifier">http</span>.<span class="ruby-identifier">request</span>(<span class="ruby-identifier">post</span>)
|
135
|
-
18: }
|
136
|
-
19: <span class="ruby-constant">Response</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span>,<span class="ruby-identifier">response</span>.<span class="ruby-identifier">code</span>.<span class="ruby-identifier">to_i</span>,<span class="ruby-identifier">response</span>.<span class="ruby-identifier">header</span>.<span class="ruby-identifier">to_hash</span>)
|
137
|
-
20: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ECONNREFUSED</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
138
|
-
21: <span class="ruby-constant">Response</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>, <span class="ruby-value">500</span>, {})
|
139
|
-
22: <span class="ruby-keyword kw">end</span>
|
140
|
-
23: <span class="ruby-keyword kw">end</span>
|
141
|
-
</pre>
|
142
|
-
</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>Class: Siffer::Response [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::Response
|
31
|
+
</h1>
|
32
|
+
<ol class='paths'>
|
33
|
+
<li>
|
34
|
+
<a href="../../files/lib/siffer/response_rb.html">lib/siffer/response.rb</a>
|
35
|
+
</li>
|
36
|
+
</ol>
|
37
|
+
<div class='parent'>
|
38
|
+
Parent:
|
39
|
+
<strong>Rack::Response</strong>
|
143
40
|
</div>
|
144
41
|
</div>
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
<
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
42
|
+
<div id='content'>
|
43
|
+
<div id='text'>
|
44
|
+
<div id='method-list'>
|
45
|
+
<h2>Methods</h2>
|
46
|
+
<h3>public class</h3>
|
47
|
+
<ol>
|
48
|
+
<li><a href="#M000061">from</a></li>
|
49
|
+
<li><a href="#M000060">new</a></li>
|
50
|
+
</ol>
|
51
|
+
</div>
|
52
|
+
<div id='section'>
|
53
|
+
<div id='methods'>
|
54
|
+
<h2>Public class methods</h2>
|
55
|
+
<div class='public-class method' id='method-M000061'>
|
56
|
+
<a name='M000061'> </a>
|
57
|
+
<div class='synopsis'>
|
58
|
+
<span class='name'>from</span>
|
59
|
+
<span class='arguments'>(url,data)</span>
|
60
|
+
</div>
|
61
|
+
<div class='source'>
|
62
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000061-source'); return false">
|
63
|
+
[show source]
|
64
|
+
</a>
|
65
|
+
<pre id='M000061-source'> <span class="ruby-comment cmt"># File lib/siffer/response.rb, line 10</span>
10: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">from</span>(<span class="ruby-identifier">url</span>,<span class="ruby-identifier">data</span>)
11: <span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">url</span>)
12: <span class="ruby-keyword kw">begin</span>
13: <span class="ruby-identifier">response</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">start</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">host</span>,<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">port</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">http</span><span class="ruby-operator">|</span>
14: <span class="ruby-identifier">post</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Post</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span>, {})
15: <span class="ruby-identifier">post</span>.<span class="ruby-identifier">body</span> = (<span class="ruby-identifier">data</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value str">"read"</span>)) <span class="ruby-operator">?</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">read</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">data</span>
16: <span class="ruby-identifier">post</span>.<span class="ruby-identifier">content_type</span> = <span class="ruby-constant">Siffer</span><span class="ruby-operator">::</span><span class="ruby-constant">Messaging</span><span class="ruby-operator">::</span><span class="ruby-constant">MIME_TYPES</span>[<span class="ruby-value str">"appxml"</span>]
17: <span class="ruby-identifier">http</span>.<span class="ruby-identifier">request</span>(<span class="ruby-identifier">post</span>)
18: }
19: <span class="ruby-constant">Response</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span>,<span class="ruby-identifier">response</span>.<span class="ruby-identifier">code</span>.<span class="ruby-identifier">to_i</span>,<span class="ruby-identifier">response</span>.<span class="ruby-identifier">header</span>.<span class="ruby-identifier">to_hash</span>)
20: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ECONNREFUSED</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
21: <span class="ruby-constant">Response</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>, <span class="ruby-value">500</span>, {})
22: <span class="ruby-keyword kw">end</span>
23: <span class="ruby-keyword kw">end</span></pre>
|
66
|
+
</div>
|
67
|
+
</div>
|
68
|
+
<div class='public-class method' id='method-M000060'>
|
69
|
+
<a name='M000060'> </a>
|
70
|
+
<div class='synopsis'>
|
71
|
+
<span class='name'>new</span>
|
72
|
+
<span class='arguments'>(body=[], status=200, header={}, &block)</span>
|
73
|
+
</div>
|
74
|
+
<div class='source'>
|
75
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000060-source'); return false">
|
76
|
+
[show source]
|
77
|
+
</a>
|
78
|
+
<pre id='M000060-source'> <span class="ruby-comment cmt"># File lib/siffer/response.rb, line 5</span>
5: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">body</span>=[], <span class="ruby-identifier">status</span>=<span class="ruby-value">200</span>, <span class="ruby-identifier">header</span>={}, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
6: <span class="ruby-identifier">header</span>[<span class="ruby-value str">"Content-Type"</span>] <span class="ruby-operator">||=</span> <span class="ruby-constant">Siffer</span><span class="ruby-operator">::</span><span class="ruby-constant">Messaging</span><span class="ruby-operator">::</span><span class="ruby-constant">MIME_TYPES</span>[<span class="ruby-value str">"appxmlencoded"</span>]
7: <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">body</span>,<span class="ruby-identifier">status</span>,<span class="ruby-identifier">header</span>,<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
8: <span class="ruby-keyword kw">end</span></pre>
|
79
|
+
</div>
|
80
|
+
</div>
|
81
|
+
</div>
|
166
82
|
</div>
|
167
83
|
</div>
|
168
84
|
</div>
|
169
|
-
|
170
|
-
|
85
|
+
<div id='footer-push'></div>
|
86
|
+
</div>
|
87
|
+
<div id='footer'>
|
88
|
+
<a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
|
171
89
|
</div>
|
172
|
-
|
173
|
-
|
174
|
-
</div>
|
175
|
-
|
176
|
-
|
177
|
-
<div id="validator-badges">
|
178
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
179
|
-
</div>
|
180
|
-
|
181
|
-
</body>
|
182
|
-
</html>
|
90
|
+
</body>
|
91
|
+
</html>
|
@@ -1,242 +1,156 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
<
|
7
|
-
<
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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::Server</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/server_rb.html">
|
59
|
-
lib/server.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
|
-
Object
|
69
|
-
</td>
|
70
|
-
</tr>
|
71
|
-
</table>
|
72
|
-
</div>
|
73
|
-
<!-- banner header -->
|
74
|
-
|
75
|
-
<div id="bodyContent">
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
<div id="contextContent">
|
80
|
-
|
81
|
-
<div id="description">
|
82
|
-
<p>
|
83
|
-
Zone Integration <a href="Server.html">Server</a> Facilitates communication
|
84
|
-
between Agents. Acts as a central point where Agents can send their
|
85
|
-
events/requests and receive the response from other Agents.
|
86
|
-
</p>
|
87
|
-
|
88
|
-
</div>
|
89
|
-
|
90
|
-
|
91
|
-
</div>
|
92
|
-
|
93
|
-
<div id="method-list">
|
94
|
-
<h3 class="section-bar">Methods</h3>
|
95
|
-
|
96
|
-
<div class="name-list">
|
97
|
-
<a href="#M000067">call</a>
|
98
|
-
<a href="#M000066">new</a>
|
99
|
-
</div>
|
100
|
-
</div>
|
101
|
-
|
102
|
-
</div>
|
103
|
-
|
104
|
-
|
105
|
-
<!-- if includes -->
|
106
|
-
<div id="includes">
|
107
|
-
<h3 class="section-bar">Included Modules</h3>
|
108
|
-
|
109
|
-
<div id="includes-list">
|
110
|
-
<span class="include-name"><a href="Protocol.html">Siffer::Protocol</a></span>
|
111
|
-
<span class="include-name"><a href="Registration.html">Siffer::Registration</a></span>
|
112
|
-
</div>
|
113
|
-
</div>
|
114
|
-
|
115
|
-
<div id="section">
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
<div id="attribute-list">
|
122
|
-
<h3 class="section-bar">Attributes</h3>
|
123
|
-
|
124
|
-
<div class="name-list">
|
125
|
-
<table>
|
126
|
-
<tr class="top-aligned-row context-row">
|
127
|
-
<td class="context-item-name">agents</td>
|
128
|
-
<td class="context-item-value"> [R] </td>
|
129
|
-
<td class="context-item-desc"></td>
|
130
|
-
</tr>
|
131
|
-
<tr class="top-aligned-row context-row">
|
132
|
-
<td class="context-item-name">host</td>
|
133
|
-
<td class="context-item-value"> [R] </td>
|
134
|
-
<td class="context-item-desc"></td>
|
135
|
-
</tr>
|
136
|
-
<tr class="top-aligned-row context-row">
|
137
|
-
<td class="context-item-name">min_buffer</td>
|
138
|
-
<td class="context-item-value"> [R] </td>
|
139
|
-
<td class="context-item-desc"></td>
|
140
|
-
</tr>
|
141
|
-
<tr class="top-aligned-row context-row">
|
142
|
-
<td class="context-item-name">name</td>
|
143
|
-
<td class="context-item-value"> [R] </td>
|
144
|
-
<td class="context-item-desc"></td>
|
145
|
-
</tr>
|
146
|
-
<tr class="top-aligned-row context-row">
|
147
|
-
<td class="context-item-name">port</td>
|
148
|
-
<td class="context-item-value"> [R] </td>
|
149
|
-
<td class="context-item-desc"></td>
|
150
|
-
</tr>
|
151
|
-
</table>
|
152
|
-
</div>
|
153
|
-
</div>
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
<!-- if method_list -->
|
158
|
-
<div id="methods">
|
159
|
-
<h3 class="section-bar">Public Class methods</h3>
|
160
|
-
|
161
|
-
<div id="method-M000066" class="method-detail">
|
162
|
-
<a name="M000066"></a>
|
163
|
-
|
164
|
-
<div class="method-heading">
|
165
|
-
<a href="#M000066" class="method-signature">
|
166
|
-
<span class="method-name">new</span><span class="method-args">(options = {})</span>
|
167
|
-
</a>
|
168
|
-
</div>
|
169
|
-
|
170
|
-
<div class="method-description">
|
171
|
-
<pre>
|
172
|
-
options Parameter
|
173
|
-
</pre>
|
174
|
-
<p>
|
175
|
-
name = The name of the ZIS host = The host this instance is started on port
|
176
|
-
= The port to connect to this ZIS admin = The administration site managing
|
177
|
-
this ZIS min_buffer = The minimum buffer size this ZIS will facilitate
|
178
|
-
</p>
|
179
|
-
<p><a class="source-toggle" href="#"
|
180
|
-
onclick="toggleCode('M000066-source');return false;">[Source]</a></p>
|
181
|
-
<div class="method-source-code" id="M000066-source">
|
182
|
-
<pre>
|
183
|
-
<span class="ruby-comment cmt"># File lib/server.rb, line 19</span>
|
184
|
-
19: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span> = {})
|
185
|
-
20: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"Administration URL required"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">include?</span> <span class="ruby-value str">"admin"</span>
|
186
|
-
21: <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value str">"name"</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">"Default Server"</span>
|
187
|
-
22: <span class="ruby-ivar">@host</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value str">"host"</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">"localhost"</span>
|
188
|
-
23: <span class="ruby-ivar">@port</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value str">"port"</span>] <span class="ruby-operator">||</span> <span class="ruby-value">8300</span>
|
189
|
-
24: <span class="ruby-ivar">@min_buffer</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value str">"min_buffer"</span>] <span class="ruby-operator">||</span> <span class="ruby-value">1024</span>
|
190
|
-
25: <span class="ruby-ivar">@agents</span> = {}
|
191
|
-
26: <span class="ruby-keyword kw">end</span>
|
192
|
-
</pre>
|
193
|
-
</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>Class: Siffer::Server [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::Server
|
31
|
+
</h1>
|
32
|
+
<ol class='paths'>
|
33
|
+
<li>
|
34
|
+
<a href="../../files/lib/siffer/server_rb.html">lib/siffer/server.rb</a>
|
35
|
+
</li>
|
36
|
+
</ol>
|
37
|
+
<div class='parent'>
|
38
|
+
Parent:
|
39
|
+
<strong>Object</strong>
|
194
40
|
</div>
|
195
41
|
</div>
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
</
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
42
|
+
<div id='content'>
|
43
|
+
<div id='text'>
|
44
|
+
<div id='description'>
|
45
|
+
<p>
|
46
|
+
Zone Integration <a href="Server.html">Server</a> Facilitates communication
|
47
|
+
between Agents. Acts as a central point where Agents can send their
|
48
|
+
events/requests and receive the response from other Agents.
|
49
|
+
</p>
|
50
|
+
</div>
|
51
|
+
<div id='method-list'>
|
52
|
+
<h2>Methods</h2>
|
53
|
+
<h3>public class</h3>
|
54
|
+
<ol>
|
55
|
+
<li><a href="#M000067">new</a></li>
|
56
|
+
</ol>
|
57
|
+
<h3>public instance</h3>
|
58
|
+
<ol>
|
59
|
+
<li><a href="#M000068">call</a></li>
|
60
|
+
</ol>
|
61
|
+
</div>
|
62
|
+
<div id='context'>
|
63
|
+
<div id='includes'>
|
64
|
+
<h2>Included modules</h2>
|
65
|
+
<ol>
|
66
|
+
<li><a href="Protocol.html">Siffer::Protocol</a></li>
|
67
|
+
<li><a href="Registration.html">Siffer::Registration</a></li>
|
68
|
+
</ol>
|
69
|
+
</div>
|
70
|
+
</div>
|
71
|
+
<div id='section'>
|
72
|
+
<div id='attribute-list'>
|
73
|
+
<h2 class='section-bar'>Attributes</h2>
|
74
|
+
<div class='name-list'>
|
75
|
+
<table>
|
76
|
+
<tr class='top-aligned-row context-row'>
|
77
|
+
<td class='context-item-name'>agents</td>
|
78
|
+
<td class='context-item-value'>[R]</td>
|
79
|
+
<td class='context-item-desc'></td>
|
80
|
+
</tr>
|
81
|
+
<tr class='top-aligned-row context-row'>
|
82
|
+
<td class='context-item-name'>host</td>
|
83
|
+
<td class='context-item-value'>[R]</td>
|
84
|
+
<td class='context-item-desc'></td>
|
85
|
+
</tr>
|
86
|
+
<tr class='top-aligned-row context-row'>
|
87
|
+
<td class='context-item-name'>min_buffer</td>
|
88
|
+
<td class='context-item-value'>[R]</td>
|
89
|
+
<td class='context-item-desc'></td>
|
90
|
+
</tr>
|
91
|
+
<tr class='top-aligned-row context-row'>
|
92
|
+
<td class='context-item-name'>name</td>
|
93
|
+
<td class='context-item-value'>[R]</td>
|
94
|
+
<td class='context-item-desc'></td>
|
95
|
+
</tr>
|
96
|
+
<tr class='top-aligned-row context-row'>
|
97
|
+
<td class='context-item-name'>port</td>
|
98
|
+
<td class='context-item-value'>[R]</td>
|
99
|
+
<td class='context-item-desc'></td>
|
100
|
+
</tr>
|
101
|
+
</table>
|
102
|
+
</div>
|
103
|
+
</div>
|
104
|
+
<div id='methods'>
|
105
|
+
<h2>Public class methods</h2>
|
106
|
+
<div class='public-class method' id='method-M000067'>
|
107
|
+
<a name='M000067'> </a>
|
108
|
+
<div class='synopsis'>
|
109
|
+
<span class='name'>new</span>
|
110
|
+
<span class='arguments'>(options = {})</span>
|
111
|
+
</div>
|
112
|
+
<div class='description'>
|
113
|
+
<pre>options Parameter</pre>
|
114
|
+
<p>
|
115
|
+
name = The name of the ZIS host = The host this instance is started on port
|
116
|
+
= The port to connect to this ZIS admin = The administration site managing
|
117
|
+
this ZIS min_buffer = The minimum buffer size this ZIS will facilitate
|
118
|
+
</p>
|
119
|
+
</div>
|
120
|
+
<div class='source'>
|
121
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000067-source'); return false">
|
122
|
+
[show source]
|
123
|
+
</a>
|
124
|
+
<pre id='M000067-source'> <span class="ruby-comment cmt"># File lib/siffer/server.rb, line 19</span>
19: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span> = {})
20: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"Administration URL required"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">include?</span> <span class="ruby-value str">"admin"</span>
21: <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value str">"name"</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">"Default Server"</span>
22: <span class="ruby-ivar">@host</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value str">"host"</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">"localhost"</span>
23: <span class="ruby-ivar">@port</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value str">"port"</span>] <span class="ruby-operator">||</span> <span class="ruby-value">8300</span>
24: <span class="ruby-ivar">@min_buffer</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value str">"min_buffer"</span>] <span class="ruby-operator">||</span> <span class="ruby-value">1024</span>
25: <span class="ruby-ivar">@agents</span> = {}
26: <span class="ruby-keyword kw">end</span></pre>
|
125
|
+
</div>
|
126
|
+
</div>
|
127
|
+
<h2>Public instance methods</h2>
|
128
|
+
<div class='public-instance method' id='method-M000068'>
|
129
|
+
<a name='M000068'> </a>
|
130
|
+
<div class='synopsis'>
|
131
|
+
<span class='name'>call</span>
|
132
|
+
<span class='arguments'>(env)</span>
|
133
|
+
</div>
|
134
|
+
<div class='description'>
|
135
|
+
<p>
|
136
|
+
Process the request with all the SIF protocols
|
137
|
+
</p>
|
138
|
+
</div>
|
139
|
+
<div class='source'>
|
140
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000068-source'); return false">
|
141
|
+
[show source]
|
142
|
+
</a>
|
143
|
+
<pre id='M000068-source'> <span class="ruby-comment cmt"># File lib/siffer/server.rb, line 29</span>
29: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
30: <span class="ruby-identifier">with_each_request</span>(<span class="ruby-identifier">env</span>) <span class="ruby-keyword kw">do</span>
31: <span class="ruby-identifier">process_registration</span>
32: <span class="ruby-comment cmt"># process_provision MAYBE SAME MODULE</span>
33: <span class="ruby-comment cmt"># process_subscription MAYBE SAME MODULE</span>
34: <span class="ruby-comment cmt"># process_event (server process not agent) REDIRECTS</span>
35: <span class="ruby-comment cmt"># process_request (server process not agent) REDIRECTS</span>
36: <span class="ruby-comment cmt"># process_response (server process not agent) REDIRECTS</span>
37: <span class="ruby-keyword kw">end</span>
38: <span class="ruby-keyword kw">end</span></pre>
|
144
|
+
</div>
|
145
|
+
</div>
|
146
|
+
</div>
|
226
147
|
</div>
|
227
148
|
</div>
|
228
149
|
</div>
|
229
|
-
|
230
|
-
|
150
|
+
<div id='footer-push'></div>
|
151
|
+
</div>
|
152
|
+
<div id='footer'>
|
153
|
+
<a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
|
231
154
|
</div>
|
232
|
-
|
233
|
-
|
234
|
-
</div>
|
235
|
-
|
236
|
-
|
237
|
-
<div id="validator-badges">
|
238
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
239
|
-
</div>
|
240
|
-
|
241
|
-
</body>
|
242
|
-
</html>
|
155
|
+
</body>
|
156
|
+
</html>
|