Example #1
0
 public RequestList(uint maximumRecordCount, uint maxRequestSize, IPushSerializer <TRequest> serializer)
 {
     this.maximumRecordCount = maximumRecordCount;
     this.maxRequestSize     = maxRequestSize;
     this.serializer         = serializer;
     this.ResetList();
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FormatSerializer"/> class.
 /// </summary>
 /// <param name="serializerFormat">The selected format to intialize the object with.</param>
 public FormatSerializer(Format serializerFormat)
 {
     this.activeSerializer = serializerMap[serializerFormat];
 }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SimpleBingCommercePusher"/> class.
        /// </summary>
        /// <param name="config">The pusher configurations object</param>
        /// <param name="checkpoint">The checkpoint to poll the data since if it's valid.</param>
        /// <param name="serializer">(Optional): Explicit serialier to be used.</param>
        public SimpleBingCommercePusher(BingCommerceConfig config, IDataCheckpoint checkpoint, IPushSerializer <IDictionary <string, object> > serializer = null)
        {
            var sdkClient = new BingCommerceIngestion(new TokenCredentials(config.AccessToken));
            var logger    = new RequestLogger(config.RequestLogLocation, config.RequestLog);

            this.config             = config;
            this.client             = new IngestionClient(sdkClient, config.TenantId, config.IndexId, config.RetryCount, logger);
            this.tracker            = new StatusTracker(this.client, config.TrackingInterval, logger);
            this.taskManager        = new TaskManager(config.MaxConcurrentRequests);
            this.checkpointAcceptor = new CheckpointAcceptor(checkpoint);
            this.Serializer         = serializer ?? new FormatSerializer(config.PushFormat);

            log.Debug("Successfully created the Simple Bing Commerce Pusher with the provided access token.");
        }