// Path: environment.monitor.core/src/main/java/org/yagel/monitor/StatusUpdate.java
// public interface StatusUpdate {
// 
//   Status getStatus();
// 
//   void setStatus(Status status);
// 
//   Date getUpdated();
// 
//   void setUpdated(Date updated);
// }
// 
// Path: environment.monitor.runner/src/main/java/org/yagel/monitor/mongo/MongoConnector.java
// public class MongoConnector {
// 
//   private final static String MONITOR_DB = "monitor_tmp_newDomain";
//   private final static Logger log = Logger.getLogger(MongoConnector.class);
//   private static MongoConnector connector;
// 
//   private MongoDatabase db;
//   private MongoClient client;
// 
// 
//   private MongoConnector() throws DiagnosticException {
//     client = new MongoClient();
//     db = client.getDatabase(MONITOR_DB);
// 
//   }
// 
//   private MongoConnector(String connectURIStr) throws DiagnosticException {
//     MongoClientURI clientURI = new MongoClientURI(connectURIStr);
//     client = new MongoClient(clientURI);
//     String dbName = clientURI.getDatabase() == null ? MONITOR_DB : clientURI.getDatabase();
//     db = client.getDatabase(dbName);
// 
//   }
// 
//   public static MongoConnector getInstance() {
//     if (connector == null) {
//       try {
//         String mongoConnectURI = System.getProperty("mongo.connect.uri", null);
//         if (mongoConnectURI == null)
//           connector = new MongoConnector();
//         else
//           connector = new MongoConnector(mongoConnectURI);
//       } catch (Exception e) {
//         log.error("Exception on mongoDB connection creation. ", e);
//         throw new RuntimeException(e);
//       }
//     }
//     return connector;
//   }
// 
// 
//   public ResourceLastStatusDAO getLastStatusDAO() {
//     return new ResourceLastStatusDAO(db);
//   }
// 
//   public ResourceStatusDetailDAO getMonthDetailDAO() {
//     return new ResourceStatusDetailDAO(db);
//   }
// 
//   public AggregatedStatusDAO getAggregatedStatusDAO() {
//     return new AggregatedStatusDAO(db);
//   }
// 
//   public ResourceDAO getResourceDAO() {
//     return new ResourceDAO(db);
//   }
// 
// 
//   public void close() {
//     client.close();
//     connector = null;
//   }
// 
// 
// }


import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.yagel.monitor.StatusUpdate;
import org.yagel.monitor.mongo.MongoConnector;
import java.util.Date;
import java.util.List;
package org.yagel.monitor.api.rest;



@RestController
@RequestMapping("/resource/status/")
public class ResourceStatusService extends AbstractService {


  @RequestMapping(value = "{environmentName}/{resourceId}", method = RequestMethod.GET)
// Path: environment.monitor.core/src/main/java/org/yagel/monitor/StatusUpdate.java
// public interface StatusUpdate {
// 
//   Status getStatus();
// 
//   void setStatus(Status status);
// 
//   Date getUpdated();
// 
//   void setUpdated(Date updated);
// }
// 
// Path: environment.monitor.runner/src/main/java/org/yagel/monitor/mongo/MongoConnector.java
// public class MongoConnector {
// 
//   private final static String MONITOR_DB = "monitor_tmp_newDomain";
//   private final static Logger log = Logger.getLogger(MongoConnector.class);
//   private static MongoConnector connector;
// 
//   private MongoDatabase db;
//   private MongoClient client;
// 
// 
//   private MongoConnector() throws DiagnosticException {
//     client = new MongoClient();
//     db = client.getDatabase(MONITOR_DB);
// 
//   }
// 
//   private MongoConnector(String connectURIStr) throws DiagnosticException {
//     MongoClientURI clientURI = new MongoClientURI(connectURIStr);
//     client = new MongoClient(clientURI);
//     String dbName = clientURI.getDatabase() == null ? MONITOR_DB : clientURI.getDatabase();
//     db = client.getDatabase(dbName);
// 
//   }
// 
//   public static MongoConnector getInstance() {
//     if (connector == null) {
//       try {
//         String mongoConnectURI = System.getProperty("mongo.connect.uri", null);
//         if (mongoConnectURI == null)
//           connector = new MongoConnector();
//         else
//           connector = new MongoConnector(mongoConnectURI);
//       } catch (Exception e) {
//         log.error("Exception on mongoDB connection creation. ", e);
//         throw new RuntimeException(e);
//       }
//     }
//     return connector;
//   }
// 
// 
//   public ResourceLastStatusDAO getLastStatusDAO() {
//     return new ResourceLastStatusDAO(db);
//   }
// 
//   public ResourceStatusDetailDAO getMonthDetailDAO() {
//     return new ResourceStatusDetailDAO(db);
//   }
// 
//   public AggregatedStatusDAO getAggregatedStatusDAO() {
//     return new AggregatedStatusDAO(db);
//   }
// 
//   public ResourceDAO getResourceDAO() {
//     return new ResourceDAO(db);
//   }
// 
// 
//   public void close() {
//     client.close();
//     connector = null;
//   }
// 
// 
// }


// Path: environment.monitor.server/src/main/java/org/yagel/monitor/api/rest/ResourceStatusService.java
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.yagel.monitor.StatusUpdate;
import org.yagel.monitor.mongo.MongoConnector;
import java.util.Date;
import java.util.List;

package org.yagel.monitor.api.rest;



@RestController
@RequestMapping("/resource/status/")
public class ResourceStatusService extends AbstractService {


  @RequestMapping(value = "{environmentName}/{resourceId}", method = RequestMethod.GET)
  public ResponseEntity<List<StatusUpdate>> getResourceStatuses(