net.sourceforge.wurfl.wurflapi
Class UAManager

java.lang.Object
  |
  +--net.sourceforge.wurfl.wurflapi.UAManager

public class UAManager
extends java.lang.Object

Author:
Luca Passani, passani at eunet dot no

Similarly to CapabilityMatrix, this object screens the rest of the app from WURFL parsing and XOM. UAManager implements a caching mechanism to minimize expensive analisys of UA strings to identify the device ID

There are actually two separate chaches. One for storing queries for strict matching and one for queries for loose matching (the latter are heavy to compute, so one definitely wants to cache that)

Method Summary
 java.lang.String getDeviceIDFromUA(java.lang.String ua)
          Given the UA of a device, find the device ID of the associated device.
 java.lang.String getDeviceIDFromUALoose(java.lang.String ua)
          Given the UA of a device, find the device ID of the associated device.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDeviceIDFromUA

public java.lang.String getDeviceIDFromUA(java.lang.String ua)
Given the UA of a device, find the device ID of the associated device. Match must be perfect.


getDeviceIDFromUALoose

public java.lang.String getDeviceIDFromUALoose(java.lang.String ua)
Given the UA of a device, find the device ID of the associated device. Match may be loose, meaning that MOT-T720/G_05.01.43R will match MOT-T720/05.08.41R MIB/2.0 Profile/MIDP-1.0 Configuration/CLDC-1.0. (assuming no better match is found). Observe that this is more powerful than a simple substring match. Matching UAs loosely is an expensive operation, but UAManager implements a cache that helps a lot.



Copyright © 2003,2004 Luca Passani.