aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins/Rest
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/ApplicationPlugins/Rest')
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs38
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs10
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs6
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs11
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs14
5 files changed, 37 insertions, 42 deletions
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs
index 8ab9fd2..62e18c4 100644
--- a/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs
@@ -69,11 +69,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
69 69
70 internal static IRestHandler Plugin = null; 70 internal static IRestHandler Plugin = null;
71 internal static OpenSimBase main = null; 71 internal static OpenSimBase main = null;
72 internal static CommunicationsManager Comms = null;
73 internal static IInventoryServices InventoryServices = null;
74 internal static IUserService UserServices = null;
75 internal static IAvatarService AvatarServices = null;
76 internal static IAssetCache AssetServices = null;
77 internal static string Prefix = null; 72 internal static string Prefix = null;
78 internal static IConfig Config = null; 73 internal static IConfig Config = null;
79 internal static string GodKey = null; 74 internal static string GodKey = null;
@@ -88,6 +83,39 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
88 internal static int DumpLineSize = 32; // Should be a multiple of 16 or (possibly) 4 83 internal static int DumpLineSize = 32; // Should be a multiple of 16 or (possibly) 4
89 84
90 /// <summary> 85 /// <summary>
86 /// These are all dependent upon the Comms manager
87 /// being initialized. So they have to be properties
88 /// because the comms manager is now a module and is
89 /// not guaranteed to be there when the rest handler
90 /// initializes.
91 /// </summary>
92
93 internal static CommunicationsManager Comms
94 {
95 get { return main.CommunicationsManager; }
96 }
97
98 internal static IInventoryServices InventoryServices
99 {
100 get { return Comms.InventoryService; }
101 }
102
103 internal static IUserService UserServices
104 {
105 get { return Comms.UserService; }
106 }
107
108 internal static IAvatarService AvatarServices
109 {
110 get { return Comms.AvatarService; }
111 }
112
113 internal static IAssetCache AssetServices
114 {
115 get { return Comms.AssetCache; }
116 }
117
118 /// <summary>
91 /// HTTP requires that status information be generated for PUT 119 /// HTTP requires that status information be generated for PUT
92 /// and POST opertaions. This is in support of that. The 120 /// and POST opertaions. This is in support of that. The
93 /// operation verb gets substituted into the first string, 121 /// operation verb gets substituted into the first string,
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs
index 667cf57..fad0438 100644
--- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs
@@ -55,16 +55,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
55 Rest.Log.InfoFormat("{0} User appearance services initializing", MsgId); 55 Rest.Log.InfoFormat("{0} User appearance services initializing", MsgId);
56 Rest.Log.InfoFormat("{0} Using REST Implementation Version {1}", MsgId, Rest.Version); 56 Rest.Log.InfoFormat("{0} Using REST Implementation Version {1}", MsgId, Rest.Version);
57 57
58 // This is better than a null reference.
59
60 if (Rest.AvatarServices == null)
61 throw new Exception(String.Format("{0} OpenSim inventory services are not available",
62 MsgId));
63
64 if (Rest.UserServices == null)
65 throw new Exception(String.Format("{0} OpenSim user profile services are not available",
66 MsgId));
67
68 // If a relative path was specified for the handler's domain, 58 // If a relative path was specified for the handler's domain,
69 // add the standard prefix to make it absolute, e.g. /admin 59 // add the standard prefix to make it absolute, e.g. /admin
70 60
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs
index 3475d32..043fca8 100644
--- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs
@@ -46,12 +46,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
46 Rest.Log.InfoFormat("{0} Asset services initializing", MsgId); 46 Rest.Log.InfoFormat("{0} Asset services initializing", MsgId);
47 Rest.Log.InfoFormat("{0} Using REST Implementation Version {1}", MsgId, Rest.Version); 47 Rest.Log.InfoFormat("{0} Using REST Implementation Version {1}", MsgId, Rest.Version);
48 48
49 // This is better than a null reference.
50
51 if (Rest.AssetServices == null)
52 throw new Exception(String.Format("{0} OpenSim asset services are not available",
53 MsgId));
54
55 // If the handler specifies a relative path for its domain 49 // If the handler specifies a relative path for its domain
56 // then we must add the standard absolute prefix, e.g. /admin 50 // then we must add the standard absolute prefix, e.g. /admin
57 51
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs
index f0a5308..5ff9da3 100644
--- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs
@@ -227,16 +227,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
227 // them easy to reach from anywhere in the assembly. 227 // them easy to reach from anywhere in the assembly.
228 228
229 Rest.main = openSim; 229 Rest.main = openSim;
230 if(Rest.main == null)
231 throw new Exception("OpenSim base pointer is null");
232
230 Rest.Plugin = this; 233 Rest.Plugin = this;
231 Rest.Comms = Rest.main.CommunicationsManager;
232 Rest.UserServices = Rest.Comms.UserService;
233 Rest.InventoryServices = Rest.Comms.InventoryService;
234 Rest.AssetServices = Rest.Comms.AssetCache;
235 Rest.AvatarServices = Rest.Comms.AvatarService;
236 Rest.Config = Config; 234 Rest.Config = Config;
237 Rest.Prefix = Prefix; 235 Rest.Prefix = Prefix;
238 Rest.GodKey = GodKey; 236 Rest.GodKey = GodKey;
239
240 Rest.Authenticate = Rest.Config.GetBoolean("authenticate", Rest.Authenticate); 237 Rest.Authenticate = Rest.Config.GetBoolean("authenticate", Rest.Authenticate);
241 Rest.Scheme = Rest.Config.GetString("auth-scheme", Rest.Scheme); 238 Rest.Scheme = Rest.Config.GetString("auth-scheme", Rest.Scheme);
242 Rest.Secure = Rest.Config.GetBoolean("secured", Rest.Secure); 239 Rest.Secure = Rest.Config.GetBoolean("secured", Rest.Secure);
@@ -253,7 +250,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
253 (Rest.Authenticate ? "" : "not ")); 250 (Rest.Authenticate ? "" : "not "));
254 251
255 Rest.Log.InfoFormat("{0} Security is {1}enabled", MsgId, 252 Rest.Log.InfoFormat("{0} Security is {1}enabled", MsgId,
256 (Rest.Authenticate ? "" : "not ")); 253 (Rest.Secure ? "" : "not "));
257 254
258 Rest.Log.InfoFormat("{0} Extended URI escape processing is {1}enabled", MsgId, 255 Rest.Log.InfoFormat("{0} Extended URI escape processing is {1}enabled", MsgId,
259 (Rest.ExtendedEscape ? "" : "not ")); 256 (Rest.ExtendedEscape ? "" : "not "));
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs
index 9935046..95e3d71 100644
--- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs
@@ -62,20 +62,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
62 Rest.Log.InfoFormat("{0} Inventory services initializing", MsgId); 62 Rest.Log.InfoFormat("{0} Inventory services initializing", MsgId);
63 Rest.Log.InfoFormat("{0} Using REST Implementation Version {1}", MsgId, Rest.Version); 63 Rest.Log.InfoFormat("{0} Using REST Implementation Version {1}", MsgId, Rest.Version);
64 64
65 // This is better than a null reference.
66
67 if (Rest.InventoryServices == null)
68 throw new Exception(String.Format("{0} OpenSim inventory services are not available",
69 MsgId));
70
71 if (Rest.UserServices == null)
72 throw new Exception(String.Format("{0} OpenSim user services are not available",
73 MsgId));
74
75 if (Rest.AssetServices == null)
76 throw new Exception(String.Format("{0} OpenSim asset services are not available",
77 MsgId));
78
79 // If a relative path was specified for the handler's domain, 65 // If a relative path was specified for the handler's domain,
80 // add the standard prefix to make it absolute, e.g. /admin 66 // add the standard prefix to make it absolute, e.g. /admin
81 67