// Path: src/main/java/com/proofpoint/cloudmanagement/service/InstanceConnector.java
// public enum InstanceDestructionStatus
// {
//     DESTROYED, NOT_FOUND
// }


import static com.google.common.base.Preconditions.checkNotNull;
import com.proofpoint.cloudmanagement.service.InstanceConnector.InstanceDestructionStatus;
import javax.inject.Inject;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.core.UriInfo;
import java.net.URI;
import java.util.Map;

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Response getInstance(@PathParam("id") String instanceId, @Context UriInfo uriInfo)
    {
        checkNotNull(instanceId);
        checkNotNull(uriInfo);

        for (Map.Entry<String, InstanceConnector> instanceConnectorEntry : instanceConnectorMap.entrySet()) {
            Instance instance = instanceConnectorEntry.getValue().getInstance(instanceId);
            if (instance != null) {
                return Response.ok(
                        InstanceRepresentation.fromInstance(
                                instance.toBuilder()
                                        .setProvider(instanceConnectorEntry.getKey())
                                        .setHostname(dnsManager.getFullyQualifiedDomainName(instance))
                                        .setTags(tagManager.getTags(instance))
                                        .build(),
                                constructSelfUri(uriInfo, instanceId))).build();
            }
        }
        return Response.status(Status.NOT_FOUND).build();
    }

    @DELETE
    public Response deleteInstance(@PathParam("id") String instanceId)
    {
        checkNotNull(instanceId, "Instance ID cannot be null");

        for (InstanceConnector instanceConnector : instanceConnectorMap.values()) {
// Path: src/main/java/com/proofpoint/cloudmanagement/service/InstanceConnector.java
// public enum InstanceDestructionStatus
// {
//     DESTROYED, NOT_FOUND
// }


// Path: src/main/java/com/proofpoint/cloudmanagement/service/InstanceResource.java
import static com.google.common.base.Preconditions.checkNotNull;
import com.proofpoint.cloudmanagement.service.InstanceConnector.InstanceDestructionStatus;
import javax.inject.Inject;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.core.UriInfo;
import java.net.URI;
import java.util.Map;


    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Response getInstance(@PathParam("id") String instanceId, @Context UriInfo uriInfo)
    {
        checkNotNull(instanceId);
        checkNotNull(uriInfo);

        for (Map.Entry<String, InstanceConnector> instanceConnectorEntry : instanceConnectorMap.entrySet()) {
            Instance instance = instanceConnectorEntry.getValue().getInstance(instanceId);
            if (instance != null) {
                return Response.ok(
                        InstanceRepresentation.fromInstance(
                                instance.toBuilder()
                                        .setProvider(instanceConnectorEntry.getKey())
                                        .setHostname(dnsManager.getFullyQualifiedDomainName(instance))
                                        .setTags(tagManager.getTags(instance))
                                        .build(),
                                constructSelfUri(uriInfo, instanceId))).build();
            }
        }
        return Response.status(Status.NOT_FOUND).build();
    }

    @DELETE
    public Response deleteInstance(@PathParam("id") String instanceId)
    {
        checkNotNull(instanceId, "Instance ID cannot be null");

        for (InstanceConnector instanceConnector : instanceConnectorMap.values()) {
            if (instanceConnector.destroyInstance(instanceId) == InstanceDestructionStatus.DESTROYED) {