Package nl.topicus.onderwijs.dashboard.modules.topicus

Examples of nl.topicus.onderwijs.dashboard.modules.topicus.StatusPageResponse


    trains = newTrains;
  }

  private List<Train> fetchDepartures(Key location, String station) {
    try {
      StatusPageResponse response = RetrieverUtils
          .getStatuspage("http://www.ns.nl/actuele-vertrektijden/main.link?station="
              + station);
      if (response.getHttpStatusCode() != 200) {
        return null;
      }
      Source source = new Source(response.getPageContent());

      source.fullSequentialParse();

      List<Train> newTrains = new ArrayList<Train>();
      List<Element> tableRows = source.getAllElements(HTMLElementName.TR);
View Full Code Here


        Map<String, String> patterns = (Map<String, String>) hudsonSettingsForProject
            .get("matchers");

        if (!url.endsWith("/"))
          url = url + "/";
        StatusPageResponse response = RetrieverUtils.getStatuspage(url
            + "api/json");
        if (response.getHttpStatusCode() != 200) {
          return;
        }
        Hudson hudson = mapper.readValue(response.getPageContent(),
            Hudson.class);

        for (JobReference jobReference : hudson.getJobs()) {
          String name = jobReference.getName();
          for (Entry<String, String> patternEntry : patterns
View Full Code Here

    }
  }

  private void refreshData(Project project, JobReference jobReference,
      String code) throws Exception {
    StatusPageResponse response = RetrieverUtils.getStatuspage(jobReference
        .getUrl() + "api/json");
    if (response.getHttpStatusCode() != 200) {
      return;
    }
    Job job = mapper.readValue(response.getPageContent(), Job.class);
    job.setCode(code);

    List<Job> jobs = jobsCache.putIfAbsent(project, new ArrayList<Job>());
    if (jobs == null)
      jobs = jobsCache.get(project);
View Full Code Here

    }
    if (buildsCache.size() > 1000) {
      buildsCache.clear();
    }
    try {
      StatusPageResponse response = RetrieverUtils
          .getStatuspage(reference.getUrl() + "api/json");
      if (response.getHttpStatusCode() != 200) {
        return null;
      }
      Build build = mapper.readValue(response.getPageContent(),
          Build.class);
      build.setJob(job);
      if (!build.isBuilding()) {
        // don't store the build result in the cache when it's still
        // building.
View Full Code Here

        for (int i = 0; i < thedigest.length; i++) {
          sb.append(Integer.toString((thedigest[i] & 0xff) + 0x100,
              16).substring(1));
        }

        StatusPageResponse response = RetrieverUtils
            .getStatuspage(String.format("http://api.wetter.com"
                + "/forecast/weather/city/%s/project/%s/cs/%s",
                cityKey, applicationName, sb.toString()));
        DocumentBuilderFactory dbf = DocumentBuilderFactory
            .newInstance();
        DocumentBuilder db = dbf.newDocumentBuilder();
        InputSource is = new InputSource();
        is.setCharacterStream(new StringReader(response
            .getPageContent()));

        Document doc = db.parse(is);
        Element time = findTime(doc);
        WeatherReport report = new WeatherReport();
View Full Code Here

TOP

Related Classes of nl.topicus.onderwijs.dashboard.modules.topicus.StatusPageResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.