Skip to content
This repository
Browse code

Removed generic parameter in WSF_FILTER_HANDLER, since it is useless …

…and make code heavy

Signed-off-by: Olivier Ligot <oligot@gmail.com>
Signed-off-by: Jocelyn Fiat <jfiat@eiffel.com>
  • Loading branch information...
commit aa743c0a7d24c8c0b1dd8e4866a103802e31a55e 1 parent 2d3151e
Jocelyn Fiat authored October 08, 2012
25  examples/filter/src/database/database_api.e
@@ -24,6 +24,31 @@ feature -- Initialization
24 24
 
25 25
 feature -- Access
26 26
 
  27
+	user (a_id: INTEGER; a_name: detachable READABLE_STRING_GENERAL): detachable USER
  28
+			-- User with id `a_id' or name `a_name'.
  29
+		require
  30
+			a_id > 0 xor a_name /= Void
  31
+		local
  32
+			n: like {USER}.name
  33
+		do
  34
+			if a_id > 0 then
  35
+				Result := users.item (a_id)
  36
+			elseif a_name /= Void then
  37
+				n := a_name.as_string_8
  38
+				across
  39
+					users as c
  40
+				until
  41
+					Result /= Void
  42
+				loop
  43
+					if attached c.item as u and then u.name.same_string (n) then
  44
+						Result := u
  45
+					end
  46
+				end
  47
+			end
  48
+		ensure
  49
+			Result /= Void implies ((a_id > 0 and then Result.id = a_id) xor (a_name /= Void and then Result.name.same_string_general (a_name)))
  50
+		end
  51
+
27 52
 	users: HASH_TABLE [USER, INTEGER]
28 53
 
29 54
 ;note
10  examples/filter/src/filter/authentication_filter.e
@@ -8,7 +8,7 @@ class
8 8
 	AUTHENTICATION_FILTER
9 9
 
10 10
 inherit
11  
-	WSF_FILTER_CONTEXT_HANDLER [FILTER_HANDLER_CONTEXT, WSF_URI_TEMPLATE_CONTEXT_HANDLER [FILTER_HANDLER_CONTEXT]]
  11
+	WSF_FILTER_CONTEXT_HANDLER [FILTER_HANDLER_CONTEXT]
12 12
 
13 13
 	WSF_URI_TEMPLATE_CONTEXT_HANDLER [FILTER_HANDLER_CONTEXT]
14 14
 
@@ -25,9 +25,11 @@ feature -- Basic operations
25 25
 		do
26 26
 			create l_auth.make (req.http_authorization)
27 27
 			if (attached l_auth.type as l_auth_type and then l_auth_type.is_equal ("basic")) and
28  
-				attached Db_access.users.item (1) as l_user and then
29  
-				(attached l_auth.login as l_auth_login and then l_auth_login.is_equal (l_user.name)
30  
-				and attached l_auth.password as l_auth_password and then l_auth_password.is_equal (l_user.password))
  28
+				attached l_auth.login as l_auth_login and then
  29
+				attached Db_access.user (0, l_auth_login) as l_user and then
  30
+				l_auth_login.same_string (l_user.name) and then
  31
+				attached l_auth.password as l_auth_password and then
  32
+				l_auth_password.same_string (l_user.password)
31 33
 			then
32 34
 				ctx.set_user (l_user)
33 35
 				execute_next (ctx, req, res)
2  examples/filter/src/resource/user_handler.e
@@ -8,7 +8,7 @@ class
8 8
 	USER_HANDLER
9 9
 
10 10
 inherit
11  
-	WSF_FILTER_CONTEXT_HANDLER [FILTER_HANDLER_CONTEXT, WSF_URI_TEMPLATE_CONTEXT_HANDLER [FILTER_HANDLER_CONTEXT]]
  11
+	WSF_FILTER_CONTEXT_HANDLER [FILTER_HANDLER_CONTEXT]
12 12
 
13 13
 	WSF_URI_TEMPLATE_CONTEXT_HANDLER [FILTER_HANDLER_CONTEXT]
14 14
 
93  library/server/wsf/extension/wsf_resource_context_handler_helper.e
@@ -23,17 +23,21 @@ feature -- Basic operations
23 23
 				execute_delete (ctx, req, res)
24 24
 			elseif m.same_string ({HTTP_REQUEST_METHODS}.method_post) then
25 25
 				execute_post (ctx, req, res)
  26
+			elseif m.same_string ({HTTP_REQUEST_METHODS}.method_trace) then
  27
+				execute_trace (ctx, req, res)
26 28
 			elseif m.same_string ({HTTP_REQUEST_METHODS}.method_options) then
27 29
 				execute_options (ctx, req, res)
28 30
 			elseif m.same_string ({HTTP_REQUEST_METHODS}.method_head) then
29 31
 				execute_head (ctx, req, res)
  32
+			elseif m.same_string ({HTTP_REQUEST_METHODS}.method_connect) then
  33
+				execute_connect (ctx, req, res)
30 34
 			else
31 35
 					--| Eventually handle other methods...
32 36
 				execute_extension_method (ctx, req, res)
33 37
 			end
34 38
 		end
35 39
 
36  
-feature {NONE} -- Implementation
  40
+feature -- Method Get
37 41
 
38 42
 	execute_get (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
39 43
 		do
@@ -52,6 +56,8 @@ feature {NONE} -- Implementation
52 56
 			handle_not_implemented ("Method GET not implemented", req, res)
53 57
 		end
54 58
 
  59
+feature -- Method Post
  60
+
55 61
 	execute_post (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
56 62
 		do
57 63
 			if req.is_chunked_input then
@@ -78,6 +84,8 @@ feature {NONE} -- Implementation
78 84
 			handle_not_implemented ("Method POST not implemented",  req, res)
79 85
 		end
80 86
 
  87
+feature-- Method Put		
  88
+
81 89
 	execute_put (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
82 90
 		do
83 91
 			if req.is_chunked_input then
@@ -96,20 +104,36 @@ feature {NONE} -- Implementation
96 104
 			handle_not_implemented ("Method PUT not implemented", req, res)
97 105
 		end
98 106
 
  107
+feature -- Method DELETE		
  108
+
99 109
 	execute_delete (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
100 110
 		do
101 111
 			do_delete (ctx, req, res)
102 112
 		end
103 113
 
104 114
 	do_delete (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
105  
-		-- Here we use DELETE to logically delete a person.
106  
-		-- 204 if is ok
107  
-		-- 404 Resource not found
108  
-		-- 500 if we have an internal server error
  115
+			-- Here we use DELETE to logically delete a person.
  116
+			-- 204 if is ok
  117
+			-- 404 Resource not found
  118
+			-- 500 if we have an internal server error
109 119
 		do
110 120
 			handle_not_implemented ("Method DELETE not implemented", req, res)
111 121
 		end
112 122
 
  123
+feature -- Method CONNECT
  124
+
  125
+	execute_connect (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
  126
+		do
  127
+			do_connect (ctx, req, res)
  128
+		end
  129
+
  130
+	do_connect (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
  131
+		do
  132
+			handle_not_implemented ("Method CONNECT not implemented", req, res)
  133
+		end
  134
+
  135
+feature -- Method HEAD		
  136
+
113 137
 	execute_head (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
114 138
 		do
115 139
 			do_head (ctx, req, res)
@@ -127,6 +151,8 @@ feature {NONE} -- Implementation
127 151
 			handle_not_implemented ("Method HEAD not implemented", req, res)
128 152
 		end
129 153
 
  154
+feature -- Method OPTIONS
  155
+
130 156
 	execute_options (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
131 157
 		do
132 158
 			do_options (ctx, req, res)
@@ -139,6 +165,20 @@ feature {NONE} -- Implementation
139 165
 			handle_not_implemented ("Method OPTIONS not implemented", req, res)
140 166
 		end
141 167
 
  168
+feature -- Method TRACE
  169
+
  170
+	execute_trace (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
  171
+		do
  172
+			do_trace (ctx, req, res)
  173
+		end
  174
+
  175
+	do_trace (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
  176
+		do
  177
+			handle_not_implemented ("Method TRACE not implemented", req, res)
  178
+		end
  179
+
  180
+feature -- Method Extension Method		
  181
+
142 182
 	execute_extension_method (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
143 183
 		do
144 184
 			do_extension_method (ctx, req, res)
@@ -149,13 +189,25 @@ feature {NONE} -- Implementation
149 189
 			handle_not_implemented ("Method extension-method not implemented", req, res)
150 190
 		end
151 191
 
  192
+feature -- Handle responses
  193
+	-- TODO Handle Content negotiation.
  194
+	-- The option : Server-driven negotiation: uses request headers to select a variant
  195
+	-- More info : http://www.w3.org/Protocols/rfc2616/rfc2616-sec12.html#sec12
  196
+
  197
+--	supported_content_types: detachable ARRAY [READABLE_STRING_8]
  198
+--			-- Supported content types
  199
+--			-- Can be redefined
  200
+--		do
  201
+--			Result := Void
  202
+--		end
  203
+
152 204
 	handle_error (a_description: STRING; a_status_code: INTEGER; req: WSF_REQUEST; res: WSF_RESPONSE)
153 205
 			-- Handle an error.
154 206
 		local
155 207
 			h: HTTP_HEADER
156 208
 		do
157 209
 			create h.make
158  
-			h.put_content_type_application_json
  210
+			h.put_content_type_text_plain
159 211
 			h.put_content_length (a_description.count)
160 212
 			h.put_current_date
161 213
 			res.set_status_code (a_status_code)
@@ -184,8 +236,35 @@ feature {NONE} -- Implementation
184 236
 			handle_error (a_description, {HTTP_STATUS_CODE}.forbidden, req, res)
185 237
 		end
186 238
 
  239
+feature -- Handle responses: others		
  240
+
  241
+	handle_precondition_fail_response (a_description: STRING; req: WSF_REQUEST; res: WSF_RESPONSE )
  242
+		do
  243
+			handle_error (a_description, {HTTP_STATUS_CODE}.precondition_failed, req, res)
  244
+		end
  245
+
  246
+	handle_internal_server_error (a_description: STRING; req: WSF_REQUEST; res: WSF_RESPONSE )
  247
+		do
  248
+			handle_error (a_description, {HTTP_STATUS_CODE}.internal_server_error, req, res)
  249
+		end
  250
+
  251
+	handle_method_not_allowed_response (a_description: STRING; req: WSF_REQUEST; res: WSF_RESPONSE)
  252
+		do
  253
+			handle_error (a_description, {HTTP_STATUS_CODE}.method_not_allowed, req, res)
  254
+		end
  255
+
  256
+	handle_resource_not_modified_response (a_description: STRING; req: WSF_REQUEST; res: WSF_RESPONSE)
  257
+		do
  258
+			handle_error (a_description, {HTTP_STATUS_CODE}.not_modified, req, res)
  259
+		end
  260
+
  261
+	handle_resource_conflict_response (a_description: STRING; req: WSF_REQUEST; res: WSF_RESPONSE)
  262
+		do
  263
+			handle_error (a_description, {HTTP_STATUS_CODE}.conflict, req, res)
  264
+		end
  265
+
187 266
 note
188  
-	copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
  267
+	copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
189 268
 	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
190 269
 	source: "[
191 270
 			Eiffel Software
167  library/server/wsf/extension/wsf_resource_handler_helper.e
@@ -37,6 +37,25 @@ feature -- Execute template
37 37
 			end
38 38
 		end
39 39
 
  40
+feature -- Method Get
  41
+
  42
+	execute_get (req: WSF_REQUEST; res: WSF_RESPONSE)
  43
+		do
  44
+			do_get (req, res)
  45
+		end
  46
+
  47
+	do_get (req: WSF_REQUEST; res: WSF_RESPONSE)
  48
+			-- Using GET to retrieve resource information.
  49
+			-- If the GET request is SUCCESS, we response with
  50
+			-- 200 OK, and a representation of the person
  51
+			-- If the GET request is not SUCCESS, we response with
  52
+			-- 404 Resource not found
  53
+			-- If is a Condition GET and the resource does not change we send a
  54
+			-- 304, Resource not modifed	
  55
+		do
  56
+			handle_not_implemented ("Method GET not implemented", req, res)
  57
+		end
  58
+
40 59
 feature -- Method Post
41 60
 
42 61
 	execute_post (req: WSF_REQUEST; res: WSF_RESPONSE)
@@ -53,6 +72,14 @@ feature -- Method Post
53 72
 		end
54 73
 
55 74
 	do_post (req: WSF_REQUEST; res: WSF_RESPONSE)
  75
+			-- Here the convention is the following.
  76
+			-- POST is used for creation and the server determines the URI
  77
+			-- of the created resource.
  78
+			-- If the request post is SUCCESS, the server will create the order and will response with
  79
+			-- HTTP_RESPONSE 201 CREATED, the Location header will contains the newly created order's URI
  80
+			-- if the request post is not SUCCESS, the server will response with
  81
+			-- HTTP_RESPONSE 400 BAD REQUEST, the client send a bad request
  82
+			-- HTTP_RESPONSE 500 INTERNAL_SERVER_ERROR, when the server can deliver the request
56 83
 		do
57 84
 			handle_not_implemented ("Method POST not implemented",  req, res)
58 85
 		end
@@ -77,18 +104,6 @@ feature-- Method Put
77 104
 			handle_not_implemented ("Method PUT not implemented", req, res)
78 105
 		end
79 106
 
80  
-feature -- Method Get
81  
-
82  
-	execute_get (req: WSF_REQUEST; res: WSF_RESPONSE)
83  
-		do
84  
-			do_get (req, res)
85  
-		end
86  
-
87  
-	do_get (req: WSF_REQUEST; res: WSF_RESPONSE)
88  
-		do
89  
-			handle_not_implemented ("Method GET not implemented", req, res)
90  
-		end
91  
-
92 107
 feature -- Method DELETE
93 108
 
94 109
 	execute_delete (req: WSF_REQUEST; res: WSF_RESPONSE)
@@ -97,6 +112,10 @@ feature -- Method DELETE
97 112
 		end
98 113
 
99 114
 	do_delete (req: WSF_REQUEST; res: WSF_RESPONSE)
  115
+			-- Here we use DELETE to logically delete a person.
  116
+			-- 204 if is ok
  117
+			-- 404 Resource not found
  118
+			-- 500 if we have an internal server error	
100 119
 		do
101 120
 			handle_not_implemented ("Method DELETE not implemented", req, res)
102 121
 		end
@@ -121,6 +140,13 @@ feature -- Method HEAD
121 140
 		end
122 141
 
123 142
 	do_head (req: WSF_REQUEST; res: WSF_RESPONSE)
  143
+			-- Using HEAD to retrieve resource information.
  144
+			-- If the HEAD request is SUCCESS, we response with
  145
+			-- 200 OK, and WITHOUT a representation of the person
  146
+			-- If the HEAD request is not SUCCESS, we response with
  147
+			-- 404 Resource not found
  148
+			-- If is a Condition HEAD and the resource does not change we send a
  149
+			-- 304, Resource not modifed	
124 150
 		do
125 151
 			handle_not_implemented ("Method HEAD not implemented", req, res)
126 152
 		end
@@ -201,122 +227,77 @@ feature -- Handle responses
201 227
 	-- The option : Server-driven negotiation: uses request headers to select a variant
202 228
 	-- More info : http://www.w3.org/Protocols/rfc2616/rfc2616-sec12.html#sec12
203 229
 
204  
-	supported_content_types: detachable ARRAY [READABLE_STRING_8]
205  
-			-- Supported content types
206  
-			-- Can be redefined
207  
-		do
208  
-			Result := Void
209  
-		end
  230
+--	supported_content_types: detachable ARRAY [READABLE_STRING_8]
  231
+--			-- Supported content types
  232
+--			-- Can be redefined
  233
+--		do
  234
+--			Result := Void
  235
+--		end
210 236
 
211  
-	handle_bad_request_response (a_description: STRING; req: WSF_REQUEST; res: WSF_RESPONSE )
  237
+	handle_error (a_description: STRING; a_status_code: INTEGER; req: WSF_REQUEST; res: WSF_RESPONSE)
  238
+			-- Handle an error.
212 239
 		local
213  
-			h : HTTP_HEADER
  240
+			h: HTTP_HEADER
214 241
 		do
215 242
 			create h.make
216  
-			h.put_content_type_application_json
  243
+			h.put_content_type_text_plain
217 244
 			h.put_content_length (a_description.count)
218 245
 			h.put_current_date
219  
-			res.set_status_code ({HTTP_STATUS_CODE}.bad_request)
  246
+			res.set_status_code (a_status_code)
220 247
 			res.put_header_text (h.string)
221 248
 			res.put_string (a_description)
222 249
 		end
223 250
 
224  
-	handle_precondition_fail_response (a_description: STRING; req: WSF_REQUEST; res: WSF_RESPONSE )
225  
-		local
226  
-			h : HTTP_HEADER
  251
+	handle_not_implemented (a_description: STRING; req: WSF_REQUEST; res: WSF_RESPONSE)
227 252
 		do
228  
-			create h.make
229  
-			h.put_content_type_application_json
230  
-			h.put_content_length (a_description.count)
231  
-			h.put_current_date
232  
-			res.set_status_code ({HTTP_STATUS_CODE}.precondition_failed)
233  
-			res.put_header_text (h.string)
234  
-			res.put_string (a_description)
  253
+			handle_error (a_description, {HTTP_STATUS_CODE}.not_implemented, req, res)
235 254
 		end
236 255
 
237  
-	handle_internal_server_error (a_description: STRING; req: WSF_REQUEST; res: WSF_RESPONSE )
238  
-		local
239  
-			h : HTTP_HEADER
  256
+	handle_bad_request_response (a_description: STRING; req: WSF_REQUEST; res: WSF_RESPONSE)
240 257
 		do
241  
-			create h.make
242  
-			h.put_content_type_application_json
243  
-			h.put_content_length (a_description.count)
244  
-			h.put_current_date
245  
-			res.set_status_code ({HTTP_STATUS_CODE}.internal_server_error)
246  
-			res.put_header_text (h.string)
247  
-			res.put_string (a_description)
  258
+			handle_error (a_description, {HTTP_STATUS_CODE}.bad_request, req, res)
248 259
 		end
249 260
 
250  
-	handle_not_implemented (a_description: STRING; req: WSF_REQUEST; res: WSF_RESPONSE )
251  
-		local
252  
-			h : HTTP_HEADER
  261
+	handle_resource_not_found_response (a_description: STRING; req: WSF_REQUEST; res: WSF_RESPONSE)
253 262
 		do
254  
-			create h.make
255  
-			h.put_content_type_application_json
256  
-			h.put_content_length (a_description.count)
257  
-			h.put_current_date
258  
-			res.set_status_code ({HTTP_STATUS_CODE}.not_implemented)
259  
-			res.put_header_text (h.string)
260  
-			res.put_string (a_description)
  263
+			handle_error (a_description, {HTTP_STATUS_CODE}.not_found, req, res)
261 264
 		end
262 265
 
263  
-	handle_method_not_allowed_response (a_description: STRING; req: WSF_REQUEST; res: WSF_RESPONSE)
264  
-		local
265  
-			h : HTTP_HEADER
  266
+	handle_forbidden (a_description: STRING; req: WSF_REQUEST; res: WSF_RESPONSE)
  267
+			-- Handle forbidden.
266 268
 		do
267  
-			create h.make
268  
-			h.put_content_type_application_json
269  
-			h.put_content_length (a_description.count)
270  
-			h.put_current_date
271  
-			res.set_status_code ({HTTP_STATUS_CODE}.method_not_allowed)
272  
-			res.put_header_text (h.string)
273  
-			res.put_string (a_description)
  269
+			handle_error (a_description, {HTTP_STATUS_CODE}.forbidden, req, res)
274 270
 		end
275 271
 
276  
-	handle_resource_not_found_response (a_description: STRING; req: WSF_REQUEST; res: WSF_RESPONSE)
277  
-		local
278  
-			h : HTTP_HEADER
  272
+feature -- Handle responses: others		
  273
+
  274
+	handle_precondition_fail_response (a_description: STRING; req: WSF_REQUEST; res: WSF_RESPONSE )
279 275
 		do
280  
-			create h.make
281  
-			h.put_content_type_application_json
282  
-			h.put_content_length (a_description.count)
283  
-			h.put_current_date
284  
-			res.set_status_code ({HTTP_STATUS_CODE}.not_found)
285  
-			res.put_header_text (h.string)
286  
-			res.put_string (a_description)
  276
+			handle_error (a_description, {HTTP_STATUS_CODE}.precondition_failed, req, res)
287 277
 		end
288 278
 
  279
+	handle_internal_server_error (a_description: STRING; req: WSF_REQUEST; res: WSF_RESPONSE )
  280
+		do
  281
+			handle_error (a_description, {HTTP_STATUS_CODE}.internal_server_error, req, res)
  282
+		end
289 283
 
290  
-	handle_resource_not_modified_response (a_description: STRING; req: WSF_REQUEST; res: WSF_RESPONSE)
291  
-		local
292  
-			h : HTTP_HEADER
  284
+	handle_method_not_allowed_response (a_description: STRING; req: WSF_REQUEST; res: WSF_RESPONSE)
293 285
 		do
294  
-			res.flush
295  
-			create h.make
296  
-			h.put_content_type_application_json
297  
-			h.put_content_length (a_description.count)
298  
-			h.put_current_date
299  
-			res.set_status_code ({HTTP_STATUS_CODE}.not_modified)
300  
-			res.put_header_text (h.string)
301  
-			res.put_string (a_description)
  286
+			handle_error (a_description, {HTTP_STATUS_CODE}.method_not_allowed, req, res)
302 287
 		end
303 288
 
  289
+	handle_resource_not_modified_response (a_description: STRING; req: WSF_REQUEST; res: WSF_RESPONSE)
  290
+		do
  291
+			handle_error (a_description, {HTTP_STATUS_CODE}.not_modified, req, res)
  292
+		end
304 293
 
305 294
 	handle_resource_conflict_response (a_description: STRING; req: WSF_REQUEST; res: WSF_RESPONSE)
306  
-		local
307  
-			h : HTTP_HEADER
308 295
 		do
309  
-			create h.make
310  
-			h.put_content_type_application_json
311  
-			h.put_content_length (a_description.count)
312  
-			h.put_current_date
313  
-			res.set_status_code ({HTTP_STATUS_CODE}.conflict)
314  
-			res.put_header_text (h.string)
315  
-			res.put_string (a_description)
  296
+			handle_error (a_description, {HTTP_STATUS_CODE}.conflict, req, res)
316 297
 		end
317 298
 
318 299
 note
319  
-	copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
  300
+	copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
320 301
 	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
321 302
 	source: "[
322 303
 			Eiffel Software
12  ...erver/wsf/src/filter/wsf_filter_context_handler.e → ...r/wsf/router/context/wsf_filter_context_handler.e
@@ -5,13 +5,21 @@ note
5 5
 	revision: "$Revision$"
6 6
 
7 7
 deferred class
8  
-	WSF_FILTER_CONTEXT_HANDLER [C -> WSF_HANDLER_CONTEXT create make end, H -> WSF_CONTEXT_HANDLER [C]]
  8
+	WSF_FILTER_CONTEXT_HANDLER [C -> WSF_HANDLER_CONTEXT create make end]
9 9
 
10 10
 inherit
11  
-	WSF_FILTER_HANDLER [H]
  11
+	WSF_FILTER_HANDLER
  12
+		redefine
  13
+			next
  14
+		end
12 15
 
13 16
 	WSF_CONTEXT_HANDLER [C]
14 17
 
  18
+feature -- Access
  19
+
  20
+	next: detachable WSF_CONTEXT_HANDLER [C]
  21
+			-- Next handler	
  22
+
15 23
 feature {NONE} -- Implementation
16 24
 
17 25
 	execute_next (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
0  library/server/wsf/src/filter/README.md → library/server/wsf/router/filter/README.md
Source Rendered
File renamed without changes
0  library/server/wsf/src/filter/wsf_filter.e → library/server/wsf/router/filter/wsf_filter.e
File renamed without changes
4  library/server/wsf/src/filter/wsf_filter_handler.e → ...ary/server/wsf/router/filter/wsf_filter_handler.e
@@ -8,14 +8,14 @@ note
8 8
 	revision: "$Revision$"
9 9
 
10 10
 deferred class
11  
-	WSF_FILTER_HANDLER [H -> WSF_HANDLER]
  11
+	WSF_FILTER_HANDLER
12 12
 
13 13
 inherit
14 14
 	WSF_HANDLER
15 15
 
16 16
 feature -- Access
17 17
 
18  
-	next: detachable H
  18
+	next: detachable WSF_HANDLER
19 19
 			-- Next handler
20 20
 
21 21
 feature -- Element change
0  library/server/wsf/src/filter/wsf_filtered_service.e → ...y/server/wsf/router/filter/wsf_filtered_service.e
File renamed without changes
0  library/server/wsf/src/filter/wsf_routing_filter.e → ...ary/server/wsf/router/filter/wsf_routing_filter.e
File renamed without changes
42  library/server/wsf/router/support/starts_with/helpers/wsf_starts_with_filter_handler.e
... ...
@@ -0,0 +1,42 @@
  1
+note
  2
+	description : "Objects that ..."
  3
+	author      : "$Author$"
  4
+	date        : "$Date$"
  5
+	revision    : "$Revision$"
  6
+
  7
+deferred class
  8
+	WSF_STARTS_WITH_FILTER_HANDLER
  9
+
  10
+inherit
  11
+	WSF_FILTER_HANDLER
  12
+		redefine
  13
+			next
  14
+		end
  15
+
  16
+	WSF_STARTS_WITH_HANDLER
  17
+
  18
+feature -- Access
  19
+
  20
+	next: detachable WSF_STARTS_WITH_FILTER_HANDLER
  21
+			-- Next handler	
  22
+
  23
+feature -- Execution
  24
+
  25
+	execute_next (a_start_path: READABLE_STRING_8; req: WSF_REQUEST; res: WSF_RESPONSE)
  26
+		do
  27
+			if attached next as n then
  28
+				n.execute (a_start_path, req, res)
  29
+			end
  30
+		end
  31
+
  32
+note
  33
+	copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
  34
+	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
  35
+	source: "[
  36
+			Eiffel Software
  37
+			5949 Hollister Ave., Goleta, CA 93117 USA
  38
+			Telephone 805-685-1006, Fax 805-685-6869
  39
+			Website http://www.eiffel.com
  40
+			Customer support http://support.eiffel.com
  41
+		]"
  42
+end
12  ...ry/server/wsf/src/filter/wsf_filter_uri_handler.e → ...uter/support/uri/helpers/wsf_uri_filter_handler.e
@@ -5,13 +5,21 @@ note
5 5
 	revision    : "$Revision$"
6 6
 
7 7
 deferred class
8  
-	WSF_FILTER_URI_HANDLER
  8
+	WSF_URI_FILTER_HANDLER
9 9
 
10 10
 inherit
11  
-	WSF_FILTER_HANDLER [WSF_URI_HANDLER]
  11
+	WSF_FILTER_HANDLER
  12
+		redefine
  13
+			next
  14
+		end
12 15
 
13 16
 	WSF_URI_HANDLER
14 17
 
  18
+feature -- Access
  19
+
  20
+	next: detachable WSF_URI_FILTER_HANDLER
  21
+			-- Next handler	
  22
+
15 23
 feature -- Execution
16 24
 
17 25
 	execute_next (req: WSF_REQUEST; res: WSF_RESPONSE)
12  .../wsf/src/filter/wsf_filter_uri_template_handler.e → ...emplate/helpers/wsf_uri_template_filter_handler.e
@@ -5,13 +5,21 @@ note
5 5
 	revision    : "$Revision$"
6 6
 
7 7
 deferred class
8  
-	WSF_FILTER_URI_TEMPLATE_HANDLER
  8
+	WSF_URI_TEMPLATE_FILTER_HANDLER
9 9
 
10 10
 inherit
11  
-	WSF_FILTER_HANDLER [WSF_URI_TEMPLATE_HANDLER]
  11
+	WSF_FILTER_HANDLER
  12
+		redefine
  13
+			next
  14
+		end
12 15
 
13 16
 	WSF_URI_TEMPLATE_HANDLER
14 17
 
  18
+feature -- Access
  19
+
  20
+	next: detachable WSF_URI_TEMPLATE_HANDLER
  21
+			-- Next handler	
  22
+
15 23
 feature -- Execution
16 24
 
17 25
 	execute_next (req: WSF_REQUEST; res: WSF_RESPONSE)
42  ...ry/server/wsf/router/support/uri_template_with_context/helpers/wsf_uri_template_filter_context_handler.e
... ...
@@ -0,0 +1,42 @@
  1
+note
  2
+	description : "Objects that ..."
  3
+	author      : "$Author$"
  4
+	date        : "$Date$"
  5
+	revision    : "$Revision$"
  6
+
  7
+deferred class
  8
+	WSF_URI_TEMPLATE_FILTER_CONTEXT_HANDLER [C -> WSF_HANDLER_CONTEXT create make end]
  9
+
  10
+inherit
  11
+	WSF_FILTER_HANDLER
  12
+		redefine
  13
+			next
  14
+		end
  15
+
  16
+	WSF_URI_TEMPLATE_CONTEXT_HANDLER [C]
  17
+
  18
+feature -- Access
  19
+
  20
+	next: detachable WSF_URI_TEMPLATE_CONTEXT_HANDLER [C]
  21
+			-- Next handler	
  22
+
  23
+feature -- Execution
  24
+
  25
+	execute_next (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
  26
+		do
  27
+			if attached next as n then
  28
+				n.execute (ctx, req, res)
  29
+			end
  30
+		end
  31
+
  32
+note
  33
+	copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
  34
+	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
  35
+	source: "[
  36
+			Eiffel Software
  37
+			5949 Hollister Ave., Goleta, CA 93117 USA
  38
+			Telephone 805-685-1006, Fax 805-685-6869
  39
+			Website http://www.eiffel.com
  40
+			Customer support http://support.eiffel.com
  41
+		]"
  42
+end

0 notes on commit aa743c0

Please sign in to comment.
Something went wrong with that request. Please try again.