Builder newBuilder() { return new Builder() .withId(this.baseInstanceInfo.getId()) .withVersion(this.baseInstanceInfo.getVersion() + 1); } }
@Override public InstanceInfo get() { if (snapshot != null) { return snapshot.getData(); } return null; }
@Override public boolean matches(Object item) { if (!(item instanceof InstanceInfo)) { return false; } // Versions may be different InstanceInfo target = (InstanceInfo) item; if (!expectSameVersion) { target = new Builder() .withInstanceInfo(target) .withVersion(expectedValue.getVersion()) .build(); } return target.equals(expectedValue); }
@Override public Observable<ChangeNotification<InstanceInfo>> forInterest(Interest<InstanceInfo> interest) { return eurekaRegistry.forInterest(interest); }
@Override public NetworkAddressBuilder builder() { return aNetworkAddress() .withHostName("test.private.host") .withIpAddress("192.168.0.1") .withProtocolType(ProtocolType.IPv4); } };
@Override public int size() { return eurekaRegistry.size(); }
@Override public ServicePort build() { return new ServicePort(Names.REGISTRATION, EurekaTransports.DEFAULT_REGISTRATION_PORT, false); } },
@Override public Source getSource() { if (delegate instanceof Sourced) { return ((Sourced) delegate).getSource(); } return null; } }
@Override public Observable<InstanceInfo> forSnapshot(Interest<InstanceInfo> interest, Source.SourceMatcher sourceMatcher) { return eurekaRegistry.forSnapshot(interest, sourceMatcher); }
public void resume() { request(1); } }
@Override public boolean match(Source another) { if (another == null) { return false; } return origin.equals(another.origin); } };
@Override public SourcedChangeNotification<InstanceInfo> getChangeNotification() { if (snapshot != null) { return snapshot.getNotification(); } return null; }
@Override public Collection<Source> getAllSources() { return dataStore.getAllSources(); }
public NotifyingInstanceInfoHolder( HolderStoreAccessor<NotifyingInstanceInfoHolder> holderStoreAccessor, PauseableSubject<ChangeNotification<InstanceInfo>> pauseableSubject, NotificationTaskInvoker invoker, String id) { this.holderStoreAccessor = holderStoreAccessor; this.pauseableSubject = pauseableSubject; this.invoker = invoker; this.id = id; this.dataStore = new DataStore(); }
@Override public Source getSource() { if (snapshot != null) { return snapshot.getSource(); } return null; }
@Override public boolean match(Source another) { return (source == null) ? (another == null) : source.equals(another); } };
@Override public ServicePort build() { return new ServicePort("WebServer", 80, false); } },
@Override public void onStart() { request(1); }
@Override public ServicePort build() { return new ServicePort(Names.REPLICATION, EurekaTransports.DEFAULT_REPLICATION_PORT, false); } };