Package kth.soffgrupp.se
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.ErrorDispatchHandlerNested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainerNested 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.GHRepositorygit_repo(package private) io.jsondb.JsonDBTemplatejsonDBTemplateFields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPINGFields 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 voidhandle(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 voidhandleGet(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 voidhandlePost(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 voidmain(String[] args)This function starts the CI serverMethods inherited from class org.eclipse.jetty.server.handler.AbstractHandler
destroy, doError, doStart, doStop, getServer, setServerMethods 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, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListenersMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dumpSelfMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpableMethods 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.ServletExceptionThis function handles a POST request. This is run when there is an incoming webhook from GitHub.- Throws:
IOExceptionjavax.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.ServletExceptionThis function handles a GET request. If the site is requested in a browser it is served using this function.- Throws:
IOExceptionjavax.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.ServletExceptionThis 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:
handlein interfaceorg.eclipse.jetty.server.Handler- Specified by:
handlein classorg.eclipse.jetty.server.handler.AbstractHandler- Throws:
IOExceptionjavax.servlet.ServletException
-
main
This function starts the CI server- Throws:
Exception
-