|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.data.ClientInfo
public final class ClientInfo
Client specific data related to a call.
Constructor Summary | |
---|---|
ClientInfo()
Constructor. |
Method Summary | |
---|---|
List<Preference<CharacterSet>> |
getAcceptedCharacterSets()
Returns the character set preferences. |
List<Preference<Encoding>> |
getAcceptedEncodings()
Returns the encoding preferences. |
List<Preference<Language>> |
getAcceptedLanguages()
Returns the language preferences. |
List<Preference<MediaType>> |
getAcceptedMediaTypes()
Returns the media type preferences. |
String |
getAddress()
Returns the client's IP address. |
List<String> |
getAddresses()
Returns the 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). |
String |
getAgent()
Returns the agent name (ex: "Noelios Restlet Engine/1.0"). |
int |
getPort()
Returns the port number which sent the call. |
Variant |
getPreferredVariant(List<Variant> variants,
Language defaultLanguage)
Returns the best variant for a given resource according the the client preferences: accepted languages, accepted character sets, accepted media types and accepted encodings. A default language is provided in case the variants don't match the client preferences. |
Variant |
getPreferredVariant(Resource resource,
Language defaultLanguage)
Returns the best variant for a given resource according the the client preferences. A default language is provided in case the resource's variants don't match the client preferences. |
void |
setAddress(String address)
Sets the client's IP address. |
void |
setAgent(String agent)
Sets the agent name (ex: "Noelios Restlet Engine/1.0"). |
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 |
---|
public ClientInfo()
Method Detail |
---|
public List<Preference<CharacterSet>> getAcceptedCharacterSets()
public List<Preference<Encoding>> getAcceptedEncodings()
public List<Preference<Language>> getAcceptedLanguages()
public List<Preference<MediaType>> getAcceptedMediaTypes()
public String getAddress()
public List<String> getAddresses()
public String getAgent()
public int getPort()
public Variant getPreferredVariant(List<Variant> variants, Language defaultLanguage)
variants
- The list of variants to compare.defaultLanguage
- The default language.
public Variant getPreferredVariant(Resource resource, Language defaultLanguage)
resource
- The resource for which the best representation needs to be
set.defaultLanguage
- The default language.
public void setAddress(String address)
address
- The client's IP address.public void setAgent(String agent)
agent
- The agent name.public void setPort(int port)
port
- The port number which sent the call.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |