aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/AssetInventoryConfig.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/AssetInventoryConfig.cs')
-rw-r--r--OpenSim/Framework/AssetInventoryConfig.cs146
1 files changed, 146 insertions, 0 deletions
diff --git a/OpenSim/Framework/AssetInventoryConfig.cs b/OpenSim/Framework/AssetInventoryConfig.cs
new file mode 100644
index 0000000..9277b5e
--- /dev/null
+++ b/OpenSim/Framework/AssetInventoryConfig.cs
@@ -0,0 +1,146 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29
30namespace OpenSim.Framework
31{
32 /// <summary>
33 /// AssetInventoryConfig -- For AssetInventory Server Configuration
34 /// </summary>
35 public class AssetInventoryConfig
36 {
37 private ConfigurationMember configMember;
38
39 public const uint DefaultHttpPort = 8003;
40 public uint HttpPort = DefaultHttpPort;
41
42 public string AssetStorageProvider = "OpenSimAssetStorage";
43 public string AssetDatabaseConnect = String.Empty;
44 public string InventoryStorageProvider = "OpenSimInventoryStorage";
45 public string InventoryDatabaseConnect = String.Empty;
46
47 public string AuthenticationProvider = "NullAuthentication";
48 public string AuthorizationProvider = "AuthorizeAll";
49 public string MetricsProvider = "NullMetrics";
50 public string Frontends = "OpenSimAssetFrontend,OpenSimInventoryFrontend";
51
52 public AssetInventoryConfig(string description, string filename)
53 {
54 configMember = new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, true);
55 configMember.performConfigurationRetrieve();
56 }
57
58 public void loadConfigurationOptions()
59 {
60 configMember.addConfigurationOption("listen_port",
61 ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
62 "HTTP listener port",
63 DefaultHttpPort.ToString(),
64 false);
65
66 configMember.addConfigurationOption("asset_storage_provider",
67 ConfigurationOption.ConfigurationTypes.TYPE_STRING,
68 "Asset storage provider",
69 AssetStorageProvider,
70 false);
71 configMember.addConfigurationOption("asset_database_connect",
72 ConfigurationOption.ConfigurationTypes.TYPE_STRING,
73 "Asset database connection string",
74 AssetDatabaseConnect,
75 false);
76 configMember.addConfigurationOption("inventory_storage_provider",
77 ConfigurationOption.ConfigurationTypes.TYPE_STRING,
78 "Inventory storage provider",
79 InventoryStorageProvider,
80 false);
81 configMember.addConfigurationOption("inventory_database_connect",
82 ConfigurationOption.ConfigurationTypes.TYPE_STRING,
83 "Inventory database connection string",
84 InventoryDatabaseConnect,
85 false);
86
87 configMember.addConfigurationOption("authentication_provider",
88 ConfigurationOption.ConfigurationTypes.TYPE_STRING,
89 "Authentication provider",
90 AuthenticationProvider,
91 false);
92 configMember.addConfigurationOption("authorization_provider",
93 ConfigurationOption.ConfigurationTypes.TYPE_STRING,
94 "Authentication provider",
95 AuthorizationProvider,
96 false);
97 configMember.addConfigurationOption("metrics_provider",
98 ConfigurationOption.ConfigurationTypes.TYPE_STRING,
99 "Metrics provider",
100 MetricsProvider,
101 false);
102 configMember.addConfigurationOption("frontends",
103 ConfigurationOption.ConfigurationTypes.TYPE_STRING,
104 "Comma-separated list of frontends",
105 Frontends,
106 false);
107
108 }
109
110 public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
111 {
112 switch (configuration_key)
113 {
114 case "listen_port":
115 HttpPort = (uint) configuration_result;
116 break;
117 case "asset_storage_provider":
118 AssetStorageProvider = (string) configuration_result;
119 break;
120 case "asset_database_connect":
121 AssetDatabaseConnect = (string) configuration_result;
122 break;
123 case "inventory_storage_provider":
124 InventoryStorageProvider = (string) configuration_result;
125 break;
126 case "inventory_database_connect":
127 InventoryDatabaseConnect = (string) configuration_result;
128 break;
129 case "authentication_provider":
130 AuthenticationProvider = (string) configuration_result;
131 break;
132 case "authorization_provider":
133 AuthorizationProvider = (string) configuration_result;
134 break;
135 case "metrics_provider":
136 MetricsProvider = (string) configuration_result;
137 break;
138 case "frontends":
139 Frontends = (string) configuration_result;
140 break;
141 }
142
143 return true;
144 }
145 }
146}