remove exceptions
[jSite2.git] / src / net / pterodactylus / util / fcp / message / ClientHello.java
1 /**
2  * © 2008 INA Service GmbH
3  */
4 package net.pterodactylus.util.fcp.message;
5
6 import net.pterodactylus.util.fcp.FcpConnection;
7 import net.pterodactylus.util.fcp.FcpMessage;
8
9 /**
10  * A “ClientHello” message that <i>must</i> be sent to the node first thing
11  * after calling {@link FcpConnection#connect()}.
12  * 
13  * @author <a href="mailto:dr@ina-germany.de">David Roden</a>
14  * @version $Id$
15  */
16 public class ClientHello extends FcpMessage {
17
18         /**
19          * Creates a new “ClientHello” message with the given client name. The
20          * client name has to be unique to the node otherwise you will get a
21          * {@link CloseConnectionDuplicateClientName} response from the node!
22          * 
23          * @param clientName
24          *            The unique client name
25          */
26         public ClientHello(String clientName) {
27                 this(clientName, "2.0");
28         }
29
30         /**
31          * Creates a new “ClientHello” message with the given client name. The
32          * client name has to be unique to the node otherwise you will get a
33          * {@link CloseConnectionDuplicateClientName} response from the node!
34          * 
35          * The expected FCP version is currently ignored by the node.
36          * 
37          * @param clientName
38          *            The unique client name
39          * @param expectedVersion
40          *            The FCP version that the node is expected to talk
41          */
42         public ClientHello(String clientName, String expectedVersion) {
43                 super("ClientHello");
44                 setField("Name", clientName);
45                 setField("ExpectedVersion", expectedVersion);
46         }
47
48 }