protected Backend.Infrastructure.IBackend LookForBackend(Core.Identity.UserIdentity userIdentity, Core.Identity.ClientIdentity clientIdentity) { Core.Identity.DomainIdentity domainIdentity = DomainIdentity.Create(userIdentity, clientIdentity); Backend.Infrastructure.IBackend backend = null; if (this.state != KernelState.initialized) { throw new Core.Exceptions.CoreNotInitializedException(); } this.backends.TryGetValue(domainIdentity, out backend); return(backend); }
public override bool Equals(object obj) { // If parameter is null return false. if (obj == null) { return(false); } // If parameter cannot be cast to Point return false. DomainIdentity p = obj as DomainIdentity; if ((System.Object)p == null) { return(false); } // Return true if the fields match: return((this.clientIdentity.ClientId == p.clientIdentity.ClientId) && (this.userIdentity.UserId == p.userIdentity.UserId)); }
private void BindBackendFor(Core.Identity.UserIdentity userIdentity, Core.Identity.ClientIdentity clientIdentity) { if (userIdentity == null) { throw new ArgumentException("userIdentity must be provided", "userIdentity"); } if (clientIdentity == null) { throw new ArgumentException("clientIdentity must be provided", "clientIdentity"); } Core.Identity.DomainIdentity domainIdentity = DomainIdentity.Create(userIdentity, clientIdentity); Backend.Infrastructure.IBackend backend = new Backend.Implementations.Lest.LESTBackend( new Backend.Infrastructure.Identity.UserIdentity(userIdentity.UserId, userIdentity.Name, userIdentity.Password), new Backend.Infrastructure.Identity.ClientIdentity(clientIdentity.ClientId, clientIdentity.Name) ); this.backends.Add(domainIdentity, backend); }