public void ProcessEvent(AmClusterEventInfo cei) { if (cei.IsNetInterfaceStateChanged) { this.ProcessNicEvent(cei); } }
private void ProcessNicEvent(AmClusterEventInfo cei) { Dictionary <string, AmNetworkMonitor.Nic> nicTable = this.m_nicTable; IAmCluster cluster = this.GetCluster(); if (nicTable == null || cluster == null) { AmNetworkMonitor.Tracer.TraceError(0L, "Not yet initialized. Ignoring event"); return; } AmNetworkMonitor.Nic nic; if (!nicTable.TryGetValue(cei.ObjectName, out nic)) { this.TriggerClusterRefresh("nic not found"); return; } AmNetInterfaceState nicState = this.GetNicState(cei.ObjectName); switch (nicState) { case AmNetInterfaceState.Unavailable: AmNetworkMonitor.Tracer.TraceError <string, AmNetInterfaceState>(0L, "MAPI NIC '{0}' is {1}.", cei.ObjectName, nicState); return; case AmNetInterfaceState.Failed: case AmNetInterfaceState.Unreachable: { AmNetworkMonitor.Tracer.TraceError <string, AmNetInterfaceState>(0L, "MAPI NIC '{0}' is {1}.", cei.ObjectName, nicState); AmEvtMapiNetworkFailure amEvtMapiNetworkFailure = new AmEvtMapiNetworkFailure(nic.Node.Name); amEvtMapiNetworkFailure.Notify(true); return; } case AmNetInterfaceState.Up: AmNetworkMonitor.Tracer.TraceDebug <string>(0L, "MAPI NIC '{0}' is Up.", cei.ObjectName); if (nic.Node.Name.IsLocalComputerName) { AmClusterNodeNetworkStatus amClusterNodeNetworkStatus = new AmClusterNodeNetworkStatus(); Exception ex = AmClusterNodeStatusAccessor.Write(cluster, nic.Node.Name, amClusterNodeNetworkStatus); if (ex != null) { ReplayCrimsonEvents.AmNodeStatusUpdateFailed.Log <string, string>(amClusterNodeNetworkStatus.ToString(), ex.Message); return; } } break; default: AmNetworkMonitor.Tracer.TraceError <AmNetInterfaceState, string>(0L, "Unexpected NIC state {0} for {1}", nicState, cei.ObjectName); break; } }