public IEnumerable<Subscription> LoadSubscriptions(string name, SubscriptionRole role)
 {
     using (var session = _store.OpenSession())
     {
         return session.Query<Subscription>().Where(x => x.NodeName == name && x.Role == role);
     }
 }
 public IEnumerable<Subscription> LoadSubscriptions(string name, SubscriptionRole role)
 {
     using (var session = _store.OpenSession())
     {
         return session.Query<Subscription>()
             .Customize(x => x.WaitForNonStaleResultsAsOfLastWrite())
             .Where(x => x.NodeName == name && x.Role == role)
             .ToList();
     }
 }
 public IEnumerable <Subscription> LoadSubscriptions(string name, SubscriptionRole role)
 {
     using (var session = _store.OpenSession())
     {
         return(session.Query <Subscription>()
                .Customize(x => x.WaitForNonStaleResultsAsOfLastWrite())
                .Where(x => x.NodeName == name && x.Role == role)
                .ToList());
     }
 }
Example #4
0
        private void persist(Subscription[] requirements, SubscriptionRole subscriptionRole)
        {
            requirements.Each(x => {
                x.NodeName = _graph.Name;
                x.Role     = subscriptionRole;
            });

            var existing = _persistence.LoadSubscriptions(_graph.Name, subscriptionRole);
            var newReqs  = requirements.Where(x => !existing.Contains(x)).ToArray();

            newReqs.Each(x => x.Id = Guid.NewGuid());
            _persistence.Persist(newReqs);
        }
        private void persist(Subscription[] requirements, SubscriptionRole subscriptionRole)
        {
            requirements.Each(x => {
                x.NodeName = _graph.Name;
                x.Role = subscriptionRole;
            });

            var existing = _persistence.LoadSubscriptions(_graph.Name, subscriptionRole);
            var newReqs = requirements.Where(x => !existing.Contains(x)).ToArray();

            newReqs.Each(x => x.Id = Guid.NewGuid());
            _persistence.Persist(newReqs);
        }
Example #6
0
 public IEnumerable <Subscription> LoadSubscriptions(SubscriptionRole role)
 {
     return(_persistence.LoadSubscriptions(_graph.Name, role));
 }
 public IEnumerable<Subscription> LoadSubscriptions(SubscriptionRole role)
 {
     return _persistence.LoadSubscriptions(_graph.Name, role);
 }
 public IEnumerable<Subscription> LoadSubscriptions(string name, SubscriptionRole role)
 {
     return _subscriptions.Where(x => x.NodeName.EqualsIgnoreCase(name) && x.Role == role).ToArray();
 }
 public IEnumerable <Subscription> LoadSubscriptions(string name, SubscriptionRole role)
 {
     return(_lock.Read(() => {
         return _subscriptions.Where(x => x.NodeName.EqualsIgnoreCase(name) && x.Role == role).ToArray();
     }));
 }
 public IEnumerable<Subscription> PersistedSubscriptions(SubscriptionRole role = SubscriptionRole.Publishes)
 {
     return _runtime.Factory.Get<ISubscriptionRepository>().LoadSubscriptions(role);
 }
Example #11
0
 public IEnumerable <Subscription> PersistedSubscriptions(SubscriptionRole role = SubscriptionRole.Publishes)
 {
     return(_runtime.Factory.Get <ISubscriptionRepository>().LoadSubscriptions(role));
 }