Class ContinuousIntegrationServer

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.server.handler.AbstractHandler
kth.soffgrupp.se.ContinuousIntegrationServer
All Implemented Interfaces:
org.eclipse.jetty.server.Handler, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.LifeCycle

public class ContinuousIntegrationServer
extends org.eclipse.jetty.server.handler.AbstractHandler
This class is a Continuos Integration Server that is set up to handle webhooks and run compilation and tests while serving results on a web interface.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.AbstractHandler

    org.eclipse.jetty.server.handler.AbstractHandler.ErrorDispatchHandler

    Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

    org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable

    org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

    org.eclipse.jetty.util.component.LifeCycle.Listener
  • Field Summary

    Fields
    Modifier and Type Field Description
    (package private) org.kohsuke.github.GHRepository git_repo  
    (package private) io.jsondb.JsonDBTemplate jsonDBTemplate  

    Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    FAILED, STARTED, STARTING, STOPPED, STOPPING

    Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

    KEY
  • Constructor Summary

    Constructors
    Constructor Description
    ContinuousIntegrationServer()
    Creates an instance of the continuos integration server
  • Method Summary

    Modifier and Type Method Description
    void handle​(String target, org.eclipse.jetty.server.Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    This function is called for all incoming requests to the server.
    private void handleGet​(String target, org.eclipse.jetty.server.Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    This function handles a GET request.
    private void handlePost​(String target, org.eclipse.jetty.server.Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    This function handles a POST request.
    static void main​(String[] args)
    This function starts the CI server

    Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler

    destroy, doError, doStart, doStop, getServer, setServer

    Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle

    addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans

    Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.eclipse.jetty.util.component.Container

    getCachedBeans, getEventListeners

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

    dumpSelf

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    isDumpable

    Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle

    addEventListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, start, stop
  • Field Details

    • git_repo

      org.kohsuke.github.GHRepository git_repo
    • jsonDBTemplate

      io.jsondb.JsonDBTemplate jsonDBTemplate
  • Constructor Details

    • ContinuousIntegrationServer

      public ContinuousIntegrationServer()
      Creates an instance of the continuos integration server
  • Method Details

    • handlePost

      private void handlePost​(String target, org.eclipse.jetty.server.Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
      This function handles a POST request. This is run when there is an incoming webhook from GitHub.
      Throws:
      IOException
      javax.servlet.ServletException
    • handleGet

      private void handleGet​(String target, org.eclipse.jetty.server.Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
      This function handles a GET request. If the site is requested in a browser it is served using this function.
      Throws:
      IOException
      javax.servlet.ServletException
    • handle

      public void handle​(String target, org.eclipse.jetty.server.Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
      This function is called for all incoming requests to the server. It handles incoming webhooks and runs the CI server, reporting back to GitHub. It also serves a web interface with information on the build status and test status of different tests.
      Specified by:
      handle in interface org.eclipse.jetty.server.Handler
      Specified by:
      handle in class org.eclipse.jetty.server.handler.AbstractHandler
      Throws:
      IOException
      javax.servlet.ServletException
    • main

      public static void main​(String[] args) throws Exception
      This function starts the CI server
      Throws:
      Exception