org.ocap.hn.upnp.server
Interface UPnPManagedStateVariable

All Superinterfaces:
UPnPStateVariable

public interface UPnPManagedStateVariable
extends UPnPStateVariable

This interface provides the server representation of a UPnP state variable.


Method Summary
 UPnPAdvertisedStateVariable[] getAdvertisedStateVariables()
          Gets the network representations of this UPnPManagedStateVariable.
 String[] getAllowedValues()
          Gets the allowed values for this UPnP state variable.
 String getDataType()
          Gets the data type of this UPnP state variable.
 String getDefaultValue()
          Reports the default value of this UPnP state variable.
 String getMaximumValue()
          Gets the allowedValueRange maximum value of this UPnP state variable.
 String getMinimumValue()
          Gets the allowedValueRange minimum value for this UPnP state variable.
 int getModerationDelta()
          Gets the moderation delta of this state variable.
 int getModerationInterval()
          Gets the moderation interval of this state variable, in milliseconds.
 String getName()
          Gets the name of this UPnP state variable.
 UPnPManagedService getService()
          Gets the service that this state variable is a member of.
 String getStepValue()
          Gets the allowedValueRange step value for this UPnP state variable.
 String getValue()
          Reports the current value of this UPnPManagedStateVariable.
 boolean isEvented()
          Indicates if this state variable is evented.
 void setModerationDelta(int delta)
          Sets the moderation delta of this state variable.
 void setModerationInterval(int interval)
          Sets the moderation interval of this state variable, in milliseconds.
 void setValue(String value)
          Sets the value of this state variable.
 

Method Detail

setValue

void setValue(String value)
              throws SecurityException
Sets the value of this state variable. If the UPnP state variable corresponding to this UPnPManagedStateVariable is evented the host will send the appropriate UPnP event, subject to the moderation constraints set for this UPnPManagedStateVariable.

Parameters:
value - The new value of the state variable.
Throws:
IllegalArgumentException - if value violates the constraints of this variable's allowedValueList or allowedValueRange, or does not conform to the required format of the state variable's dataType as indicated by the UPnP Device Architecture Specification.
SecurityException - if the calling application has not been granted MonitorAppPermission("handler.homenetwork").
See Also:
getAllowedValues(), getMinimumValue(), getMaximumValue(), getDataType()

getValue

String getValue()
Reports the current value of this UPnPManagedStateVariable. This method will return the most recent value specified by setValue(java.lang.String), or the variable's default value if its value has not been set.

Returns:
The value of this UPnPManagedStateVariable.

setModerationInterval

void setModerationInterval(int interval)
                           throws SecurityException
Sets the moderation interval of this state variable, in milliseconds. Corresponds to the UPnP DA 1.0 "maximumRate".

Parameters:
interval - New moderation interval of the state variable, in milliseconds. A value of zero indicates unmoderated.
Throws:
UnsupportedOperationException - if the corresponding UPnPStateVariable is not evented.
IllegalArgumentException - if interval is negative.
SecurityException - if the calling application has not been granted MonitorAppPermission("handler.homenetwork").

getModerationInterval

int getModerationInterval()
Gets the moderation interval of this state variable, in milliseconds. Corresponds to the UPnP DA 1.0 "maximumRate".

Returns:
The current moderation interval for this UPnPManagedStateVariable in milliseconds. A value of zero indicates unmoderated.
Throws:
UnsupportedOperationException - if the corresponding UPnPStateVariable is not evented.

setModerationDelta

void setModerationDelta(int delta)
                        throws SecurityException
Sets the moderation delta of this state variable. Corresponds to the UPnP DA 1.0 "minimumDelta".

Parameters:
delta - New moderation delta of the state variable. A value of zero indicates unmoderated.
Throws:
UnsupportedOperationException - if the state variable is not evented or if the data type of this variable is not numeric.
IllegalArgumentException - if delta is negative.
SecurityException - if the calling application has not been granted MonitorAppPermission("handler.homenetwork").
See Also:
getDataType()

getModerationDelta

int getModerationDelta()
Gets the moderation delta of this state variable. Corresponds to the UPnP DA 1.0 "minimumDelta".

Returns:
The current moderation delta for this UPnPManagedStateVariable. A value of zero indicates unmoderated.
Throws:
UnsupportedOperationException - if the corresponding UPnPStateVariable is not evented.

getAdvertisedStateVariables

UPnPAdvertisedStateVariable[] getAdvertisedStateVariables()
Gets the network representations of this UPnPManagedStateVariable. Since the UPnP service description contains information specific to the network interface on which it is advertised, there can be multiple UPnPAdvertisedStateVarable objects associated with a single UPnPManagedStateVariable.

Returns:
The network representations of this UPnPManagedStateVariable. Returns a zero-length array if the corresponding UPnP service has not been advertised on a network interface.

getService

UPnPManagedService getService()
Gets the service that this state variable is a member of.

Returns:
The UPnPManagedService that this state variable is a member of.

getAllowedValues

String[] getAllowedValues()
Gets the allowed values for this UPnP state variable. The value returned is formatted per the UPnP Device Architecture specification, service description, allowedValueList element definition. If the UPnPStateVariable does not have an allowedValueList specified, returns zero length array.

Specified by:
getAllowedValues in interface UPnPStateVariable
Returns:
An array containing the allowed values for this state variable. Each element in the array contains the value of one allowedValue element in the allowedValueList. The array has the same order as the allowedValueList element. If the corresponding UPnP service has been advertised, this method returns the same value as getAdvertisedStateVariables()[0].getAllowedValues().

getDefaultValue

String getDefaultValue()
Reports the default value of this UPnP state variable. This value is taken from the defaultValue element in the UPnP service description that defines this state variable.

Specified by:
getDefaultValue in interface UPnPStateVariable
Returns:
The default value of this state variable. Returns an empty string if the variable does not have a defaultValue. If the corresponding UPnP service has been advertised, this method returns the same value as getAdvertisedStateVariables()[0].getDefaultValue().

getMaximumValue

String getMaximumValue()
Gets the allowedValueRange maximum value of this UPnP state variable. The value returned is formatted per the UPnP Device Architecture specification, service description, allowedValueRange maximum element definition.

Specified by:
getMaximumValue in interface UPnPStateVariable
Returns:
A String containing the maximum allowed value for this state variable. Returns an empty string if the variable does not have an allowedValueRange. If the corresponding UPnP service has been advertised, this method returns the same value as getAdvertisedStateVariables()[0].getMaximumValue().

getMinimumValue

String getMinimumValue()
Gets the allowedValueRange minimum value for this UPnP state variable. The value returned is formatted per the UPnP Device Architecture specification, service description, allowedValueRange minimum element definition.

Specified by:
getMinimumValue in interface UPnPStateVariable
Returns:
A String containing the minimum allowed value for this state variable. Returns an empty string if the variable does not have an allowedValueRange. If the corresponding UPnP service has been advertised, this method returns the same value as getAdvertisedStateVariables()[0].getMinimumValue().

getName

String getName()
Gets the name of this UPnP state variable. This value is taken from the name element of the UPnP service description stateVariable element.

Specified by:
getName in interface UPnPStateVariable
Returns:
The name of the state variable. If the corresponding UPnP service has been advertised, this method returns the same value as getAdvertisedStateVariables()[0].getName().

getDataType

String getDataType()
Gets the data type of this UPnP state variable. The value returned is formatted per the UPnP Device Architecture specification, service description, dataType element definition.

Specified by:
getDataType in interface UPnPStateVariable
Returns:
The data type of the state variable. If the corresponding UPnP service has been advertised, this method returns the same value as getAdvertisedStateVariables()[0].getStateVariableType().

getStepValue

String getStepValue()
Gets the allowedValueRange step value for this UPnP state variable. The value returned is formatted per the UPnP Device Architecture specification, service description, allowedValueRange step element definition.

Note that if the step element is omitted and the data type of the state variable is an integer, the step value is considered to be 1.

Specified by:
getStepValue in interface UPnPStateVariable
Returns:
A String containing the step value for this state variable. Returns an empty string if service description of this variable does not specify a step value. If the corresponding UPnP service has been advertised, this method returns the same value as getAdvertisedStateVariables()[0].getStepValue().

isEvented

boolean isEvented()
Indicates if this state variable is evented. The value is taken from the sendEvents attribute in the UPnP service description that defines this state variable.

Specified by:
isEvented in interface UPnPStateVariable
Returns:
True if this UPnP state variable is evented, otherwise returns false. If the corresponding UPnP service has been advertised, this method returns the same value as getAdvertisedStateVariables()[0].isEvented().


Copyright © 2011. All Rights Reserved.