org.restlet.gwt.data
Class ClientInfo

java.lang.Object
  extended by org.restlet.gwt.data.ClientInfo

public final class ClientInfo
extends java.lang.Object

Client specific data related to a call.

Author:
Jerome Louvel

Constructor Summary
ClientInfo()
          Constructor.
 
Method Summary
 java.util.List<Preference<CharacterSet>> getAcceptedCharacterSets()
          Returns the modifiable list of character set preferences.
 java.util.List<Preference<Encoding>> getAcceptedEncodings()
          Returns the modifiable list of encoding preferences.
 java.util.List<Preference<Language>> getAcceptedLanguages()
          Returns the modifiable list of language preferences.
 java.util.List<Preference<MediaType>> getAcceptedMediaTypes()
          Returns the modifiable list of media type preferences.
 java.lang.String getAddress()
          Returns the client's IP address which is the first address in the list of client addresses, if this list exists and isn't empty.
 java.util.List<java.lang.String> getAddresses()
          Returns the modifiable list of client IP addresses.

The first address is the one of the immediate client component as returned by the getClientAdress() method and the last address should correspond to the origin client (frequently a user agent).

This is useful when the user agent is separated from the origin server by a chain of intermediary components.
 java.lang.String getAgent()
          Returns the agent name (ex: "Noelios-Restlet-Engine/1.1").
 java.util.List<Product> getAgentProducts()
          Returns the list of product tokens from the user agent name.
 int getPort()
          Returns the port number which sent the call.
 void setAcceptedCharacterSets(java.util.List<Preference<CharacterSet>> acceptedCharacterSets)
          Sets the character set preferences.
 void setAcceptedEncodings(java.util.List<Preference<Encoding>> acceptedEncodings)
          Sets the encoding preferences.
 void setAcceptedLanguages(java.util.List<Preference<Language>> acceptedLanguages)
          Sets the language preferences.
 void setAcceptedMediaTypes(java.util.List<Preference<MediaType>> acceptedMediaTypes)
          Sets the media type preferences.
 void setAddress(java.lang.String address)
          Sets the client's IP address.
 void setAddresses(java.util.List<java.lang.String> addresses)
          Sets the list of client IP addresses.
 void setAgent(java.lang.String agent)
          Sets the agent name (ex: "Noelios Restlet Engine/1.1").
 void setPort(int port)
          Sets the port number which sent the call.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientInfo

public ClientInfo()
Constructor.

Method Detail

getAcceptedCharacterSets

public java.util.List<Preference<CharacterSet>> getAcceptedCharacterSets()
Returns the modifiable list of character set preferences. Creates a new instance if no one has been set.

Returns:
The character set preferences.

getAcceptedEncodings

public java.util.List<Preference<Encoding>> getAcceptedEncodings()
Returns the modifiable list of encoding preferences. Creates a new instance if no one has been set.

Returns:
The encoding preferences.

getAcceptedLanguages

public java.util.List<Preference<Language>> getAcceptedLanguages()
Returns the modifiable list of language preferences. Creates a new instance if no one has been set.

Returns:
The language preferences.

getAcceptedMediaTypes

public java.util.List<Preference<MediaType>> getAcceptedMediaTypes()
Returns the modifiable list of media type preferences. Creates a new instance if no one has been set.

Returns:
The media type preferences.

getAddress

public java.lang.String getAddress()
Returns the client's IP address which is the first address in the list of client addresses, if this list exists and isn't empty.

Returns:
The client's IP address.

getAddresses

public java.util.List<java.lang.String> getAddresses()
Returns the modifiable list of client IP addresses.

The first address is the one of the immediate client component as returned by the getClientAdress() method and the last address should correspond to the origin client (frequently a user agent).

This is useful when the user agent is separated from the origin server by a chain of intermediary components. Creates a new instance if no one has been set.

Returns:
The client IP addresses.

getAgent

public java.lang.String getAgent()
Returns the agent name (ex: "Noelios-Restlet-Engine/1.1").

Returns:
The agent name.

getAgentProducts

public java.util.List<Product> getAgentProducts()
Returns the list of product tokens from the user agent name.

Returns:
The list of product tokens from the user agent name.

getPort

public int getPort()
Returns the port number which sent the call. If no port is specified, -1 is returned.

Returns:
The port number which sent the call.

setAcceptedCharacterSets

public void setAcceptedCharacterSets(java.util.List<Preference<CharacterSet>> acceptedCharacterSets)
Sets the character set preferences.

Parameters:
acceptedCharacterSets - The character set preferences.

setAcceptedEncodings

public void setAcceptedEncodings(java.util.List<Preference<Encoding>> acceptedEncodings)
Sets the encoding preferences.

Parameters:
acceptedEncodings - The encoding preferences.

setAcceptedLanguages

public void setAcceptedLanguages(java.util.List<Preference<Language>> acceptedLanguages)
Sets the language preferences.

Parameters:
acceptedLanguages - The language preferences.

setAcceptedMediaTypes

public void setAcceptedMediaTypes(java.util.List<Preference<MediaType>> acceptedMediaTypes)
Sets the media type preferences.

Parameters:
acceptedMediaTypes - The media type preferences.

setAddress

public void setAddress(java.lang.String address)
Sets the client's IP address.

Parameters:
address - The client's IP address.

setAddresses

public void setAddresses(java.util.List<java.lang.String> addresses)
Sets the list of client IP addresses.

Parameters:
addresses - The list of client IP addresses.

setAgent

public void setAgent(java.lang.String agent)
Sets the agent name (ex: "Noelios Restlet Engine/1.1").

Parameters:
agent - The agent name.

setPort

public void setPort(int port)
Sets the port number which sent the call.

Parameters:
port - The port number which sent the call.


Copyright © 2005-2008 Noelios Technologies.