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 being static to safely save in sessions.

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 getDefaultCharactedEncoding()
          Gets the default character extension of the MIME type 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.
 MimeType getPreferredContentType()
          Gets the preferred MIME type of the terminal.
 Profile getProfile()
          Gets the profile.
 String getTerminalId()
          Gets the terminal id from the HTTP request headers.
 Locale getTerminalLocale()
          Gets the current locale with terminal specific variants.
 Locale getTerminalLocale(Locale locale)
          Gets the specified locale with terminal specific variants.
 String getUserAgentVariant()
          Gets the user agent variant.
protected  void setSuggestedContentType(MimeType mime)
          Sets the suggested MIME type of the terminal.
 void setTerminalLocale(Locale locale)
          Sets the current locale with terminal specific variants.
 void valueBound(ServletRequestBindingEvent event)
          Notifies the object that it is being bound to a request.
 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
 
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

getProfile

public Profile getProfile()
Description copied from interface: TerminalExtension
Gets the profile.

Specified by:
getProfile in interface TerminalExtension
Returns:
the profile.

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.

getPreferredContentType

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

Specified by:
getPreferredContentType in interface TerminalExtension
Returns:
the read-only MIME type of the terminal.

getDefaultCharactedEncoding

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

Specified by:
getDefaultCharactedEncoding in interface TerminalExtension
Returns:
the character encoding or null.

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.

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

getTerminalLocale

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

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

setTerminalLocale

public void setTerminalLocale(Locale locale)
Description copied from interface: TerminalExtension
Sets the current locale with terminal specific variants.

Specified by:
setTerminalLocale in interface TerminalExtension
Parameters:
locale - the terminal specific locale.

getTerminalLocale

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

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

valueBound

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

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

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.

setSuggestedContentType

protected void setSuggestedContentType(MimeType mime)
Sets the suggested MIME type of the terminal.

Parameters:
mime - the MIME type.


Copyright © 2004 The Norther Organization. All rights reserved.