Пример #1
0
        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);
        }
Пример #2
0
 public static DomainIdentity Create(UserIdentity userIdentity, ClientIdentity clientIdentity)
 {
     return(new DomainIdentity(userIdentity.UserId, userIdentity.Name, userIdentity.Password, clientIdentity.ClientId, clientIdentity.Name));
 }
Пример #3
0
 private DomainIdentity(string userId, string userName, string password, string clientId, string clientName)
 {
     this.userIdentity   = new UserIdentity(userId, userName, password);
     this.clientIdentity = new ClientIdentity(clientId, clientName);
 }
Пример #4
0
        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);
        }