aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/HttpServer/BaseOutputStreamHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseOutputStreamHandler.cs (renamed from OpenSim/Framework/Communications/XMPP/XmppPresenceStanza.cs)47
1 files changed, 19 insertions, 28 deletions
diff --git a/OpenSim/Framework/Communications/XMPP/XmppPresenceStanza.cs b/OpenSim/Framework/Servers/HttpServer/BaseOutputStreamHandler.cs
index 4d45ac0..72b3065 100644
--- a/OpenSim/Framework/Communications/XMPP/XmppPresenceStanza.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseOutputStreamHandler.cs
@@ -25,45 +25,36 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System.Xml.Serialization; 28using System.IO;
29 29
30namespace OpenSim.Framework.Communications.XMPP 30namespace OpenSim.Framework.Servers.HttpServer
31{ 31{
32 /// <summary> 32 /// <summary>
33 /// Message types. 33 /// Base handler for writing to an output stream
34 /// </summary> 34 /// </summary>
35 public enum XmppPresenceType 35 /// <remarks>
36 /// Inheriting classes should override ProcessRequest() rather than Handle()
37 /// </remarks>
38 public abstract class BaseOutputStreamHandler : BaseRequestHandler, IRequestHandler
36 { 39 {
37 [XmlEnum("unavailable")] unavailable, 40 protected BaseOutputStreamHandler(string httpMethod, string path) : this(httpMethod, path, null, null) {}
38 [XmlEnum("subscribe")] subscribe,
39 [XmlEnum("subscribed")] subscribed,
40 [XmlEnum("unsubscribe")] unsubscribe,
41 [XmlEnum("unsubscribed")] unsubscribed,
42 [XmlEnum("probe")] probe,
43 [XmlEnum("error")] error,
44 }
45 41
42 protected BaseOutputStreamHandler(string httpMethod, string path, string name, string description)
43 : base(httpMethod, path, name, description) {}
46 44
47 [XmlRoot("message")] 45 public virtual void Handle(
48 public class XmppPresenceStanza: XmppStanza 46 string path, Stream request, Stream response, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
49 { 47 {
50 /// <summary> 48 RequestsReceived++;
51 /// IQ type: one of set, get, result, error
52 /// </summary>
53 [XmlAttribute("type")]
54 public XmppPresenceType PresenceType;
55 49
56 // [XmlAttribute("error")] 50 ProcessRequest(path, request, response, httpRequest, httpResponse);
57 // public XmppError Error;
58 51
59 public XmppPresenceStanza() : base() 52 RequestsHandled++;
60 {
61 } 53 }
62 54
63 public XmppPresenceStanza(string fromJid, string toJid, XmppPresenceType pType) : 55 protected virtual void ProcessRequest(
64 base(fromJid, toJid) 56 string path, Stream request, Stream response, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
65 { 57 {
66 PresenceType = pType;
67 } 58 }
68 } 59 }
69} 60} \ No newline at end of file