org.apache.felix.upnp.sample.binaryLight.services
Class PowerSwitchService

java.lang.Object
  extended by org.apache.felix.upnp.sample.binaryLight.services.PowerSwitchService
All Implemented Interfaces:
UPnPService

public class PowerSwitchService
extends Object
implements UPnPService


Field Summary
 
Fields inherited from interface org.osgi.service.upnp.UPnPService
ID, TYPE
 
Constructor Summary
PowerSwitchService(LightModel model)
           
 
Method Summary
 UPnPAction getAction(String name)
          Locates a specific action by name.
 UPnPAction[] getActions()
          Lists all actions provided by this service.
 String getId()
          Returns the serviceId field in the UPnP service description.
 UPnPStateVariable getStateVariable(String name)
          Gets a UPnPStateVariable objects provided by this service by name
 UPnPStateVariable[] getStateVariables()
          Lists all UPnPStateVariable objects provided by this service.
 String getType()
          Returns the serviceType field in the UPnP service description.
 String getVersion()
          Returns the version suffix encoded in the serviceType field in the UPnP service description.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PowerSwitchService

public PowerSwitchService(LightModel model)
Method Detail

getId

public String getId()
Description copied from interface: UPnPService
Returns the serviceId field in the UPnP service description.

For standard services defined by a UPnP Forum working committee, the serviceId must contain the following components in the indicated order:

Example: urn:upnp-org:serviceId:serviceID.

Note that upnp-org is used instead of schemas-upnp-org in this example because an XML schema is not defined for each serviceId.

For non-standard services specified by UPnP vendors, the serviceId must contain the following components in the indicated order:

Example: urn:domain-name:serviceId:serviceID.

Specified by:
getId in interface UPnPService
Returns:
The service ID suffix defined by a UPnP Forum working committee or specified by a UPnP vendor. Must be <= 64 characters. Single URI.

getType

public String getType()
Description copied from interface: UPnPService
Returns the serviceType field in the UPnP service description.

For standard services defined by a UPnP Forum working committee, the serviceType must contain the following components in the indicated order:

Example: urn:schemas-upnp-org:service:serviceType:v.

For non-standard services specified by UPnP vendors, the serviceType must contain the following components in the indicated order:

Example: urn:domain-name:service:serviceType:v.

Specified by:
getType in interface UPnPService
Returns:
The service type suffix defined by a UPnP Forum working committee or specified by a UPnP vendor. Must be <= 64 characters, not including the version suffix and separating colon. Single URI.

getVersion

public String getVersion()
Description copied from interface: UPnPService
Returns the version suffix encoded in the serviceType field in the UPnP service description.

Specified by:
getVersion in interface UPnPService
Returns:
The integer service version defined by a UPnP Forum working committee or specified by a UPnP vendor.

getAction

public UPnPAction getAction(String name)
Description copied from interface: UPnPService
Locates a specific action by name. Looks up an action by its name.

Specified by:
getAction in interface UPnPService
Parameters:
name - Name of action. Must not contain hyphen or hash characters. Should be < 32 characters.
Returns:
The requested action or null if no action is found.

getActions

public UPnPAction[] getActions()
Description copied from interface: UPnPService
Lists all actions provided by this service.

Specified by:
getActions in interface UPnPService
Returns:
Array of actions (UPnPAction[] )or null if no actions are defined for this service.

getStateVariables

public UPnPStateVariable[] getStateVariables()
Description copied from interface: UPnPService
Lists all UPnPStateVariable objects provided by this service.

Specified by:
getStateVariables in interface UPnPService
Returns:
Array of state variables or null if none are defined for this service.

getStateVariable

public UPnPStateVariable getStateVariable(String name)
Description copied from interface: UPnPService
Gets a UPnPStateVariable objects provided by this service by name

Specified by:
getStateVariable in interface UPnPService
Parameters:
name - Name of the State Variable
Returns:
State variable or null if no such state variable exists for this service.


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.