Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the BrokerLauncherClient class.
 /// </summary>
 /// <param name="uri">The broker launcher EPR</param>
 /// <param name="info">The sesion info</param>
 /// <param name="binding">indicting the binding</param>
 public BrokerLauncherClient(Uri uri, SessionInfoBase info, Binding binding)
     : this(info, binding, uri)
 {
     if (info.UseAad)
     {
     }
     else if ((info.TransportScheme & TransportScheme.NetTcp) == TransportScheme.NetTcp)
     {
         SessionInfo sessionInfo = info as SessionInfo;
         if (SoaHelper.IsSchedulerOnIaaS(info.Headnode) || (sessionInfo != null && sessionInfo.UseWindowsClientCredential))
         {
             string domainName;
             string userName;
             SoaHelper.ParseDomainUser(info.Username, out domainName, out userName);
             this.ClientCredentials.Windows.ClientCredential.Domain   = domainName;
             this.ClientCredentials.Windows.ClientCredential.UserName = userName;
             this.ClientCredentials.Windows.ClientCredential.Password = info.InternalPassword;
         }
     }
     else if ((info.TransportScheme & TransportScheme.Http) == TransportScheme.Http || (info.TransportScheme & TransportScheme.NetHttp) == TransportScheme.NetHttp)
     {
         this.ClientCredentials.UserName.UserName = info.Username;
         this.ClientCredentials.UserName.Password = info.InternalPassword;
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the BrokerLauncherClientFactory class
        /// </summary>
        /// <param name="info">indicating the session info</param>
        /// <param name="binding">indicating the binding</param>
        public BrokerLauncherClientFactory(SessionInfoBase info, Binding binding)
        {
            this.info    = info;
            this.binding = binding;
            Debug.Assert(info is SessionInfo);

#if DEBUG
            this.allowsHeartbeat = true;
#endif
            SessionInfo sessionInfo = (SessionInfo)info;
            if (info.UseInprocessBroker)
            {
                this.brokerLauncher             = sessionInfo.InprocessBrokerAdapter;
                this.brokerLauncherForHeartbeat = sessionInfo.InprocessBrokerAdapter;
            }
            else if (sessionInfo.BrokerLauncherEpr == SessionInternalConstants.BrokerConnectionStringToken)
            {
                Trace.TraceInformation($"[{nameof(BrokerLauncherClientFactory)}] will not connect to frontend as EPR is {nameof(SessionInternalConstants.BrokerConnectionStringToken)}.");
            }
            else
            {
                this.uri = new Uri(sessionInfo.BrokerLauncherEpr);
                this.heartbeatInterval = sessionInfo.ClientBrokerHeartbeatInterval;
            }

            //             else
            //             {
            //                 // info is WebSessionInfo
            //                 WebSessionInfo webSessionInfo = (WebSessionInfo)info;
            //                 this.brokerLauncher = new WebBrokerLauncherClient(webSessionInfo.HeadNode, webSessionInfo.Credential);
            // #if DEBUG
            //                 this.allowsHeartbeat = false;
            // #endif
            //             }
        }
Esempio n. 3
0
 public BrokerLauncherClient(SessionInfoBase info, Binding binding, Uri uri)
     : base(binding ?? info.GetBrokerBinding(), GetEndpoint(uri, info))
 {
     this.InitAzureOrAadOrCertAuth(info, info.Username, info.InternalPassword);
 }