aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage/llservicebuilder.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llmessage/llservicebuilder.h')
-rw-r--r--linden/indra/llmessage/llservicebuilder.h93
1 files changed, 93 insertions, 0 deletions
diff --git a/linden/indra/llmessage/llservicebuilder.h b/linden/indra/llmessage/llservicebuilder.h
new file mode 100644
index 0000000..817ea0c
--- /dev/null
+++ b/linden/indra/llmessage/llservicebuilder.h
@@ -0,0 +1,93 @@
1/**
2* @file llservicebuilder.h
3* @brief Declaration of the LLServiceBuilder class.
4*
5* Copyright (c) 2007-2007, Linden Research, Inc.
6*
7 * Second Life Viewer Source Code
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27*/
28
29#ifndef LLSERVICEBUILDER_H
30#define LLSERVICEBUILDER_H
31
32#include <string>
33#include <map>
34#include "llerror.h"
35
36class LLSD;
37
38/**
39 * @class LLServiceBuilder
40 * @brief This class builds urls for us to use when making web service calls.
41 */
42
43class LLServiceBuilder
44{
45 LOG_CLASS(LLServiceBuilder);
46public:
47 LLServiceBuilder(void) {}
48 ~LLServiceBuilder(void) {}
49
50 /**
51 * @brief Initialize this object with the service definitions.
52 *
53 * @param service_filename The services definition files -- services.xml.
54 */
55 void loadServiceDefinitionsFromFile(const std::string& service_filename);
56
57 /**
58 * @brief Build a service url if the url needs no construction parameters.
59 *
60 * @param service_name The name of the service you want to call.
61 */
62 std::string buildServiceURI(const std::string& service_name);
63
64 /**
65 * @brief Build a service url if the url with construction parameters.
66 *
67 * The parameter substitution supports string substituition from RUSS:
68 * [[Recursive_URL_Substitution_Syntax]]
69 * @param service_name The name of the service you want to call.
70 * @param option_map The parameters in a map of name:value for the service.
71 */
72 std::string buildServiceURI(
73 const std::string& service_name,
74 const LLSD& option_map);
75
76public:
77 /**
78 * @brief Helper method which builds construction state for a service
79 *
80 * This method should probably be protected, but we need to test this
81 * method.
82 */
83 void createServiceDefinition(
84 const std::string& service_name,
85 LLSD& service_url);
86
87protected:
88 std::map<std::string, std::string> mServiceMap;
89};
90
91
92
93#endif