Exemple #1
0
            public CheckServiceStatus(NaturalLanguageClassifier service, ServiceStatus callback)
            {
                m_Service  = service;
                m_Callback = callback;

                string customClassifierID = Config.Instance.GetVariableValue(SERVICE_ID + "_ID");

                m_Service.DisableCache = true;
                //If custom classifierID is defined then we are using it to check the service health
                if (!string.IsNullOrEmpty(customClassifierID))
                {
                    if (!m_Service.GetClassifier(customClassifierID, OnCheckService))
                    {
                        OnFailure("Failed to call GetClassifier()");
                    }
                    else
                    {
                        m_GetClassifierCount += 1;
                    }
                }
                else
                {
                    if (!m_Service.GetClassifiers(OnCheckServices))
                    {
                        OnFailure("Failed to call GetClassifiers()");
                    }
                }
            }
Exemple #2
0
            public FindClassifierReq(NaturalLanguageClassifier service, string classifierName, OnFindClassifier callback)
            {
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (string.IsNullOrEmpty(classifierName))
                {
                    throw new ArgumentNullException("classifierName");
                }
                if (callback == null)
                {
                    throw new ArgumentNullException("callback");
                }

                Service        = service;
                ClassifierName = classifierName;
                Callback       = callback;

                Service.GetClassifiers(GetClassifiers);
            }