org.restlet.data

## Class ServerInfo

- java.lang.Object
- - org.restlet.data.ServerInfo

    public final class ServerInfo
    extends java.lang.Object

Server specific data related to a call.

Author:
  Jerome Louvel

### Constructor Summary

Constructors
Constructor and Description
`ServerInfo()` Constructor.

### Method Summary

Methods
`java.lang.String` `getAddress()` Returns the IP address.
`java.lang.String` `getAgent()` Returns the agent name (ex: "Restlet-Framework/2.0").
`int` `getPort()` Returns the port number which received the call.
`boolean` `isAcceptingRanges()` Return true if the server accepts range requests for a resource, with the "byte" range unit.
`boolean` `isAcceptRanges()` Deprecated. Use `isAcceptingRanges()` instead.
`void` `setAcceptingRanges(boolean acceptingRanges)` Indicates if the server accepts range requests for a resource, with the "byte" range unit.
`void` `setAcceptRanges(boolean acceptingRanges)` Deprecated. Use `setAcceptingRanges(boolean)` instead.
`void` `setAddress(java.lang.String address)` Sets the IP address which received the call.
`void` `setAgent(java.lang.String agent)` Sets the agent name (ex: "Restlet-Framework/2.0").
`void` `setPort(int port)` Sets the port number which received the call.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ServerInfo

    public ServerInfo()

Constructor.

### Method Detail

#### getAddress

    public java.lang.String getAddress()

Returns the IP address.

Returns:
  The IP address.

#### getAgent

    public java.lang.String getAgent()

Returns the agent name (ex: "Restlet-Framework/2.0"). Note that when used with HTTP connectors, this property maps to the "Server" header.

Returns:
  The agent name.

#### getPort

    public int getPort()

Returns the port number which received the call. If no port is specified, -1 is returned.

Returns:
  The port number which received the call.

#### isAcceptingRanges

    public boolean isAcceptingRanges()

Return true if the server accepts range requests for a resource, with the "byte" range unit. Note that when used with HTTP connectors, this property maps to the "Accept-Ranges" header.

Returns:
  True if the server accepts range requests for a resource.

#### isAcceptRanges

    @Deprecated
    public boolean isAcceptRanges()

Deprecated. Use `isAcceptingRanges()` instead.
Return true if the server accepts range requests for a resource, with the "byte" range unit. Note that when used with HTTP connectors, this property maps to the "Accept-Ranges" header.

Returns:
  True if the server accepts range requests for a resource.

#### setAcceptingRanges

    public void setAcceptingRanges(boolean acceptingRanges)

Indicates if the server accepts range requests for a resource, with the "byte" range unit. Note that when used with HTTP connectors, this property maps to the "Accept-Ranges" header.

Parameters:
  `acceptingRanges` - True if the server accepts range requests for a resource.

#### setAcceptRanges

    @Deprecated
    public void setAcceptRanges(boolean acceptingRanges)

Deprecated. Use `setAcceptingRanges(boolean)` instead.
Indicates if the server accepts range requests for a resource, with the "byte" range unit. Note that when used with HTTP connectors, this property maps to the "Accept-Ranges" header.

Parameters:
  `acceptingRanges` - True if the server accepts range requests for a resource.

#### setAddress

    public void setAddress(java.lang.String address)

Sets the IP address which received the call.

Parameters:
  `address` - The IP address which received the call.

#### setAgent

    public void setAgent(java.lang.String agent)

Sets the agent name (ex: "Restlet-Framework/2.0"). Note that when used with HTTP connectors, this property maps to the "Server" header.

Parameters:
  `agent` - The agent name.

#### setPort

    public void setPort(int port)

Sets the port number which received the call.

Parameters:
  `port` - The port number which received the call.