001: /*
002: * Copyright 2005-2007 Noelios Consulting.
003: *
004: * The contents of this file are subject to the terms of the Common Development
005: * and Distribution License (the "License"). You may not use this file except in
006: * compliance with the License.
007: *
008: * You can obtain a copy of the license at
009: * http://www.opensource.org/licenses/cddl1.txt See the License for the specific
010: * language governing permissions and limitations under the License.
011: *
012: * When distributing Covered Code, include this CDDL HEADER in each file and
013: * include the License file at http://www.opensource.org/licenses/cddl1.txt If
014: * applicable, add the following below this CDDL HEADER, with the fields
015: * enclosed by brackets "[]" replaced with your own identifying information:
016: * Portions Copyright [yyyy] [name of copyright owner]
017: */
018:
019: package org.restlet.data;
020:
021: /**
022: * Server specific data related to a call.
023: *
024: * @author Jerome Louvel (contact@noelios.com)
025: */
026: public final class ServerInfo {
027: /** The IP address. */
028: private String address;
029:
030: /** The agent name. */
031: private String agent;
032:
033: /** The port number. */
034: private int port;
035:
036: /**
037: * Constructor.
038: */
039: public ServerInfo() {
040: this .address = null;
041: this .agent = null;
042: this .port = -1;
043: }
044:
045: /**
046: * Returns the IP address.
047: *
048: * @return The IP address.
049: */
050: public String getAddress() {
051: return this .address;
052: }
053:
054: /**
055: * Returns the agent name (ex: "Noelios Restlet Engine/1.0").
056: *
057: * @return The agent name.
058: */
059: public String getAgent() {
060: return this .agent;
061: }
062:
063: /**
064: * Returns the port number which received the call. If no port is specified,
065: * -1 is returned.
066: *
067: * @return The port number which received the call.
068: */
069: public int getPort() {
070: return this .port;
071: }
072:
073: /**
074: * Sets the IP address which received the call.
075: *
076: * @param address
077: * The IP address which received the call.
078: */
079: public void setAddress(String address) {
080: this .address = address;
081: }
082:
083: /**
084: * Sets the agent name (ex: "Noelios Restlet Engine/1.0").
085: *
086: * @param agent
087: * The agent name.
088: */
089: public void setAgent(String agent) {
090: this .agent = agent;
091: }
092:
093: /**
094: * Sets the port number which received the call.
095: *
096: * @param port
097: * The port number which received the call.
098: */
099: public void setPort(int port) {
100: this.port = port;
101: }
102:
103: }
|