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.backend;
17  
18  import java.io.Serializable;
19  import java.util.Map;
20  
21  /**
22   * Interface for the session data DTO.
23   * 
24   * @author Nicolas Richeton - Capgemini
25   * 
26   */
27  public interface ISessionData extends Serializable {
28  
29  	/**
30  	 * Returns session attributes.
31  	 * 
32  	 * @return
33  	 */
34  	Map<String, Object> getContent();
35  
36  	/**
37  	 * Returns session creation time stamp.
38  	 * 
39  	 * @return
40  	 */
41  	long getCreationTime();
42  
43  	/**
44  	 * Returns session Id.
45  	 * 
46  	 * @return
47  	 */
48  	String getId();
49  
50  	// No longer used.
51  	// /**
52  	// * Returns request Id. Note: the request Id changes between each session
53  	// and
54  	// * is used to ensure that all backends restore the same session.
55  	// *
56  	// * @return
57  	// */
58  	// long getRequestId();
59  
60  	/**
61  	 * Checks if session is valid (not invalidated / not expired).
62  	 * 
63  	 * @return
64  	 */
65  	boolean isValid();
66  }