| Modifier and Type | Method and Description |
|---|---|
DiscoveryAutoBinding |
addBinding(CommunicationAutoBinding binding,
boolean addDiscoveryBinding,
boolean addOutgoingDiscoveryInfo)
Adds the given autoBinding to this
Bindable. |
BindingContainer |
addBinding(CommunicationBinding binding,
boolean addDiscoveryBinding,
boolean addOutgoingDiscoveryInfo)
Adds the given binding to this
Bindable. |
void |
addBinding(DiscoveryAutoBinding autoBinding) |
void |
addBinding(DiscoveryBinding binding) |
void |
addCustomMData(java.lang.String communicationManagerId,
UnknownDataContainer container) |
void |
addFriendlyName(java.lang.String lang,
java.lang.String friendlyName)
Adds a friendly name to the device.
|
void |
addOutgoingDiscoveryInfo(OutgoingDiscoveryInfo odi) |
void |
addService(LocalService service)
Adds service to device.
|
void |
addService(LocalService service,
boolean startIfRunning)
Adds a service to the device.
|
void |
addSupportedProtocolInfo(ProtocolInfo pinfo) |
boolean |
deviceMatches(SearchParameter search)
Checks if the outer device matches the SearchParameter.
|
AuthorizationManager |
getAuthorizationManager()
Returns the authorization manager of this Device.
|
AutoBindingAndOutgoingDiscoveryInfoListener |
getAutoBindingAndOutgoingDiscoveryInfoListener() |
Iterator |
getDiscoveryAutoBindings() |
Iterator |
getDiscoveryBindings() |
DiscoveryData |
getDiscoveryData()
This will return the discovery data of the local device.
|
NetworkChangeListener |
getNetworkChangeListener() |
Set |
getOutgoingDiscoveryInfos() |
Service |
getService(URI serviceId)
Get a service.
|
Iterator |
getServices()
Get iterator over all services.
|
HashSet |
getSupportedProtocolInfos() |
boolean |
hasDiscoveryAutoBindings()
Returns
true |
boolean |
hasDiscoveryBindings()
Returns
true |
boolean |
hasOutgoingDiscoveryInfos()
Returns
true |
boolean |
isRunning()
Returns if the device was started and is running now.
|
boolean |
removeBinding(BindingContainer container) |
boolean |
removeBinding(CommunicationAutoBinding communicationBinding,
DiscoveryAutoBinding discoveryBinding) |
boolean |
removeBinding(DiscoveryAutoBinding autoBinding) |
boolean |
removeBinding(DiscoveryBinding binding) |
boolean |
removeOutgoingDiscoveryInfo(OutgoingDiscoveryInfo odi) |
void |
removeService(LocalService service)
Removes service from device.
|
void |
removeService(LocalService service,
boolean stopIfRunning)
Removes a service from the device.
|
void |
removeSupportedProtocolInfo(ProtocolInfo pinfo) |
void |
sendBye()
Send Bye Message.
|
void |
sendHello()
Send hello message.
|
void |
setAuthorizationManager(AuthorizationManager authorizationManager)
Set the authorization manager for this device.
|
void |
setCustomMData(java.lang.String communicationManagerId,
ArrayList customMData)
Set the custom metadata
|
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 |
setServiceChanged() |
void |
start()
Starts the device.
|
void |
stop()
Stops the device.
|
addMatchingServiceReferencesToDataStructure, getComManId, getCustomMData, getDefaultNamespace, getDeviceReference, getDiscoveryXAddressInfos, getEndpointReference, getFirmwareVersion, getFriendlyName, getFriendlyNames, getManufacturer, getManufacturers, getManufacturerUrl, getMetadataVersion, getModelName, getModelNames, getModelNumber, getModelUrl, getPortTypes, getPresentationUrl, getScopes, getSerialNumber, getServiceReference, getServiceReference, getServiceReferences, getServiceReferences, getTransportAndDiscoveryXAddressInfos, getTransportXAddressInfos, invalidate, isRemote, isValidaddBinding, addBinding, clearBindings, getCommunicationAutoBindings, getCommunicationBindings, hasCommunicationAutoBindings, hasCommunicationBindings, removeBinding, removeBindingexclusiveLock, releaseExclusiveLock, releaseSharedLock, sharedLock, tryExclusiveLock, trySharedLockDiscoveryData getDiscoveryData()
boolean isRunning()
true, if this device is runningvoid 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(SearchParameter search)
search - SearchParameter to match.true - if the outer device matches search.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 setServiceChanged()
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) throws java.lang.IllegalArgumentException
qnsPortTypes - Device port types to set.java.lang.IllegalArgumentExceptionvoid 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.
service - The service to remove from the device.stopIfRunning - true the service is stopped if the service is running, false just remove.java.io.IOExceptionvoid 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.void setCustomMData(java.lang.String communicationManagerId,
ArrayList customMData)
customMData - String which contains the new custom metadata.void addCustomMData(java.lang.String communicationManagerId,
UnknownDataContainer container)
org.ws4d.java.service.LocalDevice#addCustomMData(UnknownDataContainer)Iterator getServices()
Service.Service.Service getService(URI serviceId)
Service.Service.boolean hasDiscoveryBindings()
true if discovery bindings are available.true if discovery bindings are available.boolean hasDiscoveryAutoBindings()
true if discovery auto bindings are available.true if discovery auto bindings are available.Iterator getDiscoveryBindings()
Iterator getDiscoveryAutoBindings()
void addBinding(DiscoveryBinding binding)
void addBinding(DiscoveryAutoBinding autoBinding)
boolean removeBinding(DiscoveryBinding binding)
boolean removeBinding(DiscoveryAutoBinding autoBinding)
boolean hasOutgoingDiscoveryInfos()
true if outgoing discovery infos are available.true if outgoing discovery infos are available.Set getOutgoingDiscoveryInfos()
void addOutgoingDiscoveryInfo(OutgoingDiscoveryInfo odi)
boolean removeOutgoingDiscoveryInfo(OutgoingDiscoveryInfo odi)
AutoBindingAndOutgoingDiscoveryInfoListener getAutoBindingAndOutgoingDiscoveryInfoListener()
NetworkChangeListener getNetworkChangeListener()
AuthorizationManager getAuthorizationManager()
void setAuthorizationManager(AuthorizationManager authorizationManager)
authorizationManager - void addSupportedProtocolInfo(ProtocolInfo pinfo)
void removeSupportedProtocolInfo(ProtocolInfo pinfo)
HashSet getSupportedProtocolInfos()
DiscoveryAutoBinding addBinding(CommunicationAutoBinding binding, boolean addDiscoveryBinding, boolean addOutgoingDiscoveryInfo)
Bindable. Does nothing if the Bindable
already contains the binding.autoBinding - the binding to addWS4DIllegalStateException - in case this Bindable doesn't currently support modifications (see #supportsBindingChanges())BindingContainer addBinding(CommunicationBinding binding, boolean addDiscoveryBinding, boolean addOutgoingDiscoveryInfo)
Bindable. Does nothing if the Bindable
already contains the binding.addDiscoveryBinding - If true, also all corresponding DiscoveryBinding is add to the device.addOutgoingDiscoveryInfo - If true, also all corresponding OutgoingDiscoverInfos are add to the device.binding - The binding to add.WS4DIllegalStateException - in case this Bindable doesn't currently support modifications (see #supportsBindingChanges())boolean removeBinding(BindingContainer container)
boolean removeBinding(CommunicationAutoBinding communicationBinding, DiscoveryAutoBinding discoveryBinding)