Пример #1
0
        public TransactionToken CreateToken(Guid tokenId)
        {
            TransactionToken newToken = new TransactionToken(tokenId);

            _transactionTokens[newToken.TokenId] = newToken;

            return(newToken);
        }
Пример #2
0
        public TransactionToken CreateToken(Guid tokenId)
        {
            TransactionToken newToken = new TransactionToken(tokenId);

            _transactionTokens[newToken.TokenId] = newToken;

            return newToken;
        }
Пример #3
0
        public void DeleteNode(TransactionToken domainId, TransactionToken nodeId)
        {
            DeleteNodeTransactionOperation operation = new DeleteNodeTransactionOperation(Connection, TokenFactory);

            operation.DomainId = TokenFactory.ProcessToken(domainId);
            operation.NodeId   = TokenFactory.ProcessToken(nodeId);

            Operations.Enqueue(operation);
        }
Пример #4
0
        public void DeleteRelationship(TransactionToken domainId, TransactionToken relationshipId)
        {
            DeleteRelationshipTransactionOperation operation = new DeleteRelationshipTransactionOperation(Connection, TokenFactory);

            operation.DomainId       = TokenFactory.ProcessToken(domainId);
            operation.RelationshipId = TokenFactory.ProcessToken(relationshipId);

            Operations.Enqueue(operation);
        }
Пример #5
0
        internal void Refresh(TransactionToken token)
        {
            MapObjectId = token.MapObjectId;

            if (token.DelayedExecutionMapObjectId != null)
            {
                DelayedExecutionMapObjectId = token.DelayedExecutionMapObjectId;
            }
        }
Пример #6
0
        internal void Refresh(TransactionToken token)
        {
            MapObjectId = token.MapObjectId;

            if (token.DelayedExecutionMapObjectId != null)
            {
                DelayedExecutionMapObjectId = token.DelayedExecutionMapObjectId;
            }
        }
        public TransactionToken AddNode(TransactionToken domainId, SoapNodeType nodeType, string originalId)
        {
            AddNodeTransactionOperation operation = new AddNodeTransactionOperation(Connection, TokenFactory);

            operation.DomainId = TokenFactory.ProcessToken(domainId);
            operation.NodeType = nodeType;
            operation.OriginalId = originalId;

            Operations.Enqueue(operation);

            return operation.ResultTokens.First();
        }
Пример #8
0
        public TransactionToken AddNode(TransactionToken domainId, SoapNodeType nodeType, string originalId)
        {
            AddNodeTransactionOperation operation = new AddNodeTransactionOperation(Connection, TokenFactory);

            operation.DomainId   = TokenFactory.ProcessToken(domainId);
            operation.NodeType   = nodeType;
            operation.OriginalId = originalId;

            Operations.Enqueue(operation);

            return(operation.ResultTokens.First());
        }
        protected SqlCommand CreateDescriptor(out Guid newDescriptorUid, SoapDescriptorType descriptorType, TransactionToken nodeUid, Guid relationshipUid)
        {
            SqlCommand createDescriptorCommand = new SqlCommand();
            createDescriptorCommand.CommandText = "INSERT INTO dbo.[Descriptors] (DescriptorUid, DescriptorTypeUid, NodeUid, RelationshipUid) VALUES (@DescriptorUid, @DescriptorTypeUid, @NodeUid, @RelationshipUid)";
            createDescriptorCommand.Connection = Connection;

            newDescriptorUid = Guid.NewGuid();

            createDescriptorCommand.Parameters.AddWithValue("@DescriptorUid", newDescriptorUid);
            createDescriptorCommand.Parameters.AddWithValue("@DescriptorTypeUid", descriptorType.Id);
            createDescriptorCommand.Parameters.AddWithValue("@NodeUid", nodeUid.GetValue());
            createDescriptorCommand.Parameters.AddWithValue("@RelationshipUid", relationshipUid);

            return createDescriptorCommand;
        }
Пример #10
0
        public override void ExecuteOperation()
        {
            if (!ExecuteDomainExistsQuery())
            {
                CreateDomainCommand().ExecuteNonQuery();
            }

            Guid newNodeId = Guid.Empty;

            CreateNodeCommand(out newNodeId).ExecuteNonQuery();

            TransactionToken token = TokenFactory.CreateToken();

            token.DelayedExecutionMapObjectId = newNodeId;

            ResultTokens.Add(token);
        }
Пример #11
0
        public TransactionToken AddRelationship(TransactionToken domainId, Dictionary <SoapDescriptorType, TransactionToken> nodes, SoapRelationshipType relationshipType, string originalId)
        {
            AddRelationshipTransactionOperation operation = new AddRelationshipTransactionOperation(Connection, TokenFactory);

            foreach (KeyValuePair <SoapDescriptorType, TransactionToken> keyValuePair in nodes)
            {
                nodes[keyValuePair.Key] = TokenFactory.ProcessToken(keyValuePair.Value);
            }

            operation.DomainId         = TokenFactory.ProcessToken(domainId);
            operation.Nodes            = nodes;
            operation.RelationshipType = relationshipType;
            operation.OriginalId       = originalId;

            Operations.Enqueue(operation);

            return(operation.ResultTokens.First());
        }
Пример #12
0
        public TransactionToken ProcessToken(TransactionToken token)
        {
            if (_transactionTokens.ContainsKey(token.TokenId))
            {
                if (_transactionTokens[token.TokenId] == token)
                {
                    return(token);
                }
                else
                {
                    _transactionTokens[token.TokenId].Refresh(token);

                    return(_transactionTokens[token.TokenId]);
                }
            }
            else
            {
                return(_transactionTokens[token.TokenId] = token);
            }
        }
Пример #13
0
        public TransactionToken ProcessToken(TransactionToken token)
        {
            if (_transactionTokens.ContainsKey(token.TokenId))
            {
                if (_transactionTokens[token.TokenId] == token)
                {
                    return token;
                }
                else
                {
                    _transactionTokens[token.TokenId].Refresh(token);

                    return _transactionTokens[token.TokenId];
                }
            }
            else
            {
                return _transactionTokens[token.TokenId] = token;
            }
        }
        public void DeleteNode(TransactionToken domainId, TransactionToken nodeId)
        {
            DeleteNodeTransactionOperation operation = new DeleteNodeTransactionOperation(Connection, TokenFactory);

            operation.DomainId = TokenFactory.ProcessToken(domainId);
            operation.NodeId = TokenFactory.ProcessToken(nodeId);

            Operations.Enqueue(operation);
        }
        public void DeleteRelationship(TransactionToken domainId, TransactionToken relationshipId)
        {
            DeleteRelationshipTransactionOperation operation = new DeleteRelationshipTransactionOperation(Connection, TokenFactory);

            operation.DomainId = TokenFactory.ProcessToken(domainId);
            operation.RelationshipId = TokenFactory.ProcessToken(relationshipId);

            Operations.Enqueue(operation);
        }
Пример #16
0
        protected SqlCommand CreateDescriptor(out Guid newDescriptorUid, SoapDescriptorType descriptorType, TransactionToken nodeUid, Guid relationshipUid)
        {
            SqlCommand createDescriptorCommand = new SqlCommand();

            createDescriptorCommand.CommandText = "INSERT INTO dbo.[Descriptors] (DescriptorUid, DescriptorTypeUid, NodeUid, RelationshipUid) VALUES (@DescriptorUid, @DescriptorTypeUid, @NodeUid, @RelationshipUid)";
            createDescriptorCommand.Connection  = Connection;

            newDescriptorUid = Guid.NewGuid();

            createDescriptorCommand.Parameters.AddWithValue("@DescriptorUid", newDescriptorUid);
            createDescriptorCommand.Parameters.AddWithValue("@DescriptorTypeUid", descriptorType.Id);
            createDescriptorCommand.Parameters.AddWithValue("@NodeUid", nodeUid.GetValue());
            createDescriptorCommand.Parameters.AddWithValue("@RelationshipUid", relationshipUid);

            return(createDescriptorCommand);
        }
        public TransactionToken AddRelationship(TransactionToken domainId, Dictionary<SoapDescriptorType, TransactionToken> nodes, SoapRelationshipType relationshipType, string originalId)
        {
            AddRelationshipTransactionOperation operation = new AddRelationshipTransactionOperation(Connection, TokenFactory);

            foreach (KeyValuePair<SoapDescriptorType, TransactionToken> keyValuePair in nodes)
            {
                nodes[keyValuePair.Key] = TokenFactory.ProcessToken(keyValuePair.Value);
            }

            operation.DomainId = TokenFactory.ProcessToken(domainId);
            operation.Nodes = nodes;
            operation.RelationshipType = relationshipType;
            operation.OriginalId = originalId;

            Operations.Enqueue(operation);

            return operation.ResultTokens.First();
        }