Class DeviceImpl
- All Implemented Interfaces:
com.google.common.util.concurrent.Service,Device,DiscoveryAccess,HostingServiceAccess
todo DGr no support for hosting and hosted services being updated during runtime.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHostedService(HostedService hostedService) Adds a hosted service definition.Gets access to WS-Discovery in order to configure types and scopes.Gets access to Hosting Service metadata and Hosted Services.voidSends a Hello message to the network.voidsetScopes(Collection<String> scopes) Sets the scopes in accordance with WS-Discovery.voidsetThisDevice(org.somda.sdc.dpws.model.ThisDeviceType thisDevice) Adds the ThisModel definition.voidsetThisModel(org.somda.sdc.dpws.model.ThisModelType thisModel) Updates the ThisModel definition.voidsetTypes(Collection<QName> types) Sets the types in accordance with WS-Discovery.protected voidshutDown()protected voidstartUp()Methods inherited from class com.google.common.util.concurrent.AbstractIdleService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, state, stopAsync, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.common.util.concurrent.Service
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, failureCause, isRunning, startAsync, state, stopAsync
-
Method Details
-
startUp
- Specified by:
startUpin classcom.google.common.util.concurrent.AbstractIdleService- Throws:
Exception
-
shutDown
- Specified by:
shutDownin classcom.google.common.util.concurrent.AbstractIdleService- Throws:
Exception
-
getActiveSubscriptions
- Specified by:
getActiveSubscriptionsin interfaceDevice
-
getDiscoveryAccess
Description copied from interface:DeviceGets access to WS-Discovery in order to configure types and scopes.- Specified by:
getDiscoveryAccessin interfaceDevice- Returns:
- discovery access.
-
getHostingServiceAccess
Description copied from interface:DeviceGets access to Hosting Service metadata and Hosted Services.- Specified by:
getHostingServiceAccessin interfaceDevice- Returns:
- hosting service access.
-
getEprAddress
- Specified by:
getEprAddressin interfaceDevice
-
setTypes
Description copied from interface:DiscoveryAccessSets the types in accordance with WS-Discovery.- Specified by:
setTypesin interfaceDiscoveryAccess- Parameters:
types- the types to set.- See Also:
-
setScopes
Description copied from interface:DiscoveryAccessSets the scopes in accordance with WS-Discovery.- Specified by:
setScopesin interfaceDiscoveryAccess- Parameters:
scopes- the scopes to set.- See Also:
-
sendHello
public void sendHello()Description copied from interface:DiscoveryAccessSends a Hello message to the network.The Hello message will be sent only if
DiscoveryAccess.setScopes(Collection)orDiscoveryAccess.setTypes(Collection)has been called prior to this function. This needs to be repeated for every Hello to be sent.- Specified by:
sendHelloin interfaceDiscoveryAccess
-
setThisDevice
public void setThisDevice(org.somda.sdc.dpws.model.ThisDeviceType thisDevice) Description copied from interface:HostingServiceAccessAdds the ThisModel definition.According to the DPWS specification, certain information is limited in the number of characters:
ThisDeviceType.getFriendlyName()shall have fewer thanDpwsConstants.MAX_FIELD_SIZEoctetsThisDeviceType.getFirmwareVersion()shall have fewer thanDpwsConstants.MAX_FIELD_SIZEoctetsThisDeviceType.getSerialNumber()()} shall have fewer thanDpwsConstants.MAX_FIELD_SIZEoctets
Attention: If those limits are exceeded, the underlying implementation may cut off overflowing characters.
- Specified by:
setThisDevicein interfaceHostingServiceAccess- Parameters:
thisDevice- the ThisModel information to set.- See Also:
-
setThisModel
public void setThisModel(org.somda.sdc.dpws.model.ThisModelType thisModel) Description copied from interface:HostingServiceAccessUpdates the ThisModel definition.According to the DPWS specification, certain information is limited in the number of characters:
ThisModelType.getManufacturer()()} shall have fewer thanDpwsConstants.MAX_FIELD_SIZEoctetsThisModelType.getModelName()()} shall have fewer thanDpwsConstants.MAX_FIELD_SIZEoctetsThisModelType.getModelNumber()()} ()} shall have fewer thanDpwsConstants.MAX_FIELD_SIZEoctetsThisModelType.getManufacturerUrl()shall have fewer thanDpwsConstants.MAX_URI_SIZEoctetsThisModelType.getModelUrl()()} shall have fewer thanDpwsConstants.MAX_URI_SIZEoctets
Attention: If those limits are exceeded, the underlying implementation may cut off overflowing characters.
- Specified by:
setThisModelin interfaceHostingServiceAccess- Parameters:
thisModel- the ThisModel information to set.- See Also:
-
addHostedService
Description copied from interface:HostingServiceAccessAdds a hosted service definition.Attention: there is currently no mechanism that verifies if the hosted service was added before!
- Specified by:
addHostedServicein interfaceHostingServiceAccess- Parameters:
hostedService- the hosted service definition to add.
-