public interface ControllerService
This service allows applications to:
| Modifier and Type | Method and Description |
|---|---|
void |
addDataPathListener(DataPathListener listener)
Adds the specified datapath listener to the controller.
|
void |
addFlowListener(FlowListener listener)
Adds the specified flow listener to the controller.
|
void |
addGroupListener(GroupListener listener)
Adds the specified group listener to the controller.
|
void |
addMessageListener(MessageListener listener,
Set<MessageType> types)
Adds the specified message listener to the controller.
|
void |
addMeterListener(MeterListener listener)
Adds the specified meter listener to the controller.
|
void |
addPacketListener(SequencedPacketListener listener,
PacketListenerRole role,
int altitude)
Adds the specified packet listener to the packet sequencer, in the
specified role and at the specified altitude.
|
void |
addPacketListener(SequencedPacketListener listener,
PacketListenerRole role,
int altitude,
Set<ProtocolId> interest)
Adds the specified packet listener to the sequencer, in the
specified role and at the specified altitude.
|
MessageContext |
createMsgContext(OpenflowEventType type,
OpenflowMessage msg,
DataPathId dpid,
int auxId,
ProtocolVersion pv) |
MessageContextForHost |
createMsgContextForHost(MessageContext context,
boolean bL3Forwarding) |
MessageContextForPath |
createMsgContextForPath(MessageContext context,
boolean bL3Forwarding) |
MessageFuture |
enablePort(DataPathId dpid,
BigPortNumber port,
boolean enable)
Instructs the controller to enable or disable the given port on the
specified datapath.
|
Set<DataPathInfo> |
getAllDataPathInfo()
Returns information describing each of the OpenFlow datapaths
currently connected to the controller.
|
ControllerMx |
getControllerMx()
Returns an instance of the management interface.
|
DataPathInfo |
getDataPathInfo(DataPathId dpid)
Returns information describing a specific OpenFlow datapath.
|
MBodyDesc |
getDesc(DataPathInfo dpinfo) |
List<MBodyExperimenter> |
getExperimenter(DataPathId dpid)
Returns meter configuration or statistics (for OF 1.0 datapaths),
encoded in experimenter multipart replies.
|
List<MBodyFlowStats> |
getFlowStats(DataPathId dpid,
TableId tableId)
Returns flows installed in the specified table of the given datapath.
|
List<MBodyGroupDescStats> |
getGroupDescription(DataPathId dpid)
Returns the group descriptions from the specified datapath.
|
MBodyGroupDescStats |
getGroupDescription(DataPathId dpid,
GroupId groupId)
Returns the group description for the given group ID, from the
specified datapath.
|
MBodyGroupFeatures |
getGroupFeatures(DataPathId dpid)
Returns the supported group features for the specified datapath.
|
List<MBodyGroupStats> |
getGroupStats(DataPathId dpid)
Returns the group statistics from the specified datapath.
|
MBodyGroupStats |
getGroupStats(DataPathId dpid,
GroupId groupId)
Returns the group statistics for the given group ID, from the specified
datapath.
|
List<MBodyMeterConfig> |
getMeterConfig(DataPathId dpid)
Returns the meter configuration details from the specified datapath.
|
MBodyMeterConfig |
getMeterConfig(DataPathId dpid,
MeterId meterId)
Returns the meter configuration for the given meter ID, from the
specified datapath.
|
MBodyMeterFeatures |
getMeterFeatures(DataPathId dpid)
Returns the meter features for the specified datapath.
|
List<MBodyMeterStats> |
getMeterStats(DataPathId dpid)
Returns the meter statistics from the specified datapath.
|
MBodyMeterStats |
getMeterStats(DataPathId dpid,
MeterId meterId)
Returns the meter statistics for the given meter ID, from the specified
datapath.
|
List<SequencedPacketListener> |
getPacketListeners(PacketListenerRole role)
Returns an ordered list of packet listeners registered with the
packet sequencer, for the specified role.
|
PipelineDefinition |
getPipelineDefinition(DataPathId dpid)
Returns the
PipelineDefinition for the given datapath. |
List<MBodyPortStats> |
getPortStats(DataPathId dpid)
Returns the port statistics from the specified datapath.
|
MBodyPortStats |
getPortStats(DataPathId dpid,
BigPortNumber portNumber)
Returns the port statistics for the given port, from the specified
datapath.
|
ControllerStats |
getStats()
Returns statistical information about the controller.
|
void |
removeDataPathListener(DataPathListener listener)
Removes the specified datapath listener from the controller.
|
void |
removeFlowListener(FlowListener listener)
Removes the specified flow listener from the controller.
|
void |
removeGroupListener(GroupListener listener)
Removes the specified group listener from the controller.
|
void |
removeMessageListener(MessageListener listener)
Removes the specified message listener from the controller.
|
void |
removeMeterListener(MeterListener listener)
Removes the specified meter listener from the controller.
|
void |
removePacketListener(SequencedPacketListener listener)
Removes the specified packet listener from the packet sequencer.
|
List<MessageFuture> |
send(List<OpenflowMessage> msgs,
DataPathId dpid)
Instructs the controller to send the specified list of messages
(in order) to the specified datapath.
|
MessageFuture |
send(OpenflowMessage msg,
DataPathId dpid)
Instructs the controller to send the specified message to the
specified datapath.
|
MessageFuture |
sendFlowMod(OfmFlowMod flowMod,
DataPathId dpid)
Sends the given FlowMod message to the specified datapath.
|
MessageFuture |
sendGroupMod(OfmGroupMod groupMod,
DataPathId dpid)
Sends the given GroupMod message to the specified datapath.
|
MessageFuture |
sendMeterMod(OfmMeterMod meterMod,
DataPathId dpid)
Sends the given MeterMod message to the specified datapath.
|
ProtocolVersion |
versionOf(DataPathId dpid)
Returns the (negotiated) protocol version of the specified datapath.
|
void addPacketListener(SequencedPacketListener listener, PacketListenerRole role, int altitude)
The listener's event() callback
will be invoked for every Packet-In message that the controller
passes to the packet sequencer.
listener - the listener to be addedrole - the role the listener wishes to assumealtitude - the listener's altitudeNullPointerException - if listener or role is nullIllegalArgumentException - if altitude is negativeIllegalStateException - if the altitude (for the role)
has already been claimedaddPacketListener(SequencedPacketListener, PacketListenerRole, int, Set)void addPacketListener(SequencedPacketListener listener, PacketListenerRole role, int altitude, Set<ProtocolId> interest)
The interest argument specifies the protocols that the listener
cares about. When the sequencer receives a Packet-In message,
it will be forwarded to the listener if the packet contains any protocol
that is a member of the specified set.
listener - the listener to be addedrole - the role the listener wishes to assumealtitude - the listener's altitudeinterest - the packet protocols the listener is interested inNullPointerException - if listener or role is nullIllegalArgumentException - if altitude is negativeIllegalStateException - if the altitude (for the role)
has already been claimedaddPacketListener(SequencedPacketListener, PacketListenerRole, int)void removePacketListener(SequencedPacketListener listener)
listener - the listener to be removedNullPointerException - if listener is nullList<SequencedPacketListener> getPacketListeners(PacketListenerRole role)
role - the role to examineNullPointerException - if role is nullvoid addMessageListener(MessageListener listener, Set<MessageType> types)
The types argument specifies the types of message that the
listener cares about. When the controller receives a message,
it will be forwarded to the listener if and only if the
message's type is a member of the specified set.
An empty set (or null) is taken to mean that the listener wants to hear about every message, regardless of type. However, PacketIn messages are not forwarded in this case; see note below.
If a listener calls this method when it is already registered, the specified set of message types completely replaces the original set.
Important Note:
PacketIn messages are processed exclusively by the packet
sequencer. To participate in PacketIn processing, you must use
addPacketListener(SequencedPacketListener, PacketListenerRole, int, Set).
Attempting to request PacketIn messages by including
PACKET_IN in the types set will throw an exception.
listener - the listener to be addedtypes - the message types the listener cares aboutNullPointerException - if listener is nullIllegalArgumentException - types includes PACKET_INvoid removeMessageListener(MessageListener listener)
listener - the listener to be removedNullPointerException - if listener is nullvoid addDataPathListener(DataPathListener listener)
listener - the listener to be addedNullPointerException - if listener is nullvoid removeDataPathListener(DataPathListener listener)
listener - the listener to be removedNullPointerException - if listener is nullSet<DataPathInfo> getAllDataPathInfo()
DataPathInfo getDataPathInfo(DataPathId dpid)
NotFoundException will be thrown if there is no datapath
connected to the controller with the given ID.dpid - the datapath idNullPointerException - if dpid is nullNotFoundException - if the specified datapath does not existProtocolVersion versionOf(DataPathId dpid)
NotFoundException will be thrown if there is no datapath
connected to the controller with the given ID.dpid - the datapath IDNullPointerException - if dpid is nullNotFoundException - if the specified datapath does not existControllerStats getStats()
List<MBodyPortStats> getPortStats(DataPathId dpid)
Note that this is a synchronous call that blocks until all the port statistics replies have returned from the datapath.
dpid - the target datapathNullPointerException - if dpid is nullNotFoundException - if the specified datapath does not existMBodyPortStats getPortStats(DataPathId dpid, BigPortNumber portNumber)
Note that this is a synchronous call that blocks until the port statistics reply has returned from the datapath.
dpid - the target datapathportNumber - the target portNullPointerException - if dpid is nullNotFoundException - if the specified datapath does not exist or
the specified port does not exist on the datapathMessageFuture enablePort(DataPathId dpid, BigPortNumber port, boolean enable)
dpid - the target datapathport - the target portenable - true to enable; false to disableNullPointerException - if either parameter is nullNotFoundException - if the specified datapath does not exist or
the specified port does not exist on the datapathMessageFuture send(OpenflowMessage msg, DataPathId dpid) throws OpenflowException
Important Note:
The sending of FlowMod messages via this method is disallowed;
use sendFlowMod(com.h3c.of.lib.msg.OfmFlowMod, com.h3c.of.lib.dt.DataPathId) instead.
msg - the OpenFlow message to senddpid - the OpenFlow datapath to which the message is to be sentNullPointerException - if either parameter is nullIllegalArgumentException - if msg is mutable, or if it is a
FlowModOpenflowException - if there was a problem encoding or sending
the messageList<MessageFuture> send(List<OpenflowMessage> msgs, DataPathId dpid) throws OpenflowException
Important Note:
The sending of FlowMod messages via this method is disallowed;
use sendFlowMod(com.h3c.of.lib.msg.OfmFlowMod, com.h3c.of.lib.dt.DataPathId) instead.
msgs - the OpenFlow messages to senddpid - the OpenFlow datapath to which the messages are to be sentNullPointerException - if either parameter is null, or if any
element in the list is nullIllegalArgumentException - if any message in the list is mutable,
or is a FlowModOpenflowException - if there was a problem encoding or sending
the messagesControllerMx getControllerMx() throws AuthorizationException
ControllerManagementAuthorizer.AuthorizationException - if the caller is not authorizedList<MBodyFlowStats> getFlowStats(DataPathId dpid, TableId tableId)
tableId is null) then
all tables are assumed.
If the specified table ID is TableId.ALL, all flows from all
tables will be returned.
Note that table ID is ignored for OpenFlow 1.0 devices.
Note that this is a synchronous call that blocks until all the flow statistics replies have returned from the datapath.
dpid - the datapath from which the flows are requestedtableId - the ID of the flow tableNullPointerException - if dpid is nullNotFoundException - if the specified datapath does not existMessageFuture sendFlowMod(OfmFlowMod flowMod, DataPathId dpid) throws OpenflowException
Adds the specified flow to the given datapath if the message's
command is ADD.
Deletes the specified flow from the given datapath if the message's
command is DELETE.
flowMod - the FlowMod message to senddpid - the target datapathNullPointerException - if either parameter is nullIllegalArgumentException - if flowMod is mutableNotFoundException - if the specified datapath does not existOpenflowException - if there was an issue sending the messageFlowModCommandvoid addFlowListener(FlowListener listener)
listener - the flow listener to be addedNullPointerException - if listener is nullvoid removeFlowListener(FlowListener listener)
listener - the flow listener to be removedNullPointerException - if listener is nullList<MBodyGroupDescStats> getGroupDescription(DataPathId dpid)
Note that this is a synchronous call that blocks until all the group description replies have returned from the datapath.
dpid - the target datapathNullPointerException - if dpid is nullNotFoundException - if the specified datapath does not existVersionMismatchException - if datapath is not
OpenFlow 1.3 compliantMBodyGroupDescStats getGroupDescription(DataPathId dpid, GroupId groupId)
Note that this is a synchronous call that blocks until the group description reply has returned from the datapath.
dpid - the target datapathgroupId - the ID of the groupNullPointerException - if either parameter is nullNotFoundException - if the specified datapath or group
does not existVersionMismatchException - if datapath is not
OpenFlow 1.3 compliantList<MBodyGroupStats> getGroupStats(DataPathId dpid)
Note that this is a synchronous call that blocks until all the group statistics replies have returned from the datapath.
dpid - the target datapathNullPointerException - if dpid is nullNotFoundException - if the specified datapath does not existVersionMismatchException - if datapath is not
OpenFlow 1.3 compliantMBodyGroupStats getGroupStats(DataPathId dpid, GroupId groupId)
Note that this is a synchronous call that blocks until the group statistics reply has returned from the datapath.
dpid - the target datapathgroupId - the target group IDNullPointerException - if either parameter is nullNotFoundException - if the specified datapath or group
does not existVersionMismatchException - if datapath is not
OpenFlow 1.3 compliantMBodyGroupFeatures getGroupFeatures(DataPathId dpid)
Note that this is a synchronous call that blocks until the group features reply has returned from the datapath.
dpid - the target datapathNullPointerException - if dpid id nullNotFoundException - if the specified datapath does not existVersionMismatchException - if datapath is not
OpenFlow 1.3 compliantMessageFuture sendGroupMod(OfmGroupMod groupMod, DataPathId dpid) throws OpenflowException
Adds the group entry to the specified datapath if the message's
command is ADD.
Modifies the group entry on the specified datapath if the message's
command is MODIFY.
Deletes the group entry from the specified datapath if the message's
command is DELETE.
groupMod - the GroupMod message to senddpid - the target datapathNullPointerException - if either parameter is nullIllegalArgumentException - if groupMod is mutableNotFoundException - if the specified datapath does not existOpenflowException - if there was an issue sending the messageGroupModCommandvoid addGroupListener(GroupListener listener)
listener - the group listener to be addedNullPointerException - if listener is nullvoid removeGroupListener(GroupListener listener)
listener - the group listener to be removedNullPointerException - if listener is nullList<MBodyMeterConfig> getMeterConfig(DataPathId dpid)
Note that this is a synchronous call that blocks until all the meter configuration replies have returned from the datapath.
dpid - the target datapathNullPointerException - if dpid is nullNotFoundException - if the specified datapath does not existVersionMismatchException - if datapath is not
OpenFlow 1.3 compliantMBodyMeterConfig getMeterConfig(DataPathId dpid, MeterId meterId)
Note that this is a synchronous call that blocks until all the meter configuration reply has returned from the datapath.
dpid - the target datapathmeterId - the ID of the meterNullPointerException - if either parameter is nullNotFoundException - if the specified datapath or meter
does not existVersionMismatchException - if datapath is not
OpenFlow 1.3 compliantList<MBodyMeterStats> getMeterStats(DataPathId dpid)
Note that this is a synchronous call that blocks until all the meter statistics replies have returned from the datapath.
dpid - the target datapathNullPointerException - if dpid is nullNotFoundException - if the specified datapath does not existVersionMismatchException - if datapath is not
OpenFlow 1.3 compliantMBodyMeterStats getMeterStats(DataPathId dpid, MeterId meterId)
Note that this is a synchronous call that blocks until the meter statistics reply has returned from the datapath.
dpid - the target datapathmeterId - the target meter IDNullPointerException - if either parameter is nullNotFoundException - if the specified datapath or meter
does not existVersionMismatchException - if datapath is not
OpenFlow 1.3 compliantMBodyMeterFeatures getMeterFeatures(DataPathId dpid)
Note that this is a synchronous call that blocks until the meter features reply has returned from the datapath.
dpid - the target datapathNullPointerException - if dpid is nullNotFoundException - if the specified datapath does not existVersionMismatchException - if datapath is not
OpenFlow 1.3 compliantList<MBodyExperimenter> getExperimenter(DataPathId dpid)
Note that this is a synchronous call that blocks until the replies have returned from the datapath.
dpid - the target datapathNullPointerException - if dpid is nullNotFoundException - if the specified datapath does not existMessageFuture sendMeterMod(OfmMeterMod meterMod, DataPathId dpid) throws OpenflowException
Adds the meter to the specified datapath if the message's
command is ADD.
Modifies the meter on the specified datapath if the message's
command is MODIFY.
Deletes the meter from the specified datapath if the message's
command is DELETE.
meterMod - the MeterMod message to senddpid - the target datapathNullPointerException - if either parameter is nullIllegalArgumentException - if meterMod is mutableNotFoundException - if the specified datapath does not existOpenflowException - if there was an issue sending the messageMeterModCommandvoid addMeterListener(MeterListener listener)
listener - the meter listener to be addedNullPointerException - if listener is nullvoid removeMeterListener(MeterListener listener)
listener - the meter listener to be removedNullPointerException - if listener is nullPipelineDefinition getPipelineDefinition(DataPathId dpid)
PipelineDefinition for the given datapath.dpid - the target datapathNullPointerException - if dpid is nullNotFoundException - if the specified datapath does not existMBodyDesc getDesc(DataPathInfo dpinfo)
dpinfo - MessageContext createMsgContext(OpenflowEventType type, OpenflowMessage msg, DataPathId dpid, int auxId, ProtocolVersion pv)
MessageContextForHost createMsgContextForHost(MessageContext context, boolean bL3Forwarding)
MessageContextForPath createMsgContextForPath(MessageContext context, boolean bL3Forwarding)
Copyright © 2014. All Rights Reserved.