/** * Extract the desired request property, and pass it (along with the * specified request and response objects) to the protected * <code>process()</code> method to perform the actual filtering. * This method must be implemented by a concrete subclass. * * @param request The servlet request to be processed * @param response The servlet response to be created * * @exception IOException if an input/output error occurs * @exception ServletException if a servlet error occurs */ @Override public void invoke(Request request, Response response) throws IOException, ServletException { process(request.getRequest().getRemoteHost(), request, response); }
/** * Create a new Remote Host Filter Valve. * * @param parent MBean Name of the associated parent component * * @exception Exception if an MBean cannot be created or registered */ public String createRemoteHostValve(String parent) throws Exception { // Create a new RemoteHostValve instance RemoteHostValve valve = new RemoteHostValve(); // Add the new instance to its parent component ObjectName pname = new ObjectName(parent); ContainerBase containerBase = getParentContainerFromParent(pname); containerBase.addValve(valve); ObjectName oname = valve.getObjectName(); return (oname.toString()); }
@Override public void invoke(Request request, Response response) throws IOException, ServletException { String property; if (getAddConnectorPort()) { property = request.getRequest().getRemoteHost() + ";" + request.getConnector().getPortWithOffset(); } else { property = request.getRequest().getRemoteHost(); } process(property, request, response); }
void configureRemoteHostFilterValve(String allow, String deny) { RemoteHostValve remoteHostValve = null; if (allow != null || deny != null) { remoteHostValve = new RemoteHostValve(); } if (allow != null) { if (_logger.isLoggable(Level.FINE)) { _logger.fine("Allowing access to " + getID() + " from " + allow); } remoteHostValve.setAllow(allow); } if (deny != null) { if (_logger.isLoggable(Level.FINE)) { _logger.fine("Denying access to " + getID() + " from " + deny); } remoteHostValve.setDeny(deny); } if (remoteHostValve != null) { // Remove existing RemoteHostValve (if any), in case of a reconfig GlassFishValve[] valves = getValves(); for (int i=0; valves!=null && i<valves.length; i++) { if (valves[i] instanceof RemoteHostValve) { removeValve(valves[i]); break; } } addValve((GlassFishValve) remoteHostValve); } }
/** * Extract the desired request property, and pass it (along with the * specified request and response objects) to the protected * <code>process()</code> method to perform the actual filtering. * This method must be implemented by a concrete subclass. * * @param request The servlet request to be processed * @param response The servlet response to be created * * @exception IOException if an input/output error occurs * @exception ServletException if a servlet error occurs */ public void invoke(Request request, Response response) throws IOException, ServletException { process(request.getRequest().getRemoteHost(), request, response); }
/** * Create a new Remote Host Filter Valve. * * @param parent MBean Name of the associated parent component * * @exception Exception if an MBean cannot be created or registered */ public String createRemoteHostValve(String parent) throws Exception { // Create a new RemoteHostValve instance RemoteHostValve valve = new RemoteHostValve(); // Add the new instance to its parent component ObjectName pname = new ObjectName(parent); ContainerBase containerBase = getParentContainerFromParent(pname); containerBase.getPipeline().addValve(valve); ObjectName oname = valve.getObjectName(); return (oname.toString()); }
@Override public void invoke(Request request, Response response) throws IOException, ServletException { String property; if (getAddConnectorPort()) { property = request.getRequest().getRemoteHost() + ";" + request.getConnector().getPort(); } else { property = request.getRequest().getRemoteHost(); } process(property, request, response); }
/** * Extract the desired request property, and pass it (along with the * specified request and response objects) to the protected * <code>process()</code> method to perform the actual filtering. * This method must be implemented by a concrete subclass. * * @param request The servlet request to be processed * @param response The servlet response to be created * * @exception IOException if an input/output error occurs * @exception ServletException if a servlet error occurs */ public void invoke(Request request, Response response) throws IOException, ServletException { process(request.getRequest().getRemoteHost(), request, response); }
/** * Create a new Remote Host Filter Valve. * * @param parent MBean Name of the associated parent component * * @exception Exception if an MBean cannot be created or registered */ public String createRemoteHostValve(String parent) throws Exception { // Create a new RemoteHostValve instance RemoteHostValve valve = new RemoteHostValve(); // Add the new instance to its parent component ObjectName pname = new ObjectName(parent); ContainerBase containerBase = getParentContainerFromParent(pname); containerBase.getPipeline().addValve(valve); ObjectName oname = valve.getObjectName(); return (oname.toString()); }
/** * Extract the desired request property, and pass it (along with the * specified request and response objects) to the protected * <code>process()</code> method to perform the actual filtering. * This method must be implemented by a concrete subclass. * * @param request The servlet request to be processed * @param response The servlet response to be created * * @exception IOException if an input/output error occurs * @exception ServletException if a servlet error occurs */ public void invoke(Request request, Response response) throws IOException, ServletException { process(request.getRequest().getRemoteHost(), request, response); }
/** * Create a new Remote Host Filter Valve. * * @param parent MBean Name of the associated parent component * * @exception Exception if an MBean cannot be created or registered */ public String createRemoteHostValve(String parent) throws Exception { // Create a new RemoteHostValve instance RemoteHostValve valve = new RemoteHostValve(); // Add the new instance to its parent component ObjectName pname = new ObjectName(parent); ContainerBase containerBase = getParentContainerFromParent(pname); containerBase.getPipeline().addValve(valve); ObjectName oname = valve.getObjectName(); return (oname.toString()); }
/** * Extract the desired request property, and pass it (along with the * specified request and response objects) to the protected * <code>process()</code> method to perform the actual filtering. * This method must be implemented by a concrete subclass. * * @param request The servlet request to be processed * @param response The servlet response to be created * * @exception IOException if an input/output error occurs * @exception ServletException if a servlet error occurs */ @Override public void invoke(Request request, Response response) throws IOException, ServletException { process(request.getRequest().getRemoteHost(), request, response); }
/** * Create a new Remote Host Filter Valve. * * @param parent MBean Name of the associated parent component * * @exception Exception if an MBean cannot be created or registered * * @deprecated Will be removed in Tomcat 8.0.x. Replaced by {@link * #createValve(String, String)}. */ @Deprecated public String createRemoteHostValve(String parent) throws Exception { // Create a new RemoteHostValve instance RemoteHostValve valve = new RemoteHostValve(); // Add the new instance to its parent component ObjectName pname = new ObjectName(parent); ContainerBase containerBase = getParentContainerFromParent(pname); containerBase.getPipeline().addValve(valve); ObjectName oname = valve.getObjectName(); return (oname.toString()); }
/** * Extract the desired request property, and pass it (along with the * specified request and response objects) to the protected * <code>process()</code> method to perform the actual filtering. * This method must be implemented by a concrete subclass. * * @param request The servlet request to be processed * @param response The servlet response to be created * * @exception IOException if an input/output error occurs * @exception ServletException if a servlet error occurs */ @Override public void invoke(Request request, Response response) throws IOException, ServletException { process(request.getRequest().getRemoteHost(), request, response); } }
/** * Create a new Remote Host Filter Valve. * * @param parent MBean Name of the associated parent component * * @exception Exception if an MBean cannot be created or registered * * @deprecated Will be removed in Tomcat 8.0.x. Replaced by {@link * #createValve(String, String)}. */ @Deprecated public String createRemoteHostValve(String parent) throws Exception { // Create a new RemoteHostValve instance RemoteHostValve valve = new RemoteHostValve(); // Add the new instance to its parent component ObjectName pname = new ObjectName(parent); ContainerBase containerBase = getParentContainerFromParent(pname); containerBase.getPipeline().addValve(valve); ObjectName oname = valve.getObjectName(); return (oname.toString()); }
/** * Extract the desired request property, and pass it (along with the * specified request and response objects) to the protected * <code>process()</code> method to perform the actual filtering. * This method must be implemented by a concrete subclass. * * @param request The servlet request to be processed * @param response The servlet response to be created * * @exception IOException if an input/output error occurs * @exception ServletException if a servlet error occurs */ @Override public void invoke(Request request, Response response) throws IOException, ServletException { process(request.getRequest().getRemoteHost(), request, response); }
/** * Extract the desired request property, and pass it (along with the * specified request and response objects) to the protected * <code>process()</code> method to perform the actual filtering. * This method must be implemented by a concrete subclass. * * @param request The servlet request to be processed * @param response The servlet response to be created * * @exception IOException if an input/output error occurs * @exception ServletException if a servlet error occurs */ @Override public void invoke(Request request, Response response) throws IOException, ServletException { process(request.getRequest().getRemoteHost(), request, response); }
/** * Extract the desired request property, and pass it (along with the * specified request and response objects) to the protected * <code>process()</code> method to perform the actual filtering. * This method must be implemented by a concrete subclass. * * @param request The servlet request to be processed * @param response The servlet response to be created * * @exception IOException if an input/output error occurs * @exception ServletException if a servlet error occurs */ @Override public void invoke(Request request, Response response) throws IOException, ServletException { process(request.getRequest().getRemoteHost(), request, response); }
/** * Extract the desired request property, and pass it (along with the * specified request and response objects) to the protected * <code>process()</code> method to perform the actual filtering. * This method must be implemented by a concrete subclass. * * @param request The servlet request to be processed * @param response The servlet response to be created * * @exception IOException if an input/output error occurs * @exception ServletException if a servlet error occurs */ public int invoke(Request request, Response response) throws IOException, ServletException { return process(request.getRequest().getRemoteHost(), request, response); }