X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fprotocol_plugins%2Fopenflow%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fprotocol_plugin%2Fopenflow%2Fcore%2FISwitch.java;h=41da311fd916dc8c1913b98f19976d9b319bf7d8;hb=eb9e1983a0fce7e4a381eff33e40cae957cddf53;hp=a15c2e5c715c95d89203a15b25dc95ebc185506c;hpb=10bace8af39d9b1642657bf9325a7123a101558a;p=controller.git diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/ISwitch.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/ISwitch.java index a15c2e5c71..41da311fd9 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/ISwitch.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/ISwitch.java @@ -1,4 +1,3 @@ - /* * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. * @@ -23,166 +22,210 @@ import org.openflow.protocol.OFStatisticsRequest; * */ public interface ISwitch { - /** - * Gets a unique XID. - * @return XID - */ - public int getNextXid(); - - /** - * Returns the Switch's ID. - * @return the Switch's ID - */ - public Long getId(); - - /** - * Returns the Switch's table numbers supported by datapath - * @return the tables - */ - public Byte getTables(); - - /** - * Returns the Switch's bitmap of supported ofp_action_type - * @return the actions - */ - public Integer getActions(); - - /** - * Returns the Switch's bitmap of supported ofp_capabilities - * @return the capabilities - */ - public Integer getCapabilities(); - - /** - * Returns the Switch's buffering capacity in Number of Pkts - * @return the buffers - */ - public Integer getBuffers(); - - /** - * Returns the Date when the switch was connected. - * @return Date The date when the switch was connected - */ - public Date getConnectedDate(); - - /** - * This method puts the message in an outgoing priority queue with normal - * priority. It will be served after high priority messages. The method - * should be used for non-critical messages such as statistics request, - * discovery packets, etc. An unique XID is generated automatically and - * inserted into the message. - * - * @param msg The OF message to be sent - * @return The XID used - */ - public Integer asyncSend(OFMessage msg); - - /** - * This method puts the message in an outgoing priority queue with normal - * priority. It will be served after high priority messages. The method - * should be used for non-critical messages such as statistics request, - * discovery packets, etc. The specified XID is inserted into the message. - * - * @param msg The OF message to be Sent - * @param xid The XID to be used in the message - * @return The XID used - */ - public Integer asyncSend(OFMessage msg, int xid); - - /** - * This method puts the message in an outgoing priority queue with high - * priority. It will be served first before normal priority messages. The - * method should be used for critical messages such as hello, echo reply - * etc. An unique XID is generated automatically and inserted into the - * message. - * - * @param msg The OF message to be sent - * @return The XID used - */ - public Integer asyncFastSend(OFMessage msg); - - /** - * This method puts the message in an outgoing priority queue with high - * priority. It will be served first before normal priority messages. The - * method should be used for critical messages such as hello, echo reply - * etc. The specified XID is inserted into the message. - * - * @param msg The OF message to be sent - * @return The XID used - */ - public Integer asyncFastSend(OFMessage msg, int xid); - - /** - * Sends the OF message followed by a Barrier Request with a unique XID which is automatically generated, - * and waits for a result from the switch. - * @param msg The message to be sent - * @return An Object which has one of the followings instances/values: - * Boolean with value true to indicate the message has been successfully processed and acknowledged by the switch; - * Boolean with value false to indicate the message has failed to be processed by the switch within a period of time or - * OFError to indicate that the message has been denied by the switch which responded with OFError. - */ - public Object syncSend(OFMessage msg); - - /** - * Returns a map containing all OFPhysicalPorts of this switch. - * @return The Map of OFPhysicalPort - */ - public Map getPhysicalPorts(); - - /** - * Returns a Set containing all port IDs of this switch. - * @return The Set of port ID - */ - public Set getPorts(); - - /** - * Returns OFPhysicalPort of the specified portNumber of this switch. - * @param portNumber The port ID - * @return OFPhysicalPort for the specified PortNumber - */ - public OFPhysicalPort getPhysicalPort(Short portNumber); - - /** - * Returns the bandwidth of the specified portNumber of this switch. - * @param portNumber the port ID - * @return bandwidth - */ - public Integer getPortBandwidth(Short portNumber); - - /** - * Returns True if the port is enabled, - * @param portNumber - * @return True if the port is enabled - */ - public boolean isPortEnabled(short portNumber); - - /** - * Returns True if the port is enabled. - * @param port - * @return True if the port is enabled - */ - public boolean isPortEnabled(OFPhysicalPort port); - - /** - * Returns a list containing all enabled ports of this switch. - * @return: List containing all enabled ports of this switch - */ - public List getEnabledPorts(); - - /** - * Sends OFStatisticsRequest with a unique XID generated automatically and waits for a result from the switch. - * @param req the OF Statistic Request to be sent - * @return Object has one of the following instances/values:: - * List, a list of statistics records received from the switch as response from the request; - * OFError if the switch failed handle the request or - * NULL if timeout has occurred while waiting for the response. - */ - public Object getStatistics(OFStatisticsRequest req); - - /** - * Returns true if the switch has reached the operational state (has sent FEATURE_REPLY to the controller). - * @return true if the switch is operational - */ - public boolean isOperational(); - + /** + * Gets a unique XID. + * + * @return XID + */ + public int getNextXid(); + + /** + * Returns the Switch's ID. + * + * @return the Switch's ID + */ + public Long getId(); + + /** + * Returns the Switch's table numbers supported by datapath + * + * @return the tables + */ + public Byte getTables(); + + /** + * Returns the Switch's bitmap of supported ofp_action_type + * + * @return the actions + */ + public Integer getActions(); + + /** + * Returns the Switch's bitmap of supported ofp_capabilities + * + * @return the capabilities + */ + public Integer getCapabilities(); + + /** + * Returns the Switch's buffering capacity in Number of Pkts + * + * @return the buffers + */ + public Integer getBuffers(); + + /** + * Returns the Date when the switch was connected. + * + * @return Date The date when the switch was connected + */ + public Date getConnectedDate(); + + /** + * This method puts the message in an outgoing priority queue with normal + * priority. It will be served after high priority messages. The method + * should be used for non-critical messages such as statistics request, + * discovery packets, etc. An unique XID is generated automatically and + * inserted into the message. + * + * @param msg + * The OF message to be sent + * @return The XID used + */ + public Integer asyncSend(OFMessage msg); + + /** + * This method puts the message in an outgoing priority queue with normal + * priority. It will be served after high priority messages. The method + * should be used for non-critical messages such as statistics request, + * discovery packets, etc. The specified XID is inserted into the message. + * + * @param msg + * The OF message to be Sent + * @param xid + * The XID to be used in the message + * @return The XID used + */ + public Integer asyncSend(OFMessage msg, int xid); + + /** + * This method puts the message in an outgoing priority queue with high + * priority. It will be served first before normal priority messages. The + * method should be used for critical messages such as hello, echo reply + * etc. An unique XID is generated automatically and inserted into the + * message. + * + * @param msg + * The OF message to be sent + * @return The XID used + */ + public Integer asyncFastSend(OFMessage msg); + + /** + * This method puts the message in an outgoing priority queue with high + * priority. It will be served first before normal priority messages. The + * method should be used for critical messages such as hello, echo reply + * etc. The specified XID is inserted into the message. + * + * @param msg + * The OF message to be sent + * @return The XID used + */ + public Integer asyncFastSend(OFMessage msg, int xid); + + /** + * Sends the OF message followed by a Barrier Request with a unique XID + * which is automatically generated, and waits for a result from the switch. + * + * @param msg + * The message to be sent + * @return An Object which has one of the followings instances/values: + * Boolean with value true to indicate the message has been + * successfully processed and acknowledged by the switch; Boolean + * with value false to indicate the message has failed to be + * processed by the switch within a period of time or OFError to + * indicate that the message has been denied by the switch which + * responded with OFError. + */ + public Object syncSend(OFMessage msg); + + /** + * Returns a map containing all OFPhysicalPorts of this switch. + * + * @return The Map of OFPhysicalPort + */ + public Map getPhysicalPorts(); + + /** + * Returns a Set containing all port IDs of this switch. + * + * @return The Set of port ID + */ + public Set getPorts(); + + /** + * Returns OFPhysicalPort of the specified portNumber of this switch. + * + * @param portNumber + * The port ID + * @return OFPhysicalPort for the specified PortNumber + */ + public OFPhysicalPort getPhysicalPort(Short portNumber); + + /** + * Returns the bandwidth of the specified portNumber of this switch. + * + * @param portNumber + * the port ID + * @return bandwidth + */ + public Integer getPortBandwidth(Short portNumber); + + /** + * Returns True if the port is enabled, + * + * @param portNumber + * @return True if the port is enabled + */ + public boolean isPortEnabled(short portNumber); + + /** + * Returns True if the port is enabled. + * + * @param port + * @return True if the port is enabled + */ + public boolean isPortEnabled(OFPhysicalPort port); + + /** + * Returns a list containing all enabled ports of this switch. + * + * @return: List containing all enabled ports of this switch + */ + public List getEnabledPorts(); + + /** + * Sends OFStatisticsRequest with a unique XID generated automatically and + * waits for a result from the switch. + * + * @param req + * the OF Statistic Request to be sent + * @return Object has one of the following instances/values:: + * List, a list of statistics records received from + * the switch as response from the request; OFError if the switch + * failed handle the request or NULL if timeout has occurred while + * waiting for the response. + */ + public Object getStatistics(OFStatisticsRequest req); + + /** + * Returns true if the switch has reached the operational state (has sent + * FEATURE_REPLY to the controller). + * + * @return true if the switch is operational + */ + public boolean isOperational(); + + /** + * Send Barrier message synchronously. The caller will be blocked until the + * Barrier reply arrives. + */ + Object syncSendBarrierMessage(); + + /** + * Send Barrier message asynchronously. The caller is not blocked. The + * Barrier message will be sent in a transmit thread which will be blocked + * until the Barrier reply arrives. + */ + Object asyncSendBarrierMessage(); }