Class InstanceInfo.Builder

  • Enclosing class:
    InstanceInfo

    public static final class InstanceInfo.Builder
    extends java.lang.Object
    • Constructor Detail

    • Method Detail

      • newBuilder

        public static InstanceInfo.Builder newBuilder​(java.util.function.Function<java.lang.String,​java.lang.String> intern)
      • setAppName

        public InstanceInfo.Builder setAppName​(java.lang.String appName)
        Set the application name of the instance.This is mostly used in querying of instances.
        Parameters:
        appName - the application name.
        Returns:
        the instance info builder.
      • setAppGroupNameForDeser

        public InstanceInfo.Builder setAppGroupNameForDeser​(java.lang.String appGroupName)
      • setHostName

        public InstanceInfo.Builder setHostName​(java.lang.String hostName)
        Sets the fully qualified hostname of this running instance.This is mostly used in constructing the URL for communicating with the instance.
        Parameters:
        hostName - the host name of the instance.
        Returns:
        the InstanceInfo builder.
      • setIPAddr

        public InstanceInfo.Builder setIPAddr​(java.lang.String ip)
        Sets the ip address of this running instance.
        Parameters:
        ip - the ip address of the instance.
        Returns:
        the InstanceInfo builder.
      • setSID

        @Deprecated
        public InstanceInfo.Builder setSID​(java.lang.String sid)
        Deprecated.
        Sets the identity of this application instance.
        Parameters:
        sid - the sid of the instance.
        Returns:
        the InstanceInfo builder.
      • setPort

        public InstanceInfo.Builder setPort​(int port)
        Sets the port number that is used to service requests.
        Parameters:
        port - the port number that is used to service requests.
        Returns:
        the InstanceInfo builder.
      • setSecurePort

        public InstanceInfo.Builder setSecurePort​(int port)
        Sets the secure port that is used to service requests.
        Parameters:
        port - the secure port that is used to service requests.
        Returns:
        the InstanceInfo builder.
      • enablePort

        public InstanceInfo.Builder enablePort​(InstanceInfo.PortType type,
                                               boolean isEnabled)
        Enabled or disable secure/non-secure ports .
        Parameters:
        type - Secure or Non-Secure.
        isEnabled - true if enabled.
        Returns:
        the instance builder.
      • setHomePageUrl

        public InstanceInfo.Builder setHomePageUrl​(java.lang.String relativeUrl,
                                                   java.lang.String explicitUrl)
        Sets the absolute home page URL for this instance. The users can provide the homePageUrlPath if the home page resides in the same instance talking to discovery, else in the cases where the instance is a proxy for some other server, it can provide the full URL. If the full URL is provided it takes precedence.

        The full URL should follow the format http://${netflix.appinfo.hostname}:7001/ where the value ${netflix.appinfo.hostname} is replaced at runtime.

        Parameters:
        relativeUrl - the relative url path of the home page.
        explicitUrl - - The full URL for the home page
        Returns:
        the instance builder.
      • setStatusPageUrl

        public InstanceInfo.Builder setStatusPageUrl​(java.lang.String relativeUrl,
                                                     java.lang.String explicitUrl)
        Sets the absolute status page URL for this instance. The users can provide the statusPageUrlPath if the status page resides in the same instance talking to discovery, else in the cases where the instance is a proxy for some other server, it can provide the full URL. If the full URL is provided it takes precedence.

        The full URL should follow the format http://${netflix.appinfo.hostname}:7001/Status where the value ${netflix.appinfo.hostname} is replaced at runtime.

        Parameters:
        relativeUrl - - The URL path for status page for this instance
        explicitUrl - - The full URL for the status page
        Returns:
        - Builder instance
      • setHealthCheckUrls

        public InstanceInfo.Builder setHealthCheckUrls​(java.lang.String relativeUrl,
                                                       java.lang.String explicitUrl,
                                                       java.lang.String secureExplicitUrl)
        Sets the absolute health check URL for this instance for both secure and non-secure communication The users can provide the healthCheckUrlPath if the healthcheck page resides in the same instance talking to discovery, else in the cases where the instance is a proxy for some other server, it can provide the full URL. If the full URL is provided it takes precedence.

        The full URL should follow the format http://${netflix.appinfo.hostname}:7001/healthcheck where the value ${netflix.appinfo.hostname} is replaced at runtime.

        Parameters:
        relativeUrl - - The URL path for healthcheck page for this instance.
        explicitUrl - - The full URL for the healthcheck page.
        secureExplicitUrl - the full secure explicit url of the healthcheck page.
        Returns:
        the instance builder
      • setVIPAddress

        public InstanceInfo.Builder setVIPAddress​(java.lang.String vipAddress)
        Sets the Virtual Internet Protocol address for this instance. The address should follow the format This address needs to be resolved into a real address for communicating with this instance.
        Parameters:
        vipAddress - - The Virtual Internet Protocol address of this instance.
        Returns:
        the instance builder.
      • setVIPAddressDeser

        public InstanceInfo.Builder setVIPAddressDeser​(java.lang.String vipAddress)
        Setter used during deserialization process, that does not do macro expansion on the provided value.
      • setSecureVIPAddress

        public InstanceInfo.Builder setSecureVIPAddress​(java.lang.String secureVIPAddress)
        Sets the Secure Virtual Internet Protocol address for this instance. The address should follow the format This address needs to be resolved into a real address for communicating with this instance.
        Parameters:
        secureVIPAddress - the secure VIP address of the instance.
        Returns:
        - Builder instance
      • setSecureVIPAddressDeser

        public InstanceInfo.Builder setSecureVIPAddressDeser​(java.lang.String secureVIPAddress)
        Setter used during deserialization process, that does not do macro expansion on the provided value.
      • setDataCenterInfo

        public InstanceInfo.Builder setDataCenterInfo​(DataCenterInfo datacenter)
        Sets the datacenter information.
        Parameters:
        datacenter - the datacenter information for where this instance is running.
        Returns:
        the InstanceInfo builder.
      • setLeaseInfo

        public InstanceInfo.Builder setLeaseInfo​(LeaseInfo info)
        Set the instance lease information.
        Parameters:
        info - the lease information for this instance.
      • add

        public InstanceInfo.Builder add​(java.lang.String key,
                                        java.lang.String val)
        Add arbitrary metadata to running instance.
        Parameters:
        key - The key of the metadata.
        val - The value of the metadata.
        Returns:
        the InstanceInfo builder.
      • setMetadata

        public InstanceInfo.Builder setMetadata​(java.util.Map<java.lang.String,​java.lang.String> mt)
        Replace the existing metadata map with a new one.
        Parameters:
        mt - the new metadata name.
        Returns:
        instance info builder.
      • getRawInstance

        public InstanceInfo getRawInstance()
        Returns the encapsulated instance info even it it is not built fully.
        Returns:
        the existing information about the instance.
      • isInitialized

        public boolean isInitialized()
      • setASGName

        public InstanceInfo.Builder setASGName​(java.lang.String asgName)
        Sets the AWS ASG name for this instance.
        Parameters:
        asgName - the asg name for this instance.
        Returns:
        the instance info builder.
      • setIsCoordinatingDiscoveryServer

        public InstanceInfo.Builder setIsCoordinatingDiscoveryServer​(boolean isCoordinatingDiscoveryServer)
      • setLastUpdatedTimestamp

        public InstanceInfo.Builder setLastUpdatedTimestamp​(long lastUpdatedTimestamp)
      • setLastDirtyTimestamp

        public InstanceInfo.Builder setLastDirtyTimestamp​(long lastDirtyTimestamp)