Class OriginName

java.lang.Object
com.netflix.zuul.origins.OriginName

public final class OriginName extends Object
An Origin Name is a tuple of a target to connect to, an authority to use for connecting, and an NIWS client name used for configuration of an Origin. These fields are semi independent, but are usually used in proximity to each other, and thus makes sense to group them together.

The target represents the string used to look up the origin during name resolution. Currently, this is a VIP, which is passed to a Eureka name resolved. In the future, other targets will be supported, such as DNS.

The authority represents who we plan to connect to. In the case of TLS / SSL connections, this can be used to verify the remote endpoint. It is not specified what the format is, but it may not be null. In the case of VIPs, which are frequently used with AWS clusters, this is the Application Name.

The NIWS Client Name is a legacy construct, which is used to configure an origin. When the origin is created, the NIWS client name can be used as a key into a configuration mapping to decide how the Origin should behave. By default, the VIP is the same for the NIWS client name, but it can be different in scenarios where multiple connections to the same origin are needed. Additionally, the NIWS client name also functions as a key in metrics.

  • Method Details

    • fromVip

      @Deprecated public static OriginName fromVip(String vip)
    • fromVip

      @Deprecated public static OriginName fromVip(String vip, String niwsClientName)
    • fromVipAndApp

      public static OriginName fromVipAndApp(String vip, String appName)
      Constructs an OriginName with a target and authority from the vip and app name. The vip is used as the NIWS client name, which is frequently used for configuration.
    • fromVipAndApp

      public static OriginName fromVipAndApp(String vip, String appName, String niwsClientName)
      Constructs an OriginName with a target, authority, and NIWS client name. The NIWS client name can be different from the vip in cases where custom configuration for an Origin is needed.
    • getTarget

      public String getTarget()
      This is typically the VIP for the given Origin.
    • getNiwsClientName

      public String getNiwsClientName()
      Returns the niwsClientName. This is normally used for interaction with NIWS, and should be used without prior knowledge that the value will be used in NIWS libraries.
    • getMetricId

      public String getMetricId()
      Returns the identifier for this this metric name. This may be different than any of the other fields; currently it is equivalent to the lowercased getNiwsClientName().
    • getAuthority

      public String getAuthority()
      Returns the Authority of this origin. This is used for establishing secure connections. May be absent if the authority is not trusted.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object