package kz.cafe.client;

import javax.servlet.http.*;



public class ServiceRequestModel{

   public final String remoteAddress;
   public final String remoteIP;
   public final String URL;





   public ServiceRequestModel(String remoteAddress, String remoteIP, String URL){
      this.remoteAddress = remoteAddress;
      this.remoteIP = remoteIP;
      this.URL = URL;
   }





   public static final ServiceRequestModel buildUpponServlet(HttpServletRequest hsr){
      ServiceRequestModel srm =
         new ServiceRequestModel(hsr.getRemoteHost() + ":" + hsr.getRemotePort() + "\n"
                                 + hsr.getRequestURL(),
                                 hsr.getRemoteAddr(),
                                 hsr.getRequestURL().toString());

      return srm;
   }
}
