@Override public Boolean call(InstanceInfo instanceInfo) { return instanceInfo != null && interest.matches(instanceInfo); } });
@Override public Boolean call(InstanceInfo instanceInfo) { return instanceInfo != null && interest.matches(instanceInfo); } });
@Override public Boolean call(InstanceInfo instanceInfo) { return instanceInfo != null && interest.matches(instanceInfo); } });
@Override public boolean matches(T data) { for (Interest<T> interest : interests) { if (interest.matches(data)) { return true; } } return false; }
@Override public Boolean call(ChangeNotification<T> notification) { return interest.matches(notification.getData()); } }).subscribe(toReturn); // data source sends all notifications irrespective of the interest set. Here we filter based on interest.
public void batchStartFor(InstanceInfo instanceInfo) { for (Entry<Interest, ReplaySubject<ChangeNotification<InstanceInfo>>> entry : notificationSubjects.entrySet()) { if (entry.getKey().matches(instanceInfo)) { entry.getValue().onNext(StreamStateNotification.bufferStartNotification(entry.getKey())); } } }
public void batchEndFor(InstanceInfo instanceInfo) { for (Entry<Interest, ReplaySubject<ChangeNotification<InstanceInfo>>> entry : notificationSubjects.entrySet()) { if (entry.getKey().matches(instanceInfo)) { entry.getValue().onNext(StreamStateNotification.bufferEndNotification(entry.getKey())); } } }
@Override public boolean hasNext() { if (null != next) { return true; } while (delegate.hasNext()) { // Iterate till we get a matching item. MultiSourcedDataHolder<InstanceInfo> possibleNext = delegate.next(); ChangeNotification<InstanceInfo> notification = possibleNext.getChangeNotification(); if (notification != null && interest.matches(notification.getData())) { next = notification; return true; } } return false; }
@Override public boolean hasNext() { if (null != next) { return true; } while (delegate.hasNext()) { // Iterate till we get a matching item. MultiSourcedDataHolder<InstanceInfo> possibleNext = delegate.next(); ChangeNotification<InstanceInfo> notification = possibleNext.getChangeNotification(); if (notification != null && interest.matches(notification.getData())) { next = notification; return true; } } return false; }
@Override public boolean hasNext() { if (null != next) { return true; } while (delegate.hasNext()) { // Iterate till we get a matching item. InstanceInfo possibleNext = delegate.next(); ChangeNotification<InstanceInfo> notification = new ChangeNotification<>(Kind.Add, possibleNext); if (notification != null && interest.matches(notification.getData())) { next = notification; return true; } } return false; }
@Override public void call(ChangeNotification<InstanceInfo> notification) { if (interest.matches(notification.getData())) { notificationTracker.addExpectation(notification); } } }
@Override public void onNext(ChangeNotification<InstanceInfo> notification) { if (notification.isDataNotification() && interest.matches(notification.getData())) { notificationTracker.verifyWithExpectations(notification); logger.debug("Notification={}", notification); } } });
@Override public void onNext(ChangeNotification<InstanceInfo> notification) { if (notification.isDataNotification() && interest.matches(notification.getData())) { finalSubject.onNext(notification); } } });