// Path: src/main/java/no/cantara/cs/persistence/ApplicationConfigDao.java
// public interface ApplicationConfigDao {
// 	
// 	Application getApplication(String artifact);
// 	
//     Application createApplication(Application newApplication);
// 
//     ApplicationConfig createApplicationConfig(String applicationId, ApplicationConfig newConfig);
// 
//     List<ApplicationConfig> findAllApplicationConfigsByArtifactId(String artifactId);
//     
//     ApplicationConfig findTheLatestApplicationConfigByArtifactId(String artifactId);
// 
//     List<ApplicationConfig> findAllApplicationConfigsByApplicationId(String applicationId);
//     
//     ApplicationConfig findTheLatestApplicationConfigByApplicationId(String applicationId);
// 
//     ApplicationConfig getApplicationConfig(String configId);
// 
//     ApplicationConfig deleteApplicationConfig(String configId);
// 
//     ApplicationConfig updateApplicationConfig(String configId, ApplicationConfig updatedConfig);
// 
//     String getArtifactId(ApplicationConfig config);
// 
//     List< ApplicationConfig> getAllConfigs();
// 
//     List<Application> getApplications();
// 
// 	Application deleteApplication(String applicationId);
// 
// 	boolean canDeleteApplicationConfig(String configId);
// 
// 	boolean canDeleteApplication(String applicationId);
// }


import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import no.cantara.cs.dto.Application;
import no.cantara.cs.dto.ApplicationConfig;
import no.cantara.cs.persistence.ApplicationConfigDao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.io.IOException;
import java.util.List;
import java.util.Map;
package no.cantara.cs.admin;



/**
 * CRUD, http endpoint for ApplicationConfig
 *
 * @author <a href="mailto:erik-dev@fjas.no">Erik Drolshammer</a>
 */
@Path(ApplicationResource.APPLICATION_PATH)
public class ApplicationConfigResource {
	public static final String CONFIG_PATH_WITH_APPID = "/{applicationId}/config";
	public static final String CONFIG_PATH = "/config";

	private static final Logger log = LoggerFactory.getLogger(ApplicationConfigResource.class);
	private static final ObjectMapper mapper = new ObjectMapper();
// Path: src/main/java/no/cantara/cs/persistence/ApplicationConfigDao.java
// public interface ApplicationConfigDao {
// 	
// 	Application getApplication(String artifact);
// 	
//     Application createApplication(Application newApplication);
// 
//     ApplicationConfig createApplicationConfig(String applicationId, ApplicationConfig newConfig);
// 
//     List<ApplicationConfig> findAllApplicationConfigsByArtifactId(String artifactId);
//     
//     ApplicationConfig findTheLatestApplicationConfigByArtifactId(String artifactId);
// 
//     List<ApplicationConfig> findAllApplicationConfigsByApplicationId(String applicationId);
//     
//     ApplicationConfig findTheLatestApplicationConfigByApplicationId(String applicationId);
// 
//     ApplicationConfig getApplicationConfig(String configId);
// 
//     ApplicationConfig deleteApplicationConfig(String configId);
// 
//     ApplicationConfig updateApplicationConfig(String configId, ApplicationConfig updatedConfig);
// 
//     String getArtifactId(ApplicationConfig config);
// 
//     List< ApplicationConfig> getAllConfigs();
// 
//     List<Application> getApplications();
// 
// 	Application deleteApplication(String applicationId);
// 
// 	boolean canDeleteApplicationConfig(String configId);
// 
// 	boolean canDeleteApplication(String applicationId);
// }


// Path: src/main/java/no/cantara/cs/admin/ApplicationConfigResource.java
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import no.cantara.cs.dto.Application;
import no.cantara.cs.dto.ApplicationConfig;
import no.cantara.cs.persistence.ApplicationConfigDao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.io.IOException;
import java.util.List;
import java.util.Map;

package no.cantara.cs.admin;



/**
 * CRUD, http endpoint for ApplicationConfig
 *
 * @author <a href="mailto:erik-dev@fjas.no">Erik Drolshammer</a>
 */
@Path(ApplicationResource.APPLICATION_PATH)
public class ApplicationConfigResource {
	public static final String CONFIG_PATH_WITH_APPID = "/{applicationId}/config";
	public static final String CONFIG_PATH = "/config";

	private static final Logger log = LoggerFactory.getLogger(ApplicationConfigResource.class);
	private static final ObjectMapper mapper = new ObjectMapper();
	private final ApplicationConfigDao applicationConfigDao;