public abstract class UscPlugin extends Object implements AutoCloseable
Modifier and Type | Field and Description |
---|---|
static io.netty.util.AttributeKey<UscChannelImpl> |
CHANNEL
Constant used for setting the UscChannel attribute on a netty channel.
|
static io.netty.util.AttributeKey<io.netty.channel.Channel> |
CLIENT_CHANNEL
Constant used for setting the client channel attribute on a server
channel
|
static io.netty.util.AttributeKey<io.netty.channel.Channel> |
DIRECT_CHANNEL
Constant used for setting the next direct channel between the plugin and
device
|
static io.netty.util.AttributeKey<io.netty.channel.local.LocalChannel> |
LOCAL_SERVER_CHANNEL |
static io.netty.util.AttributeKey<UscRouteIdentifier> |
ROUTE_IDENTIFIER
Constant used for setting the UscDevice attribute on a server channel
|
static io.netty.util.AttributeKey<com.google.common.util.concurrent.SettableFuture<UscSessionImpl>> |
SESSION
Constant used for setting the UscSession attribute on a netty channel.
|
Modifier | Constructor and Description |
---|---|
protected |
UscPlugin(io.netty.channel.local.LocalAddress localAddr) |
Modifier and Type | Method and Description |
---|---|
protected void |
addCallHomeConnection(InetSocketAddress address,
io.netty.channel.Channel channel) |
void |
close() |
com.google.common.util.concurrent.SettableFuture<Boolean> |
closeAgentInternalConnection(io.netty.channel.Channel clientChannel) |
io.netty.channel.ChannelFuture |
connect(io.netty.bootstrap.Bootstrap clientBootstrap,
InetSocketAddress address)
Initiates a client session to a device service as specified by the
address parameter.
|
io.netty.channel.ChannelFuture |
connect(io.netty.bootstrap.Bootstrap clientBootstrap,
InetSocketAddress address,
boolean remote) |
protected abstract io.netty.channel.Channel |
connectToAgent(UscDevice device) |
protected abstract io.netty.channel.Channel |
connectToDeviceDirectly(UscDevice device) |
protected abstract UscChannel.ChannelType |
getChannelType() |
protected ConcurrentMap<io.netty.channel.Channel,com.google.common.util.concurrent.SettableFuture<Boolean>> |
getCloseFuture() |
protected UscConnectionManager |
getConnectionManager() |
protected UscDemultiplexer |
getDemultiplexer() |
protected Demultiplexer |
getDmpx() |
protected abstract io.netty.channel.ChannelInboundHandler |
getFrameDecoder() |
protected abstract io.netty.channel.ChannelOutboundHandler |
getFrameEncoder() |
protected io.netty.channel.ChannelInboundHandler |
getMultiplexer() |
protected void |
initAgentPipeline(io.netty.channel.ChannelPipeline p,
io.netty.channel.ChannelHandler securityHandler) |
protected void |
initDirectPipeline(io.netty.channel.ChannelPipeline p,
io.netty.channel.ChannelHandler securityHandler) |
boolean |
isChannelAvailable(InetSocketAddress address) |
UscChannelImpl |
retrieveChannelImpl(InetSocketAddress address) |
void |
sendEvent(UscEvent event)
send event to monitor service using monitor
|
public static final io.netty.util.AttributeKey<UscChannelImpl> CHANNEL
public static final io.netty.util.AttributeKey<com.google.common.util.concurrent.SettableFuture<UscSessionImpl>> SESSION
public static final io.netty.util.AttributeKey<io.netty.channel.Channel> CLIENT_CHANNEL
public static final io.netty.util.AttributeKey<UscRouteIdentifier> ROUTE_IDENTIFIER
public static final io.netty.util.AttributeKey<io.netty.channel.Channel> DIRECT_CHANNEL
public static final io.netty.util.AttributeKey<io.netty.channel.local.LocalChannel> LOCAL_SERVER_CHANNEL
protected void initAgentPipeline(io.netty.channel.ChannelPipeline p, io.netty.channel.ChannelHandler securityHandler)
protected void initDirectPipeline(io.netty.channel.ChannelPipeline p, io.netty.channel.ChannelHandler securityHandler)
protected io.netty.channel.ChannelInboundHandler getMultiplexer()
protected UscDemultiplexer getDemultiplexer()
protected Demultiplexer getDmpx()
protected UscConnectionManager getConnectionManager()
protected abstract io.netty.channel.ChannelOutboundHandler getFrameEncoder()
protected abstract io.netty.channel.ChannelInboundHandler getFrameDecoder()
public io.netty.channel.ChannelFuture connect(io.netty.bootstrap.Bootstrap clientBootstrap, InetSocketAddress address) throws InterruptedException, ExecutionException, Exception
clientBootstrap
- the Netty bootstrap to use to create the sessionaddress
- the IP address and port of the device serviceInterruptedException
ExecutionException
Exception
public io.netty.channel.ChannelFuture connect(io.netty.bootstrap.Bootstrap clientBootstrap, InetSocketAddress address, boolean remote) throws InterruptedException, ExecutionException, Exception
protected abstract UscChannel.ChannelType getChannelType()
protected abstract io.netty.channel.Channel connectToAgent(UscDevice device) throws InterruptedException, Exception
InterruptedException
Exception
protected abstract io.netty.channel.Channel connectToDeviceDirectly(UscDevice device) throws InterruptedException, Exception
InterruptedException
Exception
public void close()
close
in interface AutoCloseable
protected void addCallHomeConnection(InetSocketAddress address, io.netty.channel.Channel channel)
protected ConcurrentMap<io.netty.channel.Channel,com.google.common.util.concurrent.SettableFuture<Boolean>> getCloseFuture()
public void sendEvent(UscEvent event)
event
- event objectpublic com.google.common.util.concurrent.SettableFuture<Boolean> closeAgentInternalConnection(io.netty.channel.Channel clientChannel)
clientChannel
- public boolean isChannelAvailable(InetSocketAddress address)
public UscChannelImpl retrieveChannelImpl(InetSocketAddress address)
Copyright © 2019 OpenDaylight. All rights reserved.