org.ws4d.java.service
Class ProxyDevice

java.lang.Object
  extended by org.ws4d.java.service.DeviceCommons
      extended by org.ws4d.java.service.ProxyDevice
All Implemented Interfaces:
Device

public class ProxyDevice
extends DeviceCommons

Proxy class of a (remote) dpws device


Constructor Summary
ProxyDevice(GetResponseMessage message, DefaultDeviceReference devRef, Device oldDevice, ProtocolData protocolData)
          Constructor.
 
Method Summary
 void addServiceReferences(DataStructure to, QNameSet servicePortTypes)
          Adds service references associated to this device to the data structure to, if they match the service port types given within serviceTypes.
 java.lang.String getDefaultNamespace()
          return the default namespace.
 DeviceReference getDeviceReference()
          Gets the DeviceReference of this device.
 EndpointReference getEndpointReference()
          Returns the endpoint reference of this device.
 long getMetadataVersion()
          Returns metadata version for this device.
 Iterator getPortTypes()
          Gets the iterator over device port types of the device.
 Iterator getScopes()
          Gets iterator over all scopes of the device.
 ServiceReference getServiceReference(EndpointReference serviceEpr)
          Get service reference by endpoint reference of referenced service.
 ServiceReference getServiceReference(URI serviceId)
          Gets service reference by service id of referenced service.
 Iterator getServiceReferences()
          Gets iterator over the service references of all services.
 Iterator getServiceReferences(QNameSet servicePortTypes)
          Gets iterator over the service reference of the services, which implements all port types specified.
 Iterator getXAddressInfos()
          Returns a iterator over the transport addresses of this device.
 boolean hasCustomizeMData()
          Tagged if a Device has metadata which are added by a user
 void invalidate()
           
 boolean isRemote()
          Is device remote (proxy) or local?
 boolean isValid()
           
 java.lang.String readCustomizeMData()
          The method return the metadata that a user has added as String
 
Methods inherited from class org.ws4d.java.service.DeviceCommons
equals, getCertificate, getFirmwareVersion, getFriendlyName, getFriendlyNames, getManufacturer, getManufacturers, getManufacturerUrl, getModelName, getModelNames, getModelNumber, getModelUrl, getPresentationUrl, getPrivateKey, getSerialNumber, hashCode, isSecure, setCertificate, setPrivateKey, setSecureDevice, setSecureDevice, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProxyDevice

public ProxyDevice(GetResponseMessage message,
                   DefaultDeviceReference devRef,
                   Device oldDevice,
                   ProtocolData protocolData)
Constructor. Constructs device proxy by get response message.

Parameters:
message - Holds information about discovered device.
Method Detail

isRemote

public boolean isRemote()
Description copied from interface: Device
Is device remote (proxy) or local?

Returns:
whether this is a remote device (proxy) or not

getEndpointReference

public EndpointReference getEndpointReference()
Description copied from interface: Device
Returns the endpoint reference of this device. This endpoint reference is a unique identifier for the device.

Returns:
endpoint reference as unique identifier.

getPortTypes

public Iterator getPortTypes()
Description copied from interface: Device
Gets the iterator over device port types of the device. The port types are of type QName.

Returns:
Iterator over device port types of type QName.

getMetadataVersion

public long getMetadataVersion()
Description copied from interface: Device
Returns metadata version for this device. The metadata version is transmitted via discovery messages.

Returns:
metadata version as unsigned integer.

getDeviceReference

public DeviceReference getDeviceReference()
Description copied from interface: Device
Gets the DeviceReference of this device.

Returns:
The DeviceReference of this device.

getXAddressInfos

public Iterator getXAddressInfos()
Description copied from interface: Device
Returns a iterator over the transport addresses of this device. The type of the addresses is URI.

Returns:
Iterator over transport addresses of type URI.

getScopes

public Iterator getScopes()
Description copied from interface: Device
Gets iterator over all scopes of the device. A scope is of type URI.

Returns:
Iterator over all scopes of type URI.

getServiceReferences

public Iterator getServiceReferences()
Description copied from interface: Device
Gets iterator over the service references of all services. A service reference is of type ServiceReference.

Returns:
Iterator over the (@link ServiceReference) of each service of the device.

getServiceReferences

public Iterator getServiceReferences(QNameSet servicePortTypes)
Description copied from interface: Device
Gets iterator over the service reference of the services, which implements all port types specified. A service reference is of type ServiceReference.

Parameters:
servicePortTypes - The service port types the services must implement, to be returned by its reference.
Returns:
Iterator over the (@link ServiceReferences) to the services of the device, which implements the specified service port types.

addServiceReferences

public void addServiceReferences(DataStructure to,
                                 QNameSet servicePortTypes)
Description copied from interface: Device
Adds service references associated to this device to the data structure to, if they match the service port types given within serviceTypes.

Parameters:
to - collection to add matching service references to
servicePortTypes - service port types to look for

getServiceReference

public ServiceReference getServiceReference(URI serviceId)
Description copied from interface: Device
Gets service reference by service id of referenced service. Service id is compared as case-sensitive string.

Returns:
service reference, or null if no service matches the service id.

getServiceReference

public ServiceReference getServiceReference(EndpointReference serviceEpr)
Description copied from interface: Device
Get service reference by endpoint reference of referenced service.

Returns:
service reference, or null, if no service matches the service id.

getDefaultNamespace

public java.lang.String getDefaultNamespace()
Description copied from interface: Device
return the default namespace.

Returns:
default namespace

isValid

public boolean isValid()

invalidate

public void invalidate()

readCustomizeMData

public java.lang.String readCustomizeMData()
Description copied from interface: Device
The method return the metadata that a user has added as String

Returns:
String which contains the users metadata
See Also:
Device.readCustomizeMData()

hasCustomizeMData

public boolean hasCustomizeMData()
Description copied from interface: Device
Tagged if a Device has metadata which are added by a user

Returns:
boolean
See Also:
Device.hasCustomizeMData()