From 7dce121f8cd722e22a93c579a58452b9ad611378 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Mon, 22 Oct 2012 14:54:02 +0200 Subject: [PATCH] added REST_URI_TEMPLATE_ROUTING_HANDLER --- .../rest_uri_template_routing_handler.e | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 draft/library/server/request/rest/src/uri_template/rest_uri_template_routing_handler.e diff --git a/draft/library/server/request/rest/src/uri_template/rest_uri_template_routing_handler.e b/draft/library/server/request/rest/src/uri_template/rest_uri_template_routing_handler.e new file mode 100644 index 00000000..d9b14a24 --- /dev/null +++ b/draft/library/server/request/rest/src/uri_template/rest_uri_template_routing_handler.e @@ -0,0 +1,67 @@ +note + description : "Objects that ..." + author : "$Author$" + date : "$Date$" + revision : "$Revision$" + +class + REST_URI_TEMPLATE_ROUTING_HANDLER [C -> WSF_HANDLER_CONTEXT create make end] + +inherit + WSF_URI_TEMPLATE_ROUTING_CONTEXT_HANDLER [C] + rename + execute as old_execute, + uri_template_execute as execute + redefine + execute + end + + REST_REQUEST_HANDLER [C] + undefine + execute + end + +create + make, + make_with_router + +feature -- Status report + + authentication_required (req: WSF_REQUEST): BOOLEAN + do + Result := internal_authentication_required + end + +feature {NONE} -- Implementation + + internal_authentication_required: BOOLEAN + +feature -- Execution + + execute (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) + do + pre_execute (ctx, req, res) + Precursor {WSF_URI_TEMPLATE_ROUTING_CONTEXT_HANDLER} (ctx, req, res) + post_execute (ctx, req, res) + end + + execute_application (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) + do + check should_not_occur: False end + end + + +invariant +-- invariant_clause: True + +note + copyright: "Copyright (c) 1984-2012, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 5949 Hollister Ave., Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" +end