/// <summary> /// Builds LP-AUXRegistrations Array /// </summary> /// <param name="xmlNodeList"> xml node list</param> /// <param name="wsdba">White Space DBA Name</param> /// <param name="namespacemanager">XML name space manager</param> /// <returns>LPAuxRegistration array</returns> private LPAuxRegistration[] BuildLPAuxRegistrations(XmlNodeList xmlNodeList, string wsdba, XmlNamespaceManager namespacemanager) { LPAuxRegistration[] lpauxRegistrations; try { // Lp-Aux Registrations processing this.logger.Log(TraceEventType.Information, LoggingMessageId.DBSyncPollerGenericMessage, "Begin " + "SyncManager.ParseResponseXML - LPAuxRegistration serialization "); lpauxRegistrations = new LPAuxRegistration[xmlNodeList.Count]; for (int regindex = 0; regindex < xmlNodeList.Count; regindex++) { LPAuxRegistration lpauxRegn = new LPAuxRegistration(); this.regbuilder.BuildEntity(lpauxRegn, xmlNodeList[regindex], namespacemanager); lpauxRegn.WSDBA = wsdba; lpauxRegn.Timestamp = DateTime.Now; lpauxRegn.RowKey = lpauxRegn.Disposition.RegId; lpauxRegn.PartitionKey = lpauxRegn.WSDBA; lpauxRegn.SerializeObjectsToJston(); lpauxRegistrations[regindex] = lpauxRegn; } } catch { throw; } return(lpauxRegistrations); }
/// <summary> /// constructs the Spectrum object Entity /// </summary> /// <param name="lpauxReg">CallSign Object to be deserialized.</param> /// <param name="xmlNode">XML Node</param> /// <param name="namespaceManager">name space manager</param> private void BuildLPAuxTvsSpectrum(ref LPAuxRegistration lpauxReg, XmlNode xmlNode, XmlNamespaceManager namespaceManager) { if (xmlNode.SelectSingleNode("ren:LP-Aux_Registration/ren:lpauxCallSign", namespaceManager) != null) { lpauxReg.CallSign.CallSign = xmlNode.SelectSingleNode("ren:LP-Aux_Registration/ren:lpauxCallSign", namespaceManager).InnerText; } if (xmlNode.SelectSingleNode("ren:LP-Aux_Registration/ren:lpauxEvent/ren:eventChannel", namespaceManager) != null) { lpauxReg.CallSign.Channel = Convert.ToInt32(xmlNode.SelectNodes("ren:LP-Aux_Registration/ren:lpauxEvent/ren:eventChannel/ren:chanNum", namespaceManager)[0].InnerText); } }
/// <summary> /// Build operational area xml node. /// </summary> /// <param name="xmlNode"> Registration Xml </param> /// <param name="lpauxRegn"> LP-Aux Registration </param> /// <param name="namespaceManager"> Namespace Manager </param> /// <returns> Xml Node </returns> private static XmlNode BuildLpAuxOperationalArea(XmlNode xmlNode, LPAuxRegistration lpauxRegn, XmlNamespaceManager namespaceManager) { XmlNode nodeOperationalArea = xmlNode.SelectSingleNode("//ren:LP-Aux_Registration/ren:lpauxOperationalArea", namespaceManager); // Quad Points Check if (lpauxRegn.QuadrilateralArea != null && lpauxRegn.QuadrilateralArea.Length > 0) { for (int index = 0; index < lpauxRegn.QuadrilateralArea.Length; index++) { XmlNode nodeQuad = xmlNode.OwnerDocument.CreateNode(XmlNodeType.Element, "n1:lpauxQuadrilateralArea", xmlNode.OwnerDocument.NamespaceURI); XmlNode nodeNEPoint = xmlNode.OwnerDocument.CreateNode(XmlNodeType.Element, "n1:NE_Point", xmlNode.OwnerDocument.NamespaceURI); XmlNode nodeSEPoint = xmlNode.OwnerDocument.CreateNode(XmlNodeType.Element, "n1:SE_Point", xmlNode.OwnerDocument.NamespaceURI); XmlNode nodeSWPoint = xmlNode.OwnerDocument.CreateNode(XmlNodeType.Element, "n1:SW_Point", xmlNode.OwnerDocument.NamespaceURI); XmlNode nodeNWPoint = xmlNode.OwnerDocument.CreateNode(XmlNodeType.Element, "n1:NW_Point", xmlNode.OwnerDocument.NamespaceURI); XmlElement neposition = xmlNode.OwnerDocument.CreateElement("gml:pos", "http://www.opengis.net/gml"); XmlElement seposition = xmlNode.OwnerDocument.CreateElement("gml:pos", "http://www.opengis.net/gml"); XmlElement swposition = xmlNode.OwnerDocument.CreateElement("gml:pos", "http://www.opengis.net/gml"); XmlElement nwposition = xmlNode.OwnerDocument.CreateElement("gml:pos", "http://www.opengis.net/gml"); neposition.InnerText = lpauxRegn.QuadrilateralArea[index].NEPoint.Latitude.ToString() + " " + lpauxRegn.QuadrilateralArea[index].NEPoint.Longitude.ToString(); seposition.InnerText = lpauxRegn.QuadrilateralArea[index].SEPoint.Latitude.ToString() + " " + lpauxRegn.QuadrilateralArea[index].SEPoint.Longitude.ToString(); swposition.InnerText = lpauxRegn.QuadrilateralArea[index].SWPoint.Latitude.ToString() + " " + lpauxRegn.QuadrilateralArea[index].SWPoint.Longitude.ToString(); nwposition.InnerText = lpauxRegn.QuadrilateralArea[index].NWPoint.Latitude.ToString() + " " + lpauxRegn.QuadrilateralArea[index].NWPoint.Longitude.ToString(); nodeNEPoint.AppendChild(neposition); nodeSEPoint.AppendChild(seposition); nodeSWPoint.AppendChild(swposition); nodeNWPoint.AppendChild(nwposition); nodeQuad.AppendChild(nodeNEPoint); nodeQuad.AppendChild(nodeSEPoint); nodeQuad.AppendChild(nodeSWPoint); nodeQuad.AppendChild(nodeNWPoint); nodeOperationalArea.AppendChild(nodeQuad); } } else if (lpauxRegn.PointsArea != null && lpauxRegn.PointsArea.Length > 0) { // Points Area Adding for (int index = 0; index < lpauxRegn.PointsArea.Length; index++) { XmlNode nodePoint = xmlNode.OwnerDocument.CreateNode(XmlNodeType.Element, "n1:lpauxPointArea", xmlNode.NamespaceURI); XmlNode nodeCentrePoint = xmlNode.OwnerDocument.CreateNode(XmlNodeType.Element, "n1:CenterPoint", xmlNode.NamespaceURI); XmlElement centrePosition = xmlNode.OwnerDocument.CreateElement("gml:pos", "http://www.opengis.net/gml"); centrePosition.InnerText = lpauxRegn.PointsArea[index].Latitude.ToString() + " " + lpauxRegn.PointsArea[index].Longitude.ToString(); nodeCentrePoint.AppendChild(centrePosition); nodePoint.AppendChild(nodeCentrePoint); nodeOperationalArea.AppendChild(nodePoint); } } return(xmlNode); }
/// <summary> /// parses the response xml received as poll response. /// </summary> /// <param name="adminName">Indicates admin name </param> /// <param name="pollResponse">response xml string</param> /// <param name="key">public key of the administrator</param> private void ParseResponseXML(string adminName, string pollResponse, string key) { string wsdba = null; LPAuxRegistration[] lpauxRegistrations = null; MVPDRegistration[] mvpdRegistrations = null; TempBASRegistration[] tempBasRegistrations = null; FixedTVBDRegistration[] fixedTVBDRegistrations = null; TVReceiveSiteRegistration[] tvreceiveSiteRegistrtions = null; this.logger.Log(TraceEventType.Information, LoggingMessageId.DBSyncPollerGenericMessage, "WSDBA:" + adminName + ", Begin - dbSyncManager ParseResponseXML()"); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.PreserveWhitespace = true; xmlDoc.LoadXml(pollResponse); XmlNodeList regNodes = null; XmlNamespaceManager namespaceManager = new XmlNamespaceManager(xmlDoc.NameTable); namespaceManager.AddNamespace("vcard", Constants.VCardXmlns); namespaceManager.AddNamespace("ical", Constants.ICalXmlns); namespaceManager.AddNamespace("gml", Constants.GMLXmlns); namespaceManager.AddNamespace("ren", xmlDoc.DocumentElement.NamespaceURI); if (!this.IsXMLSignatureValid(xmlDoc, key)) { this.logger.Log(TraceEventType.Error, LoggingMessageId.DBSyncPollerGenericMessage, "WSDBA:" + adminName + ", SyncManager.ParseResponseXML - XML signature mismatched and not verified with the certificate. please check the xml file received."); throw new CryptographicException("Xml signature is not matching."); } else if (!this.IsXmlValidWithSchema(xmlDoc)) { this.logger.Log(TraceEventType.Error, LoggingMessageId.DBSyncPollerGenericMessage, "WSDBA:" + adminName + ", SyncManager.ParseResponseXML - XML file is invalid. please check the xml file received."); throw new XmlException("Xml file schema validaion failed."); } else { try { this.logger.Log(TraceEventType.Information, LoggingMessageId.DBSyncPollerGenericMessage, "WSDBA:" + adminName + ", Begin " + "SyncManager.ParseResponseXML - LP-AuxRegistrations serialization Started"); wsdba = xmlDoc.SelectSingleNode("//ren:RegistrationRecordEnsemble/ren:EnsembleDescription/ren:Registrar", namespaceManager).InnerText; // lpAuxRegistrations processing. regNodes = xmlDoc.SelectNodes("//ren:Registration[ren:registrationType='LP-Aux_Registration']", namespaceManager); lpauxRegistrations = new LPAuxRegistration[regNodes.Count]; if (regNodes != null && regNodes.Count > 0) { lpauxRegistrations = this.BuildLPAuxRegistrations(regNodes, wsdba, namespaceManager); } this.logger.Log(TraceEventType.Information, LoggingMessageId.DBSyncPollerGenericMessage, "WSDBA:" + adminName + ", End " + "SyncManager.ParseResponseXML - LP-AuxRegistrations serialization Completed"); // MVPD Registrations processing this.logger.Log(TraceEventType.Information, LoggingMessageId.DBSyncPollerGenericMessage, "WSDBA:" + adminName + ", Begin " + "SyncManager.ParseResponseXML - MVPD Registration serialization Started"); regNodes = null; regNodes = xmlDoc.SelectNodes("//ren:Registration[ren:registrationType='MVPD_Registration']", namespaceManager); mvpdRegistrations = new MVPDRegistration[regNodes.Count]; if (regNodes != null && regNodes.Count > 0) { mvpdRegistrations = this.BuildMVPDRegistrations(regNodes, wsdba, namespaceManager); } this.logger.Log(TraceEventType.Information, LoggingMessageId.DBSyncPollerGenericMessage, "WSDBA:" + adminName + ", End " + "SyncManager.ParseResponseXML - MVPD Registration serialization completed"); // Temp Bas Registraions Processing this.logger.Log(TraceEventType.Information, LoggingMessageId.DBSyncPollerGenericMessage, "WSDBA:" + adminName + ", Begin " + "SyncManager.ParseResponseXML - Temp Bas Registration serialization Started"); regNodes = null; regNodes = xmlDoc.SelectNodes("//ren:Registration[ren:registrationType='Temp_BAS_Registration']", namespaceManager); tempBasRegistrations = new TempBASRegistration[regNodes.Count]; if (regNodes != null && regNodes.Count > 0) { tempBasRegistrations = this.BuildTempBASRegistration(regNodes, wsdba, namespaceManager); } this.logger.Log(TraceEventType.Information, LoggingMessageId.DBSyncPollerGenericMessage, "WSDBA:" + adminName + ", End " + "SyncManager.ParseResponseXML - Temp Bas Registration serialization Completed"); // Fixed TVBD Registraions Processing this.logger.Log(TraceEventType.Information, LoggingMessageId.DBSyncPollerGenericMessage, "WSDBA:" + adminName + ", Begin " + "SyncManager.ParseResponseXML - Fixed TVBD Registration serialization Started"); regNodes = null; regNodes = xmlDoc.SelectNodes("//ren:Registration[ren:registrationType='Fixed_TVBD_Registration']", namespaceManager); fixedTVBDRegistrations = new FixedTVBDRegistration[regNodes.Count]; if (regNodes != null && regNodes.Count > 0) { fixedTVBDRegistrations = this.BuildFixedTVBDRegistrations(regNodes, wsdba, namespaceManager); } this.logger.Log(TraceEventType.Information, LoggingMessageId.DBSyncPollerGenericMessage, "WSDBA:" + adminName + ", End" + "SyncManager.ParseResponseXML - Fixed TVBD Registration serialization Completed"); // TV Receive Site Registrations proceswsing this.logger.Log(TraceEventType.Information, LoggingMessageId.DBSyncPollerGenericMessage, "WSDBA:" + adminName + ", Begin " + "SyncManager.ParseResponseXML - TV Receive Site Registration serialization Started"); regNodes = null; regNodes = xmlDoc.SelectNodes("//ren:Registration[ren:registrationType='TV_Receive_Site_Registration']", namespaceManager); tvreceiveSiteRegistrtions = new TVReceiveSiteRegistration[regNodes.Count]; if (regNodes != null && regNodes.Count > 0) { tvreceiveSiteRegistrtions = this.BuildTVSiteReceiveRegistrations(regNodes, wsdba, namespaceManager); } this.logger.Log(TraceEventType.Information, LoggingMessageId.DBSyncPollerGenericMessage, "WSDBA:" + adminName + ", Begin " + "SyncManager.ParseResponseXML - TV Receive Site Registration serialization Completed"); } catch { throw; } } try { this.logger.Log(TraceEventType.Information, LoggingMessageId.DBSyncPollerGenericMessage, "WSDBA:" + adminName + ", Begin " + "dalcDBSync.Update - Registration saving to azure table started"); this.dalcDbSync.Update(adminName, fixedTVBDRegistrations, lpauxRegistrations, mvpdRegistrations, tvreceiveSiteRegistrtions, tempBasRegistrations, null); this.logger.Log(TraceEventType.Information, LoggingMessageId.DBSyncPollerGenericMessage, "WSDBA:" + adminName + ", End " + "dalcDBSync.Update - Registration saving to azure table completed"); } catch (StorageException e) { this.logger.Log(TraceEventType.Error, LoggingMessageId.DBSyncPollerGenericMessage, "dalcDbSync " + "dalcDBSync.Update - Registration saving to azure table got exception :" + e.ToString()); this.auditor.Audit(AuditId.DBSyncPollRequest, AuditStatus.Failure, 0, "dalcDbSync " + "dalcDBSync.Update - Registration saving to azure table got exception :" + e.ToString()); } }
public IEnumerable <LPAuxRegistration> GetLpAuxRegistrations(string userId) { List <LPAuxRegistration> registrations = new List <LPAuxRegistration>(); object lockobject = new object(); var query = new TableQuery <DynamicTableEntity>(); List <string> columns = new List <string>(); columns.Add("AuxRegDisposition"); columns.Add("AuxRegistrant"); columns.Add("AuxTvSpectrum"); columns.Add("ULSFileNumber"); columns.Add("RegId"); columns.Add("VenueName"); columns.Add("Licensed"); columns.Add("UserId"); columns.Add("Latitude"); columns.Add("Longitude"); columns.Add("AuxEvent"); columns.Add("AuxContact"); columns.Add("AuxPointsArea"); query.Select(columns); string registrationTableName = Microsoft.Whitespace.Common.Utils.GetRegionalTableName(Microsoft.Whitespace.Entities.Constants.LPAuxRegistrationTable); var results = this.azureTableOperations.GetTableEntityProjection(registrationTableName, query); if (results != null && results.Count() > 0) { if (!string.IsNullOrEmpty(userId)) { results = results.Where(x => x.Properties["UserId"].StringValue == userId); } Parallel.ForEach( results, result => { var lpAuxRegistration = new LPAuxRegistration { AuxRegDisposition = result.Properties["AuxRegDisposition"].StringValue, AuxRegistrant = result.Properties["AuxRegistrant"].StringValue, AuxContact = result.Properties["AuxContact"].StringValue, AuxTvSpectrum = result.Properties["AuxTvSpectrum"].StringValue, AuxPointsArea = result.Properties["AuxPointsArea"].StringValue, AuxEvent = result.Properties["AuxEvent"].StringValue, ULSFileNumber = result.Properties["ULSFileNumber"].StringValue, RegId = result.Properties["RegId"].StringValue, VenueName = result.Properties["VenueName"].StringValue, UserId = result.Properties["UserId"].StringValue, Licensed = Convert.ToBoolean(result.Properties["Licensed"].BooleanValue), Latitude = Convert.ToDouble(result.Properties["Latitude"].DoubleValue), Longitude = Convert.ToDouble(result.Properties["Longitude"].DoubleValue), PartitionKey = result.PartitionKey, RowKey = result.RowKey, ETag = result.ETag }; lock (lockobject) { registrations.Add(lpAuxRegistration); } }); } return(registrations); }
/// <summary>Registered the specified device.</summary> /// <param name="parameters">Registration parameters</param> /// <param name="userId">User ID</param> /// <returns>PMSE response object</returns> public PMSEResponse RegisterProtectedDevice(Parameters parameters, string userId) { string logMethodName = "PMSEDriver.RegisterProtectedDevice(Parameters parameters)"; PMSEResponse response = new PMSEResponse(); try { // Begin Log transaction this.Logger.Log(TraceEventType.Information, LoggingMessageId.DriverGenericMessage, "Enter " + logMethodName); string wsdba = Utils.RegistrationIdOrg; DateTime settingsDate = this.GetDateSequenceFromSettingsTable(); int sequenceNumber = this.GetSequenceFromSettingsTable(); string regSeqNumber = sequenceNumber.ToString("0000000"); RegistrationDisposition regDisposition = new RegistrationDisposition(); regDisposition.RegDate = settingsDate.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'", DateTimeFormatInfo.InvariantInfo); regDisposition.RegId = string.Format("{0:yyMMdd}", settingsDate) + Utils.RegistrationIdOrg + regSeqNumber; regDisposition.Action = 1; Check.IsNotNull <ParametersBase>(parameters, Constants.ParameterNameParameters); List <string> errorList; if (this.PMSEValidator.IsProtectedDeviceValid(parameters, out errorList)) { string registrationTableName = Utils.GetRegionalTableName(Constants.LPAuxRegistrationTable); LPAuxRegistration lowPowerAuxReg = new LPAuxRegistration() { PartitionKey = wsdba, RowKey = regDisposition.RegId, AuxTvSpectrum = JsonSerialization.SerializeObject(parameters.TvSpectrum), AuxContact = JsonSerialization.SerializeObject(parameters.Contact), AuxRegDisposition = JsonSerialization.SerializeObject(regDisposition), AuxEvent = JsonSerialization.SerializeObject(parameters.Event), AuxRegistrant = JsonSerialization.SerializeObject(parameters.Registrant), Disposition = regDisposition, Licensed = false, UserId = userId, VenueName = parameters.Venue, WSDBA = wsdba }; if (parameters.PointsArea != null && parameters.QuadrilateralArea == null) { lowPowerAuxReg.AuxPointsArea = JsonSerialization.SerializeObject(parameters.PointsArea); } else { lowPowerAuxReg.AuxQuadPoints = JsonSerialization.SerializeObject(parameters.QuadrilateralArea); } this.PMSEDalc.RegisterDevice(lowPowerAuxReg); response = new PMSEResponse { Result = new Result { Message = "Lp-Aux Unlicensed Device registration is successful.", } }; this.Logger.Log(TraceEventType.Information, LoggingMessageId.DriverGenericMessage, "Exit " + logMethodName); return(response); } else { StringBuilder builder = new StringBuilder(); foreach (string value in errorList) { builder.Append(value); builder.Append(","); } response = ErrorHelper.CreatePMSEErrorResponse(Constants.LPAuxRegistration, Constants.ErrorLPAUXDataMissing); response.Error.Data = response.Error.Data + ":" + builder.ToString(); ////response.Result = new Result { Message = builder.ToString(), }; } } catch (Exception e) { // Log transaction failure this.Logger.Log(TraceEventType.Error, LoggingMessageId.DriverGenericMessage, e.ToString()); response = ErrorHelper.CreatePMSEErrorResponse(Constants.LPAuxRegistration, e.ToString()); } this.Logger.Log(TraceEventType.Information, LoggingMessageId.DriverGenericMessage, "Exit " + logMethodName); return(response); }
private static mwc.Incumbent GetIncumbent(object incumbent, IncumbentType requestedIncumbentType) { mwc.Incumbent incumbentModel = null; if (incumbent is MVPDRegistration) { MVPDRegistration mvpdRegistration = (MVPDRegistration)incumbent; // TODO: BroadcastStationContour was removed // List<Position> contourPoints = WhitespacesManager.GetContourPoints(mvpdRegistration.BroadcastStationContour); List <Position> contourPoints = new List <Position>(); incumbentModel = new mwc.Incumbent( mvpdRegistration.Channel.CallSign, mvpdRegistration.ChannelNumber, contourPoints, null, requestedIncumbentType, mvpdRegistration.Location, mvpdRegistration.TransmitLocation); } else if (incumbent is TempBASRegistration) { TempBASRegistration tempBasRegistration = (TempBASRegistration)incumbent; // TODO: BroadcastStationContour was removed // List<Position> contourPoints = WhitespacesManager.GetContourPoints(tempBasRegistration.BroadcastStationContour); List <Position> contourPoints = new List <Position>(); incumbentModel = new mwc.Incumbent( tempBasRegistration.Channel.CallSign, tempBasRegistration.ChannelNumber, contourPoints, tempBasRegistration.Event, requestedIncumbentType, tempBasRegistration.RecvLocation, tempBasRegistration.TransmitLocation); } else if (incumbent is LPAuxRegistration) { LPAuxRegistration lpAuxIncumbent = (LPAuxRegistration)incumbent; List <Position> contourPoints = new List <Position>(); if (lpAuxIncumbent.PointsArea != null) { contourPoints = lpAuxIncumbent.PointsArea.ToList(); } else if (lpAuxIncumbent.QuadrilateralArea != null) { foreach (QuadrilateralArea area in lpAuxIncumbent.QuadrilateralArea) { contourPoints.Add(area.NEPoint); contourPoints.Add(area.NWPoint); contourPoints.Add(area.SEPoint); contourPoints.Add(area.SWPoint); } } // TODO: How to get ReceiveLocation for LPAuxRegistration entity. incumbentModel = new mwc.Incumbent( lpAuxIncumbent.CallSign.CallSign, lpAuxIncumbent.CallSign.Channel.Value, contourPoints, lpAuxIncumbent.Event, requestedIncumbentType, null, new Location(lpAuxIncumbent.Latitude, lpAuxIncumbent.Longitude)); } //// TODO: Logic to create Incumbent object for TV_US incumbent type, as now not sure what Object type to be compare with. return(incumbentModel); }
/// <summary> /// Build LPAUX Registration Xml Node /// </summary> /// <param name="node"> Xml Node </param> /// <param name="lpauxRegistration"> LPAux Registration </param> /// <param name="namespaceManager"> Namespace Manager </param> public static void BuildLPAUXRegistrationXmlNode(XmlNode node, LPAuxRegistration lpauxRegistration, XmlNamespaceManager namespaceManager) { lpauxRegistration.DeSerializeObjectsFromJson(); // disposition if (lpauxRegistration.Disposition != null) { node.SelectSingleNode("//ren:LP-Aux_Registration/ren:RegistrationDisposition/ren:RegistrationDate", namespaceManager).InnerText = lpauxRegistration.Disposition.RegDate.ToString(); node.SelectSingleNode("//ren:LP-Aux_Registration/ren:RegistrationDisposition/ren:RegID", namespaceManager).InnerText = lpauxRegistration.Disposition.RegId; node.SelectSingleNode("//ren:LP-Aux_Registration/ren:RegistrationDisposition/ren:Action", namespaceManager).InnerText = lpauxRegistration.Disposition.Action.ToString(); } // Organization if (lpauxRegistration.Registrant.Org != null) { node.SelectSingleNode("//ren:LP-Aux_Registration/ren:lpauxRegistrant/vcard:properties/vcard:org/vcard:text", namespaceManager).InnerText = lpauxRegistration.Registrant.Org.OrganizationName; } // Formatted Name if (lpauxRegistration.Contact != null && lpauxRegistration.Contact.FN != null) { node.SelectSingleNode("//ren:Fixed_TVBD_Registration/ren:lpauxContact/vcard:properties/vcard:fn/vcard:text", namespaceManager).InnerText = lpauxRegistration.Contact.FN.PrefText; } // Address if (lpauxRegistration.Contact != null && lpauxRegistration.Contact.Address != null) { node.SelectSingleNode("//ren:LP-Aux_Registration/ren:lpauxContact/vcard:properties/vcard:adr/vcard:street/vcard:text", namespaceManager).InnerText = lpauxRegistration.Contact.Address.Street; node.SelectSingleNode("//ren:LP-Aux_Registration/ren:lpauxContact/vcard:properties/vcard:adr/vcard:locality/vcard:text", namespaceManager).InnerText = lpauxRegistration.Contact.Address.Locality; node.SelectSingleNode("//ren:LP-Aux_Registration/ren:lpauxContact/vcard:properties/vcard:adr/vcard:region/vcard:text", namespaceManager).InnerText = lpauxRegistration.Contact.Address.Region; node.SelectSingleNode("//ren:LP-Aux_Registration/ren:lpauxContact/vcard:properties/vcard:adr/vcard:code/vcard:text", namespaceManager).InnerText = lpauxRegistration.Contact.Address.Code; node.SelectSingleNode("//ren:LP-Aux_Registration/ren:lpauxContact/vcard:properties/vcard:adr/vcard:country/vcard:text", namespaceManager).InnerText = lpauxRegistration.Contact.Address.Country; } // Email if (lpauxRegistration.Contact != null && lpauxRegistration.Contact.Email != null) { node.SelectSingleNode("//ren:LP-Aux_Registration/ren:lpauxContact/vcard:properties/vcard:email/vcard:text", namespaceManager).InnerText = lpauxRegistration.Contact.Email[0].EmailAddress; } // Telephone if (lpauxRegistration.Contact != null && lpauxRegistration.Contact.Telephone != null) { node.SelectSingleNode("//ren:LP-Aux_Registration/ren:lpauxContact/vcard:properties/vcard:tel/vcard:text", namespaceManager).InnerText = lpauxRegistration.Contact.Telephone[0].TelephoneNumber; } // LP-Aux venue name if (lpauxRegistration.VenueName != null) { node.SelectSingleNode("//ren:LP-Aux_Registration/ren:lpauxVenueName", namespaceManager).InnerText = lpauxRegistration.VenueName; } // LP-Aux operational area node = BuildLpAuxOperationalArea(node, lpauxRegistration, namespaceManager); // Callsign if (lpauxRegistration.CallSign != null) { node.SelectSingleNode("//ren:LP-Aux_Registration/ren:lpauxCallSign", namespaceManager).InnerText = lpauxRegistration.CallSign.CallSign; } // Event if (lpauxRegistration.Event != null) { node = BuildEvent(node, lpauxRegistration.Event, namespaceManager, "//ren:LP-Aux_Registration/ren:lpauxEvent/"); } // Licensed node.SelectSingleNode("//ren:LP-Aux_Registration/ren:Licensed", namespaceManager).InnerText = lpauxRegistration.Licensed.ToString(); }
/// <summary> /// constructs the LPAuxRegistration entity /// </summary> /// <param name="lpauxRegEntity">LPAuxRegistration Entity to be constructed.</param> /// <param name="xmlNode">XML Node</param> /// <param name="namespaceManager"> Name Space Manager which has all xml name spaces</param> public void BuildEntity(LPAuxRegistration lpauxRegEntity, XmlNode xmlNode, XmlNamespaceManager namespaceManager) { this.syncLogger.Log(TraceEventType.Information, LoggingMessageId.DBSyncPollerGenericMessage, "Begin RegistrationEntityBuilder.BuildEntity for LP-Aux Registration"); XmlNode node = null; // Call Sign this.BuildLPAuxTvsSpectrum(ref lpauxRegEntity, xmlNode, namespaceManager); // Event Deserializing lpauxRegEntity.Event = this.BuildRegistrationEvent(xmlNode.SelectSingleNode("ren:LP-Aux_Registration/ren:lpauxEvent", namespaceManager), namespaceManager); // LP-Aux Licence value if (xmlNode.SelectSingleNode("ren:LP-Aux_Registration/ren:Licensed", namespaceManager) != null) { lpauxRegEntity.Licensed = Convert.ToBoolean(Convert.ToInt16(xmlNode.SelectSingleNode("ren:LP-Aux_Registration/ren:Licensed", namespaceManager).InnerText)); } // Build Quad array if (xmlNode.SelectSingleNode("ren:LP-Aux_Registration/ren:lpauxOperationalArea/ren:lpauxQuadrilateralArea", namespaceManager) != null) { lpauxRegEntity.QuadrilateralArea = this.BuildLPAuxQuadArea(xmlNode.SelectNodes("ren:LP-Aux_Registration/ren:lpauxOperationalArea/ren:lpauxQuadrilateralArea", namespaceManager), namespaceManager); } // Build Point Area if (xmlNode.SelectSingleNode("ren:LP-Aux_Registration/ren:lpauxOperationalArea/ren:lpauxPointArea", namespaceManager) != null) { lpauxRegEntity.PointsArea = this.BuildLPAuxPointsArea(xmlNode.SelectSingleNode("ren:LP-Aux_Registration/ren:lpauxOperationalArea/ren:lpauxPointArea", namespaceManager), namespaceManager); } // build Registration disposition object RegistrationDisposition regDisposition = new RegistrationDisposition(); Utils.DeserializeXMLToObject(ref regDisposition, xmlNode.SelectSingleNode("ren:LP-Aux_Registration/ren:RegistrationDisposition", namespaceManager).OuterXml); lpauxRegEntity.Disposition = regDisposition; // eamil node = xmlNode.SelectSingleNode("ren:LP-Aux_Registration/ren:lpauxContact/vcard:properties/vcard:email", namespaceManager); if (node != null) { lpauxRegEntity.Contact.Email = this.BuildEamils(xmlNode.SelectNodes("ren:LP-Aux_Registration/ren:lpauxContact/vcard:properties/vcard:email", namespaceManager)); } // address node = null; node = xmlNode.SelectSingleNode("ren:LP-Aux_Registration/ren:lpauxContact/vcard:properties/vcard:adr", namespaceManager); if (node != null) { lpauxRegEntity.Contact.Address = this.BuildAddressEntity(node, namespaceManager); } // Registrant's org node = null; node = xmlNode.SelectSingleNode("ren:LP-Aux_Registration/ren:lpauxRegistrant/vcard:properties/vcard:org", namespaceManager); if (node != null) { Entities.Versitcard.Organization org = new Entities.Versitcard.Organization(); Utils.DeserializeXMLToObject(ref org, node.OuterXml); lpauxRegEntity.Registrant.Org = org; } // Telephones node = null; node = xmlNode.SelectSingleNode("ren:LP-Aux_Registration/ren:lpauxContact/vcard:properties/vcard:tel", namespaceManager); if (node != null) { lpauxRegEntity.Contact.Telephone = this.BuildTelephones(xmlNode.SelectNodes("ren:LP-Aux_Registration/ren:lpauxContact/vcard:properties/vcard:tel", namespaceManager)); } // Time zone node = null; node = xmlNode.SelectSingleNode("ren:LP-Aux_Registration/ren:lpauxEvent/ren:presentationTime/ren:tzname", namespaceManager); if (node != null) { lpauxRegEntity.Contact.TimeZone = node.InnerText; } // Title node = null; node = xmlNode.SelectSingleNode("ren:LP-Aux_Registration/ren:presentationTime/vcard:title", namespaceManager); if (node != null) { Entities.Versitcard.Title title = new Entities.Versitcard.Title(); Utils.DeserializeXMLToObject(ref title, node.OuterXml); lpauxRegEntity.Contact.Title = title; } // Venue Name if (xmlNode.SelectSingleNode("ren:LP-Aux_Registration/ren:lpauxVenueName", namespaceManager) != null) { lpauxRegEntity.VenueName = xmlNode.SelectSingleNode("ren:LP-Aux_Registration/ren:lpauxVenueName", namespaceManager).InnerText; } this.syncLogger.Log(TraceEventType.Information, LoggingMessageId.DBSyncPollerGenericMessage, "End RegistrationEntityBuilder.BuildEntity for LP-Aux Registration"); }