Codota Logo
StatusInfo$Builder.withInstanceInfo
Code IndexAdd Codota to your IDE (free)

How to use
withInstanceInfo
method
in
com.netflix.eureka.util.StatusInfo$Builder

Best Java code snippets using com.netflix.eureka.util.StatusInfo$Builder.withInstanceInfo (Showing top 2 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: Netflix/eureka

public StatusInfo getStatusInfo() {
  StatusInfo.Builder builder = StatusInfo.Builder.newBuilder();
  // Add application level status
  int upReplicasCount = 0;
  StringBuilder upReplicas = new StringBuilder();
  StringBuilder downReplicas = new StringBuilder();
  StringBuilder replicaHostNames = new StringBuilder();
  for (PeerEurekaNode node : peerEurekaNodes.getPeerEurekaNodes()) {
    if (replicaHostNames.length() > 0) {
      replicaHostNames.append(", ");
    }
    replicaHostNames.append(node.getServiceUrl());
    if (isReplicaAvailable(node.getServiceUrl())) {
      upReplicas.append(node.getServiceUrl()).append(',');
      upReplicasCount++;
    } else {
      downReplicas.append(node.getServiceUrl()).append(',');
    }
  }
  builder.add("registered-replicas", replicaHostNames.toString());
  builder.add("available-replicas", upReplicas.toString());
  builder.add("unavailable-replicas", downReplicas.toString());
  
  // Only set the healthy flag if a threshold has been configured.
  if (peerEurekaNodes.getMinNumberOfAvailablePeers() > -1) {
    builder.isHealthy(upReplicasCount >= peerEurekaNodes.getMinNumberOfAvailablePeers());
  }
  builder.withInstanceInfo(this.instanceInfo);
  return builder.build();
}
origin: com.netflix.eureka/eureka-core

public StatusInfo getStatusInfo() {
  StatusInfo.Builder builder = StatusInfo.Builder.newBuilder();
  // Add application level status
  int upReplicasCount = 0;
  StringBuilder upReplicas = new StringBuilder();
  StringBuilder downReplicas = new StringBuilder();
  StringBuilder replicaHostNames = new StringBuilder();
  for (PeerEurekaNode node : peerEurekaNodes.getPeerEurekaNodes()) {
    if (replicaHostNames.length() > 0) {
      replicaHostNames.append(", ");
    }
    replicaHostNames.append(node.getServiceUrl());
    if (isReplicaAvailable(node.getServiceUrl())) {
      upReplicas.append(node.getServiceUrl()).append(',');
      upReplicasCount++;
    } else {
      downReplicas.append(node.getServiceUrl()).append(',');
    }
  }
  builder.add("registered-replicas", replicaHostNames.toString());
  builder.add("available-replicas", upReplicas.toString());
  builder.add("unavailable-replicas", downReplicas.toString());
  
  // Only set the healthy flag if a threshold has been configured.
  if (peerEurekaNodes.getMinNumberOfAvailablePeers() > -1) {
    builder.isHealthy(upReplicasCount >= peerEurekaNodes.getMinNumberOfAvailablePeers());
  }
  builder.withInstanceInfo(this.instanceInfo);
  return builder.build();
}
com.netflix.eureka.utilStatusInfo$BuilderwithInstanceInfo

Popular methods of StatusInfo$Builder

  • build
    Build the StatusInfo. General information are automatically built here too.
  • isHealthy
  • newBuilder
  • <init>
  • add
    Add any application specific status data.

Popular in Java

  • Reactive rest calls using spring rest template
  • onCreateOptionsMenu (Activity)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
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