Codota Logo
InstanceInfo$Builder.build
Code IndexAdd Codota to your IDE (free)

How to use
build
method
in
com.netflix.eureka2.registry.InstanceInfo$Builder

Best Java code snippets using com.netflix.eureka2.registry.InstanceInfo$Builder.build (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: com.netflix.eureka2/eureka-write-server

final long tempNewVersion = currentVersion + 1;
final InstanceInfo tempNewInfo = new InstanceInfo.Builder()
    .withInstanceInfo(newInfo).withVersion(tempNewVersion).build();
origin: com.netflix.eureka2/eureka-write-server

@Override
public Observable<Void> register(final InstanceInfo instanceInfo) {
  logger.debug("Replicated registry entry: {}", instanceInfo);
  if (STATES.Opened != state.get()) {
    return Observable.error(state.get() == STATES.Closed ? CHANNEL_CLOSED_EXCEPTION : IDLE_STATE_EXCEPTION);
  }
  if (replicationLoop) {
    return Observable.error(REPLICATION_LOOP_EXCEPTION);
  }
  if (instanceInfoById.containsKey(instanceInfo.getId())) {
    logger.info("Overwriting existing registration entry for instance {}", instanceInfo.getId());
  }
  InstanceInfo tempNewInfo = new InstanceInfo.Builder()
      .withInstanceInfo(instanceInfo).withVersion(currentVersion++).build();
  return registry.register(tempNewInfo, replicationSource)
      .ignoreElements()
      .cast(Void.class)
      .doOnCompleted(new Action0() {
        @Override
        public void call() {
          instanceInfoById.put(instanceInfo.getId(), instanceInfo);
        }
      });
}
origin: com.netflix.eureka2/eureka-write-server

@Override
public Observable<Void> update(final InstanceInfo newInfo) {
  logger.debug("Updating existing registry entry. New info= {}", newInfo);
  if (STATES.Opened != state.get()) {
    return Observable.error(state.get() == STATES.Closed ? CHANNEL_CLOSED_EXCEPTION : IDLE_STATE_EXCEPTION);
  }
  if (replicationLoop) {
    return Observable.error(REPLICATION_LOOP_EXCEPTION);
  }
  InstanceInfo currentInfo = instanceInfoById.get(newInfo.getId());
  if (currentInfo == null) {
    logger.info("Replication update request for non-existing entry {}; handling it as an initial registration", newInfo.getId());
    return register(newInfo);
  }
  InstanceInfo tempNewInfo = new InstanceInfo.Builder()
      .withInstanceInfo(newInfo).withVersion(currentVersion++).build();
  Set<Delta<?>> deltas = tempNewInfo.diffOlder(currentInfo);
  logger.debug("Set of InstanceInfo modified fields: {}", deltas);
  return registry.update(tempNewInfo, deltas, replicationSource)
      .ignoreElements()
      .cast(Void.class)
      .doOnCompleted(new Action0() {
        @Override
        public void call() {
          instanceInfoById.put(newInfo.getId(), newInfo);
        }
      });
}
origin: com.netflix.eureka2/eureka-testkit

  protected InstanceInfo buildClientInfo(String name) {
    return new Builder()
        .withId("id#" + name)
        .withApp("app#" + name)
        .withAppGroup("appGroup#" + name)
        .withVipAddress("vip#" + name)
        .withStatus(Status.UP)
        .withPorts(SampleServicePort.httpPorts())
        .withDataCenterInfo(SampleAwsDataCenterInfo.UsEast1a.build())
        .build();
  }
}
origin: com.netflix.eureka2/eureka-testkit

private static InstanceInfo randomize(String id, InstanceInfo.Builder builder) {
  return builder.withId(id).build();
}
origin: com.netflix.eureka2/eureka-testkit

public InstanceInfo build() {
  return builder().build();
}
origin: com.netflix.eureka2/eureka-testkit

@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);
}
origin: com.netflix.eureka2/eureka-bridge

@Override
public InstanceInfo fromV1(com.netflix.appinfo.InstanceInfo v1Info) {
  InstanceInfo.Builder builder = new InstanceInfo.Builder()
      .withId(v1Info.getAppName() + "_" + v1Info.getId())  // instanceId is not unique for v1Data
      .withAppGroup(v1Info.getAppGroupName())
      .withApp(v1Info.getAppName())
      .withAsg(v1Info.getASGName())
      .withVipAddress(v1Info.getVIPAddress())
      .withSecureVipAddress(v1Info.getSecureVipAddress())
      .withPorts(toSet(new ServicePort(v1Info.getPort(), false), new ServicePort(v1Info.getSecurePort(), true)))
      .withStatus(fromV1(v1Info.getStatus()))
      .withHomePageUrl(v1Info.getHomePageUrl())
      .withStatusPageUrl(v1Info.getStatusPageUrl())
      .withHealthCheckUrls(new HashSet<>(v1Info.getHealthCheckUrls()))
      .withMetaData(v1Info.getMetadata())
      .withDataCenterInfo(fromV1(v1Info.getDataCenterInfo()));
  return builder.build();
}
origin: com.netflix.eureka2/eureka-testkit

@Override
public InstanceInfo next() {
  int cidx = idx.incrementAndGet();
  String name = baseName + '_' + cidx;
  NetworkAddress publicAddress = publicAddresses.next();
  NetworkAddress privateAddress = privateAddresses.next();
  DataCenterInfo dataCenter = new AwsDataCenterInfo.Builder()
      .withAwsDataCenter(templateDataCenter)
      .withPublicHostName(publicAddress.getHostName())
      .withPublicIPv4(publicAddress.getIpAddress())
      .withPrivateHostName(privateAddress.getHostName())
      .withPrivateIPv4(privateAddress.getIpAddress())
      .build();
  return new InstanceInfo.Builder()
      .withId("id#" + name)
      .withApp("app#" + baseName)
      .withAppGroup("group#" + baseName)
      .withAsg("asg#" + baseName)
      .withHealthCheckUrls(template.getHealthCheckUrls())
      .withHomePageUrl(template.getHomePageUrl())
      .withPorts(template.getPorts())
      .withSecureVipAddress("vipSecure#" + name)
      .withStatus(template.getStatus())
      .withStatusPageUrl(template.getStatusPageUrl())
      .withVipAddress("vip#" + baseName)
      .withMetaData(template.getMetaData())
      .withDataCenterInfo(dataCenter)
      .build();
}
origin: com.netflix.eureka2/eureka-write-server

.withInstanceInfo(instanceInfo).withVersion(tempNewVersion).build();
com.netflix.eureka2.registryInstanceInfo$Builderbuild

Popular methods of InstanceInfo$Builder

  • <init>
  • withApp
  • withDataCenterInfo
  • withHealthCheckUrls
  • withId
  • withStatus
  • withVipAddress
  • withAppGroup
  • withAsg
  • withHomePageUrl
  • withInstanceInfo
  • withMetaData
  • withInstanceInfo,
  • withMetaData,
  • withPorts,
  • withSecureVipAddress,
  • withStatusPageUrl,
  • withVersion

Popular in Java

  • Updating database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • findViewById (Activity)
  • getSharedPreferences (Context)
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now