//----------------------------------------------------------------------- // // Copyright (c) Outercurve Foundation. All rights reserved. // //----------------------------------------------------------------------- namespace DotNetOpenAuth.OpenId { using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Diagnostics.Contracts; using System.Linq; using System.Text; using DotNetOpenAuth.Messaging; using DotNetOpenAuth.OpenId.RelyingParty; /// /// A module that provides discovery services for OpenID identifiers. /// [ContractClass(typeof(IIdentifierDiscoveryServiceContract))] public interface IIdentifierDiscoveryService { /// /// Performs discovery on the specified identifier. /// /// The identifier to perform discovery on. /// The means to place outgoing HTTP requests. /// if set to true, no further discovery services will be called for this identifier. /// /// A sequence of service endpoints yielded by discovery. Must not be null, but may be empty. /// [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "2#", Justification = "By design")] [Pure] IEnumerable Discover(Identifier identifier, IDirectWebRequestHandler requestHandler, out bool abortDiscoveryChain); } /// /// Code contract for the interface. /// [ContractClassFor(typeof(IIdentifierDiscoveryService))] internal abstract class IIdentifierDiscoveryServiceContract : IIdentifierDiscoveryService { /// /// Prevents a default instance of the class from being created. /// private IIdentifierDiscoveryServiceContract() { } #region IDiscoveryService Members /// /// Performs discovery on the specified identifier. /// /// The identifier to perform discovery on. /// The means to place outgoing HTTP requests. /// if set to true, no further discovery services will be called for this identifier. /// /// A sequence of service endpoints yielded by discovery. Must not be null, but may be empty. /// IEnumerable IIdentifierDiscoveryService.Discover(Identifier identifier, IDirectWebRequestHandler requestHandler, out bool abortDiscoveryChain) { Requires.NotNull(identifier, "identifier"); Requires.NotNull(requestHandler, "requestHandler"); Contract.Ensures(Contract.Result>() != null); throw new NotImplementedException(); } #endregion } }