Tabnine Logo
InstanceInfo$Builder.build
Code IndexAdd Tabnine 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)

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-write-server

.withInstanceInfo(instanceInfo).withVersion(tempNewVersion).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-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 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-testkit

public InstanceInfo build() {
  return builder().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

  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();
  }
}
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

  • Reactive rest calls using spring rest template
  • getApplicationContext (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onRequestPermissionsResult (Fragment)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JCheckBox (javax.swing)
  • JOptionPane (javax.swing)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now