Beispiel #1
0
 private static BrokerType BrokerRoleToBrokerType(BrokerRole brokerRole)
 {
     return(brokerRole == BrokerRole.AgentBroker
             ? BrokerType.AgentBroker
             : brokerRole == BrokerRole.ResellerBroker
                 ? BrokerType.ResellerBroker
                 : BrokerType.NoBroker);
 }
Beispiel #2
0
 public BrokerInfo(string name, string groupName, string clusterName, BrokerRole role, string producerAddress, string consumerAddress, string adminAddress)
 {
     BrokerName      = name;
     GroupName       = groupName;
     ClusterName     = clusterName;
     BrokerRole      = (int)role;
     ProducerAddress = producerAddress;
     ConsumerAddress = consumerAddress;
     AdminAddress    = adminAddress;
 }
Beispiel #3
0
 public BrokerInfo(string name, string groupName, string clusterName, BrokerRole role, string producerAddress, string consumerAddress, string adminAddress)
 {
     BrokerName = name;
     GroupName = groupName;
     ClusterName = clusterName;
     BrokerRole = (int)role;
     ProducerAddress = producerAddress;
     ConsumerAddress = consumerAddress;
     AdminAddress = adminAddress;
 }
Beispiel #4
0
        public bool AddLease(string clientId, string uuid, BrokerRole brokerRole, string brokerName, long?sellerId, string customerEmail, DateTimeOffset leaseExpires, FakeDatabaseTransaction transaction)
        {
            if (transaction != null)
            {
                transaction.OrdersIds.Add(uuid);
            }

            var existingOrder = Orders.SingleOrDefault(x => x.ClientId == clientId && x.Id == uuid);

            if (existingOrder == null)
            {
                Orders.Add(new OrderTable
                {
                    ClientId      = clientId,
                    Id            = uuid,
                    Deleted       = false,
                    BrokerRole    = brokerRole,
                    BrokerName    = brokerName,
                    SellerId      = sellerId ?? default,
                    CustomerEmail = customerEmail,
                    IsLease       = true,
                    LeaseExpires  = leaseExpires,
                    VisibleInFeed = false
                });