Пример #1
0
        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);
        }
Пример #2
0
 private static void SetMaxID(IVertexStore myVertexStore,
                              IDManager myIDManager,
                              Int64 myTransaction,
                              SecurityToken mySecurity,
                              MetaManager result)
 {
     foreach (var aUserDefinedVertexType in result._vertexTypeManager.ExecuteManager.GetAllTypes(myTransaction, mySecurity))
     {
         myIDManager.GetVertexTypeUniqeID(aUserDefinedVertexType.ID).SetToMaxID(myVertexStore.GetHighestVertexID(mySecurity, myTransaction, aUserDefinedVertexType.ID) + 1);
     }
 }
Пример #3
0
 private static void SetMaxID(IVertexStore myVertexStore, IDManager myIDManager, TransactionToken myTransaction, SecurityToken mySecurity, MetaManager result)
 {
     foreach (var aUserDefinedVertexType in result._vertexTypeManager.ExecuteManager.GetAllVertexTypes(myTransaction, mySecurity).Where(_ => _.IsUserDefined))
     {
         myIDManager[aUserDefinedVertexType.ID].SetToMaxID(myVertexStore.GetHighestVertexID(mySecurity, myTransaction, aUserDefinedVertexType.ID) + 1);
     }
 }
Пример #4
0
        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;
        }
Пример #5
0
 private static void SetMaxID(IVertexStore myVertexStore, 
                                 IDManager myIDManager, 
                                 Int64 myTransaction, 
                                 SecurityToken mySecurity, 
                                 MetaManager result)
 {
     foreach (var aUserDefinedVertexType in result._vertexTypeManager.ExecuteManager.GetAllTypes(myTransaction, mySecurity))
     {
         myIDManager.GetVertexTypeUniqeID(aUserDefinedVertexType.ID).SetToMaxID(myVertexStore.GetHighestVertexID(mySecurity, myTransaction, aUserDefinedVertexType.ID) + 1);
     }
 }
Пример #6
0
        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;
        }