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 sones GQL instance /// </summary> /// <param name="myIGraphDBInstace">The graph database instance on which the gql statements are executed</param> public SonesQueryLanguage(IGraphDB myIGraphDBInstace) { _IGraphDBInstance = myIGraphDBInstace; _settings = new GraphApplicationSettings(SonesGQLConstants.ApplicationSettingsLocation); #region plugin manager _GQLPluginManager = new GQLPluginManager(); #endregion #region create gql grammar and set extendable members _GQLGrammar = new SonesGQLGrammar(myIGraphDBInstace); SetExtendableMember(_GQLGrammar); #endregion //build parser _parser = new Parser(_GQLGrammar); //check language if (_parser.Language.ErrorLevel != GrammarErrorLevel.Warning && _parser.Language.ErrorLevel != GrammarErrorLevel.NoError) { throw new IronyInitializeGrammarException(_parser.Language.Errors, ""); } }
/// <summary> /// Create a new index manager /// </summary> /// <param name="myVertexStore">The vertex store of the graphDB</param> /// <param name="myPluginManager">The sones graphDB plugin manager</param> /// <param name="myPluginDefinitions">The parameters for plugin-indices</param> public IndexManager(IDManager myIDManager, GraphDBPluginManager myPluginManager, GraphApplicationSettings myApplicationSettings, List <PluginDefinition> myPluginDefinitions = null) { _idManager = myIDManager; _pluginManager = myPluginManager; _applicationSettings = myApplicationSettings; _indexPluginParameter = myPluginDefinitions != null ? myPluginDefinitions.ToDictionary(key => key.NameOfPlugin, value => value) : new Dictionary <string, PluginDefinition>(); }
/// <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 new index manager /// </summary> /// <param name="myVertexStore">The vertex store of the graphDB</param> /// <param name="myPluginManager">The sones graphDB plugin manager</param> /// <param name="myPluginDefinitions">The parameters for plugin-indices</param> public IndexManager(IDManager myIDManager, GraphDBPluginManager myPluginManager, GraphApplicationSettings myApplicationSettings, List<PluginDefinition> myPluginDefinitions = null) { _idManager = myIDManager; _pluginManager = myPluginManager; _applicationSettings = myApplicationSettings; _indexPluginParameter = myPluginDefinitions != null ? myPluginDefinitions.ToDictionary(key => key.NameOfPlugin, value => value) : new Dictionary<string, PluginDefinition>(); }
/// <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); }
public static IMetaManager CreateMetaManager(IVertexStore myVertexStore, IDManager myIDManager, GraphDBPlugins myPlugins, GraphDBPluginManager myPluginManager, GraphApplicationSettings myApplicationSettings, TransactionToken myTransaction, SecurityToken mySecurity) { var result = new MetaManager(myVertexStore, myIDManager, myPluginManager, myPlugins, myApplicationSettings); DBCreationManager creationManager = new DBCreationManager(result.SystemSecurityToken, result.SystemTransactionToken); if (!creationManager.CheckBaseGraph(myVertexStore)) { creationManager.CreateBaseGraph(myVertexStore); } result.Initialize(); result.Load(); SetMaxID(myVertexStore, myIDManager, myTransaction, mySecurity, result); return result; }
/// <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 }
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; }