View Javadoc

1   /*
2    * SymmetricDS is an open source database synchronization solution.
3    *   
4    * Copyright (C) Keith Naas <knaas@users.sourceforge.net>
5    *               
6    *
7    * This library is free software; you can redistribute it and/or
8    * modify it under the terms of the GNU Lesser General Public
9    * License as published by the Free Software Foundation; either
10   * version 3 of the License, or (at your option) any later version.
11   *
12   * This library is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this library; if not, see
19   * <http://www.gnu.org/licenses/>.
20   */
21  
22  package org.jumpmind.symmetric.web;
23  
24  import javax.servlet.ServletRequest;
25  
26  /***
27   * This interface can be used by a servlet or a filter that is managed by
28   * Spring.
29   * 
30   * @since 1.4.0
31   * 
32   */
33  public interface IServletResource {
34  
35      public abstract void setDisabled(boolean disabled);
36  
37      public abstract void setUriPattern(String uriPattern);
38  
39      public abstract void setUriPatterns(String[] uriPatterns);
40  
41      public abstract void setRegexPattern(String regexPattern);
42  
43      public abstract void setRegexPatterns(String[] regexPatterns);
44  
45      public abstract boolean isDisabled();
46  
47      public abstract String[] getUriPatterns();
48  
49      public abstract String[] getRegexPatterns();
50  
51      public abstract void destroy();
52  
53      public abstract void refresh();
54  
55      /***
56       * Returns true if the request path matches the uriPattern on this filter.
57       * 
58       * @param request
59       * @return
60       */
61      public abstract boolean matches(ServletRequest request);
62  
63      /***
64       * Returns true if this is a container managed resource.
65       * 
66       * @return
67       */
68      public abstract boolean isSpringManaged();
69  
70      /***
71       * Returns the spring managed bean
72       * 
73       * @return
74       */
75      public abstract IServletResource getSpringBean();
76  
77      /***
78       * Returns true if this should be container compatible
79       * 
80       * @return
81       */
82      public boolean isContainerCompatible();
83  
84  }