Open Kilda Java Documentation
org.openkilda.wfm.OfeMessageUtils Class Reference

Static Public Member Functions

static String createSwitchInfoMessage (String switchId, String state)
 
static String createPortInfoMessage (String switchId, String portId, String state)
 
static String createInfoMessage (boolean isSwitch, String switchId, String portId, String state)
 
static String createSwitchDataMessage (String state, String switchId)
 
static String createPortDataMessage (String state, String switchId, String portId)
 
static String createDataMessage (String type, String state, String switchId, String portId)
 
static Map< String, ?> fromJson (String json) throws IOException
 
static String toJson (Map< String, ?> map) throws IOException
 
static Map< String, ?> getData (String json) throws IOException
 
static String createIslFail (SwitchId switchId, int portId, String correlationId) throws IOException
 
static String createIslDiscovery (SwitchId switchId, int portId, String correlationId) throws IOException
 

Static Public Attributes

static final String FIELD_SWITCH_ID = "switch_id"
 
static final String FIELD_PORT_ID = "port_no"
 
static final String FIELD_STATE = "state"
 
static final String SWITCH_UP = "ACTIVATED"
 
static final String SWITCH_DOWN = "DEACTIVATED"
 
static final String PORT_UP = "UP"
 
static final String PORT_ADD = "ADD"
 
static final String PORT_DOWN = "DOWN"
 
static final String LINK_UP = "DISCOVERED"
 
static final String LINK_DOWN = "FAILED"
 
static final String MT_SWITCH = "org.openkilda.messaging.info.event.SwitchInfoData"
 
static final String MT_PORT = "org.openkilda.messaging.info.event.PortInfoData"
 

Detailed Description

OfeMessageUtils - A utility class that will help with the messages on kilda.speaker and speaker.**.*

Example OpenFlow Messages: { "clazz": "org.openkilda.messaging.info.InfoMessage", "timestamp": 1489980143, "payload": { "clazz": "org.openkilda.messaging.info.event.SwitchInfoData", "switch_id": "0x0000000000000001", "state": "ACTIVATED | ADDED | CHANGE | DEACTIVATED | REMOVED" } }

{ "clazz": "org.openkilda.messaging.info.InfoMessage", "timestamp": 1489980143, "payload": { "clazz": "org.openkilda.messaging.info.event.PortInfoData", "switch_id": "0x0000000000000001", "state": "UP | DOWN | .. " "port_no": LONG "max_capacity": LONG } }

{"clazz": "org.openkilda.messaging.info.InfoMessage", "payload": { "clazz": "org.openkilda.messaging.info.event.SwitchInfoData", "switch_id": "0x0000000000000001", "state": "ACTIVATED"}}

Definition at line 71 of file OfeMessageUtils.java.

Member Function Documentation

◆ createDataMessage()

static String org.openkilda.wfm.OfeMessageUtils.createDataMessage ( String  type,
String  state,
String  switchId,
String  portId 
)
static

Return the {"payload":{}} portion of a Kilda message type.

Returns
the {"payload":{}} portion of a Kilda message type.

Definition at line 154 of file OfeMessageUtils.java.

◆ createInfoMessage()

static String org.openkilda.wfm.OfeMessageUtils.createInfoMessage ( boolean  isSwitch,
String  switchId,
String  portId,
String  state 
)
static

Return info message.

Parameters
isSwitchit is either a switch or port at this stage.
switchIdswitch id.
portIdport id.
statestate.
Returns
info message.

Definition at line 130 of file OfeMessageUtils.java.

◆ createIslDiscovery()

static String org.openkilda.wfm.OfeMessageUtils.createIslDiscovery ( SwitchId  switchId,
int  portId,
String  correlationId 
) throws IOException
static

Return a JSON string that can be used to for link event.

Returns
a JSON string that can be used to for link event

Definition at line 215 of file OfeMessageUtils.java.

◆ createIslFail()

static String org.openkilda.wfm.OfeMessageUtils.createIslFail ( SwitchId  switchId,
int  portId,
String  correlationId 
) throws IOException
static

Return ISL discovery failure message.

Parameters
switchIdswitch id.
portIdport id.
correlationIdcorrelation id.
Returns
isl discovery failure message.
Exceptions
IOExceptionerror writing message as string.

Definition at line 199 of file OfeMessageUtils.java.

◆ createPortDataMessage()

static String org.openkilda.wfm.OfeMessageUtils.createPortDataMessage ( String  state,
String  switchId,
String  portId 
)
static

Definition at line 145 of file OfeMessageUtils.java.

◆ createPortInfoMessage()

static String org.openkilda.wfm.OfeMessageUtils.createPortInfoMessage ( String  switchId,
String  portId,
String  state 
)
static

Return port info message.

Parameters
switchIdswitch id.
portIdport id.
state- ADD | OTHER_UPDATE | DELETE | UP | DOWN
Returns
port info message.

Definition at line 117 of file OfeMessageUtils.java.

◆ createSwitchDataMessage()

static String org.openkilda.wfm.OfeMessageUtils.createSwitchDataMessage ( String  state,
String  switchId 
)
static

Definition at line 141 of file OfeMessageUtils.java.

◆ createSwitchInfoMessage()

static String org.openkilda.wfm.OfeMessageUtils.createSwitchInfoMessage ( String  switchId,
String  state 
)
static

Return switch info message.

Parameters
switchIdswitch id.
state- ACTIVATED | ADDED | CHANGE | DEACTIVATED | REMOVED
Returns
switch info message.

Definition at line 105 of file OfeMessageUtils.java.

◆ fromJson()

static Map<String, ?> org.openkilda.wfm.OfeMessageUtils.fromJson ( String  json) throws IOException
static

Definition at line 167 of file OfeMessageUtils.java.

◆ getData()

static Map<String, ?> org.openkilda.wfm.OfeMessageUtils.getData ( String  json) throws IOException
static

Return data from json.

Parameters
jsonJSON.
Returns
data from json.
Exceptions
IOExceptionerror getting root from json.

Definition at line 182 of file OfeMessageUtils.java.

◆ toJson()

static String org.openkilda.wfm.OfeMessageUtils.toJson ( Map< String, ?>  map) throws IOException
static

Definition at line 171 of file OfeMessageUtils.java.

Member Data Documentation

◆ FIELD_PORT_ID

final String org.openkilda.wfm.OfeMessageUtils.FIELD_PORT_ID = "port_no"
static

Definition at line 74 of file OfeMessageUtils.java.

◆ FIELD_STATE

final String org.openkilda.wfm.OfeMessageUtils.FIELD_STATE = "state"
static

Definition at line 75 of file OfeMessageUtils.java.

◆ FIELD_SWITCH_ID

final String org.openkilda.wfm.OfeMessageUtils.FIELD_SWITCH_ID = "switch_id"
static

Definition at line 73 of file OfeMessageUtils.java.

◆ LINK_DOWN

final String org.openkilda.wfm.OfeMessageUtils.LINK_DOWN = "FAILED"
static

Definition at line 83 of file OfeMessageUtils.java.

◆ LINK_UP

final String org.openkilda.wfm.OfeMessageUtils.LINK_UP = "DISCOVERED"
static

Definition at line 82 of file OfeMessageUtils.java.

◆ MT_PORT

final String org.openkilda.wfm.OfeMessageUtils.MT_PORT = "org.openkilda.messaging.info.event.PortInfoData"
static

Definition at line 87 of file OfeMessageUtils.java.

◆ MT_SWITCH

final String org.openkilda.wfm.OfeMessageUtils.MT_SWITCH = "org.openkilda.messaging.info.event.SwitchInfoData"
static

Definition at line 86 of file OfeMessageUtils.java.

◆ PORT_ADD

final String org.openkilda.wfm.OfeMessageUtils.PORT_ADD = "ADD"
static

Definition at line 80 of file OfeMessageUtils.java.

◆ PORT_DOWN

final String org.openkilda.wfm.OfeMessageUtils.PORT_DOWN = "DOWN"
static

Definition at line 81 of file OfeMessageUtils.java.

◆ PORT_UP

final String org.openkilda.wfm.OfeMessageUtils.PORT_UP = "UP"
static

Definition at line 79 of file OfeMessageUtils.java.

◆ SWITCH_DOWN

final String org.openkilda.wfm.OfeMessageUtils.SWITCH_DOWN = "DEACTIVATED"
static

Definition at line 78 of file OfeMessageUtils.java.

◆ SWITCH_UP

final String org.openkilda.wfm.OfeMessageUtils.SWITCH_UP = "ACTIVATED"
static

Definition at line 77 of file OfeMessageUtils.java.


The documentation for this class was generated from the following file: