View Javadoc

1   /*
2    * Copyright 2009-2010 Capgemini
3    * Licensed under the Apache License, Version 2.0 (the "License"); 
4    * you may not use this file except in compliance with the License. 
5    * You may obtain a copy of the License at 
6    * 
7    * http://www.apache.org/licenses/LICENSE-2.0 
8    * 
9    * Unless required by applicable law or agreed to in writing, software 
10   * distributed under the License is distributed on an "AS IS" BASIS, 
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
12   * See the License for the specific language governing permissions and 
13   * limitations under the License. 
14   * 
15   */
16  package net.sourceforge.statelessfilter.filter;
17  
18  import java.util.Map;
19  
20  /**
21   * Interface for a generic Stateless filter plugin.
22   * 
23   * @author Nicolas Richeton
24   * 
25   */
26  public interface IPlugin {
27  
28  	String TYPE_BACKEND = "backend"; //$NON-NLS-1$
29  	String TYPE_REQUEST_PROCESSOR = "processor"; //$NON-NLS-1$
30  
31  	/**
32  	 * Destroy the backend. Used to perform some cleanup if necessary.
33  	 */
34  	void destroy();
35  
36  	/**
37  	 * Get backend id.
38  	 * 
39  	 * @return
40  	 */
41  	String getId();
42  
43  	/**
44  	 * Initialize the backend using the specified configuration.
45  	 * 
46  	 * Configuration can be set in /stateless.properties, using
47  	 * backendid.keyname=value.
48  	 * 
49  	 * @param config
50  	 */
51  	void init(Map<String, String> config) throws Exception;
52  
53  	/**
54  	 * Does this backend requires to buffer html. Mandatory for cookie-based
55  	 * backends.
56  	 * 
57  	 * @return
58  	 */
59  	String isBufferingRequired();
60  }