コード例 #1
0
ファイル: MetadataSet.cs プロジェクト: chris-tomich/Glyma
        public virtual void Update(string name, string value, Proxy.INode node, Proxy.IRelationship relationship, Proxy.ConnectionType connectionType, ref TransactionFramework.TransactionChain chain)
        {
            if (name != null)
            {
                Name = name;
            }

            if (value != null)
            {
                Value = value;
            }

            if (node != null)
            {
                Node = node;
            }

            if (relationship != null)
            {
                Relationship = relationship;
            }

            if (connectionType != null)
            {
                ConnectionType = connectionType;
            }
        }
コード例 #2
0
ファイル: InMemoryGraph.cs プロジェクト: chris-tomich/Glyma
        public void NodesAndRelationshipBuildEventArgs(Proxy.NodesEventArgs eventArgs, IDictionary <Guid, ServerObjects.Node> nodes, IDictionary <Guid, ServerObjects.Relationship> relationships)
        {
            foreach (ServerObjects.Node serviceNode in nodes.Values)
            {
                Proxy.INode proxyNode = NodeManager.FindNode(serviceNode);

                eventArgs.Nodes.Add(proxyNode.Id, proxyNode);
            }

            foreach (ServerObjects.Relationship serviceRelationship in relationships.Values)
            {
                RelationshipManager.CreateRelationship(serviceRelationship);
            }

            foreach (ServerObjects.Node serviceNode in nodes.Values)
            {
                Proxy.INode proxyNode = NodeManager.FindNode(serviceNode);

                SoapNode soapNode = proxyNode as SoapNode;

                /// Not all the nodes that are stored in the NodeManager are SoapNodes, some are FacadeNodes. In this scenario we want to check if they have an inner SoapNode and use that instead.
                if (soapNode == null)
                {
                    if (proxyNode is FacadeNode)
                    {
                        FacadeNode facadeNode = proxyNode as FacadeNode;
                        soapNode = facadeNode.BaseNode as SoapNode;
                    }
                }

                if (soapNode != null)
                {
                    soapNode.LoadNode(RelationshipManager);
                }
            }

            foreach (ServerObjects.Relationship serviceRelationship in relationships.Values)
            {
                Proxy.IRelationship proxyRelationship = RelationshipManager.FindRelationship(serviceRelationship);

                SoapRelationship soapRelationship = proxyRelationship as SoapRelationship;

                /// Not all the relationships that are stored in the RelationshipManager are SoapRelationships, some are FacadeRelationships. In this scenario we want to check if they have an inner SoapRelationship and use that instead.
                if (soapRelationship == null)
                {
                    if (proxyRelationship is FacadeRelationship)
                    {
                        FacadeRelationship facadeRelationship = proxyRelationship as FacadeRelationship;
                        soapRelationship = facadeRelationship.BaseRelationship as SoapRelationship;
                    }
                }

                if (soapRelationship != null)
                {
                    soapRelationship.LoadRelationship(NodeManager);
                }
            }
        }
コード例 #3
0
        public void ResetToFacade()
        {
            if (!(_baseNode is InProcess.InProcessNode))
            {
                _baseNode        = PreviousBaseNode;
                PreviousBaseNode = null;

                IsConcrete = false;
            }
        }
コード例 #4
0
        public override void Update(string name, string value, Proxy.INode node, Proxy.IRelationship relationship, Proxy.ConnectionType connectionType, ref TransactionFramework.TransactionChain chain)
        {
            base.Update(name, value, node, relationship, connectionType, ref chain);

            DelayedMetadataAction delayedAction = new DelayedMetadataAction();

            delayedAction.Action         = TransactionActionType.Updated;
            delayedAction.Name           = Name;
            delayedAction.Value          = Value;
            delayedAction.Node           = Node;
            delayedAction.DomainId       = Node.DomainId;
            delayedAction.Relationship   = Relationship;
            delayedAction.ConnectionType = ConnectionType;

            DelayedActions.Enqueue(delayedAction);
        }
コード例 #5
0
ファイル: SoapMetadataSet.cs プロジェクト: chris-tomich/Glyma
        public SoapMetadataSet(Proxy.IMapManager mapManager, ServerObjects.Metadata serviceMetadata, Proxy.INode node, Proxy.IRelationship relationship)
        {
            MapManager      = mapManager;
            ServiceMetadata = serviceMetadata;

            Id        = serviceMetadata.MetadataId;
            DomainId  = serviceMetadata.DomainUid;
            RootMapId = serviceMetadata.RootMapUid;
            Name      = serviceMetadata.MetadataName;
            Value     = serviceMetadata.MetadataValue;

            if (serviceMetadata.NodeUid.HasValue && serviceMetadata.NodeUid == node.Id)
            {
                Node = node;
            }
            else if (serviceMetadata.NodeUid.HasValue && serviceMetadata.NodeUid != node.Id)
            {
                throw new NotSupportedException("The node ID in the service metadata object differs to the provided node.");
            }
            else
            {
                Node = null;
            }

            if (serviceMetadata.RelationshipUid.HasValue && serviceMetadata.RelationshipUid == relationship.Id)
            {
                Relationship = relationship;
            }
            else if (serviceMetadata.RelationshipUid.HasValue && serviceMetadata.RelationshipUid != relationship.Id)
            {
                throw new NotSupportedException("The relationship ID in the service metadata object differs to the provided relationship.");
            }
            else
            {
                Relationship = null;
            }

            ConnectionType = null;

            if (serviceMetadata.DescriptorTypeUid.HasValue && serviceMetadata.DescriptorTypeUid != Guid.Empty)
            {
                if (MapManager.ConnectionTypes.ContainsKey(serviceMetadata.DescriptorTypeUid.Value))
                {
                    ConnectionType = MapManager.ConnectionTypes[serviceMetadata.DescriptorTypeUid.Value];
                }
            }
        }
コード例 #6
0
        public void AddNode(Proxy.ConnectionType connectionType, Proxy.INode node)
        {
            ProxyNodeConnections[connectionType] = node;

            Service.DT descriptorType = MapManager.ConnectionTypes.ConvertProxyToService(connectionType);

            SoapTransactionLinkParameter linkParameter = new SoapTransactionLinkParameter(Service.MapParameterType.Node);

            FacadeNode facadeNode = node as FacadeNode;

            // Check if this is a facade and if it is and the base node isn't concrete, then use the base node's response parameter.
            if (facadeNode != null && !facadeNode.IsConcrete)
            {
                linkParameter.SetParameterValue(facadeNode.TransactionOrigin);
            }
            else
            {
                linkParameter.SetParameterValue(node.Id);
            }

            TransactionLinkConnections[descriptorType] = linkParameter;
        }
コード例 #7
0
ファイル: SoapMetadataSet.cs プロジェクト: chris-tomich/Glyma
        public override void Update(string name, string value, Proxy.INode node, Proxy.IRelationship relationship, Proxy.ConnectionType connectionType, ref TransactionFramework.TransactionChain chain)
        {
            base.Update(name, value, node, relationship, connectionType, ref chain);

            TransactionFramework.UpdateMetadataTransactionLink updateMetadataTransaction = new TransactionFramework.UpdateMetadataTransactionLink();

            if (Node != null)
            {
                updateMetadataTransaction.DomainId = Node.DomainId;
            }
            else if (Relationship != null)
            {
                updateMetadataTransaction.DomainId = Relationship.DomainId;
            }

            updateMetadataTransaction.MapManager = MapManager;
            updateMetadataTransaction.Metadata   = this;
            updateMetadataTransaction.Name       = name;
            updateMetadataTransaction.Value      = value;

            chain.AddTransaction(updateMetadataTransaction);
        }
コード例 #8
0
 public void DeleteNode(Proxy.INode proxyNode)
 {
     DeleteNode(proxyNode.Id);
 }
コード例 #9
0
 public RelationshipSet(Proxy.INode nodeContext)
 {
     NodeContext = nodeContext;
 }
コード例 #10
0
ファイル: FacadeNode.cs プロジェクト: chris-tomich/Glyma
        public void ResetToFacade()
        {
            if (!(_baseNode is InProcess.InProcessNode))
            {
                _baseNode = PreviousBaseNode;
                PreviousBaseNode = null;

                IsConcrete = false;
            }
        }
コード例 #11
0
        protected TransactionFramework.AddMetadataTransactionLink AddMetadataTransaction(IMetadataSet metadataSet, Proxy.INode node, Proxy.IRelationship relationship, Proxy.ConnectionType connectionType, string name, string value)
        {
            TransactionFramework.AddMetadataTransactionLink addMetadataTransaction = new TransactionFramework.AddMetadataTransactionLink();
            addMetadataTransaction.DomainId       = node.DomainId;
            addMetadataTransaction.RootMapId      = node.RootMapId;
            addMetadataTransaction.MapManager     = MapManager;
            addMetadataTransaction.MetadataSet    = metadataSet;
            addMetadataTransaction.Node           = node;
            addMetadataTransaction.Relationship   = relationship;
            addMetadataTransaction.ConnectionType = connectionType;
            addMetadataTransaction.MetadataType   = StringMetadataType;
            addMetadataTransaction.Name           = name;
            addMetadataTransaction.Value          = value;

            return(addMetadataTransaction);
        }
コード例 #12
0
 public void Update(string name, string value, Proxy.INode node, Proxy.IRelationship relationship, Proxy.ConnectionType connectionType, ref TransactionFramework.TransactionChain chain)
 {
     BaseMetadata.Update(name, value, node, relationship, connectionType, ref chain);
 }
コード例 #13
0
 public void ConnectNode(Proxy.ConnectionType connectionType, Proxy.INode node, ref TransactionFramework.TransactionChain chain)
 {
     BaseRelationship.ConnectNode(connectionType, node, ref chain);
 }
コード例 #14
0
 public NodeMetadataCollection(Proxy.INode parent, IMapManager mapManager)
 {
     Parent     = parent;
     MapManager = mapManager;
 }