IntegrationManagerPDImpl.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */

  20. package org.openspcoop2.pdd.services.skeleton;

  21. import javax.servlet.http.HttpServletRequest;
  22. import javax.servlet.http.HttpServletResponse;

  23. /**
  24.  * IntegrationManager service
  25.  *
  26.  *
  27.  * @author Tronci Fabio (tronci@link.it)
  28.  * @author Nardi Lorenzo (nardi@link.it)
  29.  * @author $Author$
  30.  * @version $Rev$, $Date$
  31.  */

  32. @javax.jws.WebService(name = "IntegrationManager",
  33.         serviceName = "PDService",
  34.         portName = "PD",
  35.         targetNamespace = "http://services.pdd.openspcoop2.org",
  36.         endpointInterface = "org.openspcoop2.pdd.services.skeleton.IntegrationManagerPDInterface")
  37. public class IntegrationManagerPDImpl extends IntegrationManager{

  38.     @javax.annotation.Resource
  39.     javax.xml.ws.WebServiceContext wsc;

  40.    
  41.     @Override
  42.     @javax.jws.WebMethod
  43.     protected HttpServletRequest getHttpServletRequest() throws IntegrationManagerException{
  44.        
  45.         javax.servlet.http.HttpServletRequest req =  null;
  46.        
  47.         javax.xml.ws.handler.MessageContext msgContext = this.wsc.getMessageContext();

  48.         req =
  49.             (javax.servlet.http.HttpServletRequest) msgContext.get(javax.xml.ws.handler.MessageContext.SERVLET_REQUEST);
  50.        
  51.        
  52.         // Il path info e' nella forma /govway/protocol/IntegrationManager
  53.         String pathinfo = (String) msgContext.get(javax.xml.ws.handler.MessageContext.PATH_INFO);
  54.        
  55.         IntegrationManagerUtility.readAndSetProtocol(req, pathinfo);
  56.        
  57.         return req;
  58.     }

  59.     @Override
  60.     protected HttpServletResponse getHttpServletResponse()
  61.             throws IntegrationManagerException {
  62.        
  63.         javax.servlet.http.HttpServletResponse res =  null;
  64.        
  65.         javax.xml.ws.handler.MessageContext msgContext = this.wsc.getMessageContext();

  66.         res =
  67.             (javax.servlet.http.HttpServletResponse) msgContext.get(javax.xml.ws.handler.MessageContext.SERVLET_RESPONSE);
  68.        
  69.         return res;
  70.     }
  71.    
  72.    
  73. }