View Javadoc

1   /*
2    * $Id: Request.java 108 2004-10-17 16:08:35Z josem $
3    *
4    * Tarsis
5    * Copyright (C) 2002 Talika Open Source Group
6    *
7    * This program is free software; you can redistribute it and/or modify
8    * it under the terms of the GNU General Public License as published by
9    * the Free Software Foundation; either version 2 of the License, or
10   * (at your option) any later version.
11   *
12   * This program 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
15   * GNU General Public License for more details.
16   *
17   * You should have received a copy of the GNU General Public License
18   * along with this program; if not, write to the Free Software
19   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20   *
21   */
22  
23  package org.talika.tarsis.command;
24  
25  import java.util.Map;
26  import org.talika.tarsis.security.User;
27  
28  /**
29   * Interface that defines a client request in Tarsis MVC Framework.<br>
30   * <br>
31   * <code>Request</code> object transports all information of a request from
32   * controller servlet to the command action.<code>Request</code> is intended to
33   * decouple Tarsis commands layer from Servlet layer.<br>
34   *
35   * @author  Jose M. Palomar
36   * @version $Revision: 108 $
37   */
38  public interface Request {
39  
40      /**
41       * Returns the value of the specified parameter in request.
42       *
43       * @param name String name of parameter.
44       * @return Object value of parameter or <code>null</code> if not found.
45       */
46      Object getParameter(String name);
47  
48      /**
49       * Returns a map with all parameters in request.
50       *
51       * @return Map map with all parameters in request.
52       */
53      Map getParameters();
54  
55      /**
56       * Returns the value of the especified attribute in request.
57       *
58       * @param name String name of attribute.
59       * @return Object value of attribute or <code>null</code> if not found.
60       */
61      Object getAttribute(String name);
62  
63      /**
64       * Returns a map with all attributes in request.
65       *
66       * @return Map map with all attributes in request.
67       */
68      Map getAttributes();
69  
70      /**
71       * Returns the session associated with request.
72       *
73       * @return Session session associated with request.
74       */
75      Session getSession();
76  
77      /**
78       * Returns de user who made the request.
79       *
80       * @return User user who made the request.
81       */
82      User getRemoteUser();
83  
84  }