public class UscTopologyService extends Object
Modifier and Type | Field and Description |
---|---|
static String |
Channel_TYPE
channel type
|
static String |
Channel_TYPE_CHANNEL
channel channel type string
|
static String |
NODE_TYPE_CONTROLLER
controller node type string
|
static String |
NODE_TYPE_NETWORK_DEVICE
network device node type string
|
Modifier and Type | Method and Description |
---|---|
void |
addChannel(Channel channel)
add a channel to topology channel list
|
void |
addChannelError(String destinationId,
String type,
ChannelAlarm alarm)
add error information to the channel which has the specified destination
id
|
void |
addChannelWithoutUpdateShard(Channel channel)
add a channel to topology channel list without update shard
|
void |
addNode(Node node)
add a node to local topology, when the node exists in node list of
topology, then only update the refer number of the node
|
void |
addSession(String destinationId,
String type,
Session session)
add session to the channel which has the specified destination id
|
void |
addSessionError(String destinationId,
String type,
String sessionId,
SessionAlarm alarm)
add error information to the session specified by session id, the session
belongs to the channel which specified by the destination id
|
void |
destory()
remove all of topology manager used shard data
|
Channel |
getChannel(String destinationId,
String type)
get first channel of specified destination id
|
static UscTopologyService |
getInstance()
get the unique topology service instance
|
Node |
getLocalController()
get local controller node
|
Topology |
getLocalTopolgy()
get local topology
|
Node |
getNode(String nodeId)
get node through the id of node
|
Session |
getSession(Channel channel,
String sessionId)
get session from the channel with specified session id
|
Session |
getSession(String destinationId,
String sessionId,
String type)
get session which has specified session id from the channel which has the
destination id
|
Topology |
getWholeUscTopology()
get the whole USC topology from shard data
|
void |
init()
create topology manager of USC using a given shard data manger
|
Channel |
removeChannel(String destinationId,
String type)
remove the channel specified by the destination id,and same time will
remove the corresponding source and destination nodes
|
Channel |
removeChannelWithoutUpdateShard(String destinationId,
String type)
remove the channel specified by the destination id,and same time will
remove the corresponding source and destination nodes without update Shard
|
Node |
removeNode(String nodeId)
remove the node specified by the node id, when the refer number of the
node is more than one,then only minus one refer number.
|
Session |
removeSession(String destinationId,
String type,
String sessionId)
remove session from the channel which has the specified destination id
|
boolean |
sameNodeId(String id,
Node node)
check the node has same id with the specified id
|
Channel |
updateChannel(Channel channel)
update channel information, and update the shard data of local topology
|
void |
updateChannel(Channel channel,
Session session,
boolean removeFlag) |
void |
updateSessionTransaction(String destinationId,
String type,
String sessionId,
long bytesIn,
long bytesOut)
update the transaction data values of the session specified by session
id, the session belongs to the channel which specified by the destination
id
|
void |
updateTransaction(Channel channel,
Session session,
long bytesIn,
long bytesOut) |
public static final String NODE_TYPE_CONTROLLER
public static final String Channel_TYPE
public static final String Channel_TYPE_CHANNEL
public static final String NODE_TYPE_NETWORK_DEVICE
public static UscTopologyService getInstance()
public void init()
public Node getLocalController()
public Topology getLocalTopolgy()
public Topology getWholeUscTopology()
public Node getNode(String nodeId)
nodeId
- node idpublic void addNode(Node node)
node
- the adding nodepublic Node removeNode(String nodeId)
nodeId
- node id of the removing nodepublic boolean sameNodeId(String id, Node node)
id
- a node idnode
- a nodepublic void addChannel(Channel channel)
channel
- the adding channelpublic void addChannelWithoutUpdateShard(Channel channel)
channel
- the adding channelpublic Channel removeChannel(String destinationId, String type)
destinationId
- node id of the destination nodetype
- the type of channelpublic Channel removeChannelWithoutUpdateShard(String destinationId, String type)
destinationId
- node id of the destination nodetype
- the type of channelpublic Channel updateChannel(Channel channel)
channel
- the new channelpublic void updateTransaction(Channel channel, Session session, long bytesIn, long bytesOut)
public Channel getChannel(String destinationId, String type)
destinationId
- destination node idpublic void addSession(String destinationId, String type, Session session)
destinationId
- destination idtype
- channel typesession
- the adding sessionpublic Session removeSession(String destinationId, String type, String sessionId)
destinationId
- destination idtype
- channel typesessionId
- the removing sessionpublic Session getSession(Channel channel, String sessionId)
channel
- the target channel for gettingsessionId
- specified session idpublic Session getSession(String destinationId, String sessionId, String type)
destinationId
- the target channel for gettingsessionId
- specified session idpublic void updateSessionTransaction(String destinationId, String type, String sessionId, long bytesIn, long bytesOut)
destinationId
- specified destination idsessionId
- specified session idtype
- channel typebytesIn
- bytes in numberbytesOut
- bytes out numberpublic void addChannelError(String destinationId, String type, ChannelAlarm alarm)
destinationId
- specified destination idtype
- channel typealarm
- error information objectpublic void addSessionError(String destinationId, String type, String sessionId, SessionAlarm alarm)
destinationId
- specified destination idtype
- channel typesessionId
- specified session idalarm
- error information objectpublic void destory()
Copyright © 2019 OpenDaylight. All rights reserved.