public static Interest<InstanceInfo> forApplications(String... applicationNames) { return forApplications(Operator.Equals, applicationNames); }
@Override protected void subscribeToInterest(Session activeSession, String[] args) { activeSession.forInterest(Interests.forApplications(Operator.Like, args)); } };
@Override public Observable<ChangeNotification<InstanceInfo>> forApplication(String appName) { return forInterest(Interests.forApplications(appName)); }
public Interest<InstanceInfo> allApplicationsInterest() { List<Interest<InstanceInfo>> interests = new ArrayList<>(); for (Application application : applications) { interests.add(Interests.forApplications(application.getName())); } return Interests.forSome(interests.toArray(new Interest[interests.size()])); }
@Override public Interest<InstanceInfo> next() { DependencyProfile dependencyProfile = dependencyProfileIt.next(); Map<ApplicationProfile, Integer> subscriptionMap = dependencyProfile.getSubscriptionsPerProfile(); List<Interest<InstanceInfo>> interests = new ArrayList<>(); for (Map.Entry<ApplicationProfile, Integer> entry : subscriptionMap.entrySet()) { List<Application> byProfile = applicationsByProfile.get(entry.getKey()); List<Application> selection = randomSubset(byProfile, entry.getValue()); for (Application selected : selection) { interests.add(Interests.forApplications(selected.getName())); } } return Interests.forSome(interests.toArray(new Interest[interests.size()])); }
@Override public Interest<InstanceInfo> build() { return Interests.forApplications(SampleInstanceInfo.DiscoveryServer.build().getApp()); } },
@Override public Interest<InstanceInfo> build() { return Interests.forApplications(SampleInstanceInfo.ZuulServer.build().getApp()); } },
@Override public Interest<InstanceInfo> build() { return Interests.forApplications(SampleInstanceInfo.ZuulServer.build().getApp()); } },
@Override public Interest<InstanceInfo> build() { return Interests.forApplications(SampleInstanceInfo.DiscoveryServer.build().getVipAddress()); } },
@Override public Interest<InstanceInfo> build() { return Interests.forApplications(SampleInstanceInfo.DiscoveryServer.build().getApp()); } },
.build(); interestClient.forInterest(forApplications("WriteServer", "ReadServer", "ServiceA")).subscribe( new Subscriber<ChangeNotification<InstanceInfo>>() { @Override