com.twitter.common.net
Interface Environment


public interface Environment

Represents a network environment at the granularity of a datacenter.


Method Summary
 boolean contains(String hostname)
          Checks if a given hostname is a valid hostname for a host in this network environment; does not guarantee that the host exists in this network environment.
 String dcName()
          Returns the name of this network environment's datacenter.
 String fullyQualify(String hostname)
          Creates a fully qualified hostname for a given unqualified hostname in the network environment's datacenter.
 

Method Detail

dcName

String dcName()
Returns the name of this network environment's datacenter.

Returns:
the name of this environment's datacenter

fullyQualify

String fullyQualify(String hostname)
Creates a fully qualified hostname for a given unqualified hostname in the network environment's datacenter. Does not confirm that the host exists.

Parameters:
hostname - The simple hostname to qualify.
Returns:
The fully qualified hostname.

contains

boolean contains(String hostname)
Checks if a given hostname is a valid hostname for a host in this network environment; does not guarantee that the host exists in this network environment.

Parameters:
hostname - The simple hostname to check for membership in this network environment.
Returns:
true if the hostname is a valid hostname for this network environment.