Oracle Application Server Wireless Java API Reference
B14043-01


oracle.panama.model
Interface DeviceV2

All Superinterfaces:
AttributeQueriable
All Known Subinterfaces:
RtDevice

public interface DeviceV2
extends AttributeQueriable

A DeviceV2 is the definition of the target logical device protocol. It replaced the old Device interface. It can for example be WML11 for WML specific devices, but also WML_Nokia7110 for more Nokia specific WML. Other examples are SMS, EMAIL etc.

Observe that the same physical device can support multiple logical Devices, a phone for example can support both the SMS and the WAP protocols.

See Also:
Device

Method Summary
 void addDeviceGroup(DeviceGroup group)
          Add a device to the device group, i.e., associate the device with the given device group.
 void addDynamicAttribute(java.lang.String name, java.lang.String value)
          Adds an dynamic attribute to the device.
 void addMeta(java.lang.String name, java.lang.String value)
          Add a new meta
 void addProperty(java.lang.String name, java.lang.String value)
          Add a new property
 Transformer findTransformer(java.lang.String languageVersion, MarkupLanguage markupLanguage)
          Returns the transformer which can be used for transforming documents
 java.util.HashMap getAllDynamicAttributes()
          Return all the attributes for this device.
 boolean getDeliveryContextAttributeBoolean(java.lang.String name)
          This method can be used to get the device's delivery context attribute in boolean format.
 int getDeliveryContextAttributeInt(java.lang.String name)
          This method can be used to get the device's delivery context attribute in integer format.
 java.lang.String[] getDeliveryContextAttributeLov(java.lang.String name)
          This method can be used to get the device's delivery context attribute in string array format.
 java.lang.String getDeliveryContextAttributeString(java.lang.String name)
          This method can be used to get the device's delivery context attribute in string format.
 Device getDevice()
          This method returns an instance of the Device that's compatible with the old "Device" interface.
 DeviceGroup[] getDeviceGroups()
          Returns an array of the device groups that the device is associated with.
 java.lang.String getDynamicAttribute(java.lang.String name)
          Get the dynamic attribute's value given it's name.
 MediaQueriable getMediaQueriable()
          Return the MediaQueriable interface for the Device.
 java.lang.String getMeta(java.lang.String name)
          Returns the value of a named meta or null if the meta does not exist
 java.util.HashMap getMetas()
          Returns all Metas of this object as a name value pair.
 java.lang.String getName()
          Return the name of the device.
 java.util.HashMap getProperties()
          Returns all Properties of this object as a name value pair.
 java.lang.String getProperty(java.lang.String name)
          Returns the value of a named property or null if the property does not exist
 RtDevice getRtDevice()
          This method returns an instance of the RtDevice that can be used to add dynamic attributes to the device for use of that particular request.
 RtDevice getRtDevice(javax.servlet.http.HttpServletRequest request)
          This method returns an instance of the RtDevice that have the attributes from Http Headers prefilled and can be further extended by adding dynamic attributes to it.
 java.lang.String[] getSupportedLanguageVersions(MarkupLanguage markupLanguage)
          Returns markup language versions supported by the device
 Transformer getTransformer(java.lang.String languageVersion, MarkupLanguage markupLanguage)
          Returns transformer for a markup language version.
 java.lang.String[] getUserAgents()
          Gets the list of User Agent Strings which will be used to detect the device
 XDevice getXDevice()
          Return the XDevice interface for the device.
 org.w3c.dom.Element getXMLErrorPage()
          Gets the errorPage property value.
 org.w3c.dom.Element getXMLLoginPage()
          Gets the loginPage property value.
 void removeDeviceGroup(DeviceGroup group)
          Remove a device from the device group, i.e., un-associate the device with the given device group.
 void removeDynamicAttribute(java.lang.String name)
          Remove the dynamic attribute.
 void removeMeta(java.lang.String name)
          Remove a meta
 void removeProperty(java.lang.String name)
          Remove a property

 

Methods inherited from interface oracle.panama.model.AttributeQueriable
getDeliveryContextAttribute

 

Method Detail

addDeviceGroup

public void addDeviceGroup(DeviceGroup group)
Add a device to the device group, i.e., associate the device with the given device group.
Parameters:
group - The device group for the device to be associated with.
Throws:
java.lang.IllegalArgumentException - in case of group parameter is null.

addDynamicAttribute

public void addDynamicAttribute(java.lang.String name,
                                java.lang.String value)
Adds an dynamic attribute to the device.
Parameters:
name - The name of the attribute. The name has to be unique per device!
value - The value of the attribute.

addMeta

public void addMeta(java.lang.String name,
                    java.lang.String value)
             throws java.lang.IllegalArgumentException
Add a new meta
Parameters:
name - the name of the meta
value - the value of the meta
Throws:
java.lang.IllegalArgumentException - if either the name of the value are null

addProperty

public void addProperty(java.lang.String name,
                        java.lang.String value)
                 throws java.lang.IllegalArgumentException
Add a new property
Parameters:
name - the name of the property
value - the value of the property
Throws:
java.lang.IllegalArgumentException - if either the name of the value are null

findTransformer

public Transformer findTransformer(java.lang.String languageVersion,
                                   MarkupLanguage markupLanguage)
                            throws PanamaRuntimeException
Returns the transformer which can be used for transforming documents
Parameters:
languageVersion - the markup language version
markupLanguage - the markup language
Returns:
Transformer the transformer
Throws:
PanamaRuntimeException - when a transformer is not found
See Also:
getTransformer(String, MarkupLanguage)

getAllDynamicAttributes

public java.util.HashMap getAllDynamicAttributes()
Return all the attributes for this device.
Returns:
The attributes for this device in the form of hash map.

getDeliveryContextAttributeBoolean

public boolean getDeliveryContextAttributeBoolean(java.lang.String name)
This method can be used to get the device's delivery context attribute in boolean format.
Parameters:
name - The name of the delivery context attribute
Returns:
The value of the delivery context attribute.

getDeliveryContextAttributeInt

public int getDeliveryContextAttributeInt(java.lang.String name)
This method can be used to get the device's delivery context attribute in integer format.
Parameters:
name - The name of the delivery context attribute
Returns:
The value of the delivery context attribute.

getDeliveryContextAttributeLov

public java.lang.String[] getDeliveryContextAttributeLov(java.lang.String name)
This method can be used to get the device's delivery context attribute in string array format.
Parameters:
name - The name of the delivery context attribute
Returns:
The value of the delivery context attribute.

getDeliveryContextAttributeString

public java.lang.String getDeliveryContextAttributeString(java.lang.String name)
This method can be used to get the device's delivery context attribute in string format.
Parameters:
name - The name of the delivery context attribute
Returns:
The value of the delivery context attribute.
Throws:
java.lang.UnsupportedOperationException - if the attribute is found to be not a string type.

getDevice

public Device getDevice()
This method returns an instance of the Device that's compatible with the old "Device" interface.
Returns:
An adapter instance compatible with the "Device" interface.

getDeviceGroups

public DeviceGroup[] getDeviceGroups()
Returns an array of the device groups that the device is associated with.
Returns:
An array of the device groups that the device is associated with. An empty array is returned in case there is no such association.

getDynamicAttribute

public java.lang.String getDynamicAttribute(java.lang.String name)
Get the dynamic attribute's value given it's name.
Parameters:
name - The name of the attribute interested.
Returns:
The value of the attribute that's interesting.

getMediaQueriable

public MediaQueriable getMediaQueriable()
Return the MediaQueriable interface for the Device.
Returns:
An instance that implements the media queriable interface for the device.

getMeta

public java.lang.String getMeta(java.lang.String name)
                         throws java.lang.IllegalArgumentException
Returns the value of a named meta or null if the meta does not exist
Parameters:
name - the name of the meta
Returns:
String the value of a named meta or null if the meta does not exist
Throws:
java.lang.IllegalArgumentException - if either the name of the value are null

getMetas

public java.util.HashMap getMetas()
Returns all Metas of this object as a name value pair. The name is the key and the value is the value in the HashMap
Returns:
HashMap

getName

public java.lang.String getName()
Return the name of the device.
Returns:
The name of the device.

getProperties

public java.util.HashMap getProperties()
Returns all Properties of this object as a name value pair. The name is the key and the value is the value in the HashMap
Returns:
HashMap

getProperty

public java.lang.String getProperty(java.lang.String name)
                             throws java.lang.IllegalArgumentException
Returns the value of a named property or null if the property does not exist
Parameters:
name - the name of the property
Returns:
String the value of a named property or null if the property does not exist
Throws:
java.lang.IllegalArgumentException - if either the name of the value are null

getRtDevice

public RtDevice getRtDevice()
This method returns an instance of the RtDevice that can be used to add dynamic attributes to the device for use of that particular request.
Returns:
The instance of RtDevice that's associated with that device.

getRtDevice

public RtDevice getRtDevice(javax.servlet.http.HttpServletRequest request)
This method returns an instance of the RtDevice that have the attributes from Http Headers prefilled and can be further extended by adding dynamic attributes to it.
Parameters:
request - The request for which this Runtime device will be used.
Returns:
The RtDevice that have dynamic attributes from http header et al.

getSupportedLanguageVersions

public java.lang.String[] getSupportedLanguageVersions(MarkupLanguage markupLanguage)
Returns markup language versions supported by the device
Parameters:
markupLanguage - the markup language
Returns:
String[] language versions supported by the device

getTransformer

public Transformer getTransformer(java.lang.String languageVersion,
                                  MarkupLanguage markupLanguage)
Returns transformer for a markup language version. This method is different from findTransformer() in that it does only a direct lookup in the cached values, while findTransformer() will try do a lookup and then put it into cache if the transformer is available.
Parameters:
languageVersion - the markup language version
markupLanguage - the markup language
Returns:
Transformer the transformer

getUserAgents

public java.lang.String[] getUserAgents()
Gets the list of User Agent Strings which will be used to detect the device
Returns:
an array of user agent strings

getXDevice

public XDevice getXDevice()
Return the XDevice interface for the device.
Returns:
An adapter instance that implements the XDevice interface for the device.

getXMLErrorPage

public org.w3c.dom.Element getXMLErrorPage()
Gets the errorPage property value.
Returns:
The errorPage property value.

getXMLLoginPage

public org.w3c.dom.Element getXMLLoginPage()
Gets the loginPage property value.
Returns:
The loginPage property value.

removeDeviceGroup

public void removeDeviceGroup(DeviceGroup group)
Remove a device from the device group, i.e., un-associate the device with the given device group.
Parameters:
group - The device group for the device to not be associated with.
Throws:
java.lang.IllegalArgumentException - in case of group parameter is null.

removeDynamicAttribute

public void removeDynamicAttribute(java.lang.String name)
Remove the dynamic attribute.
Parameters:
name - The name of the attribute to be removed

removeMeta

public void removeMeta(java.lang.String name)
                throws java.lang.IllegalArgumentException
Remove a meta
Parameters:
name - the name of the meta
Throws:
java.lang.IllegalArgumentException - if either the name of the value are null

removeProperty

public void removeProperty(java.lang.String name)
                    throws java.lang.IllegalArgumentException
Remove a property
Parameters:
name - the name of the property
Throws:
java.lang.IllegalArgumentException - if either the name of the value are null

Oracle Application Server Wireless Java API Reference
B14043-01


Copyright © 2004 Oracle Corporation. All Rights Reserved.