//----------------------------------------------------------------------- // // Copyright (c) Outercurve Foundation. All rights reserved. // //----------------------------------------------------------------------- namespace DotNetOpenAuth.OpenId.RelyingParty { using System; using Validation; /// /// Stores s for lookup by their handle, keeping /// associations separated by a given OP Endpoint. /// /// /// Expired associations should be periodically cleared out of an association store. /// This should be done frequently enough to avoid a memory leak, but sparingly enough /// to not be a performance drain. Because this balance can vary by host, it is the /// responsibility of the host to initiate this cleaning. /// public interface IRelyingPartyAssociationStore { /// /// Saves an for later recall. /// /// The OP Endpoint with which the association is established. /// The association to store. /// /// If the new association conflicts (in OP endpoint and association handle) with an existing association, /// (which should never happen by the way) implementations may overwrite the previously saved association. /// void StoreAssociation(Uri providerEndpoint, Association association); /// /// Gets the best association (the one with the longest remaining life) for a given key. /// /// The OP Endpoint with which the association is established. /// The security requirements that the returned association must meet. /// /// The requested association, or null if no unexpired s exist for the given key. /// /// /// In the event that multiple associations exist for the given /// , it is important for the /// implementation for this method to use the /// to pick the best (highest grade or longest living as the host's policy may dictate) /// association that fits the security requirements. /// Associations that are returned that do not meet the security requirements will be /// ignored and a new association created. /// Association GetAssociation(Uri providerEndpoint, SecuritySettings securityRequirements); /// /// Gets the association for a given key and handle. /// /// The OP Endpoint with which the association is established. /// The handle of the specific association that must be recalled. /// The requested association, or null if no unexpired s exist for the given key and handle. Association GetAssociation(Uri providerEndpoint, string handle); /// Removes a specified handle that may exist in the store. /// The OP Endpoint with which the association is established. /// The handle of the specific association that must be deleted. /// /// Deprecated. The return value is insignificant. /// Previously: True if the association existed in this store previous to this call. /// /// /// No exception should be thrown if the association does not exist in the store /// before this call. /// bool RemoveAssociation(Uri providerEndpoint, string handle); } }