- java.lang.Object
-
- swim.io.mqtt.MqttSocketService
-
- All Implemented Interfaces:
FlowContext,IpService,MqttServiceContext
public class MqttSocketService extends Object implements IpService, MqttServiceContext
-
-
Field Summary
Fields Modifier and Type Field Description protected IpServiceContextcontextprotected MqttSettingsmqttSettingsprotected MqttServiceservice
-
Constructor Summary
Constructors Constructor Description MqttSocketService(MqttService service, MqttSettings mqttSettings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IpSocketcreateSocket()Returns a newIpSocketbinding to handle an incoming network connection.voiddidAccept(IpSocket socket)Lifecycle callback invoked by the service context after the underlying network listener has accepted a newsocketconnection.voiddidBind()Lifecycle callback invoked by the service context after the underlying network listener has bound to a port.voiddidFail(Throwable error)Lifecycle callback invoked by the service context when the underlying network listener fails by throwing anerror.voiddidUnbind()Lifecycle callback invoked by the service context after the underlying network listener has been unbound.FlowControlflowControl()Returns the currentFlowControlstate of the underlying network channel.voidflowControl(FlowControl flowControl)Enqueues an atomic replacement of the underlying network channel's flow control state with a newflowControl.FlowControlflowControl(FlowModifier flowModifier)Enqueues an atomic modification to the underlying network channel's flow control state by applying aflowModifierdelta.IpServiceContextipServiceContext()Returns the network listener context to which thisIpServiceis bound; returnsnullif thisIpServiceis unbound.InetSocketAddresslocalAddress()MqttSettingsmqttSettings()voidsetIpServiceContext(IpServiceContext context)Sets the network listener context to which thisIpServiceis bound.voidunbind()
-
-
-
Field Detail
-
service
protected final MqttService service
-
mqttSettings
protected final MqttSettings mqttSettings
-
context
protected IpServiceContext context
-
-
Constructor Detail
-
MqttSocketService
public MqttSocketService(MqttService service, MqttSettings mqttSettings)
-
-
Method Detail
-
ipServiceContext
public IpServiceContext ipServiceContext()
Description copied from interface:IpServiceReturns the network listener context to which thisIpServiceis bound; returnsnullif thisIpServiceis unbound.- Specified by:
ipServiceContextin interfaceIpService
-
setIpServiceContext
public void setIpServiceContext(IpServiceContext context)
Description copied from interface:IpServiceSets the network listener context to which thisIpServiceis bound.- Specified by:
setIpServiceContextin interfaceIpService
-
createSocket
public IpSocket createSocket()
Description copied from interface:IpServiceReturns a newIpSocketbinding to handle an incoming network connection.- Specified by:
createSocketin interfaceIpService
-
didBind
public void didBind()
Description copied from interface:IpServiceLifecycle callback invoked by the service context after the underlying network listener has bound to a port.
-
didAccept
public void didAccept(IpSocket socket)
Description copied from interface:IpServiceLifecycle callback invoked by the service context after the underlying network listener has accepted a newsocketconnection.
-
didUnbind
public void didUnbind()
Description copied from interface:IpServiceLifecycle callback invoked by the service context after the underlying network listener has been unbound.
-
didFail
public void didFail(Throwable error)
Description copied from interface:IpServiceLifecycle callback invoked by the service context when the underlying network listener fails by throwing anerror. The listener will automatically be closed.
-
flowControl
public FlowControl flowControl()
Description copied from interface:FlowContextReturns the currentFlowControlstate of the underlying network channel.- Specified by:
flowControlin interfaceFlowContext
-
flowControl
public void flowControl(FlowControl flowControl)
Description copied from interface:FlowContextEnqueues an atomic replacement of the underlying network channel's flow control state with a newflowControl.- Specified by:
flowControlin interfaceFlowContext
-
flowControl
public FlowControl flowControl(FlowModifier flowModifier)
Description copied from interface:FlowContextEnqueues an atomic modification to the underlying network channel's flow control state by applying aflowModifierdelta.- Specified by:
flowControlin interfaceFlowContext
-
mqttSettings
public MqttSettings mqttSettings()
- Specified by:
mqttSettingsin interfaceMqttServiceContext
-
localAddress
public InetSocketAddress localAddress()
- Specified by:
localAddressin interfaceMqttServiceContext
-
unbind
public void unbind()
- Specified by:
unbindin interfaceMqttServiceContext
-
-