コード例 #1
0
        public HostInformation GetHomeServer(string Username)
        {
            Member member = GetDomainMemberByName(Username);

            if (member != null)
            {
                HostNode host = member.HomeServer;
                if (host != null)
                {
                    return(new HostInformation(host));
                }

                // Call the provision service to provision this
                // user to a host
                HostInfo info = ProvisionService.ProvisionUser(Username);
                if (info != null)
                {
                    return(new HostInformation(info));
                }
            }

            return(null);
        }
コード例 #2
0
        public Simias.Host.HostInfo GetHomeServer(string user)

        {
            Simias.Server.EnterpriseDomain enterpriseDomain =
                new Simias.Server.EnterpriseDomain(false);
            if (enterpriseDomain == null)
            {
                throw new SimiasException("Enterprise server domain does not exist.");
            }

            Store store = Store.GetStore();

            Simias.Storage.Domain domain = store.GetDomain(enterpriseDomain.ID);
            if (domain == null)
            {
                throw new SimiasException("Enterprise server domain does not exist.");
            }

            // find user
            Member   member = domain.GetMemberByName(user);
            HostNode hNode  = member.HomeServer;

            if (hNode == null)
            {
                if (HostNode.GetLocalHost().IsMasterHost)
                {
                    return(ProvisionService.ProvisionUser(user));
                }
                else
                {
                    return(null);
                    //need to get the home server from master.
                }
            }

            return(new Simias.Host.HostInfo(hNode));
        }