summaryrefslogtreecommitdiffstats
path: root/src/DotNetOAuth/Messaging/IProtocolMessage.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-09-01 16:15:36 -0700
committerAndrew <andrewarnott@gmail.com>2008-09-01 16:16:29 -0700
commitfe89b650595d828f44270ee1226d72e945f7260c (patch)
tree7994fbbb23abc7ff0751ac9bb0d8cdb93bc32f6b /src/DotNetOAuth/Messaging/IProtocolMessage.cs
parent4e83c2d321f57cac5e5605097faf15bf1b46efa5 (diff)
downloadDotNetOpenAuth-fe89b650595d828f44270ee1226d72e945f7260c.zip
DotNetOpenAuth-fe89b650595d828f44270ee1226d72e945f7260c.tar.gz
DotNetOpenAuth-fe89b650595d828f44270ee1226d72e945f7260c.tar.bz2
Moved messaging infrastructure to its own namespace.
Diffstat (limited to 'src/DotNetOAuth/Messaging/IProtocolMessage.cs')
-rw-r--r--src/DotNetOAuth/Messaging/IProtocolMessage.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/DotNetOAuth/Messaging/IProtocolMessage.cs b/src/DotNetOAuth/Messaging/IProtocolMessage.cs
new file mode 100644
index 0000000..76079c0
--- /dev/null
+++ b/src/DotNetOAuth/Messaging/IProtocolMessage.cs
@@ -0,0 +1,41 @@
+//-----------------------------------------------------------------------
+// <copyright file="IProtocolMessage.cs" company="Andrew Arnott">
+// Copyright (c) Andrew Arnott. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOAuth.Messaging {
+ using System;
+ using System.Collections.Generic;
+ using System.Text;
+
+ /// <summary>
+ /// The interface that classes must implement to be serialized/deserialized
+ /// as OAuth messages.
+ /// </summary>
+ internal interface IProtocolMessage {
+ /// <summary>
+ /// Gets the version of the protocol this message is prepared to implement.
+ /// </summary>
+ Protocol Protocol { get; }
+
+ /// <summary>
+ /// Gets whether this is a direct or indirect message.
+ /// </summary>
+ MessageTransport Transport { get; }
+
+ /// <summary>
+ /// Checks the message state for conformity to the protocol specification
+ /// and throws an exception if the message is invalid.
+ /// </summary>
+ /// <remarks>
+ /// <para>Some messages have required fields, or combinations of fields that must relate to each other
+ /// in specialized ways. After deserializing a message, this method checks the state of the
+ /// message to see if it conforms to the protocol.</para>
+ /// <para>Note that this property should <i>not</i> check signatures or perform any state checks
+ /// outside this scope of this particular message.</para>
+ /// </remarks>
+ /// <exception cref="ProtocolException">Thrown if the message is invalid.</exception>
+ void EnsureValidMessage();
+ }
+}