com.free2be.dimensions.device
Class SimulationDeviceFactory

java.lang.Object
  extended by com.free2be.dimensions.device.DeviceFactory
      extended by com.free2be.dimensions.device.SimulationDeviceFactory

public class SimulationDeviceFactory
extends DeviceFactory

Used to detect simulation overrides of the calling device to simulate or emulate a different device than the actual.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.free2be.dimensions.device.DeviceFactory
DeviceFactory.ConfidenceLevel
 
Field Summary
static java.lang.String SIMULATION_DEVICE_COMMAND
          Indicator parameter that would indicate commands to communicate with the this factory...
static java.lang.String SIMULATION_DEVICE_COMMAND_STOP
          Indicator parameter that would indicate commands to communicate with the this factory...
static java.lang.String SIMULATION_DEVICE_CONTENT_TYPE_INDICATOR
          Indicator parameter that would indicate the content type to simulate...
static java.lang.String SIMULATION_DEVICE_MODEL_INDICATOR
          Indicator parameter that would indicate the device model to simulate...
static java.lang.String SIMULATION_DEVICE_SUBTYPE_INDICATOR
          Indicator parameter that would indicate the device subtype to simulate...
static java.lang.String SIMULATION_DEVICE_TYPE_INDICATOR
          Indicator parameter that would indicate the device type to simulate...
static java.lang.String SIMULATION_DEVICE_VENDOR_INDICATOR
          Indicator parameter that would indicate the device vendor to simulate...
static java.lang.String SIMULATION_WAP_PROFILE_INDICATOR
          Indicator parameter that would indicate the url to the UAProf RDF...
 
Fields inherited from class com.free2be.dimensions.device.DeviceFactory
CONTENT, DEFAULT, DEVICE, MINIMUM_LEVEL_FOR_FINAL, MODEL, NONE, OVERRIDE, PRE_DETERMINED, STANDARD
 
Constructor Summary
SimulationDeviceFactory()
           
 
Method Summary
protected  void assignDeviceSimulation(javax.servlet.http.HttpServletRequest request)
           
protected  boolean deviceMatches(Device simulationDevice)
           
protected static java.lang.String emptyStringIfNull(java.lang.String value)
           
 DeviceFactory.ConfidenceLevel getConfidenceLevel()
          Retrieves the confidence level this factory has in fulfilling the request based on the information provided during intialization.
 Device getDevice()
          Retrieves a device to represent the calling client's device.
 DeviceFactory.ConfidenceLevel getHighestConfidenceLevel()
          Returns the highest confidence level the implementing device factory can provide.
protected  void initialize(java.lang.Object informationSource)
          initalizes a factory after default construction giving some object as the source of information to determine confidence and build devices.
protected static void loadDevices()
          These should be loaded from an XML configuration file using digester.
 java.lang.String toString()
           
 
Methods inherited from class com.free2be.dimensions.device.DeviceFactory
clearPersistantDevice, getDeviceFactory, getFactories, getPersistentFactories
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SIMULATION_DEVICE_CONTENT_TYPE_INDICATOR

public static final java.lang.String SIMULATION_DEVICE_CONTENT_TYPE_INDICATOR
Indicator parameter that would indicate the content type to simulate... device.content.type is the key, but will be configurable through plugin soon.

See Also:
Device, Constant Field Values

SIMULATION_DEVICE_TYPE_INDICATOR

public static final java.lang.String SIMULATION_DEVICE_TYPE_INDICATOR
Indicator parameter that would indicate the device type to simulate... device.type is the key, but will be configurable through plugin soon.

See Also:
Device, Constant Field Values

SIMULATION_DEVICE_SUBTYPE_INDICATOR

public static final java.lang.String SIMULATION_DEVICE_SUBTYPE_INDICATOR
Indicator parameter that would indicate the device subtype to simulate... device.subtype is the key, but will be configurable through plugin soon.

See Also:
Device, Constant Field Values

SIMULATION_DEVICE_VENDOR_INDICATOR

public static final java.lang.String SIMULATION_DEVICE_VENDOR_INDICATOR
Indicator parameter that would indicate the device vendor to simulate... device.vendor is the key, but will be configurable through plugin soon.

See Also:
Device, Constant Field Values

SIMULATION_DEVICE_MODEL_INDICATOR

public static final java.lang.String SIMULATION_DEVICE_MODEL_INDICATOR
Indicator parameter that would indicate the device model to simulate... device.model is the key, but will be configurable through plugin soon.

See Also:
Device, Constant Field Values

SIMULATION_WAP_PROFILE_INDICATOR

public static final java.lang.String SIMULATION_WAP_PROFILE_INDICATOR
Indicator parameter that would indicate the url to the UAProf RDF... device.x-wap-profile is the key, but will be configurable through plugin soon.

See Also:
DeviceProfileFactory, Constant Field Values

SIMULATION_DEVICE_COMMAND

public static final java.lang.String SIMULATION_DEVICE_COMMAND
Indicator parameter that would indicate commands to communicate with the this factory... device.command is the key, but will be configurable through plugin soon.

See Also:
SIMULATION_DEVICE_COMMAND_STOP, SIMULATION_DEVICE_ALREADY_STOPPED, Constant Field Values

SIMULATION_DEVICE_COMMAND_STOP

public static final java.lang.String SIMULATION_DEVICE_COMMAND_STOP
Indicator parameter that would indicate commands to communicate with the this factory... device.command is the key, but will be configurable through plugin soon.

See Also:
SIMULATION_DEVICE_COMMAND, Constant Field Values
Constructor Detail

SimulationDeviceFactory

public SimulationDeviceFactory()
Method Detail

getDevice

public Device getDevice()
Retrieves a device to represent the calling client's device.

Specified by:
getDevice in class DeviceFactory

getConfidenceLevel

public DeviceFactory.ConfidenceLevel getConfidenceLevel()
Retrieves the confidence level this factory has in fulfilling the request based on the information provided during intialization.

Specified by:
getConfidenceLevel in class DeviceFactory

getHighestConfidenceLevel

public DeviceFactory.ConfidenceLevel getHighestConfidenceLevel()
Returns the highest confidence level the implementing device factory can provide. This method should be considered a static method and return a value upon empty construction.

Specified by:
getHighestConfidenceLevel in class DeviceFactory

initialize

protected void initialize(java.lang.Object informationSource)
initalizes a factory after default construction giving some object as the source of information to determine confidence and build devices. The majority of the work should be done during this method since this is the method that should determine the actual confidence of building a device. No exception should ever be thrown from this. Any internal exceptions should simply return a confidence level of NONE when asked.

Specified by:
initialize in class DeviceFactory
Parameters:
informationSource - any object that a factory may use to determine device (usually javax.servlet.HttpServletRequest).

assignDeviceSimulation

protected void assignDeviceSimulation(javax.servlet.http.HttpServletRequest request)

emptyStringIfNull

protected static java.lang.String emptyStringIfNull(java.lang.String value)

deviceMatches

protected boolean deviceMatches(Device simulationDevice)

loadDevices

protected static void loadDevices()
These should be loaded from an XML configuration file using digester. Placing in a MAP would be better and lookup by suffix key.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object