add flag for a node on the same machine as jSite
[jSite2.git] / src / net / pterodactylus / jsite / core / Node.java
1 /*
2  * jSite2 - Node.java -
3  * Copyright © 2008 David Roden
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program 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
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19
20 package net.pterodactylus.jsite.core;
21
22 /**
23  * Container for a Freenet node.
24  * 
25  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
26  * @version $Id$
27  */
28 public class Node {
29
30         /** The name of the node. */
31         private String name;
32
33         /** The hostname of the node. */
34         private String hostname;
35
36         /** The port number of the node. */
37         private int port;
38
39         /** Whether the node is running on the same machine as jSite. */
40         private boolean sameMachine;
41
42         /**
43          * Returns the user-given name of the node.
44          * 
45          * @return The name of the node
46          */
47         public String getName() {
48                 return name;
49         }
50
51         /**
52          * Sets the user-given name of the node.
53          * 
54          * @param name
55          *            The name of the node
56          */
57         public void setName(String name) {
58                 this.name = name;
59         }
60
61         /**
62          * Returns the hostname of the node.
63          * 
64          * @return The hostname of the node
65          */
66         public String getHostname() {
67                 return hostname;
68         }
69
70         /**
71          * Sets the hostname of the node.
72          * 
73          * @param hostname
74          *            The hostname of the node
75          */
76         public void setHostname(String hostname) {
77                 this.hostname = hostname;
78         }
79
80         /**
81          * Returns the port number of the node.
82          * 
83          * @return The port number of the node
84          */
85         public int getPort() {
86                 return port;
87         }
88
89         /**
90          * Sets the port number of the node.
91          * 
92          * @param port
93          *            The port number of the node
94          */
95         public void setPort(int port) {
96                 this.port = port;
97         }
98
99         /**
100          * Returns whether this node is running on the same machine as jSite.
101          * 
102          * @return the sameMachine <code>true</code> if, and only if, the node is
103          *         running on the same machine as jSite
104          */
105         boolean isSameMachine() {
106                 return sameMachine;
107         }
108
109         /**
110          * Sets whether this node is running on the same machine as jSite.
111          * 
112          * @param sameMachine
113          *            <code>true</code> if the node is running on the same machine
114          *            as jSite, <code>false</code> otherwise
115          */
116         void setSameMachine(boolean sameMachine) {
117                 this.sameMachine = sameMachine;
118         }
119
120 }