public QueueTriggerBinding(string parameterName,
                                   QueueServiceClient queueServiceClient,
                                   QueueClient queue,
                                   ITriggerDataArgumentBinding <QueueMessage> argumentBinding,
                                   QueuesOptions queueOptions,
                                   IWebJobsExceptionHandler exceptionHandler,
                                   SharedQueueWatcher messageEnqueuedWatcherSetter,
                                   ILoggerFactory loggerFactory,
                                   IQueueProcessorFactory queueProcessorFactory,
                                   QueueCausalityManager queueCausalityManager)
        {
            _queueServiceClient = queueServiceClient ?? throw new ArgumentNullException(nameof(queueServiceClient));
            _queue                        = queue ?? throw new ArgumentNullException(nameof(queue));
            _argumentBinding              = argumentBinding ?? throw new ArgumentNullException(nameof(argumentBinding));
            _bindingDataContract          = CreateBindingDataContract(argumentBinding.BindingDataContract);
            _queueOptions                 = queueOptions ?? throw new ArgumentNullException(nameof(queueOptions));
            _exceptionHandler             = exceptionHandler ?? throw new ArgumentNullException(nameof(exceptionHandler));
            _messageEnqueuedWatcherSetter = messageEnqueuedWatcherSetter ?? throw new ArgumentNullException(nameof(messageEnqueuedWatcherSetter));
            _queueCausalityManager        = queueCausalityManager ?? throw new ArgumentNullException(nameof(queueCausalityManager));

            _parameterName         = parameterName;
            _loggerFactory         = loggerFactory;
            _queueProcessorFactory = queueProcessorFactory;
            _converter             = CreateConverter(_queue);
            _logger = loggerFactory.CreateLogger <QueueTriggerBinding>();
        }
Exemplo n.º 2
0
 public TableBinding(string parameterName, IStorageTableArgumentBinding argumentBinding, IStorageTableClient client, IBindableTablePath path)
 {
     _parameterName   = parameterName;
     _argumentBinding = argumentBinding;
     _client          = client;
     _accountName     = TableClient.GetAccountName(client);
     _path            = path;
     _converter       = CreateConverter(client, path);
 }
Exemplo n.º 3
0
        public QueueTriggerBinding(string parameterName,
                                   IStorageQueue queue,
                                   ITriggerDataArgumentBinding <IStorageQueueMessage> argumentBinding,
                                   IQueueConfiguration queueConfiguration,
                                   IWebJobsExceptionHandler exceptionHandler,
                                   IContextSetter <IMessageEnqueuedWatcher> messageEnqueuedWatcherSetter,
                                   ISharedContextProvider sharedContextProvider,
                                   TraceWriter trace,
                                   ILoggerFactory loggerFactory)
        {
            if (queue == null)
            {
                throw new ArgumentNullException("queue");
            }

            if (argumentBinding == null)
            {
                throw new ArgumentNullException("argumentBinding");
            }

            if (queueConfiguration == null)
            {
                throw new ArgumentNullException("queueConfiguration");
            }

            if (exceptionHandler == null)
            {
                throw new ArgumentNullException("exceptionHandler");
            }

            if (messageEnqueuedWatcherSetter == null)
            {
                throw new ArgumentNullException("messageEnqueuedWatcherSetter");
            }

            if (sharedContextProvider == null)
            {
                throw new ArgumentNullException("sharedContextProvider");
            }

            if (trace == null)
            {
                throw new ArgumentNullException("trace");
            }

            _parameterName                = parameterName;
            _queue                        = queue;
            _argumentBinding              = argumentBinding;
            _bindingDataContract          = CreateBindingDataContract(argumentBinding.BindingDataContract);
            _queueConfiguration           = queueConfiguration;
            _exceptionHandler             = exceptionHandler;
            _messageEnqueuedWatcherSetter = messageEnqueuedWatcherSetter;
            _sharedContextProvider        = sharedContextProvider;
            _trace                        = trace;
            _loggerFactory                = loggerFactory;
            _converter                    = CreateConverter(queue);
        }
Exemplo n.º 4
0
 public TableBinding(string parameterName, ITableArgumentBinding argumentBinding, IStorageTableClient client, IBindableTablePath path)
 {
     _parameterName = parameterName;
     _argumentBinding = argumentBinding;
     _client = client;
     _accountName = TableClient.GetAccountName(client);
     _path = path;
     _converter = CreateConverter(client, path);
 }
Exemplo n.º 5
0
 public QueueBinding(string parameterName, IArgumentBinding<IStorageQueue> argumentBinding,
     IStorageQueueClient client, IBindableQueuePath path)
 {
     _parameterName = parameterName;
     _argumentBinding = argumentBinding;
     _client = client;
     _accountName = QueueClient.GetAccountName(client);
     _path = path;
     _converter = CreateConverter(client, path);
 }
Exemplo n.º 6
0
 public TableEntityBinding(string parameterName, IArgumentBinding <TableEntityContext> argumentBinding,
                           CloudTableClient client, IBindableTableEntityPath path)
 {
     _parameterName   = parameterName;
     _argumentBinding = argumentBinding;
     _client          = client;
     _accountName     = TableClient.GetAccountName(client);
     _path            = path;
     _converter       = CreateConverter(client, path);
 }
Exemplo n.º 7
0
 public QueueBinding(string parameterName, IArgumentBinding <IStorageQueue> argumentBinding,
                     IStorageQueueClient client, IBindableQueuePath path)
 {
     _parameterName   = parameterName;
     _argumentBinding = argumentBinding;
     _client          = client;
     _accountName     = QueueClient.GetAccountName(client);
     _path            = path;
     _converter       = CreateConverter(client, path);
 }
Exemplo n.º 8
0
 private ServiceBusTriggerBinding(string parameterName, Type parameterType, ITriggerDataArgumentBinding <Message> argumentBinding,
                                  ServiceBusAccount account, ServiceBusConfiguration config)
 {
     _parameterName       = parameterName;
     _converter           = CreateConverter(parameterType);
     _argumentBinding     = argumentBinding;
     _bindingDataContract = CreateBindingDataContract(argumentBinding.BindingDataContract);
     _account             = account;
     _config = config;
 }
        public QueueTriggerBinding(string parameterName,
            IStorageQueue queue,
            ITriggerDataArgumentBinding<IStorageQueueMessage> argumentBinding,
            IQueueConfiguration queueConfiguration,
            IBackgroundExceptionDispatcher backgroundExceptionDispatcher,
            IContextSetter<IMessageEnqueuedWatcher> messageEnqueuedWatcherSetter,
            ISharedContextProvider sharedContextProvider,
            TraceWriter trace)
        {
            if (queue == null)
            {
                throw new ArgumentNullException("queue");
            }

            if (argumentBinding == null)
            {
                throw new ArgumentNullException("argumentBinding");
            }

            if (queueConfiguration == null)
            {
                throw new ArgumentNullException("queueConfiguration");
            }

            if (backgroundExceptionDispatcher == null)
            {
                throw new ArgumentNullException("backgroundExceptionDispatcher");
            }

            if (messageEnqueuedWatcherSetter == null)
            {
                throw new ArgumentNullException("messageEnqueuedWatcherSetter");
            }

            if (sharedContextProvider == null)
            {
                throw new ArgumentNullException("sharedContextProvider");
            }

            if (trace == null)
            {
                throw new ArgumentNullException("trace");
            }

            _parameterName = parameterName;
            _queue = queue;
            _argumentBinding = argumentBinding;
            _bindingDataContract = CreateBindingDataContract(argumentBinding);
            _queueConfiguration = queueConfiguration;
            _backgroundExceptionDispatcher = backgroundExceptionDispatcher;
            _messageEnqueuedWatcherSetter = messageEnqueuedWatcherSetter;
            _sharedContextProvider = sharedContextProvider;
            _trace = trace;
            _converter = CreateConverter(queue);
        }
Exemplo n.º 10
0
        public QueueTriggerBinding(string parameterName,
                                   IStorageQueue queue,
                                   ITriggerDataArgumentBinding <IStorageQueueMessage> argumentBinding,
                                   IQueueConfiguration queueConfiguration,
                                   IBackgroundExceptionDispatcher backgroundExceptionDispatcher,
                                   IContextSetter <IMessageEnqueuedWatcher> messageEnqueuedWatcherSetter,
                                   ISharedContextProvider sharedContextProvider,
                                   TextWriter log)
        {
            if (queue == null)
            {
                throw new ArgumentNullException("queue");
            }

            if (argumentBinding == null)
            {
                throw new ArgumentNullException("argumentBinding");
            }

            if (queueConfiguration == null)
            {
                throw new ArgumentNullException("queueConfiguration");
            }

            if (backgroundExceptionDispatcher == null)
            {
                throw new ArgumentNullException("backgroundExceptionDispatcher");
            }

            if (messageEnqueuedWatcherSetter == null)
            {
                throw new ArgumentNullException("messageEnqueuedWatcherSetter");
            }

            if (sharedContextProvider == null)
            {
                throw new ArgumentNullException("sharedContextProvider");
            }

            if (log == null)
            {
                throw new ArgumentNullException("log");
            }

            _parameterName                 = parameterName;
            _queue                         = queue;
            _argumentBinding               = argumentBinding;
            _bindingDataContract           = CreateBindingDataContract(argumentBinding);
            _queueConfiguration            = queueConfiguration;
            _backgroundExceptionDispatcher = backgroundExceptionDispatcher;
            _messageEnqueuedWatcherSetter  = messageEnqueuedWatcherSetter;
            _sharedContextProvider         = sharedContextProvider;
            _log       = log;
            _converter = CreateConverter(queue);
        }
 private ServiceBusTriggerBinding(string parameterName, Type parameterType, ITriggerDataArgumentBinding <Message> argumentBinding,
                                  ServiceBusAccount account, ServiceBusOptions options, MessagingProvider messagingProvider)
 {
     _parameterName       = parameterName;
     _converter           = CreateConverter(parameterType);
     _argumentBinding     = argumentBinding;
     _bindingDataContract = CreateBindingDataContract(argumentBinding.BindingDataContract);
     _account             = account;
     _options             = options;
     _messagingProvider   = messagingProvider;
 }
Exemplo n.º 12
0
        private void SetPropertyOnObject <T>(PropertyInfo typeProperty, T newItem) where T : new()
        {
            if (TableConstants.ReservedPropertyNames.Contains(typeProperty.Name))
            {
                return;
            }

            IObjectToTypeConverter objectConverter = ObjectConverterFactory.GetConverterFor(typeProperty.PropertyType);

            typeProperty.SetValue(newItem, objectConverter.ConvertToValue(_properties[typeProperty.Name], typeProperty), null);
        }
Exemplo n.º 13
0
 public ServiceBusTriggerBinding(string parameterName, Type parameterType,
                                 ITriggerDataArgumentBinding <BrokeredMessage> argumentBinding, ServiceBusAccount account, string queueName)
 {
     _parameterName   = parameterName;
     _converter       = CreateConverter(parameterType);
     _argumentBinding = argumentBinding;
     _account         = account;
     _namespaceName   = ServiceBusClient.GetNamespaceName(account);
     _queueName       = queueName;
     _entityPath      = queueName;
 }
Exemplo n.º 14
0
 private ServiceBusTriggerBinding(string parameterName, Type parameterType, ITriggerDataArgumentBinding <BrokeredMessage> argumentBinding,
                                  ServiceBusAccount account, AccessRights accessRights, ServiceBusConfiguration config)
 {
     _parameterName   = parameterName;
     _converter       = CreateConverter(parameterType);
     _argumentBinding = argumentBinding;
     _account         = account;
     _namespaceName   = ServiceBusClient.GetNamespaceName(account);
     _accessRights    = accessRights;
     _config          = config;
 }
 public ServiceBusTriggerBinding(string parameterName, Type parameterType, 
     ITriggerDataArgumentBinding<BrokeredMessage> argumentBinding, ServiceBusAccount account, string queueName, AccessRights accessRights)
 {
     _parameterName = parameterName;
     _converter = CreateConverter(parameterType);
     _argumentBinding = argumentBinding;
     _account = account;
     _namespaceName = ServiceBusClient.GetNamespaceName(account);
     _queueName = queueName;
     _entityPath = queueName;
     _accessRights = accessRights;
 }
 public ServiceBusTriggerBinding(string parameterName, Type parameterType, ITriggerDataArgumentBinding <Message> argumentBinding,
                                 ServiceBusAccount account, ServiceBusOptions options, MessagingProvider messagingProvider, string entityPath, bool isSessionsEnabled)
 {
     _parameterName       = parameterName;
     _converter           = CreateConverter(parameterType);
     _argumentBinding     = argumentBinding;
     _bindingDataContract = CreateBindingDataContract(argumentBinding.BindingDataContract);
     _account             = account;
     _options             = options;
     _messagingProvider   = messagingProvider;
     _entityPath          = entityPath;
     _isSessionsEnabled   = isSessionsEnabled;
 }
Exemplo n.º 17
0
        private static Dictionary <string, EntityProperty> GetProperties(Dictionary <string, Tuple <object, Type> > properties)
        {
            var entityProperties = new Dictionary <string, EntityProperty>();

            foreach (KeyValuePair <string, Tuple <object, Type> > property in properties)
            {
                Type propertyType = property.Value.Item2;

                IObjectToTypeConverter converter = ObjectConverterFactory.GetConverterFor(propertyType);
                entityProperties[property.Key] = converter.ConvertToEntityProperty(property.Value.Item1, propertyType);
            }

            return(entityProperties);
        }
Exemplo n.º 18
0
        private static IObjectToTypeConverter <TOutput> Create <TOutput>(
            IObjectToTypeConverter <TOutput> identityConverter)
        {
            IConverter <string, TOutput> stringConverter =
                StringToTConverterFactory.Instance.TryCreate <TOutput>();

            if (stringConverter == null)
            {
                return(identityConverter);
            }

            return(new CompositeObjectToTypeConverter <TOutput>(
                       identityConverter,
                       new StringConverterObjectToTypeConverter <TOutput>(stringConverter)));
        }
        public QueueTriggerBinding(string parameterName,
                                   IStorageQueue queue,
                                   ITriggerDataArgumentBinding <IStorageQueueMessage> argumentBinding,
                                   IQueueConfiguration queueConfiguration,
                                   IWebJobsExceptionHandler exceptionHandler,
                                   IContextSetter <IMessageEnqueuedWatcher> messageEnqueuedWatcherSetter,
                                   ISharedContextProvider sharedContextProvider,
                                   ILoggerFactory loggerFactory)
        {
            _queue                        = queue ?? throw new ArgumentNullException(nameof(queue));
            _argumentBinding              = argumentBinding ?? throw new ArgumentNullException(nameof(argumentBinding));
            _bindingDataContract          = CreateBindingDataContract(argumentBinding.BindingDataContract);
            _queueConfiguration           = queueConfiguration ?? throw new ArgumentNullException(nameof(queueConfiguration));
            _exceptionHandler             = exceptionHandler ?? throw new ArgumentNullException(nameof(exceptionHandler));
            _messageEnqueuedWatcherSetter = messageEnqueuedWatcherSetter ?? throw new ArgumentNullException(nameof(messageEnqueuedWatcherSetter));
            _sharedContextProvider        = sharedContextProvider ?? throw new ArgumentNullException(nameof(sharedContextProvider));

            _parameterName = parameterName;
            _loggerFactory = loggerFactory;
            _converter     = CreateConverter(queue);
        }