private CreateSenderLinkSettings(SbmpMessagingFactory messagingFactory, string entityName, MessagingEntityType?entityType, string transferDestinationEntityName, RetryPolicy retryPolicy)
        {
            SbmpMessagingFactory sbmpMessagingFactory = messagingFactory;
            string str  = entityName;
            string str1 = entityName;

            Microsoft.ServiceBus.Messaging.Sbmp.LinkInfo linkInfo = new Microsoft.ServiceBus.Messaging.Sbmp.LinkInfo()
            {
                LinkId       = messagingFactory.GetNextLinkId(),
                ConnectionId = messagingFactory.ConnectionId,
                LinkType     = LinkType.Send,
                EntityName   = entityName,
                EntityType   = entityType
            };
            Microsoft.ServiceBus.Messaging.Sbmp.LinkInfo linkInfo1 = linkInfo;
            if (string.IsNullOrEmpty(transferDestinationEntityName))
            {
                string str2 = null;
            }
            else
            {
                str2 = messagingFactory.CreateUri(transferDestinationEntityName).ToString();
            }
            linkInfo1.TransferDestinationEntityAddress = str2;
            base(sbmpMessagingFactory, str, str1, linkInfo, null);
            this.MessageSender = new SbmpMessageSender(base.EntityName, base.MessagingFactory, base.MessageCreator, retryPolicy);
        }
Ejemplo n.º 2
0
 public SbmpMessageSession(string sessionId, DateTime lockedUntilUtc, SessionState sessionState, SbmpMessageReceiver innerReceiver) : base(innerReceiver.Mode, sessionId, lockedUntilUtc, innerReceiver)
 {
     this.sessionState     = sessionState;
     this.parentLinkId     = (innerReceiver.ControlMessageCreator == null ? string.Empty : innerReceiver.ControlMessageCreator.Value.LinkInfo.LinkId);
     this.CachedState      = sessionState != null;
     this.messagingFactory = (SbmpMessagingFactory)innerReceiver.MessagingFactory;
 }
Ejemplo n.º 3
0
        public AcceptMessageSessionForNamespaceAsyncResult(SbmpMessagingFactory messagingFactory, ReceiveMode receiveMode, int prefetchCount, CreateControlLinkSettings controlLinkSettings, TimeSpan serverWaitTime, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
        {
            this.MessagingFactory    = messagingFactory;
            this.controlLinkSettings = controlLinkSettings;
            this.receiveMode         = receiveMode;
            AcceptMessageSessionForNamespaceCommand acceptMessageSessionForNamespaceCommand = new AcceptMessageSessionForNamespaceCommand()
            {
                PrefetchCount    = prefetchCount,
                ReceiveMode      = receiveMode,
                Timeout          = serverWaitTime,
                OperationTimeout = timeout
            };
            AcceptMessageSessionForNamespaceCommand acceptMessageSessionForNamespaceCommand1 = acceptMessageSessionForNamespaceCommand;
            RequestInfo requestInfo = new RequestInfo()
            {
                ServerTimeout    = new TimeSpan?(acceptMessageSessionForNamespaceCommand1.Timeout),
                OperationTimeout = new TimeSpan?(acceptMessageSessionForNamespaceCommand1.OperationTimeout)
            };
            RequestInfo requestInfo1 = requestInfo;
            Message     message      = this.controlLinkSettings.MessageCreator.CreateWcfMessage("http://schemas.microsoft.com/netservices/2011/06/servicebus/SbmpConnection/AcceptMessageSessionForNamespace", acceptMessageSessionForNamespaceCommand1, null, this.MessagingFactory.RetryPolicy, null, requestInfo1);

            if (base.SyncContinue(this.MessagingFactory.Channel.BeginRequest(message, SbmpProtocolDefaults.BufferTimeout(timeout, this.MessagingFactory.GetSettings().EnableAdditionalClientTimeout), base.PrepareAsyncCompletion(AcceptMessageSessionForNamespaceAsyncResult.operationComplete), this)))
            {
                base.Complete(true);
            }
        }
 protected SbmpTransactionalAsyncResult(SbmpMessagingFactory messagingFactory, SbmpMessageCreator messageCreator, Lazy <SbmpMessageCreator> controlMessageCreator, TimeSpan timeout, AsyncCallback callback, object state) : base(timeout, callback, state)
 {
     this.messagingFactory      = messagingFactory;
     this.MessageCreator        = messageCreator;
     this.channel               = this.messagingFactory.Channel;
     this.controlMessageCreator = controlMessageCreator;
     this.Transaction           = System.Transactions.Transaction.Current;
 }
 public CreateControlLinkSettings(SbmpMessagingFactory messagingFactory, string entityPath, string entityName, MessagingEntityType entityType, string fromOffset = null) : base(messagingFactory, entityPath, entityName, new Microsoft.ServiceBus.Messaging.Sbmp.LinkInfo()
 {
     LinkId       = messagingFactory.GetNextLinkId(),
     ConnectionId = messagingFactory.ConnectionId,
     LinkType     = LinkType.Control,
     EntityName   = entityName,
     EntityType   = new MessagingEntityType?(entityType),
     FromOffset   = fromOffset
 }, null)
 {
 }
 public GetMessageSessionsAsyncResult(SbmpMessagingFactory messagingFactory, string entityName, DateTime lastUpdatedTime, SbmpMessageCreator messageCreator, RetryPolicy retryPolicy, MessagingEntityType entityType, TimeSpan timeout, AsyncCallback callback, object state) : base(timeout, callback, state)
 {
     this.lastUpdatedTime  = lastUpdatedTime;
     this.MessagingFactory = messagingFactory;
     this.messageCreator   = messageCreator;
     this.entityName       = entityName;
     this.messageSessions  = new List <MessageSession>();
     this.entityType       = entityType;
     this.sessionsPageSize = 100;
     this.retryPolicy      = retryPolicy;
     base.Start();
 }
        public GetRuntimeEntityDescriptionAsyncResult(TrackingContext trackingContext, MessageClientEntity clientEntity, string entityAddress, SbmpMessagingFactory factory, SbmpMessageCreator messageCreator, bool executeOnce, TimeSpan timeout, AsyncCallback callback, object state) : base(timeout, callback, state)
        {
            this.clientEntity    = clientEntity;
            this.entityAddress   = entityAddress;
            this.factory         = factory;
            this.messageCreator  = messageCreator;
            this.trackingContext = trackingContext ?? TrackingContext.GetInstance(Guid.NewGuid());
            this.executeOnce     = executeOnce;
            GetRuntimeEntityDescriptionAsyncResult getRuntimeEntityDescriptionAsyncResult = this;

            getRuntimeEntityDescriptionAsyncResult.OnCompleting = (Action <AsyncResult, Exception>)Delegate.Combine(getRuntimeEntityDescriptionAsyncResult.OnCompleting, GetRuntimeEntityDescriptionAsyncResult.onFinally);
        }
Ejemplo n.º 8
0
 public SbmpMessageCreator(SbmpMessagingFactory messagingFactory, Uri baseAddress, MessageVersion messageVersion, IServiceBusSecuritySettings serviceBusSecuritySettings, bool disableClientOperationTimeBuffer, EndpointAddress targetAddress)
 {
     if (baseAddress == null)
     {
         throw Fx.Exception.AsError(new ArgumentNullException("baseAddress"), null);
     }
     this.messagingFactory                 = messagingFactory;
     this.baseAddress                      = baseAddress;
     this.messageVersion                   = messageVersion;
     this.serviceBusSecuritySettings       = serviceBusSecuritySettings;
     this.targetAddress                    = targetAddress;
     this.disableClientOperationTimeBuffer = disableClientOperationTimeBuffer;
 }
Ejemplo n.º 9
0
 public CreateBrowserLinkSettings(SbmpMessagingFactory messagingFactory, string entityPath, string entityName, MessagingEntityType?entityType, Lazy <SbmpMessageCreator> controlMessageCreator, RetryPolicy retryPolicy, bool isSessionful) : base(messagingFactory, entityPath, entityName, new Microsoft.ServiceBus.Messaging.Sbmp.LinkInfo()
 {
     LinkId            = messagingFactory.GetNextLinkId(),
     ConnectionId      = messagingFactory.ConnectionId,
     LinkType          = LinkType.Receive,
     EntityName        = entityName,
     EntityType        = entityType,
     IsSessionReceiver = isSessionful,
     IsBrowseMode      = true
 }, controlMessageCreator)
 {
     this.MessageBrowser = new SbmpMessageBrowser(base.EntityPath, base.MessagingFactory, base.MessageCreator, base.ControlMessageCreator, retryPolicy, false);
 }
Ejemplo n.º 10
0
        public AcceptMessageSessionAsyncResult(SbmpMessagingFactory messagingFactory, string entityName, string sessionId, MessagingEntityType?entityType, ReceiveMode receiveMode, int prefetchCount, Lazy <SbmpMessageCreator> controlMessageCreator, RetryPolicy retryPolicy, TimeSpan serverWaitTime, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
        {
            this.prefetchCount    = prefetchCount;
            this.sessionId        = sessionId;
            this.MessagingFactory = messagingFactory;
            this.retryPolicy      = retryPolicy ?? messagingFactory.RetryPolicy.Clone();
            LinkInfo linkInfo = new LinkInfo()
            {
                LinkId            = messagingFactory.GetNextLinkId(),
                ConnectionId      = messagingFactory.ConnectionId,
                LinkType          = LinkType.Receive,
                IsSessionReceiver = true,
                ReceiveMode       = receiveMode,
                EntityName        = entityName,
                EntityType        = entityType
            };

            this.createLinkSettings = new CreateLinkSettings(messagingFactory, entityName, entityName, linkInfo, controlMessageCreator);
            AcceptMessageSessionCommand acceptMessageSessionCommand = new AcceptMessageSessionCommand()
            {
                SessionId        = this.sessionId,
                Timeout          = serverWaitTime,
                OperationTimeout = timeout,
                PrefetchCount    = this.prefetchCount
            };
            AcceptMessageSessionCommand acceptMessageSessionCommand1 = acceptMessageSessionCommand;
            string linkId = null;

            if (this.createLinkSettings.ControlMessageCreator != null && !string.IsNullOrWhiteSpace(this.createLinkSettings.ControlMessageCreator.Value.LinkInfo.LinkId))
            {
                linkId = this.createLinkSettings.ControlMessageCreator.Value.LinkInfo.LinkId;
            }
            RequestInfo requestInfo = new RequestInfo()
            {
                ServerTimeout = new TimeSpan?(acceptMessageSessionCommand1.Timeout),
                SessionId     = acceptMessageSessionCommand1.SessionId
            };
            RequestInfo requestInfo1 = requestInfo;
            Message     message      = this.createLinkSettings.MessageCreator.CreateWcfMessage("http://schemas.microsoft.com/netservices/2011/06/servicebus/SbmpMessageReceiver/AcceptMessageSession", acceptMessageSessionCommand1, linkId, this.retryPolicy, null, requestInfo1);

            if (base.SyncContinue(this.MessagingFactory.Channel.BeginRequest(message, SbmpProtocolDefaults.BufferTimeout(timeout, this.MessagingFactory.GetSettings().EnableAdditionalClientTimeout), base.PrepareAsyncCompletion(AcceptMessageSessionAsyncResult.operationComplete), this)))
            {
                base.Complete(true);
            }
        }
Ejemplo n.º 11
0
        public CreateLinkSettings(SbmpMessagingFactory messagingFactory, string entityPath, string entityName, Microsoft.ServiceBus.Messaging.Sbmp.LinkInfo linkInfo, Lazy <SbmpMessageCreator> controlMessageCreator = null)
        {
            this.LinkInfo         = linkInfo;
            this.MessagingFactory = messagingFactory;
            EndpointAddress endpointAddress = messagingFactory.CreateEndpointAddress(entityPath);

            this.EntityName            = entityName;
            this.EntityPath            = entityPath;
            this.ControlMessageCreator = controlMessageCreator;
            MessagingFactorySettings settings = this.MessagingFactory.GetSettings();

            this.MessageCreator = new SbmpMessageCreator(this.MessagingFactory, this.MessagingFactory.BaseAddress, this.MessagingFactory.MessageVersion, this.MessagingFactory.Settings, settings.EnableAdditionalClientTimeout, endpointAddress);
            if (this.LinkInfo != null)
            {
                this.MessageCreator = this.MessageCreator.CreateLinkMessageCreator(this.LinkInfo);
                if (settings.NetMessagingTransportSettings.GatewayMode)
                {
                    this.LinkInfo.IsHttp     = true;
                    this.LinkInfo.ApiVersion = ApiVersionHelper.CurrentRuntimeApiVersion;
                }
            }
        }
 public SbmpVolatileTopicClient(SbmpMessagingFactory factory, string path, string clientId, Microsoft.ServiceBus.RetryPolicy retryPolicy, Microsoft.ServiceBus.Messaging.Filter filter) : base(factory, path, clientId, retryPolicy, filter)
 {
     this.ControlMessageCreator = new Lazy <SbmpMessageCreator>(new Func <SbmpMessageCreator>(this.InitializeControlLink));
 }
 public OpenAsyncResult(SbmpMessagingFactory factory, TimeSpan timeout, AsyncCallback callback, object state) : base(timeout, callback, state)
 {
     this.factory = factory;
 }
 public CloseAsyncResult(SbmpMessagingFactory factory, TimeSpan timeout, AsyncCallback callback, object state) : base(timeout, callback, state)
 {
     this.factory = factory;
     this.channel = factory.Channel;
 }
 public SbmpSubscriptionClient(SbmpMessagingFactory messagingFactory, string topicPath, string name, ReceiveMode receiveMode) : base(messagingFactory, topicPath, name, receiveMode)
 {
     this.ControlMessageCreator = new Lazy <SbmpMessageCreator>(new Func <SbmpMessageCreator>(this.InitializeControlLink));
 }
Ejemplo n.º 16
0
 public SbmpEventHubClient(SbmpMessagingFactory messagingFactory, string path) : base(messagingFactory, path)
 {
 }
        public AcceptMessageSessionBrowserAsyncResult(SbmpBrowsableMessageSession messageSession, SbmpMessagingFactory messagingFactory, MessagingEntityType?entityType, ReceiveMode receiveMode, int prefetchCount, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
        {
            this.messageSession   = messageSession;
            this.sessionId        = messageSession.SessionId;
            this.MessagingFactory = messagingFactory;
            string   path     = messageSession.Path;
            LinkInfo linkInfo = new LinkInfo()
            {
                LinkId            = messagingFactory.GetNextLinkId(),
                ConnectionId      = messagingFactory.ConnectionId,
                LinkType          = LinkType.Receive,
                IsSessionReceiver = true,
                ReceiveMode       = receiveMode,
                EntityName        = path,
                EntityType        = entityType,
                SessionId         = messageSession.SessionId
            };

            this.createLinkSettings = new CreateLinkSettings(messagingFactory, path, path, linkInfo, null);
            AcceptMessageSessionCommand acceptMessageSessionCommand = new AcceptMessageSessionCommand()
            {
                SessionId        = this.sessionId,
                Timeout          = timeout,
                PrefetchCount    = prefetchCount,
                IsSessionBrowser = true
            };
            AcceptMessageSessionCommand acceptMessageSessionCommand1 = acceptMessageSessionCommand;
            RequestInfo requestInfo = new RequestInfo()
            {
                ServerTimeout = new TimeSpan?(acceptMessageSessionCommand1.Timeout),
                SessionId     = acceptMessageSessionCommand1.SessionId
            };
            RequestInfo requestInfo1 = requestInfo;
            Message     message      = this.createLinkSettings.MessageCreator.CreateWcfMessage("http://schemas.microsoft.com/netservices/2011/06/servicebus/SbmpMessageReceiver/AcceptMessageSession", acceptMessageSessionCommand1, null, this.messageSession.RetryPolicy, null, requestInfo1);

            if (base.SyncContinue(this.MessagingFactory.Channel.BeginRequest(message, SbmpProtocolDefaults.BufferTimeout(timeout, this.MessagingFactory.GetSettings().EnableAdditionalClientTimeout), base.PrepareAsyncCompletion(AcceptMessageSessionBrowserAsyncResult.operationComplete), this)))
            {
                base.Complete(true);
            }
        }
Ejemplo n.º 18
0
 public SbmpQueueClient(SbmpMessagingFactory messagingFactory, string name, ReceiveMode receiveMode) : base(messagingFactory, name, receiveMode)
 {
     this.ControlMessageCreator = new Lazy <SbmpMessageCreator>(new Func <SbmpMessageCreator>(this.InitializeControlLink));
 }
 public CreateReceiverLinkSettings(SbmpMessagingFactory messagingFactory, string entityPath, string entityName, MessagingEntityType?entityType, ReceiveMode receiveMode, Lazy <SbmpMessageCreator> controlMessageCreator, RetryPolicy retryPolicy, bool isSessionful) : this(messagingFactory, entityPath, entityName, entityType, receiveMode, controlMessageCreator, retryPolicy, isSessionful, null)
 {
 }
 public CreateSenderLinkSettings(SbmpMessagingFactory messagingFactory, string entityName, MessagingEntityType?entityType, RetryPolicy retryPolicy) : this(messagingFactory, entityName, entityType, null, retryPolicy)
 {
 }
Ejemplo n.º 21
0
 private SbmpMessageCreator(SbmpMessagingFactory messagingFactory, Uri baseAddress, MessageVersion messageVersion, IServiceBusSecuritySettings serviceBusSecuritySettings, bool disableClientOperationTimeBuffer, EndpointAddress targetAddress, Microsoft.ServiceBus.Messaging.Sbmp.LinkInfo linkInfo) : this(messagingFactory, baseAddress, messageVersion, serviceBusSecuritySettings, disableClientOperationTimeBuffer, targetAddress)
 {
     this.linkInfo = linkInfo;
 }
Ejemplo n.º 22
0
 public AcceptMessageSessionAsyncResult(SbmpMessagingFactory messagingFactory, string entityName, string sessionId, MessagingEntityType?entityType, ReceiveMode receiveMode, int prefetchCount, Lazy <SbmpMessageCreator> controlMessageCreator, TimeSpan serverWaitTime, TimeSpan timeout, AsyncCallback callback, object state) : this(messagingFactory, entityName, sessionId, entityType, receiveMode, prefetchCount, controlMessageCreator, null, serverWaitTime, timeout, callback, state)
 {
 }
Ejemplo n.º 23
0
 public SbmpTopicClient(SbmpMessagingFactory messagingFactory, string path) : base(messagingFactory, path)
 {
 }
Ejemplo n.º 24
0
 public SbmpBrowsableMessageSession(string path, string sessionId, MessagingEntityType entityType, SbmpMessagingFactory messagingFactory, Microsoft.ServiceBus.RetryPolicy retryPolicy) : base(ReceiveMode.PeekLock, sessionId, DateTime.MinValue, messagingFactory, retryPolicy)
 {
     this.path       = path;
     this.entityType = entityType;
     this.resetEvent = new AutoResetEvent(true);
 }
 public CreateSenderLinkSettings(SbmpMessagingFactory messagingFactory, string entityName, MessagingEntityType?entityType, string transferDestinationEntityName) : this(messagingFactory, entityName, entityType, transferDestinationEntityName, null)
 {
 }