org.norther.tammi.spray.terminal.chain
Interface TerminalExtension

All Superinterfaces:
Extension
All Known Implementing Classes:
TerminalRequest.TerminalRequestExtension

public interface TerminalExtension
extends Extension

An interface to a terminal specific extension of a servlet request. It is saved as a request attribute using its class name.

Author:
Ilkka Priha

Field Summary
static String KEY
          The extension key.
 
Method Summary
 String getContentType()
          Gets the preferred MIME type of the terminal.
 String getContentTypeVariant()
          Gets the content type variant of the terminal.
 String getDefaultExtension()
          Gets the default file extension of the MIME type of the terminal.
 String getMobileStationIsdn()
          Gets the MSISDN (phone number) of the terminal.
 String getTerminalId()
          Gets the terminal id.
 Locale getTerminalLocale()
          Gets the current locale with the terminal specific variants.
 Locale getTerminalLocale(Locale locale)
          Gets the specified locale with the terminal specific variants.
 String getUserAgentVariant()
          Gets the user agent variant of the terminal.
 void setContentTypeVariant(String variant)
          Sets the content type variant of the terminal.
 void setUserAgentVariant(String variant)
          Sets the user agent variant of the terminal.
 

Field Detail

KEY

static final String KEY
The extension key.

Method Detail

getTerminalId

String getTerminalId()
Gets the terminal id. The id is terminal specific and not always unique.

Returns:
a terminal specific id.

getMobileStationIsdn

String getMobileStationIsdn()
Gets the MSISDN (phone number) of the terminal.

Returns:
the MSISDN or null if not supported.

getContentType

String getContentType()
Gets the preferred MIME type of the terminal.

Returns:
the MIME type of the terminal.

getDefaultExtension

String getDefaultExtension()
Gets the default file extension of the MIME type of the terminal.

Returns:
the file extension (html, wml, txt, ...).

getUserAgentVariant

String getUserAgentVariant()
Gets the user agent variant of the terminal.

Returns:
the user agent variant or an empty string.

setUserAgentVariant

void setUserAgentVariant(String variant)
Sets the user agent variant of the terminal. The variant is associated to the locale of the response when resolving terminal specific resources.

The variant is a token matching request specific user agent information unless explicitly specified.

Parameters:
variant - the user agent variant.

getContentTypeVariant

String getContentTypeVariant()
Gets the content type variant of the terminal.

Returns:
the content type variant.

setContentTypeVariant

void setContentTypeVariant(String variant)
Sets the content type variant of the terminal. The variant is associated to the locale of the response when resolving content specific resources.

The variant is a token matching the subtype of the MIME type of the terminal unless explicitly specified.

Parameters:
variant - the content type variant (HTML, WML, SMS, ...).

getTerminalLocale

Locale getTerminalLocale()
Gets the current locale with the terminal specific variants.

Returns:
the terminal specific locale or null.

getTerminalLocale

Locale getTerminalLocale(Locale locale)
Gets the specified locale with the terminal specific variants.

Parameters:
locale - the locale to adjust.
Returns:
the terminal specific locale.


Copyright © 2004 The Norther Organization. All rights reserved.