OSPF-API refactored based on review comments, ONOS-2738

Change-Id: I94b22fd8f9eb8e706f049348de8ce99e2e599d67
This commit is contained in:
sunish vk 2016-02-19 19:14:35 +05:30 committed by Gerrit Code Review
parent 49abe71b0a
commit 11b02ffccf

View File

@ -1,109 +1,90 @@
/* /*
* Copyright 2016 Open Networking Laboratory * Copyright 2016 Open Networking Laboratory
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.ospf.controller; package org.onosproject.ospf.controller;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
/** /**
* Abstraction of an OSPF controller. * Abstraction of an OSPF controller.
* Serves as a one stop shop for obtaining OSPF devices and (un)register listeners on OSPF events. * Serves as a one stop shop for obtaining OSPF devices and (un)register listeners on OSPF events.
*/ */
public interface OspfController { public interface OspfController {
/** /**
* Registers a listener for router meta events. * Registers a listener for router meta events.
* *
* @param listener the listener to notify * @param listener the listener to notify
*/ */
void addRouterListener(OspfRouterListener listener); void addRouterListener(OspfRouterListener listener);
/** /**
* Unregisters a router listener. * Unregisters a router listener.
* *
* @param listener the listener to unregister * @param listener the listener to unregister
*/ */
void removeRouterListener(OspfRouterListener listener); void removeRouterListener(OspfRouterListener listener);
/** /**
* Registers a listener for OSPF message events. * Registers a listener for OSPF message events.
* *
* @param listener the listener to notify * @param listener the listener to notify
*/ */
void addLinkListener(OspfLinkListener listener); void addLinkListener(OspfLinkListener listener);
/** /**
* Unregisters a link listener. * Unregisters a link listener.
* *
* @param listener the listener to unregister * @param listener the listener to unregister
*/ */
void removeLinkListener(OspfLinkListener listener); void removeLinkListener(OspfLinkListener listener);
/** /**
* Updates configuration of processes. * Updates configuration of processes.
* *
* @param processes process info to update * @param processes process info to update
*/ */
public void updateConfig(List<OspfProcess> processes); public void updateConfig(List<OspfProcess> processes);
/** /**
* Deletes configuration parameters. * Deletes configuration parameters.
* *
* @param processes list of process instance * @param processes list of process instance
* @param attribute attribute to delete * @param attribute attribute to delete
*/ */
public void deleteConfig(List<OspfProcess> processes, String attribute); public void deleteConfig(List<OspfProcess> processes, String attribute);
/** /**
* Gets string representation of area configuration parameters to be displayed after CLI command. * Gets the list of listeners registered for router events.
* *
* @param processId process Id * @return list of listeners
* @param areaId area Id */
* @return Area Information Set<OspfRouterListener> listener();
*/
public String showAreaParameters(String processId, String areaId); /**
* Gets the list of listeners registered for link events.
/** *
* Gets string representation of area configuration information for the given area/process. * @return list of listeners
* This method will be called for CLI command. */
* public Set<OspfLinkListener> linkListener();
* @param processId process id to which area belongs
* @param areaId area id /**
* @return string representation of area configuration for CLI display * Gets the configured process.
*/ *
List<String> showAreaConfigurations(String processId, String areaId); * @return list of process instances
*/
/** public List<OspfProcess> getAllConfiguredProcesses();
* Gets the list of listeners registered for router events.
*
* @return list of listeners
*/
Set<OspfRouterListener> listener();
/**
* Gets the list of listeners registered for link events.
*
* @return list of listeners
*/
public Set<OspfLinkListener> linkListener();
/**
* Gets the configured process.
*
* @return list of process instances
*/
public List<OspfProcess> getAllConfiguredProcesses();
} }