Package com.lbslocal.api.view

Source Code of com.lbslocal.api.view.ApiCall

package com.lbslocal.api.view;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.lbslocal.api.control.ControlLog;
import com.lbslocal.api.objects.TokenValidated;
import com.lbslocal.api.proxy.Proxy;
import com.lbslocal.api.utils.Common;

/**
* Servlet implementation class ApiCall
*/
public class ApiCall extends HttpServlet {
  private static final long serialVersionUID = 1L;
      
    /**
     * @see HttpServlet#HttpServlet()
     */
    public ApiCall() {
        super();
        // TODO Auto-generated constructor stub
    }

  /**
   * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
   */
  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    TokenValidated tokenValidated;
        Proxy proxy;
        try
        {
            // Levanta os dados da chamada
            proxy = new Proxy(request);
           
            // cetifica que é chamada de log
            if (proxy.TypeCall == Proxy.ServiceLog)
            {
              tokenValidated = Common.ValidateUser(proxy);
                // Roda Log
                ControlLog.runService(proxy, tokenValidated);
            }
        }
        catch (Exception ex)
        {
            //CommonControls.CommonFunctionHelper.gravarLogErro("LBSLocalAPI.ApiCall", "ex.Message: " + ex.Message + "\r\nQueryString: " + context.Request.QueryString.ToString());
        }
//        context.Response.CacheControl = "no-cache";
//        context.Response.ContentType = "image/gif";
//        context.Response.BinaryWrite(GetBytesImage1Pixel(context.Request.PhysicalApplicationPath));
  }

}
TOP

Related Classes of com.lbslocal.api.view.ApiCall

TOP
Copyright © 2018 www.massapi.com. 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.