Class DeviceImpl
-
- All Implemented Interfaces:
-
com.google.common.util.concurrent.Service,org.somda.sdc.dpws.device.Device,org.somda.sdc.dpws.device.DiscoveryAccess,org.somda.sdc.dpws.device.HostingServiceAccess
public class DeviceImpl extends AbstractIdleService implements Device, Service, DiscoveryAccess, HostingServiceAccess
Default implementation of Device, DiscoveryAccess and HostingServiceAccess.
todo DGr no support for hosting and hosted services being updated during runtime.
-
-
Field Summary
Fields Modifier and Type Field Description public final StringeprAddress
-
Method Summary
Modifier and Type Method Description StringgetEprAddress()Map<String, SubscriptionManager>getActiveSubscriptions()DiscoveryAccessgetDiscoveryAccess()Gets access to WS-Discovery in order to configure types and scopes. HostingServiceAccessgetHostingServiceAccess()Gets access to Hosting Service metadata and Hosted Services. voidsetTypes(Collection<QName> types)Sets the types in accordance with WS-Discovery. voidsetScopes(Collection<String> scopes)Sets the scopes in accordance with WS-Discovery. voidsendHello()Sends a Hello message to the network. voidsetThisDevice(ThisDeviceType thisDevice)Adds the ThisModel definition. voidsetThisModel(ThisModelType thisModel)Updates the ThisModel definition. voidaddHostedService(HostedService hostedService)Adds a hosted service definition. -
Methods inherited from class com.google.common.util.concurrent.AbstractIdleService
addListener, awaitRunning, awaitTerminated, failureCause, isRunning, startAsync, state, stopAsync, toString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getEprAddress
String getEprAddress()
-
getActiveSubscriptions
Map<String, SubscriptionManager> getActiveSubscriptions()
-
getDiscoveryAccess
DiscoveryAccess getDiscoveryAccess()
Gets access to WS-Discovery in order to configure types and scopes.
- Returns:
discovery access.
-
getHostingServiceAccess
HostingServiceAccess getHostingServiceAccess()
Gets access to Hosting Service metadata and Hosted Services.
- Returns:
hosting service access.
-
setTypes
void setTypes(Collection<QName> types)
Sets the types in accordance with WS-Discovery.
- Parameters:
types- the types to set.
-
setScopes
void setScopes(Collection<String> scopes)
Sets the scopes in accordance with WS-Discovery.
- Parameters:
scopes- the scopes to set.
-
sendHello
void sendHello()
Sends a Hello message to the network.
The Hello message will be sent only if setScopes or setTypes has been called prior to this function. This needs to be repeated for every Hello to be sent.
-
setThisDevice
void setThisDevice(ThisDeviceType thisDevice)
Adds the ThisModel definition.
According to the DPWS specification, certain information is limited in the number of characters:
- getFriendlyName shall have fewer than MAX_FIELD_SIZE octets
- getFirmwareVersion shall have fewer than MAX_FIELD_SIZE octets
- getSerialNumber ()} shall have fewer than MAX_FIELD_SIZE octets
Attention: If those limits are exceeded, the underlying implementation may cut off overflowing characters.
- Parameters:
thisDevice- the ThisModel information to set.
-
setThisModel
void setThisModel(ThisModelType thisModel)
Updates the ThisModel definition.
According to the DPWS specification, certain information is limited in the number of characters:
- getManufacturer ()} shall have fewer than MAX_FIELD_SIZE octets
- getModelName ()} shall have fewer than MAX_FIELD_SIZE octets
- getModelNumber ()} ()} shall have fewer than MAX_FIELD_SIZE octets
- getManufacturerUrl shall have fewer than MAX_URI_SIZE octets
- getModelUrl ()} shall have fewer than MAX_URI_SIZE octets
Attention: If those limits are exceeded, the underlying implementation may cut off overflowing characters.
- Parameters:
thisModel- the ThisModel information to set.
-
addHostedService
void addHostedService(HostedService hostedService)
Adds a hosted service definition.
Attention: there is currently no mechanism that verifies if the hosted service was added before!
- Parameters:
hostedService- the hosted service definition to add.
-
-
-
-