package com.google.graphgeckos.dashboard.api;

import com.google.graphgeckos.dashboard.datatypes.BuildInfo;
import com.google.graphgeckos.dashboard.storage.DataRepository;
import com.google.graphgeckos.dashboard.storage.DatastoreRepository;
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.RestController;

@RestController
public class DashboardController {

  private static DataRepository dataRepository = new DatastoreRepository();

  @RequestMapping(value = "/builders/number={number}/offset={offset}",
    method = RequestMethod.GET, headers = {"content-type=application/json"})
  public Iterable<BuildInfo> getBuildInfo(@PathVariable int number, @PathVariable int offset) {
    return dataRepository.getLastRevisionEntries(number, offset);
  }

}
@@ -542,82 +542,763 @@
 %0A%0A  
-private static DataRepository dataRepository = new Datas
+/**%0A   * Provides access to information in the storage.%0A   */%0A  private final DataRepository DATA_REPOSITORY = new DatastoreRepository();%0A%0A  /**%0A   * Handles GET requests from the frontend part of the application.%0A   * Gets information from the database via %7B@code DATA_REPOSITORY%7D.%0A   * @param number the number of database entries 
 to
+ 
 re
-Repository();%0A
+trieve.%0A   * @param offset the offset from the latest database entry, for which to consider%0A   *               the requested number of entries.%0A   * @return list of a list containing at most %7B@code number%7D entries starting from the latest%0A   * entry - %7B@code offset%7D. If the database has not enough entries for the requested %7B@code offset%7D%0A   * and %7B@code number%7D, returns all available entries from that range.%0A   */
 %0A  @
@@ -1553,22 +1553,23 @@
 urn 
-dataRepository
+DATA_REPOSITORY
 .get

add javadocs