public class UscRouteBrokerService extends Object
Modifier and Type | Method and Description |
---|---|
void |
addLocalSession(UscRouteIdentifier localRouteId,
io.netty.channel.local.LocalChannel serverChannel)
add local session for processing the response which getting from remote
controller
|
void |
addMountedDevice(UscRemoteChannelIdentifier remoteChannel,
akka.actor.ActorRef communicator)
add remote channel and communicator which belongs to the controller which
connected with the remote channel
|
void |
broadcastMessage(UscRemoteMessage message)
broad cast message to all managed remote actors,like add channel event
message
|
boolean |
clusterMemberDown(akka.cluster.Member member)
process member down event for cluster
|
boolean |
clusterMemberUp(akka.cluster.Member member)
process member up event for cluster
|
int |
createNewLocalSessionId(UscRouteIdentifier remoteRouteId)
create a new lcoal session id for remote caller
|
void |
destroy()
destroy broker service
|
boolean |
existRemoteChannel(UscRemoteChannelIdentifier remoteChannel)
check if exist the remote channel in remote device table
|
static UscRouteBrokerService |
getInstance()
get singleton instance of broker service
|
akka.actor.ActorRef |
getRemoteActorForRequest(UscRouteIdentifier localRouteId)
get actor which has the remote channel of local route identifier
|
akka.actor.ActorRef |
getRemoteActorForResponse(UscRouteIdentifier localRouteId)
get actor which sending request to local channel, and will call back to
it
|
io.netty.channel.local.LocalChannel |
getRequestSource(UscRouteIdentifier localRouteId)
get the server channel for sending request to remote using the particular
route identifier
|
void |
init()
create actor system and communicator
|
boolean |
isLocalRemoteSession(UscRouteIdentifier routeId)
check if the route identifier is local session using remote channel for
intercepting the request from local channel
|
boolean |
isRemoteSession(UscRouteIdentifier routeId)
check if the route identifier is the remote session using local channel
for intercepting the response from agent channel
|
void |
processException(UscRemoteExceptionMessage message)
process remote exception message
|
void |
processRequest(UscRemoteDataMessage message,
akka.actor.ActorRef sender)
process remote request for remote caller(sender)
|
void |
processResponse(UscRemoteMessage message)
process response which getting from remote controller
|
void |
removeLocalSession(UscRouteIdentifier localRouteId)
remove local session for processing the response which getting from
remote controller
|
void |
removeMountedDevice(UscRemoteChannelIdentifier remoteChannel,
akka.actor.ActorRef communicator)
remove remote channel and communicator which belongs to the controller
which connected with the remote channel
|
void |
sendException(UscRouteIdentifier localRouteId,
UscException exception)
send local USC channel exception response to remote session
|
void |
sendRequest(UscRemoteMessage message)
send local remote request or notice to remote actor
|
void |
sendResponse(UscRouteIdentifier localRouteId,
byte[] payload)
send local USC channel response to remote session
|
void |
setConnetionManager(UscChannel.ChannelType type,
UscConnectionManager connectionManager)
set connection manager for each channel type
|
public void init()
public boolean clusterMemberUp(akka.cluster.Member member)
member
- the member of clusterpublic boolean clusterMemberDown(akka.cluster.Member member)
member
- the member of clusterpublic static UscRouteBrokerService getInstance()
public boolean isLocalRemoteSession(UscRouteIdentifier routeId)
routeId
- route identifierpublic boolean isRemoteSession(UscRouteIdentifier routeId)
routeId
- route identifierpublic akka.actor.ActorRef getRemoteActorForRequest(UscRouteIdentifier localRouteId)
localRouteId
- local route identifierpublic akka.actor.ActorRef getRemoteActorForResponse(UscRouteIdentifier localRouteId)
localRouteId
- local route identifier which geting from agent channelpublic boolean existRemoteChannel(UscRemoteChannelIdentifier remoteChannel)
remoteChannel
- remote channelpublic void addMountedDevice(UscRemoteChannelIdentifier remoteChannel, akka.actor.ActorRef communicator)
remoteChannel
- remote channelcommunicator
- communicatorpublic void removeMountedDevice(UscRemoteChannelIdentifier remoteChannel, akka.actor.ActorRef communicator)
remoteChannel
- remote channelcommunicator
- communicatorpublic void addLocalSession(UscRouteIdentifier localRouteId, io.netty.channel.local.LocalChannel serverChannel)
localRouteId
- local route identifierserverChannel
- server local channelpublic void removeLocalSession(UscRouteIdentifier localRouteId)
localRouteId
- local route identifierpublic int createNewLocalSessionId(UscRouteIdentifier remoteRouteId)
remoteRouteId
- remote route identifierpublic io.netty.channel.local.LocalChannel getRequestSource(UscRouteIdentifier localRouteId)
localRouteId
- local route identifierpublic void sendRequest(UscRemoteMessage message)
message
- remote messagepublic void broadcastMessage(UscRemoteMessage message)
message
- remote messagepublic void sendResponse(UscRouteIdentifier localRouteId, byte[] payload)
localRouteId
- local route identifierpayload
- response pay load, no usc headerpublic void sendException(UscRouteIdentifier localRouteId, UscException exception)
localRouteId
- local route identifierexception
- exception of agent channelpublic void processRequest(UscRemoteDataMessage message, akka.actor.ActorRef sender)
message
- request contentsender
- request callerpublic void processResponse(UscRemoteMessage message)
message
- response contentpublic void processException(UscRemoteExceptionMessage message)
message
- public void setConnetionManager(UscChannel.ChannelType type, UscConnectionManager connectionManager)
type
- channel typeconnectionManager
- connection managerpublic void destroy()
Copyright © 2019 OpenDaylight. All rights reserved.