public static IMetaManager CreateMetaManager(IVertexStore myVertexStore, IDManager myIDManager, GraphDBPlugins myPlugins, GraphDBPluginManager myPluginManager, GraphApplicationSettings myApplicationSettings, ITransactionable myTransactionManager, SecurityToken mySecurity) { var result = new MetaManager(myVertexStore, myIDManager, myPluginManager, myPlugins, myApplicationSettings); var transactionID = myTransactionManager.BeginTransaction(mySecurity); DBCreationManager creationManager = new DBCreationManager(result.SystemSecurityToken, transactionID, result._baseGraphStorageManager); if (!creationManager.CheckBaseGraph(myVertexStore)) { creationManager.CreateBaseGraph(myVertexStore); } creationManager.AddUserDefinedDataTypes(myVertexStore, myPluginManager); result.Initialize(); result.Load(transactionID); SetMaxID(myVertexStore, myIDManager, transactionID, mySecurity, result); myTransactionManager.CommitTransaction(mySecurity, transactionID); return(result); }
/// <summary> /// Creates a new meta manager /// </summary> /// <param name="myVertexStore">The vertex store on which all other manager rely on</param> /// <param name="myPlugins">The plugin definitions</param> /// <param name="myPluginManager">Used to load pluginable manager</param> /// <param name="myApplicationSettings">The current application settings</param> private MetaManager(IVertexStore myVertexStore, IDManager myIDManager, GraphDBPluginManager myPluginManager, GraphDBPlugins myPlugins, GraphApplicationSettings myApplicationSettings) { _vertexStore = myVertexStore; _vertexTypeManager = new VertexTypeManager(myIDManager); _vertexManager = new VertexManager(myIDManager); _edgeTypeManager = new EdgeTypeManager(myIDManager); _queryPlanManager = new QueryPlanManager(); _indexManager = new IndexManager(myIDManager, myPluginManager, myApplicationSettings, myPlugins.IndexPlugins); _baseTypeManager = new BaseTypeManager(); _baseGraphStorageManager = new BaseGraphStorageManager(); _pluginManager = myPluginManager; }
/// <summary> /// Create a meta manager /// </summary> /// <param name="myPlugins">The plugin definitions</param> /// <returns>A meta manager</returns> private IMetaManager CreateMetamanager(GraphDBPlugins myPlugins, ITransactionable myTransactionManager) { return(MetaManager.CreateMetaManager(_securityManager, _idManager, myPlugins, _graphDBPluginManager, _applicationSettings, myTransactionManager, null)); }
/// <summary> /// Creates a new sones graphdb instance /// </summary> /// <param name="myPlugins">The plugins that are valid for the sones GraphDB component</param> /// <param name="myCreate">Should the sones graphdb created?</param> /// <param name="myCulture">the culture of this instance, defaults to en-us</param> public SonesGraphDB( GraphDBPlugins myPlugins = null, Boolean myCreate = true, CultureInfo myCulture = null, String myPersistenceLocation = "") // HACK: myPersistenceLocation was introduced because the global settings management is not in place at the moment... { _id = Guid.NewGuid(); _cts = new CancellationTokenSource(); if (myPlugins == null) { myPlugins = new GraphDBPlugins(); } if (myCulture == null) { // defaults to en-us myCulture = new CultureInfo("en-us"); } _graphDBCulture = myCulture; #region settings _applicationSettings = new GraphApplicationSettings(ConstantsSonesGraphDB.ApplicationSettingsLocation); // HACK: if existing set the PersistenceLocation (btk,23.09.2011) PersistenceLocation pl = new PersistenceLocation(); _applicationSettings.ApplySetting(pl, myPersistenceLocation); #endregion #region plugin manager _graphDBPluginManager = new GraphDBPluginManager(); #endregion #region IGraphFS _iGraphFS = LoadGraphFsPlugin(myPlugins.IGraphFSDefinition); #endregion #region transaction _transactionManager = LoadTransactionManagerPlugin(myPlugins.TransactionManagerPlugin); #endregion #region security _securityManager = LoadSecurityManager(myPlugins.SecurityManagerPlugin); #endregion #region ids _idManager = new IDManager(); #endregion #region requests _requestManager = LoadRequestManager(CreateMetamanager(myPlugins, _transactionManager)); #endregion }