Changed TopologyManager to ignore edges that contain invalid node connectors.
[controller.git] / opendaylight / switchmanager / api / src / main / java / org / opendaylight / controller / switchmanager / ISwitchManager.java
index 48f5aa48f61c579127fc1d5229dbd116e57cd70e..9ac0b5055f071de56ad2afd87e0e65bb8ef3da29 100644 (file)
@@ -19,12 +19,6 @@ import org.opendaylight.controller.sal.core.NodeConnector;
 import org.opendaylight.controller.sal.core.Property;
 import org.opendaylight.controller.sal.utils.Status;
 
-import org.opendaylight.controller.switchmanager.SpanConfig;
-import org.opendaylight.controller.switchmanager.Subnet;
-import org.opendaylight.controller.switchmanager.SubnetConfig;
-import org.opendaylight.controller.switchmanager.Switch;
-import org.opendaylight.controller.switchmanager.SwitchConfig;
-
 /**
  * Primary purpose of this interface is to provide methods for application to
  * access various system resources and inventory data including nodes, node
@@ -37,7 +31,7 @@ public interface ISwitchManager {
      * Add a subnet configuration
      *
      * @param  configObject refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SubnetConfig}
-     * @return "Success" or failure reason
+     * @return the Status object representing the result of the request
      */
     public Status addSubnet(SubnetConfig configObject);
 
@@ -45,10 +39,18 @@ public interface ISwitchManager {
      * Remove a subnet configuration
      *
      * @param  configObject refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SubnetConfig}
-     * @return "Success" or failure reason
+     * @return the Status object representing the result of the request
      */
     public Status removeSubnet(SubnetConfig configObject);
 
+    /**
+     * Modify a subnet configuration
+     *
+     * @param  configObject refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SubnetConfig}
+     * @return the Status object representing the result of the request
+     */
+    public Status modifySubnet(SubnetConfig configObject);
+
     /**
      * Remove a subnet configuration given the name
      *
@@ -129,34 +131,60 @@ public interface ISwitchManager {
      * Update Switch specific configuration such as Switch Name and Tier
      *
      * @param cfgConfig refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SwitchConfig}
+     *
+     * @deprecated replaced by updateNodeConfig(switchConfig)
      */
+    @Deprecated
     public void updateSwitchConfig(SwitchConfig cfgObject);
 
+    /**
+     * Update Node specific configuration such as Node Name and Tier
+     *
+     * @param cfgConfig
+     *            refer to {@link Open Declaration
+     *            org.opendaylight.controller.switchmanager.SwitchConfig}
+     * @return "Success" or failure reason
+     */
+    public Status updateNodeConfig(SwitchConfig switchConfig);
+
+    /**
+     * Removes node properties configured by the user
+     *
+     * @param nodeId
+     *            Node Identifier as specified by
+     *            {@link org.opendaylight.controller.sal.core.Node}
+     * @return "Success" or failure reason
+     */
+    public Status removeNodeConfig(String nodeId);
+
     /**
      * Return the previously configured Switch Configuration given the node id
      *
-     * @param nodeId Node Identifier as specified by {@link org.opendaylight.controller.sal.core.Node}
-     * @return {@link org.opendaylight.controller.switchmanager.SwitchConfig} resources
+     * @param nodeId
+     *            Node Identifier as specified by
+     *            {@link org.opendaylight.controller.sal.core.Node}
+     * @return {@link org.opendaylight.controller.switchmanager.SwitchConfig}
+     *         resources
      */
     public SwitchConfig getSwitchConfig(String nodeId);
 
     /**
      * Add node connectors to a subnet
      *
-     * @param name The subnet config name
-     * @param nodeConnectors nodePorts string specified by {@link Open Declaration org.opendaylight.controller.switchmanager.SubnetConfig}
-     * @return "Success" or failure reason
+     * @param name The configured subnet name
+     * @param nodeConnectors list of string each representing a node connector as specified by {@link Open Declaration org.opendaylight.controller.sal.core.NodeConnector}
+     * @return The Status object indicating the result of this request
      */
-    public Status addPortsToSubnet(String name, String nodeConnectors);
+    public Status addPortsToSubnet(String name, List<String> nodeConnectors);
 
     /**
      * Remove node connectors from a subnet
      *
-     * @param name              the subnet config name
-     * @param nodeConnectors    nodePorts string specified by {@link Open Declaration org.opendaylight.controller.switchmanager.SubnetConfig}
-     * @return "Success" or failure reason
+     * @param name              the configured subnet name
+     * @param nodeConnectors    list of string each representing a node connector as specified by {@link Open Declaration org.opendaylight.controller.sal.core.NodeConnector}
+     * @return The Status object indicating the result of this request
      */
-    public Status removePortsFromSubnet(String name, String nodeConnectors);
+    public Status removePortsFromSubnet(String name, List<String> nodeConnectors);
 
     /**
      * Return the set of all the nodes
@@ -307,6 +335,14 @@ public interface ISwitchManager {
      */
     public Boolean isNodeConnectorEnabled(NodeConnector nodeConnector);
 
+    /**
+     * Test whether the given node connector exists.
+     *
+     * @param nc  {@link org.opendaylight.controller.sal.core.NodeConnector}
+     * @return    True if exists, false otherwise.
+     */
+    public boolean doesNodeConnectorExist(NodeConnector nc);
+
     /**
      * Return controller MAC address
          *
@@ -323,29 +359,19 @@ public interface ISwitchManager {
     public byte[] getNodeMAC(Node node);
 
     /**
-     * Return true if the host Refresh procedure (by sending ARP request probes
-     * to known hosts) is enabled. By default, the procedure is enabled. This can
-     * be overwritten by OSFI CLI "hostRefresh off".
-     *
-     * @return true if it is enabled; false if it's disabled.
-     */
-    public boolean isHostRefreshEnabled();
-
-    /**
-     * Return host refresh retry count
+     * Create a Name/Tier/Bandwidth Property object based on given property name
+     * and value. Other property types are not supported yet.
      *
-     * @return host refresh retry count
+     * @param propName
+     *            Name of the Property specified by
+     *            {@link org.opendaylight.controller.sal.core.Property} and its
+     *            extended classes
+     * @param propValue
+     *            Value of the Property specified by
+     *            {@link org.opendaylight.controller.sal.core.Property} and its
+     *            extended classes
+     * @return {@link org.opendaylight.controller.sal.core.Property}
      */
-    public int getHostRetryCount();
-
-        /**
-         * Create a Name/Tier/Bandwidth Property object based on given property
-         * name and value. Other property types are not supported yet.
-         *
-     * @param propName Name of the Property specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
-     * @param propValue Value of the Property specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
-         * @return {@link org.opendaylight.controller.sal.core.Property}
-         */
     public Property createProperty(String propName, String propValue);
 
     /**
@@ -357,5 +383,6 @@ public interface ISwitchManager {
      * configured and the network node does not provide its description,
      * an empty string is returned.
      */
+    @Deprecated
     public String getNodeDescription(Node node);
 }