|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DeviceReference
Reference to a device. The referenced device within can change. Get present
device by method getDevice(). Device references are created within the
discovery process and returned by the DefaultClient
. All device
references are registered in the DeviceServiceRegistry
. There should
only be one reference to each device.
Receiving a device reference typically means the registration as device
listener (DeviceListener
) to the device, which informs about device
changes by using callbacks. The DefaultClient
is such a device
listener. Device listening can be added manually by
addListener(DeviceListener)
and can be removed by
removeListener(DeviceListener)
.
Field Summary | |
---|---|
static int |
STATE_BUILD_UP
STATE: Device is running is the latest known information about the referenced device, and device (proxy/local) was created |
static int |
STATE_RUNNING
STATE: Device is running is the latest known information about the referenced device |
static int |
STATE_STOPPED
STATE: Device has stopped is the latest known information about the referenced device |
static int |
STATE_UNKNOWN
STATE: Device reference created, but no information about device state |
Fields inherited from interface org.ws4d.java.service.reference.Reference |
---|
LOCATION_LOCAL, LOCATION_REMOTE, LOCATION_UNKNOWN |
Method Summary | |
---|---|
void |
addListener(DeviceListener listener)
Register listener (callback) for device reference changes. |
void |
fetchCompleteDiscoveryDataAsync()
Fetches all discovery data of device reference by sending a directed probe to the remote device. |
void |
fetchCompleteDiscoveryDataSync()
Fetches all discovery data of device reference by sending a directed probe to the remote device. |
java.lang.String |
getCustomMData()
|
Device |
getDevice()
Get device. |
Iterator |
getDevicePortTypes(boolean doDiscovery)
Gets port types implemented by device. |
QName[] |
getDevicePortTypesAsArray(boolean doDiscovery)
Gets port types implemented by device. |
EndpointReference |
getEndpointReference()
Gets endpoint reference of device. |
long |
getMetadataVersion(boolean doDiscovery)
Returns the metadata version of the device. |
XAddressInfo |
getPreferredXAddressInfo()
|
Iterator |
getScopes(boolean doDiscovery)
Gets scopes the device resides in. |
URI[] |
getScopesAsArray(boolean doDiscovery)
Gets scopes the device resides in. |
int |
getState()
Gets state of device / device reference. |
Iterator |
getXAddressInfos(boolean doDiscovery)
Get the transport addresses of the device. |
boolean |
isAutoUpdateDevice()
|
boolean |
isCompleteDiscovered()
Case remote: Did we receive the answer to a directed probe for the current version of the device? |
boolean |
isDeviceObjectExisting()
Case remote: Did a proxy device object exist for the current version of the remote device? |
boolean |
isDiscovered()
Case remote: Did we receive a resolve message for the current version of the device. |
boolean |
isSecureDevice()
|
void |
removeListener(DeviceListener listener)
Unregisters listener for this device reference. |
void |
setAutoUpdateDevice(boolean autoUpdateDevice)
When set to true , the device reference will attempt to
rebuild the device proxy automatically each time a a change in the
device's metadata version is detected. |
void |
setSecureDevice(boolean sec)
|
Methods inherited from interface org.ws4d.java.service.reference.Reference |
---|
getLocation, getPreferredCommunicationManagerID, getPreferredXAddress |
Field Detail |
---|
static final int STATE_UNKNOWN
static final int STATE_STOPPED
static final int STATE_RUNNING
static final int STATE_BUILD_UP
Method Detail |
---|
Device getDevice() throws TimeoutException
A Proxy to a remote device is built up by sending resolve and get messages.
TimeoutException
- This exception is thrown, if the remote device
doesn't answer to the messages, which tries to receive the
necessary data. The possible messages to be sent are resolve,
and get messages. The timeout value can be configured in the
DispatchingProperties
via the methods
DispatchingProperties.setMatchWaitTime(long)
and
DispatchingProperties.setResponseWaitTime(int)
.void fetchCompleteDiscoveryDataSync() throws TimeoutException
TimeoutException
void fetchCompleteDiscoveryDataAsync() throws TimeoutException
TimeoutException
EndpointReference getEndpointReference()
Iterator getDevicePortTypes(boolean doDiscovery) throws TimeoutException
doDiscovery
- if true
and no port types are known and
device is remote located, a resolve message will be sent to
remote device to discover them.
QName
.
TimeoutException
QName[] getDevicePortTypesAsArray(boolean doDiscovery) throws TimeoutException
doDiscovery
- if true
and no port types are known and
device is remote located, a resolve message will be sent to
remote device to discover them.
QName
.
TimeoutException
Iterator getScopes(boolean doDiscovery) throws TimeoutException
doDiscovery
- if true
and no port types are known and
device is remote located, a resolve message will be sent to
remote device to discover them.
URI
.
TimeoutException
URI[] getScopesAsArray(boolean doDiscovery) throws TimeoutException
doDiscovery
- if true
and no port types are known and
device is remote located, a resolve message will be sent to
remote device to discover them.
URI
.
TimeoutException
long getMetadataVersion(boolean doDiscovery) throws TimeoutException
doDiscovery
- if true
and no port types are known and
device is remote located, a resolve message will be sent to
remote device to discover them.
TimeoutException
Iterator getXAddressInfos(boolean doDiscovery) throws TimeoutException
doDiscovery
- if true
and no port types are known and
device is remote located, a resolve message will be sent to
remote device to discover them.
URI
.
TimeoutException
java.lang.String getCustomMData()
void removeListener(DeviceListener listener)
listener
- listener to remove.void addListener(DeviceListener listener)
listener
- listener (callback) to register.boolean isDeviceObjectExisting()
true
.
true
.boolean isCompleteDiscovered()
true
.boolean isDiscovered()
true
.int getState()
STATE_UNKNOWN
, STATE_RUNNING
,
STATE_BUILD_UP
and STATE_STOPPED
.
STATE_UNKNOWN
,
STATE_RUNNING
,
STATE_BUILD_UP
,
STATE_STOPPED
boolean isSecureDevice()
void setSecureDevice(boolean sec)
boolean isAutoUpdateDevice()
void setAutoUpdateDevice(boolean autoUpdateDevice)
true
, the device reference will attempt to
rebuild the device proxy automatically each time a a change in the
device's metadata version is detected.
autoUpdateDevice
- XAddressInfo getPreferredXAddressInfo()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |