Top Description Fields Methods
org.osgi.service.upnp

public Interface UPnPStateVariable

Known Direct Subinterfaces
org.osgi.service.upnp.UPnPLocalStateVariable

The meta-information of a UPnP state variable as declared in the device's service state table (SST).

Method calls to interact with a device (e.g. UPnPAction.invoke(...);) use this class to encapsulate meta information about the input and output arguments.

The actual values of the arguments are passed as Java objects. The mapping of types from UPnP data types to Java data types is described with the field definitions.

Author
$Id: c3cb5d64cc98036befd19526c5a5855b1368b217 $

Field Summary

Modifier and TypeField and Description
public static final String
TYPE_BIN_BASE64

MIME-style Base64 encoded binary BLOB.

public static final String
TYPE_BIN_HEX

Hexadecimal digits representing octets.

public static final String
TYPE_BOOLEAN

True or false.

public static final String
TYPE_CHAR

Unicode string.

public static final String
TYPE_DATE

A calendar date.

public static final String
TYPE_DATETIME

A specific instant of time.

public static final String
TYPE_DATETIME_TZ

A specific instant of time.

public static final String
TYPE_FIXED_14_4

Same as r8 but no more than 14 digits to the left of the decimal point and no more than 4 to the right.

public static final String
TYPE_FLOAT

Floating-point number.

public static final String
TYPE_I1

1 Byte int.

public static final String
TYPE_I2

2 Byte int.

public static final String
TYPE_I4

4 Byte int.

public static final String
TYPE_INT

Integer number.

public static final String
TYPE_NUMBER

Same as r8.

public static final String
TYPE_R4

4 Byte float.

public static final String
TYPE_R8

8 Byte float.

public static final String
TYPE_STRING

Unicode string.

public static final String
TYPE_TIME

An instant of time that recurs every day.

public static final String
TYPE_TIME_TZ

An instant of time that recurs every day.

public static final String
TYPE_UI1

Unsigned 1 Byte int.

public static final String
TYPE_UI2

Unsigned 2 Byte int.

public static final String
TYPE_UI4

Unsigned 4 Byte int.

public static final String
TYPE_URI

Universal Resource Identifier.

public static final String
TYPE_UUID

Universally Unique ID.

Hexadecimal digits representing octets.

Method Summary

Modifier and TypeMethod and Description
public String[]

Returns:

The allowed values or null if not defined. Should be less than 32 characters.
getAllowedValues
()

Returns the allowed values, if defined.

public Object

Returns:

The default value or null if not defined. The type of the returned object can be determined by getJavaDataType.
getDefaultValue
()

Returns the default value, if defined.

public Class<?>

Returns:

A class object corresponding to the Java type of this argument.
getJavaDataType
()

Returns the Java class associated with the UPnP data type of this state variable.

public Number

Returns:

The maximum value or null if not defined.
getMaximum
()

Returns the maximum value, if defined.

public Number

Returns:

The minimum value or null if not defined.
getMinimum
()

Returns the minimum value, if defined.

public String

Returns:

Name of state variable. Must not contain a hyphen character nor a hash character. Should be < 32 characters.
getName
()

Returns the variable name.

public Number

Returns:

The increment size or null if not defined.
getStep
()

Returns the size of an increment operation, if defined.

public String

Returns:

The UPnP data type of this state variable, as defined in above constants.
getUPnPDataType
()

Returns the UPnP type of this state variable.

public boolean

Returns:

true if the StateVariable generates events, false otherwise.
sendsEvents
()

Tells if this StateVariable can be used as an event source.

Field Detail

TYPE_BIN_BASE64back to summary
public static final String TYPE_BIN_BASE64

MIME-style Base64 encoded binary BLOB.

Takes 3 Bytes, splits them into 4 parts, and maps each 6 bit piece to an octet. (3 octets are encoded as 4.) No limit on size.

Mapped to byte[] object. The Java byte array will hold the decoded content of the BLOB.

TYPE_BIN_HEXback to summary
public static final String TYPE_BIN_HEX

Hexadecimal digits representing octets.

Treats each nibble as a hex digit and encodes as a separate Byte. (1 octet is encoded as 2.) No limit on size.

Mapped to byte[] object. The Java byte array will hold the decoded content of the BLOB.

TYPE_BOOLEANback to summary
public static final String TYPE_BOOLEAN

True or false.

Mapped to Boolean object.

TYPE_CHARback to summary
public static final String TYPE_CHAR

Unicode string.

One character long.

Mapped to Character object.

TYPE_DATEback to summary
public static final String TYPE_DATE

A calendar date.

Date in a subset of ISO 8601 format without time data.

See http://www.w3.org/TR/ xmlschema-2/#date .

Mapped to java.util.Date object. Always 00:00 hours.

TYPE_DATETIMEback to summary
public static final String TYPE_DATETIME

A specific instant of time.

Date in ISO 8601 format with optional time but no time zone.

See http://www.w3.org /TR/xmlschema-2/#dateTime .

Mapped to java.util.Date object using default time zone.

TYPE_DATETIME_TZback to summary
public static final String TYPE_DATETIME_TZ

A specific instant of time.

Date in ISO 8601 format with optional time and optional time zone.

See http://www.w3.org /TR/xmlschema-2/#dateTime .

Mapped to java.util.Date object adjusted to default time zone.

TYPE_FIXED_14_4back to summary
public static final String TYPE_FIXED_14_4

Same as r8 but no more than 14 digits to the left of the decimal point and no more than 4 to the right.

Mapped to Double object.

TYPE_FLOATback to summary
public static final String TYPE_FLOAT

Floating-point number.

Mantissa (left of the decimal) and/or exponent may have a leading sign. Mantissa and/or exponent may have leading zeros. Decimal character in mantissa is a period, i.e., whole digits in mantissa separated from fractional digits by period. Mantissa separated from exponent by E. (No currency symbol.) (No grouping of digits in the mantissa, e.g., no commas.)

Mapped to Float object.

TYPE_I1back to summary
public static final String TYPE_I1

1 Byte int.

Mapped to Integer object.

TYPE_I2back to summary
public static final String TYPE_I2

2 Byte int.

Mapped to Integer object.

TYPE_I4back to summary
public static final String TYPE_I4

4 Byte int.

Must be between -2147483648 and 2147483647

Mapped to Integer object.

TYPE_INTback to summary
public static final String TYPE_INT

Integer number.

Mapped to Integer object.

TYPE_NUMBERback to summary
public static final String TYPE_NUMBER

Same as r8.

Mapped to Double object.

TYPE_R4back to summary
public static final String TYPE_R4

4 Byte float.

Same format as float. Must be between 3.40282347E+38 to 1.17549435E-38.

Mapped to Float object.

TYPE_R8back to summary
public static final String TYPE_R8

8 Byte float.

Same format as float. Must be between -1.79769313486232E308 and -4.94065645841247E-324 for negative values, and between 4.94065645841247E-324 and 1.79769313486232E308 for positive values, i.e., IEEE 64-bit (8-Byte) double.

Mapped to Double object.

TYPE_STRINGback to summary
public static final String TYPE_STRING

Unicode string.

No limit on length.

Mapped to String object.

TYPE_TIMEback to summary
public static final String TYPE_TIME

An instant of time that recurs every day.

Time in a subset of ISO 8601 format with no date and no time zone.

See http://www.w3.org /TR/xmlschema-2/#time .

Mapped to Long. Converted to milliseconds since midnight.

TYPE_TIME_TZback to summary
public static final String TYPE_TIME_TZ

An instant of time that recurs every day.

Time in a subset of ISO 8601 format with optional time zone but no date.

See http://www.w3.org /TR/xmlschema-2/#time .

Mapped to Long object. Converted to milliseconds since midnight and adjusted to default time zone, wrapping at 0 and 24*60*60*1000.

TYPE_UI1back to summary
public static final String TYPE_UI1

Unsigned 1 Byte int.

Mapped to an Integer object.

TYPE_UI2back to summary
public static final String TYPE_UI2

Unsigned 2 Byte int.

Mapped to Integer object.

TYPE_UI4back to summary
public static final String TYPE_UI4

Unsigned 4 Byte int.

Mapped to Long object.

TYPE_URIback to summary
public static final String TYPE_URI

Universal Resource Identifier.

Mapped to String object.

TYPE_UUIDback to summary
public static final String TYPE_UUID

Universally Unique ID.

Hexadecimal digits representing octets. Optional embedded hyphens are ignored.

Mapped to String object.

Method Detail

getAllowedValuesback to summary
public String[] getAllowedValues()

Returns the allowed values, if defined. Allowed values can be defined only for String types.

This method must continue to return the state variable allowed values after the UPnP state variable has been removed from the network.

Returns:String[]

The allowed values or null if not defined. Should be less than 32 characters.

getDefaultValueback to summary
public Object getDefaultValue()

Returns the default value, if defined.

This method must continue to return the state variable default value after the UPnP state variable has been removed from the network.

Returns:Object

The default value or null if not defined. The type of the returned object can be determined by getJavaDataType.

getJavaDataTypeback to summary
public Class<?> getJavaDataType()

Returns the Java class associated with the UPnP data type of this state variable.

Mapping between the UPnP data types and Java classes is performed according to the schema mentioned above.


 Integer              ui1, ui2, i1, i2, i4, int
 Long                 ui4, time, time.tz
 Float                r4, float
 Double               r8, number, fixed.14.4
 Character            char
 String               string, uri, uuid
 Date                 date, dateTime, dateTime.tz
 Boolean              boolean
 byte[]               bin.base64, bin.hex

This method must continue to return the state variable java type after the UPnP state variable has been removed from the network.

Returns:Class<?>

A class object corresponding to the Java type of this argument.

getMaximumback to summary
public Number getMaximum()

Returns the maximum value, if defined. Maximum values can only be defined for numeric types.

This method must continue to return the state variable maximum value after the UPnP state variable has been removed from the network.

Returns:Number

The maximum value or null if not defined.

getMinimumback to summary
public Number getMinimum()

Returns the minimum value, if defined. Minimum values can only be defined for numeric types.

This method must continue to return the state variable minimum value after the UPnP state variable has been removed from the network.

Returns:Number

The minimum value or null if not defined.

getNameback to summary
public String getName()

Returns the variable name.

  • All standard variables defined by a UPnP Forum working committee must not begin with X_ nor A_.
  • All non-standard variables specified by a UPnP vendor and added to a standard service must begin with X_.

This method must continue to return the state variable name after the UPnP state variable has been removed from the network.

Returns:String

Name of state variable. Must not contain a hyphen character nor a hash character. Should be < 32 characters.

getStepback to summary
public Number getStep()

Returns the size of an increment operation, if defined. Step sizes can be defined only for numeric types.

This method must continue to return the step size after the UPnP state variable has been removed from the network.

Returns:Number

The increment size or null if not defined.

getUPnPDataTypeback to summary
public String getUPnPDataType()

Returns the UPnP type of this state variable. Valid types are defined as constants.

This method must continue to return the state variable UPnP data type after the UPnP state variable has been removed from the network.

Returns:String

The UPnP data type of this state variable, as defined in above constants.

sendsEventsback to summary
public boolean sendsEvents()

Tells if this StateVariable can be used as an event source. If the StateVariable is eventable, an event listener service can be registered to be notified when changes to the variable appear.

This method must continue to return the correct value after the UPnP state variable has been removed from the network.

Returns:boolean

true if the StateVariable generates events, false otherwise.