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.
|
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.
|
ControllerConfig |
getControllerConfig()
Returns the current run-time immutable configuration of the open flow
controller,
|
ControllerMx |
getControllerMx()
Returns an instance of the management interface.
|
DataPathInfo |
getDataPathInfo(DataPathId dpid)
Returns information describing a specific OpenFlow datapath.
|
List<MBodyExperimenter> |
getExperimenter(DataPathId dpid)
Returns meter configuration or statistics (for OF 1.0 datapaths),
encoded in experimenter multipart replies.
|
FlowClass |
getFlowClass(String id)
Retrieves the currently registered flow class with the specified id.
|
FlowClassAdministrator |
getFlowClassAdministrator()
Returns an instance of the flow class administration interface.
|
Set<FlowClass> |
getFlowClasses()
Retrieves the set of all currently registered flow classes.
|
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.
|
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.
|
List<SplMetric> |
getSplMetrics()
Returns a snapshot of the metrics collected for the registered
sequenced packet listeners . |
ControllerStats |
getStats()
Returns statistical information about the controller.
|
boolean |
isHybridMode()
Indicates whether or not the controller is operating in hybrid mode,
which is where it will defer primary forwarding decisions to the
connected switch.
|
void |
notifyDataPathReady(DataPathId dpid,
ProtocolVersion pv,
IpAddress ip)
Notify listeners that a datapath is ready for use.
|
FlowClass |
registerFlowClass(String id,
String passwd,
String description,
Set<String> lowerIds,
Set<String> higherIds,
Set<OxmFieldType> matchFields,
Set<FlowClass.ActionClass> actions)
Registers a flow mod class, with a dynamically assigned flow mod
priority, which is required when the controller is operating in a
mode where flow mods are strictly enforced.
|
void |
registerInitialFlowContributor(InitialFlowContributor ifc)
Registers an initial flow contributor with 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 |
sendConfirmedFlowMod(OfmFlowMod flowMod,
DataPathId dpid)
Sends the given FlowMod message to the specified datapath.
|
void |
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.
|
void |
unregisterFlowClass(FlowClass flowClass,
String passwd)
Cancels flow class registration.
|
void |
unregisterInitialFlowContributor(InitialFlowContributor ifc)
Cancels the given flow contributor registration.
|
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<SplMetric> getSplMetrics()
sequenced packet listeners
. Note that
the list is returned in the same order that the packet listeners get
to see and process the packets.void 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 datapathvoid notifyDataPathReady(DataPathId dpid, ProtocolVersion pv, IpAddress ip)
dpid
- the datapath IDpv
- Openflow Protocol versionip
- address of the deviceMessageFuture send(OpenflowMessage msg, DataPathId dpid) throws OpenflowException
Important Note:
The sending of FlowMod messages via this method is disallowed;
use sendFlowMod(com.hp.of.lib.msg.OfmFlowMod, com.hp.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.hp.of.lib.msg.OfmFlowMod, com.hp.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()
ControllerManagementAuthorizer
.AuthorizationException
- if the caller is not authorizedFlowClassAdministrator getFlowClassAdministrator()
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 existFlowClass registerFlowClass(String id, String passwd, String description, Set<String> lowerIds, Set<String> higherIds, Set<OxmFieldType> matchFields, Set<FlowClass.ActionClass> actions)
FlowClass.priority()
} must be used
in lieu of raw priority when submitting flow mods.
The id
should follow a hierarchical namespace (similar
to Java packages) and must share a prefix with an id of an installed
application; otherwise the controller may reject the request.
id
- global flow class id that must share prefix with
application idpasswd
- secret password chosen by the registrant to allow
repeat registrations or unregistrations without the
originally issued flow class descriptordescription
- description of the purpose or intentlowerIds
- optional set of priority ids that should fall below
this onehigherIds
- optional set of priority ids that should rise above
this onematchFields
- set of field types expected to be set in the matchactions
- type of action, e.g. drop, forward, processIllegalArgumentException
- if unable to register due to conflicts
or if the password given is not correct during repeat registrationvoid unregisterFlowClass(FlowClass flowClass, String passwd)
flowClass
- the record to be canceledpasswd
- optional password that can be used as an override to allow
unregistration using a public flow class recordIllegalArgumentException
- if the the password supplied is not
correctFlowClass getFlowClass(String id)
id
- flow class idNotFoundException
- if a FlowClass with the given id has not been
registeredSet<FlowClass> getFlowClasses()
void registerInitialFlowContributor(InitialFlowContributor ifc)
ifc
- the flow contributor to registerNullPointerException
- if ifc is nullvoid unregisterInitialFlowContributor(InitialFlowContributor ifc)
ifc
- the flow contributor to unregisterNullPointerException
- if ifc is nullvoid sendFlowMod(OfmFlowMod flowMod, DataPathId dpid) throws OpenflowException
sendConfirmedFlowMod(com.hp.of.lib.msg.OfmFlowMod, com.hp.of.lib.dt.DataPathId)
instead.
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 mutable or the flow does
not conform to registration obtained via
registerFlowClass(java.lang.String, java.lang.String, java.lang.String, java.util.Set<java.lang.String>, java.util.Set<java.lang.String>, java.util.Set<com.hp.of.lib.match.OxmFieldType>, java.util.Set<com.hp.of.ctl.prio.FlowClass.ActionClass>)
NotFoundException
- if the specified datapath does not existOpenflowException
- if there was an issue sending the messageFlowModCommand
MessageFuture sendConfirmedFlowMod(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 mutable or the flow does
not conform to registration obtained via
registerFlowClass(java.lang.String, java.lang.String, java.lang.String, java.util.Set<java.lang.String>, java.util.Set<java.lang.String>, java.util.Set<com.hp.of.lib.match.OxmFieldType>, java.util.Set<com.hp.of.ctl.prio.FlowClass.ActionClass>)
NotFoundException
- if the specified datapath does not existOpenflowException
- if there was an issue sending the messageFlowModCommand
,
MessageFuture
void 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 nullPipelineDefinition getPipelineDefinition(DataPathId dpid)
PipelineDefinition
for the given datapath.dpid
- the target datapathNullPointerException
- if dpid is nullNotFoundException
- if the specified datapath does not existList<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 messageGroupModCommand
void 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 messageMeterModCommand
void 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 nullboolean isHybridMode()
ControllerConfig getControllerConfig()
Copyright © 2015. All Rights Reserved.