예제 #1
0
 /// <summary>
 /// Creates new instance of CommitDataService type
 /// </summary>
 /// <param name="nodes">Nodes which will accept data changes</param>
 /// <param name="snapshotsService">Service which handles snapshots</param>
 /// <param name="mutableParentProvider">Provider of node parent information</param>
 public CommitDataService(INodeProvider <Guid, object, EdgeData> nodes, TypesService typesService, SnapshotsService snapshotsService, IParentMapProvider <Guid, object, EdgeData> mutableParentProvider, IParentMapProvider <Guid, object, EdgeData> immutableParentProvider, IChangeSetProvider <Guid, object, EdgeData> changeSetProvider, NodeMergeExecutor nodeMergeExecutor, ICollectedNodesProvider <Guid, object, EdgeData> collectedNodesProvider)
 {
     this.nodes                   = nodes;
     this.snapshotsService        = snapshotsService;
     this.mutableParentProvider   = mutableParentProvider;
     this.immutableParentProvider = immutableParentProvider;
     this.changeSetProvider       = changeSetProvider;
     this.nodeMergeExecutor       = nodeMergeExecutor;
     this.typesService            = typesService;
     this.collectedNodesProvider  = collectedNodesProvider;
 }
예제 #2
0
 /// <summary>
 /// Creates new instance of CommitDataService type
 /// </summary>
 /// <param name="nodes">Nodes which will accept data changes</param>
 /// <param name="snapshotsService">Service which handles snapshots</param>
 /// <param name="mutableParentProvider">Provider of node parent information</param>
 public CommitDataService(INodeProvider<Guid, object, EdgeData> nodes, TypesService typesService, SnapshotsService snapshotsService, IParentMapProvider<Guid, object, EdgeData> mutableParentProvider, IParentMapProvider<Guid, object, EdgeData> immutableParentProvider, IChangeSetProvider<Guid, object, EdgeData> changeSetProvider, NodeMergeExecutor nodeMergeExecutor, ICollectedNodesProvider<Guid, object, EdgeData> collectedNodesProvider)
 {
     this.nodes = nodes;
     this.snapshotsService = snapshotsService;
     this.mutableParentProvider = mutableParentProvider;
     this.immutableParentProvider = immutableParentProvider;
     this.changeSetProvider = changeSetProvider;
     this.nodeMergeExecutor = nodeMergeExecutor;
     this.typesService = typesService;
     this.collectedNodesProvider = collectedNodesProvider;
 }
예제 #3
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="storage">The storage from which the types needed for visualisation are loaded</param>
        public TypesVisualisationService(IKeyValueStorage<Guid, object> storage)
        {
            if (storage is ISerializingStorage)
            {
                (storage as ISerializingStorage).Serializer = objectSerializationService;
            }

            var storageProvider = new DirectNodeProviderSafe<Guid, object, EdgeData>(storage, storage is IForceUpdateStorage);
            provider = new CachedReadNodeProvider<Guid, object, EdgeData>(storageProvider, new DirectNodeProviderSafe<Guid, object, EdgeData>(new LimitedMemoryStorageSafe<Guid, object>(Properties.Settings.Default.DataCacheMinimumCount, Properties.Settings.Default.DataCacheMaximumCount), false));
            typesService = new TypesService(provider);
            typesService.InitializeTypeSystem(null);
            objectSerializationService.TypesService = typesService;
        }
예제 #4
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="storage">The storage from which the types needed for visualisation are loaded</param>
        public TypesVisualisationService(IKeyValueStorage <Guid, object> storage)
        {
            if (storage is ISerializingStorage)
            {
                (storage as ISerializingStorage).Serializer = objectSerializationService;
            }

            var storageProvider = new DirectNodeProviderSafe <Guid, object, EdgeData>(storage, storage is IForceUpdateStorage);

            provider     = new CachedReadNodeProvider <Guid, object, EdgeData>(storageProvider, new DirectNodeProviderSafe <Guid, object, EdgeData>(new LimitedMemoryStorageSafe <Guid, object>(Properties.Settings.Default.DataCacheMinimumCount, Properties.Settings.Default.DataCacheMaximumCount), false));
            typesService = new TypesService(provider);
            typesService.InitializeTypeSystem(null);
            objectSerializationService.TypesService = typesService;
        }
예제 #5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="storage">The storage from which the types needed for visualisation are loaded</param>
 public TypesVisualisationService(INodeProvider <Guid, object, EdgeData> provider)
 {
     this.provider = provider;
     typesService  = new TypesService(provider);
 }
예제 #6
0
 /// <summary>
 /// Creates new instance of GenerationService type
 /// </summary>
 /// <param name="typesService">Type service to use</param>
 public GenerationService(TypesService typesService)
 {
     this.typesService = typesService;
 }
예제 #7
0
 public CollectionInstancesService(INodeProvider<Guid, object, EdgeData> provider, TypesService typesService)
 {
     this.provider = provider;
     this.typesService = typesService;
 }
예제 #8
0
 /// <summary>
 /// Creates new instance of SubscriptionManagerService type
 /// </summary>
 /// <param name="typesService">Service which manages types</param>
 /// <param name="objectInstancesService">Service which handles object instances</param>
 public SubscriptionManagerService(TypesService typesService, ObjectInstancesService objectInstancesService)
 {
     this.typesService = typesService;
     this.objectInstancesService = objectInstancesService;
 }
예제 #9
0
 public DictionaryInstancesService(INodeProvider <Guid, object, EdgeData> provider, TypesService typesService)
 {
     this.provider     = provider;
     this.typesService = typesService;
 }
예제 #10
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="storage">The storage from which the types needed for visualisation are loaded</param>
 public TypesVisualisationService(INodeProvider<Guid, object, EdgeData> provider)
 {
     this.provider = provider;
     typesService = new TypesService(provider);
 }
예제 #11
0
파일: Utils.cs 프로젝트: nemanjazz/iog
        private static void LogObject(Guid nodeId, Node<Guid, object, EdgeData> node, INodeProvider<Guid, object, EdgeData> nodes, INodeProvider<Guid, object, EdgeData> changes, int tabLevel, Hashtable visited, TypesService typesService)
        {
            var typeId = typesService.GetInstanceTypeId(node);
            var typeName = typesService.GetTypeFromId(typeId).Name;

            Debug.WriteLine(LogTabs(tabLevel) + nodeId + "(" + typeName + ")");
            Debug.WriteLine(LogTabs(tabLevel) + "Previous=" + node.Previous);

            foreach (var value in node.Values)
            {
                Debug.WriteLine(LogTabs(tabLevel) + typesService.GetMemberName(typeId, value.Key) + "=" + value.Value);
            }

            foreach (var edge in node.Edges)
            {
                if (edge.Value.Data.Semantic == EdgeType.Property)
                {
                    Debug.WriteLine(LogTabs(tabLevel) + typesService.GetMemberName(typeId, (Guid)edge.Value.Data.Data) + "=");
                    LogNodesRecursive(edge.Value.ToNodeId, nodes, changes, tabLevel + 1, visited, typesService);
                }
            }
        }
예제 #12
0
파일: Utils.cs 프로젝트: nemanjazz/iog
        private static void LogCollection(Guid nodeId, Node<Guid, object, EdgeData> node, INodeProvider<Guid, object, EdgeData> nodes, INodeProvider<Guid, object, EdgeData> changes, int tabLevel, Hashtable visited, TypesService typesService)
        {
            Edge<Guid, EdgeData> typeEdge = null;
            BPlusTreeOperations.TryFindEdge(nodes, nodeId, new EdgeData(EdgeType.OfType, null), out typeEdge);

            var typeId = typeEdge.ToNodeId;
            var typeName = typesService.GetTypeFromId(typeId).Name;

            Debug.WriteLine(LogTabs(tabLevel) + nodeId + "(" + typeName + ")");
            Debug.WriteLine(LogTabs(tabLevel) + "Previous=" + node.Previous);

            using (var enumeration = BPlusTreeOperations.GetEnumerator(nodes, nodeId, EdgeType.ListItem))
            {
                while (enumeration.MoveNext())
                {
                    Debug.WriteLine(LogTabs(tabLevel) + enumeration.Current.Data + "=");
                    LogNodesRecursive(enumeration.Current.ToNodeId, nodes, changes, tabLevel + 1, visited, typesService);
                }
            }
        }
예제 #13
0
파일: Utils.cs 프로젝트: nemanjazz/iog
        internal static void LogNodesRecursive(Guid nodeId, INodeProvider<Guid, object, EdgeData> nodes, INodeProvider<Guid, object, EdgeData> changes, int tabLevel, Hashtable visited, TypesService typesService)
        {
            if (visited.ContainsKey(nodeId))
            {
                Debug.WriteLine(LogTabs(tabLevel) + nodeId);
                return;
            }

            visited.Add(nodeId, null);

            if (changes.Contains(nodeId))
            {
                var node = changes.GetNode(nodeId, NodeAccess.Read);
                switch (node.NodeType)
                {
                    case NodeType.Object:
                        LogObject(nodeId, node, nodes, changes, tabLevel, visited, typesService);
                        break;
                    case NodeType.Collection:
                        LogCollection(nodeId, node, nodes, changes, tabLevel, visited, typesService);
                        break;
                    case NodeType.Dictionary:
                        LogCollection(nodeId, node, nodes, changes, tabLevel, visited, typesService);
                        break;
                    default:
                        Debug.WriteLine(LogTabs(tabLevel) + node.Previous + "->" + nodeId + "[" + node.NodeType + "]");
                        foreach (var edge in node.Edges)
                        {
                            Debug.WriteLine(LogTabs(tabLevel) + edge.Key + "=");
                            LogNodesRecursive(edge.Value.ToNodeId, nodes, changes, tabLevel + 1, visited, typesService);
                        }
                        break;
                }
            }
            else
            {
                Debug.WriteLine(LogTabs(tabLevel) + nodeId);
            }
        }
        public AttributeBasedMergeRuleProvider(TypesService typesService)
        {
            this.typesService = typesService;

            Initialize();
        }
예제 #15
0
 public NodeMergeExecutor(IMergeRuleProvider objectAttributeProvider, TypesService typesService)
 {
     this.objectAttributeProvider = objectAttributeProvider;
     this.typesService = typesService;
 }
예제 #16
0
        /// <summary>
        /// Initializes the ProxyFacade class
        /// </summary>
        /// <param name="typesService">Service for type manipulation</param>
        public static void Initialize(TypesService typesService)
        {
            if (typesService == null)
            {
                throw new ArgumentNullException("typesService");
            }

            StaticProxyFacade inst = new StaticProxyFacade();

            inst.typesService = typesService;

            instance = inst; // Instance initialized
        }