es.mcu.yingo.filtros
Class FiltroYingo

java.lang.Object
  extended by org.springframework.web.filter.GenericFilterBean
      extended by org.springframework.web.filter.OncePerRequestFilter
          extended by es.mcu.yingo.filtros.FiltroAbstracto
              extended by es.mcu.yingo.filtros.FiltroYingo
All Implemented Interfaces:
javax.servlet.Filter, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.web.context.ServletContextAware

public abstract class FiltroYingo
extends FiltroAbstracto

Clase albstracta que centraliza propiedades y métodos comunes a algunos filtros de la aplicación

Author:
carlos.garcia.h

Field Summary
protected  boolean cambiarSeguroToNormal
          Indica si se debe redirigir de https a http
private static java.lang.String EXPRESION_REGULAR_HTTPS
          Expresión regurlar para comprobar https por http
protected  SpringContextUtilWeb springContextUtilWeb
          Utilidad de contexto que hace uso del request
 
Fields inherited from class es.mcu.yingo.filtros.FiltroAbstracto
FILTRO_URL_VISTAERROR, logger, VISTA_ERROR, vistaError
 
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
 
Constructor Summary
FiltroYingo()
          Constructor por defecto
 
Method Summary
protected  void doFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain chain)
           
protected abstract  void filtrar(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain chain)
          Método que tienen que implementar las acciones del filtro para las clases que hereden
protected  SpringContextUtilWeb getSpringContextUtilWeb()
          Obtiene del contexto la clase de Utilidades springContextUtil
 boolean isCambiarSeguroToNormal()
          Indica si en el caso de que se esté bajo https, hay que cambiar a http
private  void reenviarHttpNoSeguro(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Reenvia a la misma URL pero cambiando a protocolo HTTP no seguro.
 void setCambiarSeguroToNormal(boolean cambiarSeguroToNormal)
          Indica si en el caso de que se esté bajo https, hay que cambiar a http
 
Methods inherited from class es.mcu.yingo.filtros.FiltroAbstracto
colocarParametroRequestVistaError, getVistaError, obtenerUrlActual, recogerError, setVistaError
 
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, getAlreadyFilteredAttributeName, shouldNotFilter
 
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setFilterConfig, setServletContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

springContextUtilWeb

protected SpringContextUtilWeb springContextUtilWeb
Utilidad de contexto que hace uso del request


EXPRESION_REGULAR_HTTPS

private static java.lang.String EXPRESION_REGULAR_HTTPS
Expresión regurlar para comprobar https por http


cambiarSeguroToNormal

protected boolean cambiarSeguroToNormal
Indica si se debe redirigir de https a http

Constructor Detail

FiltroYingo

public FiltroYingo()
Constructor por defecto

Method Detail

filtrar

protected abstract void filtrar(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response,
                                javax.servlet.FilterChain chain)
                         throws java.lang.Exception
Método que tienen que implementar las acciones del filtro para las clases que hereden

Parameters:
request -
response -
chain -
Throws:
java.lang.Exception

doFilterInternal

protected void doFilterInternal(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response,
                                javax.servlet.FilterChain chain)
                         throws javax.servlet.ServletException,
                                java.io.IOException
Specified by:
doFilterInternal in class org.springframework.web.filter.OncePerRequestFilter
Throws:
javax.servlet.ServletException
java.io.IOException

reenviarHttpNoSeguro

private void reenviarHttpNoSeguro(javax.servlet.http.HttpServletRequest request,
                                  javax.servlet.http.HttpServletResponse response)
                           throws java.io.IOException
Reenvia a la misma URL pero cambiando a protocolo HTTP no seguro. Cambia en la url:

Parameters:
request -
response -
Throws:
java.io.IOException

getSpringContextUtilWeb

protected SpringContextUtilWeb getSpringContextUtilWeb()
Obtiene del contexto la clase de Utilidades springContextUtil


isCambiarSeguroToNormal

public boolean isCambiarSeguroToNormal()
Indica si en el caso de que se esté bajo https, hay que cambiar a http

Returns:
the cambiarSeguroToNormal

setCambiarSeguroToNormal

public void setCambiarSeguroToNormal(boolean cambiarSeguroToNormal)
Indica si en el caso de que se esté bajo https, hay que cambiar a http

Parameters:
cambiarSeguroToNormal - the cambiarSeguroToNormal to set