aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs35
1 files changed, 35 insertions, 0 deletions
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
index 6d5b30e..30d3147 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
@@ -84,6 +84,11 @@ namespace OpenSim.Services.Connectors.SimianGrid
84 CommonInit(source); 84 CommonInit(source);
85 } 85 }
86 86
87 public SimianAssetServiceConnector(string url)
88 {
89 m_serverUrl = url;
90 }
91
87 public void Initialise(IConfigSource source) 92 public void Initialise(IConfigSource source)
88 { 93 {
89 IConfig moduleConfig = source.Configs["Modules"]; 94 IConfig moduleConfig = source.Configs["Modules"];
@@ -119,6 +124,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
119 124
120 public AssetBase Get(string id) 125 public AssetBase Get(string id)
121 { 126 {
127 if (String.IsNullOrEmpty(m_serverUrl))
128 {
129 m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI configured");
130 throw new InvalidOperationException();
131 }
132
122 // Cache fetch 133 // Cache fetch
123 if (m_cache != null) 134 if (m_cache != null)
124 { 135 {
@@ -145,6 +156,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
145 /// <returns></returns> 156 /// <returns></returns>
146 public AssetMetadata GetMetadata(string id) 157 public AssetMetadata GetMetadata(string id)
147 { 158 {
159 if (String.IsNullOrEmpty(m_serverUrl))
160 {
161 m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI configured");
162 throw new InvalidOperationException();
163 }
164
148 AssetMetadata metadata = null; 165 AssetMetadata metadata = null;
149 166
150 // Cache fetch 167 // Cache fetch
@@ -216,6 +233,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
216 /// <returns>True if the id was parseable, false otherwise</returns> 233 /// <returns>True if the id was parseable, false otherwise</returns>
217 public bool Get(string id, Object sender, AssetRetrieved handler) 234 public bool Get(string id, Object sender, AssetRetrieved handler)
218 { 235 {
236 if (String.IsNullOrEmpty(m_serverUrl))
237 {
238 m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI configured");
239 throw new InvalidOperationException();
240 }
241
219 // Cache fetch 242 // Cache fetch
220 if (m_cache != null) 243 if (m_cache != null)
221 { 244 {
@@ -246,6 +269,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
246 /// <returns></returns> 269 /// <returns></returns>
247 public string Store(AssetBase asset) 270 public string Store(AssetBase asset)
248 { 271 {
272 if (String.IsNullOrEmpty(m_serverUrl))
273 {
274 m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI configured");
275 throw new InvalidOperationException();
276 }
277
249 bool storedInCache = false; 278 bool storedInCache = false;
250 string errorMessage = null; 279 string errorMessage = null;
251 280
@@ -378,6 +407,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
378 /// <returns></returns> 407 /// <returns></returns>
379 public bool Delete(string id) 408 public bool Delete(string id)
380 { 409 {
410 if (String.IsNullOrEmpty(m_serverUrl))
411 {
412 m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI configured");
413 throw new InvalidOperationException();
414 }
415
381 //string errorMessage = String.Empty; 416 //string errorMessage = String.Empty;
382 string url = m_serverUrl + id; 417 string url = m_serverUrl + id;
383 418