private IdGenerator EnsureIdGenerator(ApplicationMetadataXml app) { IdGenerator idGenerator = this.FIdGenerators.FindByApp(app); if (idGenerator != null) { return(idGenerator); } ApplicationDbConfig connectionParams = new ApplicationDbConfig((XmlNode)app.ConnectionParams); for (int index = 0; index < this.FIdGenerators.Count; ++index) { IdGenerator fidGenerator = this.FIdGenerators[index]; if (fidGenerator.IsSameConnectionParams(connectionParams)) { idGenerator = fidGenerator; break; } } if (idGenerator == null) { idGenerator = IdGenerator.Create(this, connectionParams); this.FIdGenerators.Add((object)idGenerator); } idGenerator.ServedApps.Add((object)app); return(idGenerator); }
public ApplicationDb(ApplicationDbConfig config) { _config = config; var client = new MongoClient(_config.ConnectionString); _database = client.GetDatabase(_config.Database); _bucket = new GridFSBucket(_database); }
public DirectIdGenerator(ApplicationDbConfig connectionParams) : base(connectionParams) => this.FGeneratorInc = 100;
protected IdGenerator(ApplicationDbConfig connectionParams) => this.FConnectionParams = connectionParams;
public RemoteIdGenerator(Integro.InMeta.Runtime.CentralServer.CentralServer owner, ApplicationDbConfig connectionParams) : base(connectionParams) { string centralServerAddress; RemoteIdGenerator.TryParseAddress(IdGenerator.GetIdGeneratorAddress(connectionParams), out centralServerAddress, out this.FAppId); this.FCentralServerConnection = new CentralServerConnection(owner, centralServerAddress); }