@Test public void purgeSubscriptions() { final Connector connector1 = createConnector( newSchema( 1 ) ); createConnector( newSchema( 2 ) ); final Subscription subscription1 = createSubscription( new ChannelAddress( 1, 0 ), null, true ); final Subscription subscription2 = createSubscription( new ChannelAddress( 1, 1, 2 ), null, true ); final Subscription subscription3 = createSubscription( new ChannelAddress( 2, 0, 1 ), null, true ); final Subscription subscription4 = createSubscription( new ChannelAddress( 2, 0, 2 ), null, true ); assertFalse( Disposable.isDisposed( subscription1 ) ); assertFalse( Disposable.isDisposed( subscription2 ) ); assertFalse( Disposable.isDisposed( subscription3 ) ); assertFalse( Disposable.isDisposed( subscription4 ) ); connector1.purgeSubscriptions(); assertTrue( Disposable.isDisposed( subscription1 ) ); assertTrue( Disposable.isDisposed( subscription2 ) ); assertFalse( Disposable.isDisposed( subscription3 ) ); assertFalse( Disposable.isDisposed( subscription4 ) ); }
@Action void purgeSubscriptions() { final SubscriptionService subscriptionService = getReplicantContext().getSubscriptionService(); Stream.concat( subscriptionService.getTypeSubscriptions().stream(), subscriptionService.getInstanceSubscriptions().stream() ) .filter( s -> s.getAddress().getSystemId() == getSchema().getId() ) .sorted( Comparator.reverseOrder() ) .forEachOrdered( Disposable::dispose ); }
Connector extends ReplicantService { @Action void purgeSubscriptions() { final SubscriptionService subscriptionService = getReplicantContext().getSubscriptionService(); Stream.concat( subscriptionService.getTypeSubscriptions().stream(), subscriptionService.getInstanceSubscriptions().stream() ) .filter( s -> s.getAddress().getSystemId() == getSchema().getId() ) .sorted( Comparator.reverseOrder() ) .forEachOrdered( Disposable::dispose ); } }
Connector extends ReplicantService { @Action void purgeSubscriptions() { final SubscriptionService subscriptionService = getReplicantContext().getSubscriptionService(); Stream.concat( subscriptionService.getTypeSubscriptions().stream(), subscriptionService.getInstanceSubscriptions().stream() ) .filter( s -> s.getAddress().getSystemId() == getSchema().getId() ) .sorted( Comparator.reverseOrder() ) .forEachOrdered( Disposable::dispose ); } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); }
Connector extends ReplicantService { @Action void purgeSubscriptions() { final SubscriptionService subscriptionService = getReplicantContext().getSubscriptionService(); Stream.concat( subscriptionService.getTypeSubscriptions().stream(), subscriptionService.getInstanceSubscriptions().stream() ) .filter( s -> s.getAddress().getSystemId() == getSchema().getId() ) .sorted( Comparator.reverseOrder() ) .forEachOrdered( Disposable::dispose ); } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); @Override String toString(); }
Connector extends ReplicantService { @Action void purgeSubscriptions() { final SubscriptionService subscriptionService = getReplicantContext().getSubscriptionService(); Stream.concat( subscriptionService.getTypeSubscriptions().stream(), subscriptionService.getInstanceSubscriptions().stream() ) .filter( s -> s.getAddress().getSystemId() == getSchema().getId() ) .sorted( Comparator.reverseOrder() ) .forEachOrdered( Disposable::dispose ); } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); @Override String toString();  }