KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonathan > apis > protocols > ip > TcpIpConnectionMgr


1 /***
2  * Jonathan: an Open Distributed Processing Environment
3  * Copyright (C) 1999 France Telecom R&D
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Release: 2.0
20  *
21  * Contact: jonathan@objectweb.org
22  *
23  * Author: Bruno Dumant
24  *
25  */

26
27
28 package org.objectweb.jonathan.apis.protocols.ip;
29
30 import org.objectweb.jonathan.apis.kernel.JonathanException;
31
32 /**
33  * This interface defines a type for Tcp/Ip connection managers.
34  */

35 public interface TcpIpConnectionMgr {
36
37    /**
38     * Returns a new client connection.
39     * <p>
40     * This method is called by a protocol.
41     * The protocol provides a session (i.e. an object
42     * representing an abstract communication channel) and expects a connection
43     * (i.e. a communication resource). The returned connection must have been
44     * built using the provided session, or be a connection associated with a
45     * session having the same destination as the provided session.
46     *
47     * @param host the host name of the distant server;
48     * @param port the port number of a server socket on that host;
49     * @param session a TcpIp session
50     * @return a connection for that session.
51     * @exception JonathanException if an error occurs.
52     */

53    IpConnection newCltConnection(String JavaDoc host, int port,IpSession session)
54       throws JonathanException;
55
56    /**
57     * Returns a new server connection factory encapsulating a server socket on the
58     * provided port. If port = 0, an anonymous server socket is opened.
59     *
60     * @param port the expected port of the server socket;
61     * @return a server connection factory.
62     * @exception JonathanException if an error occurs.
63     */

64    TcpIpSrvConnectionFactory newSrvConnectionFactory(int port)
65       throws JonathanException;
66
67    /**
68     * Returns the canonical host name of the provided host.
69     *
70     * The purpose of this method is to help checking the equality of two host
71     * names. Two names corresponding to the same host should have the same
72     * (the "sameness" being defined by the equals method on type String)
73     * canonical names.
74     *
75     * @param hostname a host name
76     * @return the corresponding canonical host name.
77     */

78    String JavaDoc getCanonicalHostName(String JavaDoc hostname);
79
80 }
81
82
83
Popular Tags