/// <summary> /// Initializes a new instance of the HpcSchedulerAdapterInternalClient class /// </summary> /// <param name="headNodeMachine">indicating the headnode</param> public HpcSchedulerAdapterInternalClient(string headNodeMachine, string certThumbprint) : base( BindingHelper.HardCodedInternalSchedulerDelegationBinding, SoaHelper.CreateInternalCertEndpointAddress(new Uri(SoaHelper.GetSchedulerDelegationInternalAddress(headNodeMachine)), certThumbprint)) { #if BrokerLauncher BrokerTracing.TraceVerbose("[HpcSchedulerAdapterInternalClient] In constructor"); #endif // use certificate for cluster internal authentication this.ClientCredentials.UseInternalAuthentication(certThumbprint); if (BrokerIdentity.IsHAMode) { // Bug 10301 : Explicitly open channel when impersonating the resource group's account if running on failover cluster so identity flows correctly when // calling HpcSession. // NOTE: The patch we got from the WCF team (KB981001) only works when the caller is on a threadpool thread. // NOTE: Channel must be opened before setting OperationTimeout using (BrokerIdentity identity = new BrokerIdentity()) { identity.Impersonate(); this.Open(); } } this.InnerChannel.OperationTimeout = OperationTimeout; }
/// <summary> /// Initializes a new instance of the HpcSchedulerAdapterClient class /// </summary> /// <param name="headnode">indicating the headnode</param> /// <param name="instanceContext">indicating the instance context</param> public HpcSchedulerAdapterClient(string headnode, string certThrumbprint, InstanceContext instanceContext) : base( instanceContext, BindingHelper.HardCodedInternalSchedulerDelegationBinding, SoaHelper.CreateInternalCertEndpointAddress(new Uri(SoaHelper.GetSchedulerDelegationAddress(headnode)), certThrumbprint)) { BrokerTracing.TraceVerbose("[HpcSchedulerAdapterClient] In constructor"); this.ClientCredentials.UseInternalAuthentication(certThrumbprint); if (BrokerIdentity.IsHAMode) { // Bug 10301 : Explicitly open channel when impersonating the resource group's account if running on failover cluster so identity flows correctly when // calling HpcSession. // NOTE: The patch we got from the WCF team (KB981001) only works when the caller is on a threadpool thread. // NOTE: Channel must be opened before setting OperationTimeout using (BrokerIdentity identity = new BrokerIdentity()) { identity.Impersonate(); this.Open(); } } this.InnerChannel.OperationTimeout = SchedulerAdapterTimeout; foreach (OperationDescription op in this.Endpoint.Contract.Operations) { DataContractSerializerOperationBehavior dataContractBehavior = op.Behaviors.Find <DataContractSerializerOperationBehavior>() as DataContractSerializerOperationBehavior; if (dataContractBehavior != null) { dataContractBehavior.MaxItemsInObjectGraph = int.MaxValue; } } }
/// <summary> /// Initializes a new instance of the HpcSchedulerAdapterInternalClient class /// </summary> /// <param name="headNode">indicating the headnode</param> public HpcSchedulerAdapterInternalClient(string headNode) : base( BindingHelper.HardCodedInternalSchedulerDelegationBinding, SoaHelper.CreateInternalCertEndpointAddress( new Uri(SoaHelper.GetSchedulerDelegationInternalAddress(headNode)), HpcContext.GetOrAdd(headNode, CancellationToken.None).GetSSLThumbprint().GetAwaiter().GetResult())) { // use certificate for cluster internal authentication string thunbprint = HpcContext.GetOrAdd(headNode, CancellationToken.None).GetSSLThumbprint().GetAwaiter().GetResult(); this.ClientCredentials.UseInternalAuthentication(thunbprint); this.InnerChannel.OperationTimeout = OperationTimeout; }
/// <summary> /// Create the endpoint of broker /// </summary> /// <param name="uri">Uri address</param> /// <returns>Endpoint Address</returns> private static EndpointAddress GetEndpoint(Uri uri, string certThrumbprint) { return(SoaHelper.CreateInternalCertEndpointAddress(uri, certThrumbprint)); }