public MongoOutputAdapter(IConfigurationService configurationService, IVinterMongoDBClient dbClient) { this._configurationService = configurationService; this.dbClient = dbClient; this.database = null; this.frameCollection = null; this.bodyCollection = null; this._buffer = new List <MocapFrame>(); this._bufferSize = this._configurationService.GetConfiguration().Mongo.MongoBufferSize; this.Enabled = this._configurationService.GetConfiguration().Mongo.Enabled; this.Write = this._configurationService.GetConfiguration().Mongo.Write; this._insertOptions = new InsertManyOptions(); }
public MongoQueryService(IConfigurationService configurationService, IVinterMongoDBClient client) { _enabled = configurationService.GetConfiguration().Mongo.Enabled; if (_enabled) { client.connect(); this.client = client.getMongoClient(); // Setup Database this.database = this.client.GetDatabase(configurationService.GetConfiguration().Mongo.Database); this.sessionCollection = this.database.GetCollection <Session>("Sessions"); Logger.Debug("MongoQuery Service initialized"); } }