| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface LocalDevice
Interface of local devices.
| Method Summary | |
|---|---|
 void | 
addFriendlyName(java.lang.String lang,
                java.lang.String friendlyName)
Adds a friendly name to the device.  | 
 void | 
addService(LocalService service)
Adds service to device.  | 
 void | 
addService(LocalService service,
           boolean startIfRunning)
Adds a service to the device.  | 
 boolean | 
deviceMatches(QNameSet searchTypes,
              ProbeScopeSet searchScopes)
Checks if the outer device matches the searched device port types and scopes.  | 
 DiscoveryData | 
getDiscoveryData()
This will return the discovery data of the local device.  | 
 HTTPGroup | 
getGroup()
 | 
 Iterator | 
getServices()
Get iterator over all services.  | 
 boolean | 
isRunning()
Returns if the device was started and is running now.  | 
 void | 
removeService(LocalService service)
Removes service from device.  | 
 void | 
removeService(LocalService service,
              boolean stopIfRunning)
Removes a service from the device.  | 
 void | 
sendBye()
Send Bye Message.  | 
 void | 
sendHello()
Send hello message.  | 
 void | 
setDeviceMetadata(ThisDeviceMData deviceMetadata)
Sets the device metadata of the device.  | 
 void | 
setEndpointReference(EndpointReference endpoint)
Set the EndpointReference of this device. | 
 void | 
setFirmwareVersion(java.lang.String firmware)
Sets the firmware version to the device.  | 
 void | 
setManufacturerUrl(java.lang.String manufacturerUrl)
Set the url of the manufacturer.  | 
 void | 
setMetadataVersion(long metadataVersion)
Sets the metadata version of the device.  | 
 void | 
setModelMetadata(ThisModelMData modelMetadata)
Sets the model metadata of the device.  | 
 void | 
setModelNumber(java.lang.String modelNumber)
Sets the model number of the device.  | 
 void | 
setModelUrl(java.lang.String modelUrl)
Sets the model url of the device.  | 
 void | 
setPortTypes(QNameSet qnsPortTypes)
Sets the port types of the device.  | 
 void | 
setPresentationUrl(java.lang.String presentationUrl)
Sets the presentation url of the device.  | 
 void | 
setScopes(ScopeSet scopes)
Sets a list of scopes.  | 
 void | 
setSerialNumber(java.lang.String serialNumber)
Sets the serial number of the device.  | 
 void | 
start()
Starts the device.  | 
 void | 
stop()
Stops the device.  | 
 void | 
writeCustomizeMData(HashMap metaData)
Add user metadata to a device  | 
| Methods inherited from interface org.ws4d.java.communication.Bindable | 
|---|
addBinding, clearBindings, getBindings, hasBindings, removeBinding, supportsBindingChanges | 
| Methods inherited from interface org.ws4d.java.concurrency.Lockable | 
|---|
exclusiveLock, releaseExclusiveLock, releaseSharedLock, sharedLock, tryExclusiveLock, trySharedLock | 
| Method Detail | 
|---|
DiscoveryData getDiscoveryData()
boolean isRunning()
true, if this device is running
void stop()
          throws java.io.IOException
CommunicationBinding to the matching
 CommunicationManager,
 DeviceServiceRegistry.
 
java.io.IOException - is thrown, if a binding couldn't be unbound or if
             stopping one service will throw the exception.
void start()
           throws java.io.IOException
CommunicationBinding to the matching
 CommunicationManager, i.e. start listening on incoming messages
 for the specified address,
 DeviceServiceRegistry.
 
java.io.IOException - is thrown, if a binding couldn't be bind to the
             communication manager or if starting one service will throw
             the exception.
boolean deviceMatches(QNameSet searchTypes,
                      ProbeScopeSet searchScopes)
searchTypes - Searched device port types to match the outer device.searchScopes - Searched scopes to match the outer device.
true - if both the given device port types and
         scopes are part of the device.void sendHello()
Important: This method won't start the device. But starting this device will automatically send a hello message.
void sendBye()
Important: This method won't stop the device. But stopping this device will automatically send a bye message.
void setEndpointReference(EndpointReference endpoint)
EndpointReference of this device. The endpoint reference
 bears a stable globally-unique identifier of the device. This address
 part is typically not a physical address. Properties.
endpoint - The endpoint reference to set.void setPortTypes(QNameSet qnsPortTypes)
DefaultClient can search for the specific device port types. 
qnsPortTypes - Device port types to set.void setScopes(ScopeSet scopes)
 Setting the scopes includes getting the exclusive lock ((Lockable
 ) to the device.
 If the device is running, each change will initiate the sending of a
 hello message with an incremented metadata version. To combine multiple
 device data changes with sending only one hello, the exclusive lock has
 to be taken by Lockable.exclusiveLock(). After the last device data
 change the release of the exclusive lock by
 Lockable.releaseExclusiveLock() will send a single hello with an
 incremented metadata version.
 
scopes - List of scopes to set.void setManufacturerUrl(java.lang.String manufacturerUrl)
 Setting the manufacturer url includes getting the exclusive lock ((
 Lockable) to the device.
 If the device is running, each change will initiate the sending of a
 hello message with an incremented metadata version. To combine multiple
 device data changes with sending only one hello, the exclusive lock has
 to be taken by Lockable.exclusiveLock(). After the last device data
 change the release of the exclusive lock by
 Lockable.releaseExclusiveLock() will send a single hello with an
 incremented metadata version.
 
manufacturerUrl - The url of the manufacturer to set.void setModelNumber(java.lang.String modelNumber)
 Setting the model number includes getting the exclusive lock ((
 Lockable) to the device.
 If the device is running, each change will initiate the sending of a
 hello message with an incremented metadata version. To combine multiple
 device data changes with sending only one hello, the exclusive lock has
 to be taken by Lockable.exclusiveLock(). After the last device data
 change the release of the exclusive lock by
 Lockable.releaseExclusiveLock() will send a single hello with an
 incremented metadata version.
 
modelNumber - The model number of the device to set.void setModelUrl(java.lang.String modelUrl)
 Setting the model url includes getting the exclusive lock ((
 Lockable) to the device.
 If the device is running, each change will initiate the sending of a
 hello message with an incremented metadata version. To combine multiple
 device data changes with sending only one hello, the exclusive lock has
 to be taken by Lockable.exclusiveLock(). After the last device data
 change the release of the exclusive lock by
 Lockable.releaseExclusiveLock() will send a single hello with an
 incremented metadata version.
 
modelUrl - The model url of the device to set.void setPresentationUrl(java.lang.String presentationUrl)
 Setting the presentation url includes getting the exclusive lock ((
 Lockable) to the device.
 If the device is running, each change will initiate the sending of a
 hello message with an incremented metadata version. To combine multiple
 device data changes with sending only one hello, the exclusive lock has
 to be taken by Lockable.exclusiveLock(). After the last device data
 change the release of the exclusive lock by
 Lockable.releaseExclusiveLock() will send a single hello with an
 incremented metadata version.
 
presentationUrl - The presentation url to set.
void addFriendlyName(java.lang.String lang,
                     java.lang.String friendlyName)
 Adding a friendly name includes getting the exclusive lock ((
 Lockable) to the device.
 If the device is running, each change will initiate the sending of a
 hello message with an incremented metadata version. To combine multiple
 device data changes with sending only one hello, the exclusive lock has
 to be taken by Lockable.exclusiveLock(). After the last device data
 change the release of the exclusive lock by
 Lockable.releaseExclusiveLock() will send a single hello with an
 incremented metadata version.
 
lang - Language attribute, i. e. "en-US or "de-DE":
            friendlyName - The friendly name of the device in the specified
            language to be set.void setFirmwareVersion(java.lang.String firmware)
 Setting the firmware version includes getting the exclusive lock ((
 Lockable) to the device.
 If the device is running, each change will initiate the sending of a
 hello message with an incremented metadata version. To combine multiple
 device data changes with sending only one hello, the exclusive lock has
 to be taken by Lockable.exclusiveLock(). After the last device data
 change the release of the exclusive lock by
 Lockable.releaseExclusiveLock() will send a single hello with an
 incremented metadata version.
 
firmware - The firmware version of the device to set.void setSerialNumber(java.lang.String serialNumber)
 Set the serial number version includes getting the exclusive lock ((
 Lockable) to the device.
 If the device is running, each change will initiate the sending of a
 hello message with an incremented metadata version. To combine multiple
 device data changes with sending only one hello, the exclusive lock has
 to be taken by Lockable.exclusiveLock(). After the last device data
 change the release of the exclusive lock by
 Lockable.releaseExclusiveLock() will send a single hello with an
 incremented metadata version.
 
serialNumber - The serial number of the device to set.void addService(LocalService service)
NOTICE: If the device is already running, you must start the service with the start() method, or use the addService(LocalService, boolean) method.
 Adding a service to the device includes getting the exclusive lock ((
 Lockable) to the device.
 If the device is running, each change will initiate the sending of a
 hello message with an incremented metadata version. To combine multiple
 device data changes with sending only one hello, the exclusive lock has
 to be taken by Lockable.exclusiveLock(). After the last device data
 change the release of the exclusive lock by
 Lockable.releaseExclusiveLock() will send a single hello with an
 incremented metadata version.
 
service - service to add to this device.addService(org.ws4d.java.service.LocalService,
      boolean)
void addService(LocalService service,
                boolean startIfRunning)
                throws java.io.IOException
 Adding a service to the device includes getting the exclusive lock ((
 Lockable) to the device.
 If the device is running, each change will initiate the sending of a
 hello message with an incremented metadata version. To combine multiple
 device data changes with sending only one hello, the exclusive lock has
 to be taken by Lockable.exclusiveLock(). After the last device data
 change the release of the exclusive lock by
 Lockable.releaseExclusiveLock() will send a single hello with an
 incremented metadata version.
 
service - service to add to this device.startIfRunning - true the service is started if the
            device is already running, false the service is
            not started, we just add it.
java.io.IOExceptionvoid removeService(LocalService service)
 Removing a service from the device includes getting the exclusive lock ((
 Lockable) to the device.
 If the device is running, each change will initiate the sending of a
 hello message with an incremented metadata version. To combine multiple
 device data changes with sending only one hello, the exclusive lock has
 to be taken by Lockable.exclusiveLock(). After the last device data
 change the release of the exclusive lock by
 Lockable.releaseExclusiveLock() will send a single hello with an
 incremented metadata version.
 
service - The service to remove from this device.
void removeService(LocalService service,
                   boolean stopIfRunning)
                   throws java.io.IOException
true the service to remove is stopped if running, else not.
 
 Removing a service from the device includes getting the exclusive lock ((
 Lockable) to the device.
 If the device is running, each change will initiate the sending of a
 hello message with an incremented metadata version. To combine multiple
 device data changes with sending only one hello, the exclusive lock has
 to be taken by Lockable.exclusiveLock(). After the last device data
 change the release of the exclusive lock by
 Lockable.releaseExclusiveLock() will send a single hello with an
 incremented metadata version.
 
 
- Parameters:
 service - The service to remove from the device.stopIfRunning - true the service is stopped if the
            service is running, false just remove.
- Throws:
 java.io.IOException
 
void setDeviceMetadata(ThisDeviceMData deviceMetadata)
 Setting the device metadata includes getting the exclusive lock ((
 Lockable) to the device.
 If the device is running, each change will initiate the sending of a
 hello message with an incremented metadata version. To combine multiple
 device data changes with sending only one hello, the exclusive lock has
 to be taken by Lockable.exclusiveLock(). After the last device data
 change the release of the exclusive lock by
 Lockable.releaseExclusiveLock() will send a single hello with an
 incremented metadata version.
 
deviceMetadata - void setMetadataVersion(long metadataVersion)
 Setting the metadata version includes getting the exclusive lock ((
 Lockable) to the device.
 If the device is running, each change will initiate the sending of a
 hello message with an incremented metadata version. To combine multiple
 device data changes with sending only one hello, the exclusive lock has
 to be taken by Lockable.exclusiveLock(). After the last device data
 change the release of the exclusive lock by
 Lockable.releaseExclusiveLock() will send a single hello with the new
 metadata version.
 
metadataVersion - The metadata version to set is from type unsigned
            int.void setModelMetadata(ThisModelMData modelMetadata)
 Setting the model metadata version includes getting the exclusive lock ((
 Lockable) to the device.
 If the device is running, each change will initiate the sending of a
 hello message with an incremented metadata version. To combine multiple
 device data changes with sending only one hello, the exclusive lock has
 to be taken by Lockable.exclusiveLock(). After the last device data
 change the release of the exclusive lock by
 Lockable.releaseExclusiveLock() will send a single hello with an
 incremented metadata version.
 
modelMetadata - The model metadata of the device to set.Iterator getServices()
Service.
Service.void writeCustomizeMData(HashMap metaData)
metaData - HashMap which contains the metadata which the user wants to addHTTPGroup getGroup()
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||