Class APIServlet

java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
de.codesourcery.versiontracker.server.APIServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class APIServlet extends javax.servlet.http.HttpServlet
Servlet responsible for processing APIRequests.
Author:
tobias.gierke@code-sourcery.de
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
     
    protected void
    doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
     
    static APIRequest
    parse(String json, com.fasterxml.jackson.databind.ObjectMapper mapper)
     
    byte[]
    processRequest(byte[] requestData)
     
    byte[]
     
    processRequest(String jsonRequest)
     
    void
    service(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res)
     
    void
    setArtifactUpdatesEnabled(boolean artifactUpdatesEnabled)
     

    Methods inherited from class javax.servlet.http.HttpServlet

    doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service

    Methods inherited from class javax.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • APIServlet

      public APIServlet()
  • Method Details

    • service

      public void service(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res) throws javax.servlet.ServletException, IOException
      Specified by:
      service in interface javax.servlet.Servlet
      Overrides:
      service in class javax.servlet.http.HttpServlet
      Throws:
      javax.servlet.ServletException
      IOException
    • doGet

      protected void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws IOException
      Overrides:
      doGet in class javax.servlet.http.HttpServlet
      Throws:
      IOException
    • doPost

      protected void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws IOException
      Overrides:
      doPost in class javax.servlet.http.HttpServlet
      Throws:
      IOException
    • processRequest

      public byte[] processRequest(InputStream in, ByteArrayOutputStream reqData, IAPIClient.Protocol protocol) throws Exception
      Throws:
      Exception
    • processRequest

      public byte[] processRequest(byte[] requestData) throws Exception
      Throws:
      Exception
    • processRequest

      public String processRequest(String jsonRequest) throws Exception
      Throws:
      Exception
    • parse

      public static APIRequest parse(String json, com.fasterxml.jackson.databind.ObjectMapper mapper) throws Exception
      Throws:
      Exception
    • setArtifactUpdatesEnabled

      public void setArtifactUpdatesEnabled(boolean artifactUpdatesEnabled)