Tabnine Logo
InstanceInfo$Builder.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.netflix.eureka2.registry.InstanceInfo$Builder
constructor

Best Java code snippets using com.netflix.eureka2.registry.InstanceInfo$Builder.<init> (Showing top 11 results out of 315)

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

case Registered:
  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> 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

NetworkAddress publicAddress = publicAddresses.next();
NetworkAddress privateAddress = privateAddresses.next();
DataCenterInfo dataCenter = new AwsDataCenterInfo.Builder()
    .withAwsDataCenter(templateDataCenter)
    .withPublicHostName(publicAddress.getHostName())
    .withPrivateIPv4(privateAddress.getIpAddress())
    .build();
return new InstanceInfo.Builder()
    .withId("id#" + name)
    .withApp("app#" + baseName)
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-testkit

protected Builder templateFor(String name) {
  HashSet<String> healthCheckUrls = new HashSet<>();
  healthCheckUrls.add("http://eureka/healthCheck/" + name + "1");
  healthCheckUrls.add("http://eureka/healthCheck/" + name + "2");
  HashSet<Integer> ports = new HashSet<>();
  ports.add(80);
  ports.add(8080);
  HashSet<Integer> securePorts = new HashSet<>();
  securePorts.add(443);
  securePorts.add(8443);
  return new Builder()
      .withId("id#" + name + "_" + UUID.randomUUID().toString())
      .withApp("app#" + name)
      .withAppGroup("group#" + name)
      .withAsg("asg#" + name)
      .withHealthCheckUrls(healthCheckUrls)
      .withHomePageUrl("http://eureka/home/" + name)
      .withPorts(Sets.asSet(new ServicePort(7200, false), new ServicePort(7210, true)))
      .withSecureVipAddress("vipSecure#" + name)
      .withStatus(Status.UP)
      .withStatusPageUrl("http://eureka/status/" + name)
      .withVipAddress("vip#" + name)
      .withMetaData("optionA", "valueA")
      .withMetaData("optionB", "valueB")
      .withDataCenterInfo(SampleAwsDataCenterInfo.UsEast1a.build());
}
origin: com.netflix.eureka2/eureka-write-server

final InstanceInfo tempNewInfo = new InstanceInfo.Builder()
    .withInstanceInfo(instanceInfo).withVersion(tempNewVersion).build();
origin: com.netflix.eureka2/eureka-server

  @Override
  public InstanceInfo.Builder call(DataCenterInfo dataCenterInfo) {
    final String instanceId = config.getAppName() + '#' + UUID.randomUUID().toString();
    String address = AddressSelector.selectBy().publicIp(true).or().any().returnNameOrIp(dataCenterInfo.getAddresses());
    HashSet<String> healthCheckUrls = new HashSet<String>();
    healthCheckUrls.add("http://" + address + ':' + config.getWebAdminPort() + "/healthcheck");
    return new InstanceInfo.Builder()
        .withId(instanceId)
        .withApp(config.getAppName())
        .withVipAddress(config.getVipAddress())
        .withHealthCheckUrls(healthCheckUrls)
        .withDataCenterInfo(dataCenterInfo)
        .withStatus(InstanceInfo.Status.UP);  // for now just register with UP
  }
});
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

  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$Builder<init>

Popular methods of InstanceInfo$Builder

  • build
  • 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)
  • getSystemService (Context)
  • addToBackStack (FragmentTransaction)
  • String (java.lang)
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • 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