@Override public ChangeNotification<InstanceInfo> call(StreamStateNotification.BufferState state) { if (state == StreamStateNotification.BufferState.BufferEnd) { return new StreamStateNotification<>(state, interest); } return null; } })
public static <T> StreamStateNotification<T> bufferEndNotification(Interest<T> interest) { return new StreamStateNotification<>(BufferState.BufferEnd, interest); } }
public static <T> StreamStateNotification<T> bufferStartNotification(Interest<T> interest) { return new StreamStateNotification<>(BufferState.BufferStart, interest); }
public InstanceInfoInitStateHolder(Iterator<ChangeNotification<InstanceInfo>> initialRegistry, Interest<InstanceInfo> interest) { super(PauseableSubject.<ChangeNotification<InstanceInfo>>create()); this.bufferStartNotification = new StreamStateNotification<>(BufferState.BufferStart, interest); this.bufferEndNotification = new StreamStateNotification<>(BufferState.BufferEnd, interest); notificationMap = new ConcurrentHashMap<>(); while (initialRegistry.hasNext()) { ChangeNotification<InstanceInfo> next = initialRegistry.next(); notificationMap.put(next.getData().getId(), next); // Always Kind.Add } }
private ChangeNotification<InstanceInfo> streamStateUpdateToStreamStateNotification(StreamStateUpdate notification) { BufferState state = notification.getState(); if (state == BufferState.BufferStart || state == BufferState.BufferEnd) { return new StreamStateNotification<InstanceInfo>(state, notification.getInterest()); } throw new IllegalStateException("Unexpected state " + state); }