public KcmConnectionNotice(KasIdentifier kasID, UInt32 minorVersion) { KasID = kasID; MinorVersion = minorVersion; }
public KcmAnpMsg(AnpMsg msg, KasIdentifier kasID) { Msg = msg; KasID = kasID; }
/// <summary> /// Request a KAS to be disconnected. /// </summary> public void RequestKasDisconnect(KasIdentifier kasID) { lock (m_mutex) { m_ToKcmControlMsgArray.Add(new KcmConnectionRequest(kasID, false)); NotifyKcm(); } }
public KcmDisconnectionNotice(KasIdentifier kasID, Exception ex) { KasID = kasID; Ex = ex; }
/////////////////////////////////// // Interface methods for the WM. // /////////////////////////////////// /// <summary> /// Request a KAS to be connected. /// </summary> public void RequestKasConnect(KasIdentifier kasID) { lock (m_mutex) { // The following sequence of events can happen: // - KCM posts disconnection event. // - WM posts ANP message. // - WM receives disconnection event. // - WM posts connection request. // - KCM receives connection request and ANP message concurrently, // possibly posting the ANP message incorrectly. // To prevent this situation, we ensure that we have no lingering // ANP message left for that KAS. List<KcmAnpMsg> newList = new List<KcmAnpMsg>(); foreach (KcmAnpMsg m in m_ToKcmAnpMsgArray) { if (m.KasID != kasID) newList.Add(m); } m_ToKcmAnpMsgArray = newList; m_ToKcmControlMsgArray.Add(new KcmConnectionRequest(kasID, true)); NotifyKcm(); } }
/// <summary> /// Create the WmKas object specified if it does not exist, /// and return a reference to the WmKas object specified. /// </summary> private WmKas GetOrCreateKas(KasIdentifier kasID) { if (!KasTree.ContainsKey(kasID)) { KasTree[kasID] = new WmKas(kasID); } return KasTree[kasID]; }
public KcmConnectionRequest(KasIdentifier kasID, bool connectFlag) { KasID = kasID; ConnectFlag = connectFlag; }
/// <summary> /// Return the workspace having the Kas ID and external ID specified, /// if any. /// </summary> public Workspace GetKwsByExternalID(KasIdentifier kasID, UInt64 externalID) { if (externalID == 0) return null; foreach (Workspace kws in KwsTree.Values) if (kws.Kas.KasID.CompareTo(kasID) == 0 && kws.CoreData.Credentials.ExternalID == externalID) return kws; return null; }
/// <summary> /// Return the KAS having the identifier specified, if any. /// </summary> public WmKas GetKasById(KasIdentifier kasID) { if (!KasTree.ContainsKey(kasID)) return null; return KasTree[kasID]; }
/// <summary> /// Convert the Xml representation of a KasIdentifier object to its /// KasIdentifier object equivalent. /// </summary> public static KasIdentifier FromXml(XmlElement elem) { UInt32 version = UInt32.Parse(elem.GetAttribute("version")); if (version != 1) throw new Exception("Unsupported KasIdentifier version '" + version + "'."); String host = Misc.GetXmlChildValue(elem, "Host", ""); UInt16 port = UInt16.Parse(Misc.GetXmlChildValue(elem, "Port", "0")); KasIdentifier kasID = new KasIdentifier(host, port); return kasID; }
/// <summary> /// Non-deserializing constructor. /// </summary> public WmKas(KasIdentifier kasID) { KasID = kasID; Initialize(); }
public KcmKas(KasIdentifier kasID) { KasID = kasID; Tunnel = new AnpTunnel(KasID.Host, (int)KasID.Port); }