Package com.yahoo.config.provision
Class Zone
- java.lang.Object
-
- com.yahoo.config.provision.Zone
-
public class Zone extends java.lang.Object
The zone (environment + region) of this runtime, and some other information. An injected instance of this will return the correct current environment and region. Components can use this to obtain information about which zone they are running in.- Author:
- bratseth
-
-
Constructor Summary
Constructors Constructor Description Zone(com.yahoo.cloud.config.ConfigserverConfig configserverConfig, NodeFlavors nodeFlavors)
Zone(CloudName cloudName, SystemName systemName, Environment environment, RegionName region)
Create from cloud, system, environment and region.Zone(Environment environment, RegionName region)
Create from environment and region.Zone(SystemName systemName, Environment environment, RegionName region)
Create from system, environment and region.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CloudName
cloud()
Returns the current cloudstatic Zone
defaultZone()
Do not useEnvironment
environment()
Returns the current environmentboolean
equals(java.lang.Object o)
int
hashCode()
java.util.Optional<NodeFlavors>
nodeFlavors()
Returns all available node flavors for the zone, or empty if not set for this Zone.RegionName
region()
Returns the current regionSystemName
system()
Returns the current systemjava.lang.String
toString()
-
-
-
Constructor Detail
-
Zone
@Inject public Zone(com.yahoo.cloud.config.ConfigserverConfig configserverConfig, NodeFlavors nodeFlavors)
-
Zone
public Zone(Environment environment, RegionName region)
Create from environment and region. Use for testing.
-
Zone
public Zone(SystemName systemName, Environment environment, RegionName region)
Create from system, environment and region. Use for testing.
-
Zone
public Zone(CloudName cloudName, SystemName systemName, Environment environment, RegionName region)
Create from cloud, system, environment and region. Use for testing.
-
-
Method Detail
-
cloud
public CloudName cloud()
Returns the current cloud
-
system
public SystemName system()
Returns the current system
-
environment
public Environment environment()
Returns the current environment
-
region
public RegionName region()
Returns the current region
-
nodeFlavors
public java.util.Optional<NodeFlavors> nodeFlavors()
Returns all available node flavors for the zone, or empty if not set for this Zone.
-
defaultZone
public static Zone defaultZone()
Do not use
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-