public interface UPnPManagedService extends UPnPService
UPnPDeviceManager
in the local host.Modifier and Type | Method and Description |
---|---|
UPnPAction |
getAction(String actionName)
Gets the named action from this service.
|
UPnPActionHandler |
getActionHandler()
Gets the current action handler for this service.
|
UPnPAction[] |
getActions()
Gets the actions that can be used with this service.
|
UPnPAdvertisedService[] |
getAdvertisedServices()
Gets the representations of this service on the network interfaces
on which is it advertised.
|
UPnPManagedDevice |
getDevice()
Gets the UPnP device that this service is a part of.
|
String |
getServiceId()
Gets the UPnP serviceId of this service.
|
String |
getServiceType()
Gets the UPnP serviceType of this service.
|
String |
getSpecVersion()
Gets the UPnP specVersion major and minor values of this
service.
|
UPnPManagedStateVariable[] |
getStateVariables()
Gets the state variables that are part of this service definition.
|
boolean |
getSubscribedStatus()
Reports the subscription status of the service.
|
void |
respondToQueries(boolean respond)
Control whether the service responds to UPnP
QueryStateVariable actions.
|
UPnPActionHandler |
setActionHandler(UPnPActionHandler handler)
Sets an action handler for this service, replacing any prior
action handler.
|
UPnPStateVariableHandler |
setHandler(UPnPStateVariableHandler handler)
Sets a
UPnPStateVariableHandler
to this UPnPManagedService . |
UPnPActionHandler setActionHandler(UPnPActionHandler handler) throws SecurityException
handler
- UPnPActionHandler to be set for this managed
service.SecurityException
- if the calling application has not been
granted MonitorAppPermission("handler.homenetwork").UPnPActionHandler
UPnPActionHandler getActionHandler()
UPnPActionHandler
void respondToQueries(boolean respond) throws SecurityException
If respond is true, the UPnP stack will respond to the
QueryStateVariable action invocation with a value from any
registered UPnPManagedStateVariableHandler
, or
with the most recently set value for the state value if no
handler is registered, or with the default value of the state
variable if no handler is registered and no calls to
UPnPManagedStateVariable.setValue()
have been
made. If respond is false, responds with an error as defined
by UPnP Device Architecture 1.0, with UPnPError errorCode of
401 (Invalid Action).
If respond is true and a request is received with a state variable name that is not part of this service, responds with an error as defined by UPnP Device Architecture 1.0, with UPnPError errorCode of 404 (Invalid Var).
respond
- True to cause the stack to respond to
QueryStateVariable actions, returning the
current state variable value to the UPnP
control point. False to refuse
QueryStateVariable actions with UPnP errorCode
of 401 (Invalid Action).SecurityException
- if the calling application has not been
granted MonitorAppPermission("handler.homenetwork").UPnPAdvertisedService[] getAdvertisedServices()
UPnPAdvertisedService
objects associated with a single UPnPManagedService
.UPnPManagedService
.
Returns a zero-length array if
the service has not been advertised on a network interface.UPnPManagedStateVariable[] getStateVariables()
UPnPManagedDevice getDevice()
UPnPStateVariableHandler setHandler(UPnPStateVariableHandler handler)
UPnPStateVariableHandler
to this UPnPManagedService
.
The handler provides the ability to respond dynamically to
the QueryStateVariable action, and to be notified of subscription
requests.
Only a single handler may be registered at any point in time. Subsequent requests to add a handler replace any existing handler.
handler
- The handler to add. May be null, removing any
previously set handler.boolean getSubscribedStatus()
UPnPAction getAction(String actionName)
getAction
in interface UPnPService
actionName
- The name of the UPnPAction to retrieve.getAdvertisedServices()[0].getAction()
.IllegalArgumentException
- if the
actionName
does not match an action
name in this service.UPnPAction[] getActions()
getActions
in interface UPnPService
UPnPAction
s. If the service
has no actions, returns an zero-length array.
If the service has been advertised, this method returns the same value
as getAdvertisedServices()[0].getActions()
.String getServiceId()
serviceId
element within the device
description.getServiceId
in interface UPnPService
getAdvertisedServices()[0].getServiceId()
.String getServiceType()
serviceType
element within the
device description.getServiceType
in interface UPnPService
getAdvertisedServices()[0].getServiceType()
.String getSpecVersion()
specVersion
element within the
service description.
The format of the returned String is the <major>
value, followed by '.', followed by the <minor> value.getSpecVersion
in interface UPnPService
getAdvertisedServices()[0].getSpecVersion()
.Copyright © 2013 CableLabs. All rights reserved.