@Override public void call() { channelInterest = new MultipleInterests<>(interest); } }
public static Interest<InstanceInfo> forSome(Interest<InstanceInfo>... interests) { return new MultipleInterests<>(interests); } }
public Interest<InstanceInfo> toComposite() { if(interests.length == 0) { return Interests.forNone(); } if (interests.length > 1) { return new MultipleInterests<InstanceInfo>(interests); } return interests[0]; }
public MultipleInterests<T> copyAndAppend(Interest<T> toAppend) { Set<Interest<T>> newInterests = flatten(); // flatten does the copy of the underlying set append(toAppend, newInterests); return new MultipleInterests<>(newInterests); }
public MultipleInterests<T> copyAndRemove(Interest<T> toAppend) { Set<Interest<T>> newInterests = flatten(); // flatten does the copy of the underlying set remove(toAppend, newInterests); return new MultipleInterests<>(newInterests); }
@Override public void call(final Subscriber<? super Void> subscriber) { // Resubscribe Interest<InstanceInfo> activeInterests = new MultipleInterests<InstanceInfo>(previousState.interests.keySet()); newChannel.appendInterest(activeInterests).subscribe(); // Wait until registry fills up to the expected level. newState.registry.forInterest(activeInterests).lift( new RegistrySwapOperator(previousState.registry, newState.registry, swapStrategyFactory) ).subscribe(Subscribers.from(subscriber)); } });
public static Interest<InstanceInfo> forSecureVips(Operator operator, String... secureVips) { if (secureVips.length == 0) { return EmptyRegistryInterest.getInstance(); } if (secureVips.length == 1) { return new SecureVipInterest(secureVips[0], operator); } Interest[] interests = new Interest[secureVips.length]; for (int i = 0; i < interests.length; i++) { interests[i] = new SecureVipInterest(secureVips[i], operator); } return new MultipleInterests<InstanceInfo>(interests); }
public static Interest<InstanceInfo> forApplications(Operator operator, String... applicationNames) { if (applicationNames.length == 0) { return EmptyRegistryInterest.getInstance(); } if (applicationNames.length == 1) { return new ApplicationInterest(applicationNames[0], operator); } Interest[] interests = new Interest[applicationNames.length]; for (int i = 0; i < interests.length; i++) { interests[i] = new ApplicationInterest(applicationNames[i], operator); } return new MultipleInterests<InstanceInfo>(interests); }
public static Interest<InstanceInfo> forInstance(Operator operator, String... instanceIds) { if (instanceIds.length == 0) { return EmptyRegistryInterest.getInstance(); } if (instanceIds.length == 1) { return new InstanceInterest(instanceIds[0], operator); } Interest[] interests = new Interest[instanceIds.length]; for (int i = 0; i < interests.length; i++) { interests[i] = new InstanceInterest(instanceIds[i], operator); } return new MultipleInterests<InstanceInfo>(interests); }
InterestChannelImpl(final EurekaClientRegistry<InstanceInfo> registry, TransportClient client, InterestChannelMetrics metrics) { super(STATES.Idle, client); this.registry = registry; this.metrics = metrics; metrics.incrementStateCounter(STATES.Idle); channelInterest = new MultipleInterests<>(); // blank channelInterest to start with channelInterestSubscriber = new ChannelInterestSubscriber(registry); channelInterestStream = createInterestStream(); }
public static Interest<InstanceInfo> forVips(Operator operator, String... vips) { if (vips.length == 0) { return EmptyRegistryInterest.getInstance(); } if (vips.length == 1) { return new VipInterest(vips[0], operator); } Interest[] interests = new Interest[vips.length]; for (int i = 0; i < interests.length; i++) { interests[i] = new VipInterest(vips[i], operator); } return new MultipleInterests<InstanceInfo>(interests); }