// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.provision.zone;

import com.yahoo.config.provision.CloudName;
import com.yahoo.config.provision.Environment;
import com.yahoo.config.provision.RegionName;
import com.yahoo.config.provision.SystemName;

/**
 * @author hakonhall
 */
public interface ZoneApi {

    SystemName getSystemName();

    ZoneId getId();

    /** Returns the SYSTEM.ENVIRONMENT.REGION string. */
    default String getFullName() {
        return getSystemName().value() + "." + getEnvironment().value() + "." + getRegionName().value();
    }

    /**
     * Returns the virtual ID of this zone. For ordinary zones this is the same as {@link ZoneApi#getId()}, for a
     * system represented as a zone this is a fixed ID that is independent of the actual zone ID.
     */
    default ZoneId getVirtualId() {
        return getId();
    }

    default Environment getEnvironment() { return getId().environment(); }

    default RegionName getRegionName() { return getId().region(); }

    CloudName getCloudName();

    /** Returns the region name within the cloud, e.g. 'us-east-1' in AWS */
    String getCloudNativeRegionName();

}

@@ -411,24 +411,208 @@
 temName();%0A%0A
+    /**%0A     * Returns the ID of the zone.%0A     *%0A     * WARNING: The ID of a controller zone is equal to the ID of a prod zone in the same region.%0A     * @see #getVirtualId()%0A     */%0A
     ZoneId g
@@ -615,24 +615,24 @@
 Id getId();%0A
-
 %0A    /** Ret
@@ -851,90 +851,82 @@
 rns 
-the virtual ID of this zone. For ordinary zones this is the same as %7B@link ZoneApi
+%7B@link #getId()%7D for all zones except the controller zone.  Unlike %7B@link 
 #get
@@ -935,22 +935,16 @@
 ()%7D,
- for a
 %0A     * 
 syst
@@ -943,97 +943,71 @@
   * 
-system represented as a zone th
+the virtual ID of a controller 
 is 
+d
 is
- a fixed ID that is independent of the actual
+tinct from all other
  zone
- ID
+s
 .%0A  

Document difference between ID and virtual ID