org.norther.tammi.spray.terminal.chain
Class TerminalRequest.TerminalRequestExtension

java.lang.Object
  extended by org.norther.tammi.spray.filter.chain.AbstractExtension
      extended by org.norther.tammi.spray.terminal.chain.TerminalRequest.TerminalRequestExtension
All Implemented Interfaces:
Serializable, EventListener, Extension, ServletRequestBindingListener, TerminalExtension
Enclosing class:
TerminalRequest

protected static class TerminalRequest.TerminalRequestExtension
extends AbstractExtension
implements TerminalExtension

The terminal extension class.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.norther.tammi.spray.terminal.chain.TerminalExtension
KEY
 
Constructor Summary
TerminalRequest.TerminalRequestExtension()
          Constructs a new extension.
 
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 from the HTTP request headers.
 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.
 void valueUnbound(ServletRequestBindingEvent event)
          Notifies the object that it is being unbound from a request.
 
Methods inherited from class org.norther.tammi.spray.filter.chain.AbstractExtension
getFilterChain, getFilteredRequest, getFilteredResponse, isBound, valueBound
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TerminalRequest.TerminalRequestExtension

public TerminalRequest.TerminalRequestExtension()
Constructs a new extension.

Method Detail

getTerminalId

public String getTerminalId()
Gets the terminal id from the HTTP request headers. The goal is to return as unique terminal specific id as possible. Also, if MSISDN is available it is preferred to other unique ids. If the MSISDN has to be encrypted before storage etc, it has to be done outside this method.

In WML, different gateways put the terminal id information in different places. See e.g.:

Phone.com's identification. There is a variety of ways to identify the handset, e.g.:

The unique id that is sent via the x-uplink-subno header is unrelated to the original method of identification. The id may be e.g. "959911264-777_wapd.mobilenet.telstra.net". The right half of the string (separated e.g. by underscore) is the DNS name of the gateway host. The left half is sometimes phone number.

IP addresses in identification: E.g. x-network-info and x-up-subno may contain or be based on IP address. The IP address environment in often dynamic. In this case the addresses can't much be relied on. The address may change between different connection from the same terminal.

MSISDN in identification: MSISDN is sensitive information and is often not passed out of the operator's domain.

Specified by:
getTerminalId in interface TerminalExtension
Returns:
the terminal id.

getMobileStationIsdn

public String getMobileStationIsdn()
Description copied from interface: TerminalExtension
Gets the MSISDN (phone number) of the terminal.

Specified by:
getMobileStationIsdn in interface TerminalExtension
Returns:
the MSISDN or null if not supported.

getContentType

public String getContentType()
Description copied from interface: TerminalExtension
Gets the preferred MIME type of the terminal.

Specified by:
getContentType in interface TerminalExtension
Returns:
the MIME type of the terminal.

getDefaultExtension

public String getDefaultExtension()
Description copied from interface: TerminalExtension
Gets the default file extension of the MIME type of the terminal.

Specified by:
getDefaultExtension in interface TerminalExtension
Returns:
the file extension (html, wml, txt, ...).

getUserAgentVariant

public String getUserAgentVariant()
Description copied from interface: TerminalExtension
Gets the user agent variant of the terminal.

Specified by:
getUserAgentVariant in interface TerminalExtension
Returns:
the user agent variant or an empty string.

setUserAgentVariant

public void setUserAgentVariant(String variant)
Description copied from interface: TerminalExtension
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.

Specified by:
setUserAgentVariant in interface TerminalExtension
Parameters:
variant - the user agent variant.

getContentTypeVariant

public String getContentTypeVariant()
Description copied from interface: TerminalExtension
Gets the content type variant of the terminal.

Specified by:
getContentTypeVariant in interface TerminalExtension
Returns:
the content type variant.

setContentTypeVariant

public void setContentTypeVariant(String variant)
Description copied from interface: TerminalExtension
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.

Specified by:
setContentTypeVariant in interface TerminalExtension
Parameters:
variant - the content type variant (HTML, WML, SMS, ...).

getTerminalLocale

public Locale getTerminalLocale()
Description copied from interface: TerminalExtension
Gets the current locale with the terminal specific variants.

Specified by:
getTerminalLocale in interface TerminalExtension
Returns:
the terminal specific locale or null.

getTerminalLocale

public Locale getTerminalLocale(Locale locale)
Description copied from interface: TerminalExtension
Gets the specified locale with the terminal specific variants.

Specified by:
getTerminalLocale in interface TerminalExtension
Parameters:
locale - the locale to adjust.
Returns:
the terminal specific locale.

valueUnbound

public void valueUnbound(ServletRequestBindingEvent event)
Description copied from interface: ServletRequestBindingListener
Notifies the object that it is being unbound from a request.

Specified by:
valueUnbound in interface ServletRequestBindingListener
Overrides:
valueUnbound in class AbstractExtension
Parameters:
event - the binding event.


Copyright © 2004 The Norther Organization. All rights reserved.