diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/IAvatarData.cs (renamed from OpenSim/Grid/Framework/IMessagingServerDiscovery.cs) | 21 | ||||
-rw-r--r-- | OpenSim/Grid/Framework/IGridServiceModule.cs | 40 | ||||
-rw-r--r-- | OpenSim/Grid/Framework/IInterServiceUserService.cs | 35 | ||||
-rw-r--r-- | OpenSim/Grid/Framework/IMessageRegionLookup.cs | 38 | ||||
-rw-r--r-- | OpenSim/Server/Handlers/Simulation/Utils.cs (renamed from OpenSim/Grid/Framework/XMPPHTTPService.cs) | 109 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/ILoginService.cs (renamed from OpenSim/Grid/Framework/IGridServiceCore.cs) | 27 |
6 files changed, 86 insertions, 184 deletions
diff --git a/OpenSim/Grid/Framework/IMessagingServerDiscovery.cs b/OpenSim/Data/IAvatarData.cs index c996f4f..0a18e21 100644 --- a/OpenSim/Grid/Framework/IMessagingServerDiscovery.cs +++ b/OpenSim/Data/IAvatarData.cs | |||
@@ -27,14 +27,23 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using OpenSim.Framework.Servers; | 30 | using OpenMetaverse; |
31 | using OpenSim.Framework; | ||
31 | 32 | ||
32 | namespace OpenSim.Grid.Framework | 33 | namespace OpenSim.Data |
33 | { | 34 | { |
34 | public interface IMessagingServerDiscovery | 35 | // This MUST be a ref type! |
36 | public class AvatarBaseData | ||
35 | { | 37 | { |
36 | List<MessageServerInfo> GetMessageServersList(); | 38 | public UUID PrincipalID; |
37 | void RegisterMessageServer(MessageServerInfo m); | 39 | public Dictionary<string, string> Data; |
38 | void DeRegisterMessageServer(MessageServerInfo m); | 40 | } |
41 | |||
42 | public interface IAvatarData | ||
43 | { | ||
44 | AvatarBaseData[] Get(string field, string val); | ||
45 | bool Store(AvatarBaseData data); | ||
46 | bool Delete(UUID principalID, string name); | ||
47 | bool Delete(string field, string val); | ||
39 | } | 48 | } |
40 | } | 49 | } |
diff --git a/OpenSim/Grid/Framework/IGridServiceModule.cs b/OpenSim/Grid/Framework/IGridServiceModule.cs deleted file mode 100644 index 2fdf1e4..0000000 --- a/OpenSim/Grid/Framework/IGridServiceModule.cs +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
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 OpenSimulator 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 | |||
28 | using System; | ||
29 | using OpenSim.Framework.Servers.HttpServer; | ||
30 | |||
31 | namespace OpenSim.Grid.Framework | ||
32 | { | ||
33 | public interface IGridServiceModule | ||
34 | { | ||
35 | void Close(); | ||
36 | void Initialise(IGridServiceCore core); | ||
37 | void PostInitialise(); | ||
38 | void RegisterHandlers(BaseHttpServer httpServer); | ||
39 | } | ||
40 | } | ||
diff --git a/OpenSim/Grid/Framework/IInterServiceUserService.cs b/OpenSim/Grid/Framework/IInterServiceUserService.cs deleted file mode 100644 index ee7365a..0000000 --- a/OpenSim/Grid/Framework/IInterServiceUserService.cs +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
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 OpenSimulator 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 | |||
28 | using System; | ||
29 | namespace OpenSim.Grid.Framework | ||
30 | { | ||
31 | public interface IInterServiceUserService | ||
32 | { | ||
33 | bool SendToUserServer(System.Collections.Hashtable request, string method); | ||
34 | } | ||
35 | } | ||
diff --git a/OpenSim/Grid/Framework/IMessageRegionLookup.cs b/OpenSim/Grid/Framework/IMessageRegionLookup.cs deleted file mode 100644 index 461fe73..0000000 --- a/OpenSim/Grid/Framework/IMessageRegionLookup.cs +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
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 OpenSimulator 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 | |||
28 | using System; | ||
29 | using OpenSim.Data; | ||
30 | |||
31 | namespace OpenSim.Grid.Framework | ||
32 | { | ||
33 | public interface IMessageRegionLookup | ||
34 | { | ||
35 | int ClearRegionCache(); | ||
36 | RegionProfileData GetRegionInfo(ulong regionhandle); | ||
37 | } | ||
38 | } | ||
diff --git a/OpenSim/Grid/Framework/XMPPHTTPService.cs b/OpenSim/Server/Handlers/Simulation/Utils.cs index 9d27409..ed379da 100644 --- a/OpenSim/Grid/Framework/XMPPHTTPService.cs +++ b/OpenSim/Server/Handlers/Simulation/Utils.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -26,84 +26,77 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.IO; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using log4net; | 31 | |
32 | using OpenMetaverse; | 32 | using OpenMetaverse; |
33 | using OpenSim.Framework.Servers.HttpServer; | 33 | using OpenMetaverse.StructuredData; |
34 | |||
35 | using log4net; | ||
34 | 36 | ||
35 | namespace OpenSim.Grid.Framework | 37 | namespace OpenSim.Server.Handlers.Simulation |
36 | { | 38 | { |
37 | public class XMPPHTTPStreamHandler : BaseStreamHandler | 39 | public class Utils |
38 | { | 40 | { |
39 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 41 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
40 | 42 | ||
41 | |||
42 | /// <summary> | 43 | /// <summary> |
43 | /// Constructor. | 44 | /// Extract the param from an uri. |
44 | /// </summary> | 45 | /// </summary> |
45 | /// <param name="assetManager"></param> | 46 | /// <param name="uri">Something like this: /agent/uuid/ or /agent/uuid/handle/release</param> |
46 | /// <param name="assetProvider"></param> | 47 | /// <param name="uri">uuid on uuid field</param> |
47 | public XMPPHTTPStreamHandler() | 48 | /// <param name="action">optional action</param> |
48 | : base("GET", "/presence") | 49 | public static bool GetParams(string uri, out UUID uuid, out UUID regionID, out string action) |
49 | { | 50 | { |
50 | m_log.Info("[REST]: In Get Request"); | 51 | uuid = UUID.Zero; |
52 | regionID = UUID.Zero; | ||
53 | action = ""; | ||
51 | 54 | ||
55 | uri = uri.Trim(new char[] { '/' }); | ||
56 | string[] parts = uri.Split('/'); | ||
57 | if (parts.Length <= 1) | ||
58 | { | ||
59 | return false; | ||
60 | } | ||
61 | else | ||
62 | { | ||
63 | if (!UUID.TryParse(parts[1], out uuid)) | ||
64 | return false; | ||
65 | |||
66 | if (parts.Length >= 3) | ||
67 | UUID.TryParse(parts[2], out regionID); | ||
68 | if (parts.Length >= 4) | ||
69 | action = parts[3]; | ||
70 | |||
71 | return true; | ||
72 | } | ||
52 | } | 73 | } |
53 | 74 | ||
54 | public override byte[] Handle(string path, Stream request, | 75 | public static OSDMap GetOSDMap(string data) |
55 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | ||
56 | { | 76 | { |
57 | string param = GetParam(path); | 77 | OSDMap args = null; |
58 | byte[] result = new byte[] {}; | ||
59 | try | 78 | try |
60 | { | 79 | { |
61 | string[] p = param.Split(new char[] {'/', '?', '&'}, StringSplitOptions.RemoveEmptyEntries); | 80 | OSD buffer; |
62 | 81 | // We should pay attention to the content-type, but let's assume we know it's Json | |
63 | if (p.Length > 0) | 82 | buffer = OSDParser.DeserializeJson(data); |
83 | if (buffer.Type == OSDType.Map) | ||
64 | { | 84 | { |
65 | UUID assetID = UUID.Zero; | 85 | args = (OSDMap)buffer; |
66 | 86 | return args; | |
67 | if (!UUID.TryParse(p[0], out assetID)) | 87 | } |
68 | { | 88 | else |
69 | m_log.InfoFormat( | 89 | { |
70 | "[REST]: GET:/presence ignoring request with malformed UUID {0}", p[0]); | 90 | // uh? |
71 | return result; | 91 | m_log.Debug(("[REST COMMS]: Got OSD of unexpected type " + buffer.Type.ToString())); |
72 | } | 92 | return null; |
73 | |||
74 | } | 93 | } |
75 | } | 94 | } |
76 | catch (Exception e) | 95 | catch (Exception ex) |
77 | { | 96 | { |
78 | m_log.Error(e.ToString()); | 97 | m_log.Debug("[REST COMMS]: exception on parse of REST message " + ex.Message); |
98 | return null; | ||
79 | } | 99 | } |
80 | return result; | ||
81 | } | ||
82 | } | ||
83 | |||
84 | public class PostXMPPStreamHandler : BaseStreamHandler | ||
85 | { | ||
86 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
87 | |||
88 | public override byte[] Handle(string path, Stream request, | ||
89 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | ||
90 | { | ||
91 | string param = GetParam(path); | ||
92 | |||
93 | UUID assetId; | ||
94 | if (param.Length > 0) | ||
95 | UUID.TryParse(param, out assetId); | ||
96 | // byte[] txBuffer = new byte[4096]; | ||
97 | |||
98 | // TODO: Read POST serialize XMPP stanzas | ||
99 | |||
100 | return new byte[] {}; | ||
101 | } | ||
102 | |||
103 | public PostXMPPStreamHandler() | ||
104 | : base("POST", "/presence") | ||
105 | { | ||
106 | |||
107 | } | 100 | } |
108 | 101 | ||
109 | } | 102 | } |
diff --git a/OpenSim/Grid/Framework/IGridServiceCore.cs b/OpenSim/Services/Interfaces/ILoginService.cs index da83ade..24bf342 100644 --- a/OpenSim/Grid/Framework/IGridServiceCore.cs +++ b/OpenSim/Services/Interfaces/ILoginService.cs | |||
@@ -26,15 +26,28 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using OpenSim.Framework.Servers.HttpServer; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | ||
31 | using System.Net; | ||
30 | 32 | ||
31 | namespace OpenSim.Grid.Framework | 33 | using OpenMetaverse.StructuredData; |
34 | |||
35 | namespace OpenSim.Services.Interfaces | ||
32 | { | 36 | { |
33 | public interface IGridServiceCore | 37 | public abstract class LoginResponse |
34 | { | 38 | { |
35 | T Get<T>(); | 39 | public abstract Hashtable ToHashtable(); |
36 | void RegisterInterface<T>(T iface); | 40 | public abstract OSD ToOSDMap(); |
37 | bool TryGet<T>(out T iface); | ||
38 | BaseHttpServer GetHttpServer(); | ||
39 | } | 41 | } |
42 | |||
43 | public abstract class FailedLoginResponse : LoginResponse | ||
44 | { | ||
45 | } | ||
46 | |||
47 | public interface ILoginService | ||
48 | { | ||
49 | LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, IPEndPoint clientIP); | ||
50 | } | ||
51 | |||
52 | |||
40 | } | 53 | } |