private void PublishErrorIfNeeded(IWampPublisher publisher, long requestId, bool acknowledge, WampException ex) { if (acknowledge) { publisher.PublishError(requestId, ex); } }
public void Publish(IWampPublisher publisher, long requestId, PublishOptions options, string topicUri) { InnerPublish(publisher, topicUri, requestId, options, publishOptions => mRawTopicContainer.Publish(publishOptions, topicUri)); }
private void SendPublishAckIfNeeded(IWampPublisher publisher, long requestId, long publicationId, bool acknowledge) { if (acknowledge) { publisher.Published(requestId, publicationId); } }
public void Publish(IWampPublisher publisher, long requestId, PublishOptions options, string topicUri, TMessage[] arguments, IDictionary <string, TMessage> argumentKeywords) { InnerPublish(publisher, topicUri, requestId, options, publishOptions => mRawTopicContainer.Publish(publishOptions, topicUri, arguments, argumentKeywords)); }
public override void Publish(IWampPublisher publisher, long requestId, PublishOptions options, string topicUri) { Action publishAction = () => base.Publish(publisher, requestId, options, topicUri); InnerPublish(publisher, publishAction, requestId, options, topicUri); }
public override void Publish(IWampPublisher publisher, long requestId, PublishOptions options, string topicUri, TMessage[] arguments, IDictionary <string, TMessage> argumentKeywords) { Action publishAction = () => base.Publish(publisher, requestId, options, topicUri, arguments, argumentKeywords); InnerPublish(publisher, publishAction, requestId, options, topicUri); }
private void InnerPublish(IWampPublisher publisher, Action publishAction, long requestId, PublishOptions options, string topicUri) { InnerAction(publisher, authorizer => authorizer.CanPublish(options, topicUri), publishAction, exception => { if (options.Acknowledge == true) { publisher.PublishError(requestId, exception); } }); }
private PublishOptions GetPublishOptions(IWampPublisher publisher, string topicUri, PublishOptions options) { IWampClientProxy casted = publisher as IWampClientProxy; PublishOptionsExtended result = new PublishOptionsExtended(options); result.PublisherId = casted.Session; WelcomeDetails welcomeDetails = casted.WelcomeDetails; result.AuthenticationId = welcomeDetails.AuthenticationId; result.AuthenticationRole = welcomeDetails.AuthenticationRole; result.TopicUri = topicUri; return(result); }
private void InnerPublish(IWampPublisher publisher, string topicUri, long requestId, PublishOptions options, Func <PublishOptions, long> action) { PublishOptions publishOptions = GetPublishOptions(publisher, topicUri, options); bool acknowledge = publishOptions.Acknowledge ?? false; try { ValidatePublishUri(topicUri); long publicationId = action(publishOptions); SendPublishAckIfNeeded(publisher, requestId, publicationId, acknowledge); } catch (WampException ex) { mLogger.ErrorFormat(ex, "Failed publishing to topic '{0}'. Publication request id: {1}", topicUri, requestId); PublishErrorIfNeeded(publisher, requestId, acknowledge, ex); } }
public void Publish(IWampPublisher publisher, long requestId, PublishOptions options, string topicUri, TMessage[] arguments, IDictionary <string, TMessage> argumentKeywords) { throw new System.NotImplementedException(); }
public void Publish(IWampPublisher publisher, long requestId, PublishOptions options, string topicUri) { throw new System.NotImplementedException(); }
public void Publish(IWampPublisher publisher, long requestId, PublishOptions options, string topicUri, TMessage[] arguments) { throw new NotImplementedException(); }
public virtual void Publish(IWampPublisher publisher, long requestId, PublishOptions options, string topicUri, TMessage[] arguments, IDictionary <string, TMessage> argumentKeywords) { mBroker.Publish(publisher, requestId, options, topicUri, arguments, argumentKeywords); }
public virtual void Publish(IWampPublisher publisher, long requestId, PublishOptions options, string topicUri) { mBroker.Publish(publisher, requestId, options, topicUri); }