// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.service.duper;

import com.yahoo.config.ConfigInstance;
import com.yahoo.config.FileReference;
import com.yahoo.config.model.api.FileDistribution;
import com.yahoo.config.model.api.HostInfo;
import com.yahoo.config.model.api.Model;
import com.yahoo.config.provision.AllocatedHosts;
import com.yahoo.vespa.config.ConfigKey;
import com.yahoo.vespa.config.ConfigPayload;
import com.yahoo.vespa.config.buildergen.ConfigDefinition;

import java.time.Instant;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Set;

/**
 * Model that only supports the subset necessary to create an ApplicationInstance.
 *
 * @author hakon
 */
public class HostsModel implements Model {

    private final Collection<HostInfo> hosts;

    public HostsModel(List<HostInfo> hosts) {
        this.hosts = Collections.unmodifiableCollection(hosts);
    }

    @Override
    public Collection<HostInfo> getHosts() {
        return hosts;
    }

    @Override
    @SuppressWarnings("deprecation") // yes, this is needed
    public ConfigPayload getConfig(ConfigKey<?> configKey, ConfigDefinition configDefinition) {
        throw new UnsupportedOperationException();
    }

    @Override
    public ConfigInstance.Builder getConfigInstance(ConfigKey<?> configKey, ConfigDefinition configDefinition) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Set<ConfigKey<?>> allConfigsProduced() {
        throw new UnsupportedOperationException();
    }

    @Override
    public Set<String> allConfigIds() {
        throw new UnsupportedOperationException();
    }

    @Override
    public void distributeFiles(FileDistribution fileDistribution) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Set<FileReference> fileReferences() {
        throw new UnsupportedOperationException();
    }

    @Override
    public AllocatedHosts allocatedHosts() {
        throw new UnsupportedOperationException();
    }

    @Override
    public boolean allowModelVersionMismatch(Instant now) {
        throw new UnsupportedOperationException();
    }

    @Override
    public boolean skipOldConfigModels(Instant now) {
        throw new UnsupportedOperationException();
    }

}

@@ -1106,236 +1106,8 @@
  %7D%0A%0A
-    @Override%0A    @SuppressWarnings(%22deprecation%22) // yes, this is needed%0A    public ConfigPayload getConfig(ConfigKey%3C?%3E configKey, ConfigDefinition configDefinition) %7B%0A        throw new UnsupportedOperationException();%0A    %7D%0A%0A
     

Update HostsModel as well