net.sbbi.upnp.services
Class ServiceStateVariable

java.lang.Object
  extended by net.sbbi.upnp.services.ServiceStateVariable
All Implemented Interfaces:
ServiceStateVariableTypes

public class ServiceStateVariable
extends Object
implements ServiceStateVariableTypes

Class to contain a service state variable definition

Version:
1.0
Author:
SuperBonBon

Field Summary
protected  Set allowedvalues
           
protected  String dataType
           
protected  String defaultValue
           
protected  String maximumRangeValue
           
protected  String minimumRangeValue
           
protected  String name
           
protected  UPNPService parent
           
protected  boolean sendEvents
           
protected  String stepRangeValue
           
 
Fields inherited from interface net.sbbi.upnp.services.ServiceStateVariableTypes
BIN_BASE64, BIN_BASE64_INT, BIN_HEX, BIN_HEX_INT, BOOLEAN, BOOLEAN_INT, CHAR, CHAR_INT, DATE, DATE_INT, DATETIME, DATETIME_INT, DATETIME_TZ, DATETIME_TZ_INT, FIXED_14_4, FIXED_14_4_INT, FLOAT, FLOAT_INT, I1, I1_INT, I2, I2_INT, I4, I4_INT, INT, INT_INT, NUMBER, NUMBER_INT, R4, R4_INT, R8, R8_INT, STRING, STRING_INT, TIME, TIME_INT, TIME_TZ, TIME_TZ_INT, UI1, UI1_INT, UI2, UI2_INT, UI4, UI4_INT, URI, URI_INT, UUID, UUID_INT
 
Constructor Summary
protected ServiceStateVariable()
           
 
Method Summary
 Set getAllowedvalues()
          A set of allowed values (String objects) for the variable
 String getDataType()
          The variable UPNP data type
 Class getDataTypeAsClass()
          The varialbe JAVA data type (using an UPNP->Java mapping)
static Class getDataTypeClassMapping(String dataType)
           
 String getDefaultValue()
          The default value of the state variable
 String getMaximumRangeValue()
          The maximum value as a string
 String getMinimumRangeValue()
          The minimum value as a string
 String getName()
          State variable name
 UPNPService getParent()
          The parent UPNPService Object
 String getStepRangeValue()
          The value step range as a string
static String getUPNPDataTypeMapping(String className)
           
 String getValue()
          Call to the UPNP device to retreive the state variable actual value
 boolean isSendEvents()
          Boolean to indicate if the variable is sending events when value of the var is changing.
static Object UPNPToJavaObject(String dataType, String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected String name

sendEvents

protected boolean sendEvents

dataType

protected String dataType

defaultValue

protected String defaultValue

minimumRangeValue

protected String minimumRangeValue

maximumRangeValue

protected String maximumRangeValue

stepRangeValue

protected String stepRangeValue

allowedvalues

protected Set allowedvalues

parent

protected UPNPService parent
Constructor Detail

ServiceStateVariable

protected ServiceStateVariable()
Method Detail

getValue

public String getValue()
                throws UPNPResponseException,
                       IOException
Call to the UPNP device to retreive the state variable actual value

Returns:
the state variable actual value on the device, should be never null, an empty string could be returned by the device
Throws:
UPNPResponseException - if the device throws an exception during query
IOException - if some IO error with device occurs during query

getName

public String getName()
State variable name

Returns:
the state variable name

getParent

public UPNPService getParent()
The parent UPNPService Object

Returns:
the parent object instance

isSendEvents

public boolean isSendEvents()
Boolean to indicate if the variable is sending events when value of the var is changing. The events can be subscribed via the ServicesEventing class

Returns:
true if sending events

getDefaultValue

public String getDefaultValue()
The default value of the state variable

Returns:
the default value representation as an string

getDataType

public String getDataType()
The variable UPNP data type

Returns:
the data type

getDataTypeAsClass

public Class getDataTypeAsClass()
The varialbe JAVA data type (using an UPNP->Java mapping)

Returns:
the class mapped

getAllowedvalues

public Set getAllowedvalues()
A set of allowed values (String objects) for the variable

Returns:
the allowed values or null if none

getMinimumRangeValue

public String getMinimumRangeValue()
The minimum value as a string

Returns:
the minimum value or null if no restriction

getMaximumRangeValue

public String getMaximumRangeValue()
The maximum value as a string

Returns:
the maximum value or null if no restriction

getStepRangeValue

public String getStepRangeValue()
The value step range as a string

Returns:
the value step raqnge or null if no restriction

getDataTypeClassMapping

public static Class getDataTypeClassMapping(String dataType)

getUPNPDataTypeMapping

public static String getUPNPDataTypeMapping(String className)

UPNPToJavaObject

public static Object UPNPToJavaObject(String dataType,
                                      String value)
                               throws Throwable
Throws:
Throwable


Copyright © 2010. All Rights Reserved.