internal void Subscribe(MQSubscriptionDescriptor mqSD) { uint method = 0x2be; this.TrEntry(method, new object[] { mqSD }); int pCompCode = 0; int pReason = 0; try { base.objectHandle = MQQueueManager.nmqiEnv.NewPhobj(); base.qMgr.nmqiConnector.MQSUB(base.qMgr.hConn, mqSD, this.topic.objectHandle, base.objectHandle, out pCompCode, out pReason); if (pCompCode != 0) { base.isClosed = true; base.qMgr.CheckHConnHealth(pReason); base.throwNewMQException(pCompCode, pReason); } base.isClosed = false; } finally { base.TrExit(method); } }
internal MQSubscription(MQQueueManager qMgr, MQTopic mqTopic, MQSubscriptionDescriptor mqSD) { base.TrConstructor("@(#) lib/dotnet/pc/winnt/nmqi/MQSubscription.cs, dotnet, p000 1.3 09/12/14 05:16:29", new object[] { qMgr, mqTopic, mqSD }); base.qMgr = qMgr; this.topic = mqTopic; base.name = mqSD.ObjectString.VSString; this.Subscribe(mqSD); }
public MQSPISubscribeOut(NmqiEnvironment nmqiEnv, int version) : base(nmqiEnv) { base.TrConstructor("%Z% %W% %I% %E% %U%", new object[] { nmqiEnv, version }); this.spiSubscribeOutHdr = new SPISUBSCRIBEOUTHDR(); this.spiSubscribeOutHdr.ID = rfpVB_ID_SUBSCRIBE_OUT; this.Version = version; this.lpisd = new LpiSD(); this.subDesc = new MQSubscriptionDescriptor(); }
private void OpenForSubscription(MQDestination destination, string topicName, string subscriptionName, Hashtable parameters) { uint method = 0x2d2; this.TrEntry(method, new object[] { destination, topicName, subscriptionName, parameters }); try { int openOptions = base.OpenOptions; this.subscribed = true; if (destination == null) { base.objectHandle = MQQueueManager.nmqiEnv.NewPhobj(); } else { base.objectHandle = destination.objectHandle; } this.unmanagedDestinationReference = destination; bool flag = (openOptions & 8) == 8; bool flag2 = (subscriptionName != null) && (subscriptionName.Length > 0); this.durable = flag && flag2; bool flag3 = (openOptions & 0x20) == 0x20; bool flag4 = destination == null; this.managed = flag3 | flag4; if (flag4) { base.OpenOptions |= 0x20; } MQSubscriptionDescriptor mqSD = this.CreateMQSubscriptionDescriptor(topicName, subscriptionName, parameters); this.subscriptionReference = new MQSubscription(base.qMgr, this, mqSD); base.hObj = base.objectHandle.HOBJ; bool isOpen = this.subscriptionReference.IsOpen; base.isClosed = !isOpen; } finally { base.TrExit(method); } }
private MQSubscriptionDescriptor CreateMQSubscriptionDescriptor(string topicName, string subscriptionName, Hashtable parameters) { uint method = 0x2d3; this.TrEntry(method, new object[] { topicName, subscriptionName, parameters }); MQSubscriptionDescriptor descriptor = null; try { descriptor = new MQSubscriptionDescriptor(); if ((base.AlternateUserId != null) && (base.AlternateUserId.Length > 0)) { descriptor.AlternateUserId = base.AlternateUserId; } else { base.AlternateUserId = descriptor.AlternateUserId; } if ((base.objectName != null) && (base.objectName.Length > 0)) { descriptor.ObjectName = base.objectName; } else { base.objectName = descriptor.ObjectName; } if ((topicName != null) && (topicName.Length > 0)) { descriptor.ObjectString.VSString = topicName; } descriptor.Options = base.OpenOptions; if ((subscriptionName != null) && (subscriptionName.Length > 0)) { descriptor.SubName.VSString = subscriptionName; } if (parameters == null) { return(descriptor); } if (parameters.ContainsKey("AlternateSecurityId")) { string str = (string)parameters["AlternateSecurityId"]; if ((str != null) && (str.Length > 0)) { descriptor.AlternateSecurityId = str; } } if (parameters.ContainsKey("PublicationAccountingToken")) { byte[] buffer = (byte[])parameters["PublicationAccountingToken"]; if ((buffer != null) && (buffer.Length > 0)) { descriptor.PubAccountingToken = base.GetString(buffer); } } if (parameters.ContainsKey("PublicationApplicationIdData")) { string str2 = (string)parameters["PublicationApplicationIdData"]; if ((str2 != null) && (str2.Length > 0)) { descriptor.PubApplIdentityData = str2; } } if (parameters.ContainsKey("PublicationPriority")) { descriptor.PubPriority = (int)parameters["PublicationPriority"]; } if (parameters.ContainsKey("SubscriptionCorrelationId")) { byte[] buffer2 = (byte[])parameters["SubscriptionCorrelationId"]; if ((buffer2 != null) && (buffer2.Length > 0)) { descriptor.SubCorrelId = base.GetString(buffer2); } } if (parameters.ContainsKey("SubscriptionExpiry")) { descriptor.SubExpiry = (int)parameters["SubscriptionExpiry"]; } if (parameters.ContainsKey("SubscriptionUserData")) { string str3 = (string)parameters["SubscriptionUserData"]; if ((str3 != null) && (str3.Length > 0)) { descriptor.SubUserData.VSString = str3; } } } finally { base.TrExit(method); } return(descriptor); }