Example #1
0
 //-------------------------------------------------------------------------
 public static CSnmpProxyConfiguration GetInstance()
 {
     if (m_instance == null)
     {
         m_instance = new CSnmpProxyConfiguration();
     }
     return(m_instance);
 }
Example #2
0
        public void MiseAJour(bool bDiffere)
        {
            if (!bDiffere)
            {
                if (m_bMiseAJourEnCours)
                {
                    return;
                }
                m_bMiseAJourEnCours = true;

                try
                {
                    ISnmpConnexion          cnx    = new CSnmpConnexion();
                    CSnmpProxyConfiguration config = cnx.GetConfigurationDeSnmpProxy(GetInstance().IdProxyConfiguré);
                    if (config != null)
                    {
                        m_instance = config;
                        CSnmpPollingService.Init(m_instance.FrequencePollingMinutes);
                    }
                }
                catch
                {
                }
                m_bMiseAJourEnCours  = false;
                m_bMiseAJourDemandee = false;
                CServiceMediation.GetDefaultInstance().Trace.Write("Proxy setup updated", ALTRACE.TRACE, ALTRACE.DEBUG);
            }
            else
            {
                m_bMiseAJourDemandee = true;
                if (m_timerMiseAJour == null)
                {
                    m_timerMiseAJour          = new Timer(5000);
                    m_timerMiseAJour.Elapsed += new ElapsedEventHandler(m_timerMiseAJour_Elapsed);
                }
                m_timerMiseAJour.Start();
            }
        }
Example #3
0
 public static void SetDefaultInstance(CSnmpProxyConfiguration snmpConfig)
 {
     m_instance = snmpConfig;
 }