Example #1
0
 /// <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;
 }
Example #2
0
        public void AddUserDefinedDataTypes(IVertexStore myStore, AComponentPluginManager myPluginManager)
        {
            myStore.CheckNull("myStore");

            var creationDate = DateTime.UtcNow.ToBinary();

            List <AUserdefinedDataType> userdefinedDataTypePlugins = new List <AUserdefinedDataType>();

            foreach (var plugin in myPluginManager.GetPluginsForType <AUserdefinedDataType>())
            {
                userdefinedDataTypePlugins.Add((AUserdefinedDataType)plugin);
            }

            List <String> userdefinedTypes = new List <String>();
            var           maxValue         = long.MinValue;

            foreach (var vertex in myStore.GetVerticesByTypeID(_security, _transaction, (long)BaseTypes.BaseType))
            {
                if (vertex.GetProperty <Boolean>((long)AttributeDefinitions.BaseTypeDotIsUserDefined))
                {
                    if (!userdefinedDataTypePlugins.Any(item => item.TypeName == vertex.GetProperty <String>((long)AttributeDefinitions.BaseTypeDotName)))
                    {
                        throw new Exception();
                    }
                    else
                    {
                        userdefinedTypes.Add(vertex.GetProperty <String>((long)AttributeDefinitions.BaseTypeDotName));
                    }
                }

                if (vertex.VertexID > maxValue)
                {
                    maxValue = vertex.VertexID;
                }
            }

            maxValue++;

            foreach (var type in userdefinedDataTypePlugins.Select(item => item.TypeName).Except(userdefinedTypes))
            {
                _storageManager.StoreBasicType(myStore, new VertexInformation((long)BaseTypes.BaseType, maxValue++), type, true, "UserdefinedType" + type, creationDate, _security, _transaction);
            }
        }
Example #3
0
        public void AddUserDefinedDataTypes(IVertexStore myStore, AComponentPluginManager myPluginManager)
        {
            myStore.CheckNull("myStore");
            
            var creationDate = DateTime.UtcNow.ToBinary();

            List<AUserdefinedDataType> userdefinedDataTypePlugins = new List<AUserdefinedDataType>();

            foreach (var plugin in myPluginManager.GetPluginsForType<AUserdefinedDataType>())
            {
                userdefinedDataTypePlugins.Add((AUserdefinedDataType)plugin);
            }

            List<String> userdefinedTypes = new List<String>();
            var maxValue = long.MinValue;
            
            foreach (var vertex in myStore.GetVerticesByTypeID(_security, _transaction, (long)BaseTypes.BaseType))
            { 
                if(vertex.GetProperty<Boolean>((long)AttributeDefinitions.BaseTypeDotIsUserDefined))
                {
                    if (!userdefinedDataTypePlugins.Any(item => item.TypeName == vertex.GetProperty<String>((long)AttributeDefinitions.BaseTypeDotName)))
                    {
                        throw new Exception();
                    }
                    else
                    {
                        userdefinedTypes.Add(vertex.GetProperty<String>((long)AttributeDefinitions.BaseTypeDotName));
                    }
                }

                if (vertex.VertexID > maxValue)
                {
                    maxValue = vertex.VertexID;
                }
            }

            maxValue++;

            foreach (var type in userdefinedDataTypePlugins.Select(item => item.TypeName).Except(userdefinedTypes))
            {
                _storageManager.StoreBasicType(myStore, new VertexInformation((long)BaseTypes.BaseType, maxValue++), type, true, "UserdefinedType" + type, creationDate, _security, _transaction);
            }

        }
Example #4
0
 /// <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;
 }