Beispiel #1
0
        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;
            }
        }
Beispiel #2
0
        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);
                }
            }
        }
Beispiel #3
0
        public void ResetToFacade()
        {
            if (!(_baseRelationship is InProcess.InProcessRelationship))
            {
                _baseRelationship        = PreviousBaseRelationship;
                PreviousBaseRelationship = null;

                IsConcrete = false;
            }
        }
        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);
        }
Beispiel #5
0
        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];
                }
            }
        }
        public Proxy.IRelationship CreateInProcessObjects()
        {
            if (_inProcessResponse == null)
            {
                _inProcessResponse = MapManager.RelationshipFactory.CreateRelationship(this, DomainParameter.GetParameterValue(Guid.Empty).V, RootMapParameter.GetParameterValue(Guid.Empty).V, ProxyNodeConnections, RelationshipType, OriginalId);
                TransactionStatus  = ServerStatus.ProcessingClient;
                FacadeRelationship facadeRelationship = _inProcessResponse as FacadeRelationship;

                if (facadeRelationship != null)
                {
                    facadeRelationship.TransactionOrigin = this;
                    _inProcessResponse = facadeRelationship;
                }
            }

            return(_inProcessResponse);
        }
Beispiel #7
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);

            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);
        }
Beispiel #8
0
        private void DeleteRelationship(Guid relationshipUid)
        {
            if (ProxyRelationships.ContainsKey(relationshipUid))
            {
                Proxy.IRelationship           relationship = ProxyRelationships[relationshipUid];
                IEnumerable <Proxy.NodeTuple> nodeTuples   = relationship.Nodes.FindNodes();

                foreach (Proxy.NodeTuple nodeTuple in nodeTuples)
                {
                    Proxy.IRelationshipManager relationships = nodeTuple.Node.Relationships;
                    relationships.Remove(relationship);
                }

                Proxy.INodeManager nodes = relationship.Nodes;
                nodes.Clear();

                ProxyRelationships.Remove(relationshipUid);
            }

            if (ServiceRelationships.ContainsKey(relationshipUid))
            {
                ServiceRelationships.Remove(relationshipUid);
            }
        }
Beispiel #9
0
 public void DeleteRelationship(Proxy.IRelationship proxyRelationship)
 {
     DeleteRelationship(proxyRelationship.Id);
 }
        public void ResetToFacade()
        {
            if (!(_baseRelationship is InProcess.InProcessRelationship))
            {
                _baseRelationship = PreviousBaseRelationship;
                PreviousBaseRelationship = null;

                IsConcrete = false;
            }
        }
Beispiel #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);
        }
 public RelationshipMetadataCollection(Proxy.IRelationship parent)
 {
     Parent = parent;
 }
Beispiel #13
0
 public NodeSet(Proxy.IRelationship relationshipContext)
 {
     RelationshipContext = relationshipContext;
 }
        public Proxy.IRelationship CreateInProcessObjects()
        {
            if (_inProcessResponse == null)
            {
                _inProcessResponse = MapManager.RelationshipFactory.CreateRelationship(this, DomainParameter.GetParameterValue(Guid.Empty).V, RootMapParameter.GetParameterValue(Guid.Empty).V, ProxyNodeConnections, RelationshipType, OriginalId);
                TransactionStatus = ServerStatus.ProcessingClient;
                FacadeRelationship facadeRelationship = _inProcessResponse as FacadeRelationship;

                if (facadeRelationship != null)
                {
                    facadeRelationship.TransactionOrigin = this;
                    _inProcessResponse = facadeRelationship;
                }
            }

            return _inProcessResponse;
        }
Beispiel #15
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);
 }