예제 #1
0
        /// <summary>
        /// Close a DataServiceAgent instance or a DataProxyAgent service
        /// </summary>
        /// <param name="agent">agent instance to be closed</param>
        private static void CloseDataServiceAgent(IDataService agent)
        {
            DataServiceAgent dataServiceAgent = agent as DataServiceAgent;

            if (dataServiceAgent != null)
            {
                Microsoft.Hpc.Scheduler.Session.Internal.Utility.SafeCloseCommunicateObject(dataServiceAgent);
                return;
            }

            DataProxyAgent dataProxyAgent = agent as DataProxyAgent;

            if (dataProxyAgent != null)
            {
                dataProxyAgent.Close();
            }
        }
예제 #2
0
        /// <summary>
        /// Get agent for talking to data service or data proxy
        /// </summary>
        /// <param name="headNode">head node name</param>
        /// <param name="scheme">the transport scheme</param>
        /// <param name="userName">user name</param>
        /// <param name="password">the password name</param>
        /// <returns>agent to talk to data service or data proxy </returns>
        private static IDataService GetDataServiceAgent(string headNode, TransportScheme scheme = TransportScheme.NetTcp, string userName = null, string password = null)
        {
            if (Microsoft.Hpc.Scheduler.Session.Internal.SoaHelper.IsOnAzure() && !Microsoft.Hpc.Scheduler.Session.Internal.SoaHelper.IsSchedulerOnAzure())
            {
                // Azure burst scenario. should talk to data proxy
                return(new DataProxyAgent());
            }
            else
            {
                DataServiceAgent agent = new DataServiceAgent(headNode, scheme);
                if (!string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty(password))
                {
                    agent.SetCredential(userName, password);
                }

                return(agent);
            }
        }
예제 #3
0
파일: _Controller.cs 프로젝트: Baazka/Audit
        protected DataResponse GetDataResponse(XElement requestXml)
        {
            Result = DataServiceAgent.GetResponse(requestXml);

            return(Result);
        }