// Path: cloud-vmware-server/src/main/java/jetbrains/buildServer/clouds/base/AbstractCloudImage.java
// public abstract class AbstractCloudImage<T extends AbstractCloudInstance, G extends CloudImageDetails> implements CloudImage, UpdatableCloudErrorProvider {
//   protected final UpdatableCloudErrorProvider myErrorProvider = new CloudErrorMap(SimpleErrorMessages.getInstance());
//   private final Map<String, T> myInstances = new ConcurrentHashMap<String, T>();
//   private final String myName;
//   private final String myId;
// 
//   protected AbstractCloudImage(String name, String id) {
//     myName = name;
//     myId = id;
//   }
// 
//   @NotNull
//   public String getId() {
//     return myId;
//   }
// 
//   @NotNull
//   public String getName() {
//     return myName;
//   }
// 
//   public void updateErrors(TypedCloudErrorInfo... errors) {
//     myErrorProvider.updateErrors(errors);
//   }
// 
//   @Nullable
//   public CloudErrorInfo getErrorInfo() {
//     return myErrorProvider.getErrorInfo();
//   }
// 
//   @NotNull
//   public Collection<T> getInstances() {
//     return Collections.unmodifiableCollection(myInstances.values());
//   }
// 
//   @Nullable
//   public T findInstanceById(@NotNull final String instanceId) {
//     return myInstances.get(instanceId);
//   }
// 
//   public void removeInstance(@NotNull final String instanceId){
//     myInstances.remove(instanceId);
//   }
// 
//   public void addInstance(@NotNull final T instance){
//     myInstances.put(instance.getInstanceId(), instance);
//   }
// 
//   public boolean canStartNewInstance(){
//     return canStartNewInstanceWithDetails().isPositive();
//   }
// 
//   @NotNull
//   public abstract CanStartNewInstanceResult canStartNewInstanceWithDetails();
// 
//   public abstract void terminateInstance(@NotNull final T instance);
// 
//   public abstract void restartInstance(@NotNull final T instance);
// 
//   public abstract T startNewInstance(@NotNull final CloudInstanceUserData tag);
// 
//   public abstract G getImageDetails();
// 
//   protected abstract T createInstanceFromReal(final AbstractInstance realInstance);
// 
//   public void detectNewInstances(final Map<String,? extends AbstractInstance> realInstances){
//     for (String instanceName : realInstances.keySet()) {
//       if (myInstances.get(instanceName) == null) {
//         final AbstractInstance realInstance = realInstances.get(instanceName);
//         final T newInstance = createInstanceFromReal(realInstance);
//         newInstance.setStatus(realInstance.getInstanceStatus());
//         addInstance(newInstance);
//       }
//     }
// 
//   }
// 
//   protected Set<String> getInstanceIds(){
//     return Collections.unmodifiableSet(myInstances.keySet());
//   }
// 
//   public String toString() {
//     return getClass().getSimpleName() +"{" +"myName='" + getId() + '\'' +'}';
//   }
// }
// 
// Path: cloud-vmware-server/src/main/java/jetbrains/buildServer/clouds/base/connector/AbstractInstance.java
// public abstract class AbstractInstance {
//   @NotNull
//   public abstract String getName();
// 
//   public abstract boolean isInitialized();
// 
//   public abstract Date getStartDate();
// 
//   public abstract String getIpAddress();
// 
//   public abstract InstanceStatus getInstanceStatus();
// 
//   @Nullable
//   public abstract String getProperty(String name);
// }


import jetbrains.buildServer.clouds.CanStartNewInstanceResult;
import jetbrains.buildServer.clouds.CloudInstanceUserData;
import jetbrains.buildServer.clouds.base.AbstractCloudImage;
import jetbrains.buildServer.clouds.base.connector.AbstractInstance;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/*
 * Copyright 2000-2022 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package jetbrains.buildServer.clouds.base.stubs;


/**
 * Created by Sergey.Pak on 3/4/2016.
 */
public class DummyCloudImage extends AbstractCloudImage<DummyCloudInstance, DummyImageDetails> {
  public DummyCloudImage(final String name) {
    super(name, name);
  }

  @NotNull
  @Override
  public CanStartNewInstanceResult canStartNewInstanceWithDetails() {
    throw new UnsupportedOperationException("DummyCloudImage.canStartNewInstanceWithDetails");
  }

  @Override
  public void terminateInstance(@NotNull final DummyCloudInstance instance) {
    throw new UnsupportedOperationException("DummyCloudImage.terminateInstance");

    //
  }

  @Override
  public void restartInstance(@NotNull final DummyCloudInstance instance) {
    throw new UnsupportedOperationException("DummyCloudImage.restartInstance");

    //
  }

  @Override
  public DummyCloudInstance startNewInstance(@NotNull final CloudInstanceUserData tag) {
    throw new UnsupportedOperationException("DummyCloudImage.startNewInstance");

    //return null;
  }

  @Override
  public DummyImageDetails getImageDetails() {
    throw new UnsupportedOperationException("DummyCloudImage.getImageDetails");

    //return null;
  }

  @Override
// Path: cloud-vmware-server/src/main/java/jetbrains/buildServer/clouds/base/AbstractCloudImage.java
// public abstract class AbstractCloudImage<T extends AbstractCloudInstance, G extends CloudImageDetails> implements CloudImage, UpdatableCloudErrorProvider {
//   protected final UpdatableCloudErrorProvider myErrorProvider = new CloudErrorMap(SimpleErrorMessages.getInstance());
//   private final Map<String, T> myInstances = new ConcurrentHashMap<String, T>();
//   private final String myName;
//   private final String myId;
// 
//   protected AbstractCloudImage(String name, String id) {
//     myName = name;
//     myId = id;
//   }
// 
//   @NotNull
//   public String getId() {
//     return myId;
//   }
// 
//   @NotNull
//   public String getName() {
//     return myName;
//   }
// 
//   public void updateErrors(TypedCloudErrorInfo... errors) {
//     myErrorProvider.updateErrors(errors);
//   }
// 
//   @Nullable
//   public CloudErrorInfo getErrorInfo() {
//     return myErrorProvider.getErrorInfo();
//   }
// 
//   @NotNull
//   public Collection<T> getInstances() {
//     return Collections.unmodifiableCollection(myInstances.values());
//   }
// 
//   @Nullable
//   public T findInstanceById(@NotNull final String instanceId) {
//     return myInstances.get(instanceId);
//   }
// 
//   public void removeInstance(@NotNull final String instanceId){
//     myInstances.remove(instanceId);
//   }
// 
//   public void addInstance(@NotNull final T instance){
//     myInstances.put(instance.getInstanceId(), instance);
//   }
// 
//   public boolean canStartNewInstance(){
//     return canStartNewInstanceWithDetails().isPositive();
//   }
// 
//   @NotNull
//   public abstract CanStartNewInstanceResult canStartNewInstanceWithDetails();
// 
//   public abstract void terminateInstance(@NotNull final T instance);
// 
//   public abstract void restartInstance(@NotNull final T instance);
// 
//   public abstract T startNewInstance(@NotNull final CloudInstanceUserData tag);
// 
//   public abstract G getImageDetails();
// 
//   protected abstract T createInstanceFromReal(final AbstractInstance realInstance);
// 
//   public void detectNewInstances(final Map<String,? extends AbstractInstance> realInstances){
//     for (String instanceName : realInstances.keySet()) {
//       if (myInstances.get(instanceName) == null) {
//         final AbstractInstance realInstance = realInstances.get(instanceName);
//         final T newInstance = createInstanceFromReal(realInstance);
//         newInstance.setStatus(realInstance.getInstanceStatus());
//         addInstance(newInstance);
//       }
//     }
// 
//   }
// 
//   protected Set<String> getInstanceIds(){
//     return Collections.unmodifiableSet(myInstances.keySet());
//   }
// 
//   public String toString() {
//     return getClass().getSimpleName() +"{" +"myName='" + getId() + '\'' +'}';
//   }
// }
// 
// Path: cloud-vmware-server/src/main/java/jetbrains/buildServer/clouds/base/connector/AbstractInstance.java
// public abstract class AbstractInstance {
//   @NotNull
//   public abstract String getName();
// 
//   public abstract boolean isInitialized();
// 
//   public abstract Date getStartDate();
// 
//   public abstract String getIpAddress();
// 
//   public abstract InstanceStatus getInstanceStatus();
// 
//   @Nullable
//   public abstract String getProperty(String name);
// }


// Path: cloud-vmware-server/src/test/java/jetbrains/buildServer/clouds/base/stubs/DummyCloudImage.java
import jetbrains.buildServer.clouds.CanStartNewInstanceResult;
import jetbrains.buildServer.clouds.CloudInstanceUserData;
import jetbrains.buildServer.clouds.base.AbstractCloudImage;
import jetbrains.buildServer.clouds.base.connector.AbstractInstance;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/*
 * Copyright 2000-2022 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package jetbrains.buildServer.clouds.base.stubs;


/**
 * Created by Sergey.Pak on 3/4/2016.
 */
public class DummyCloudImage extends AbstractCloudImage<DummyCloudInstance, DummyImageDetails> {
  public DummyCloudImage(final String name) {
    super(name, name);
  }

  @NotNull
  @Override
  public CanStartNewInstanceResult canStartNewInstanceWithDetails() {
    throw new UnsupportedOperationException("DummyCloudImage.canStartNewInstanceWithDetails");
  }

  @Override
  public void terminateInstance(@NotNull final DummyCloudInstance instance) {
    throw new UnsupportedOperationException("DummyCloudImage.terminateInstance");

    //
  }

  @Override
  public void restartInstance(@NotNull final DummyCloudInstance instance) {
    throw new UnsupportedOperationException("DummyCloudImage.restartInstance");

    //
  }

  @Override
  public DummyCloudInstance startNewInstance(@NotNull final CloudInstanceUserData tag) {
    throw new UnsupportedOperationException("DummyCloudImage.startNewInstance");

    //return null;
  }

  @Override
  public DummyImageDetails getImageDetails() {
    throw new UnsupportedOperationException("DummyCloudImage.getImageDetails");

    //return null;
  }

  @Override
  protected DummyCloudInstance createInstanceFromReal(final AbstractInstance realInstance) {