KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > ubik > net > Request


1 package org.sapia.ubik.net;
2
3
4 /**
5  * Models a request to a server. Encapsulates the connection corresponding
6  * to the network link with the client making the request, as well as the
7  * address of the server that received the request.
8  *
9  * @author Yanick Duchesne
10  * <dl>
11  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
12  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
13  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
14  * </dl>
15  */

16 public class Request {
17   private Connection _client;
18   private ServerAddress _localHost;
19
20   /**
21    * Creates an instance of this class.
22    *
23    * @param client the <code>Connection</code> which consists of the
24    * network link with the client.
25    *
26    * @param localHost the <code>ServerAddress</code> of the server
27    * that received the request.
28    */

29   public Request(Connection client, ServerAddress localHost) {
30     _client = client;
31     _localHost = localHost;
32   }
33
34   /**
35    * Returns the address of the server that received the request.
36    *
37    * @return a <code>ServerAddress</code>.
38    */

39   public ServerAddress getServerAddress() {
40     return _localHost;
41   }
42
43   /**
44    * Returns the connection which is linking to the client that made
45    * the request.
46    *
47    * @return a <code>Connection</code> instance.
48    */

49   public Connection getConnection() {
50     return _client;
51   }
52 }
53
Popular Tags