From b3cc8b36ff7b225fc1306426220ed7d49326b4b7 Mon Sep 17 00:00:00 2001 From: Viji J Date: Tue, 3 May 2016 18:29:19 +0530 Subject: [PATCH] Integration of Fcaps framework Change-Id: I68429a51ba6cd8a7d49a426b78fad866efdf126e Signed-off-by: Viji J --- fcapsmanager/alarmmanager/pom.xml | 64 +++++++ .../fcapsmanager/alarmmanager/Activator.java | 35 ++++ .../AlarmNotificationListeners.java | 179 ++++++++++++++++++ fcapsmanager/countermanager/pom.xml | 64 +++++++ .../countermanager/Activator.java | 41 ++++ .../PMRegistrationListener.java | 117 ++++++++++++ .../fcapsmanager/countermanager/Poller.java | 85 +++++++++ fcapsmanager/fcaps-api/pom.xml | 59 ++++++ .../vpnservice/fcapsmanager/Activator.java | 25 +++ .../fcapsmanager/AlarmServiceFacade.java | 36 ++++ .../fcapsmanager/PMServiceFacade.java | 14 ++ fcapsmanager/pom.xml | 50 +++++ features/pom.xml | 18 ++ features/src/main/features/features.xml | 8 +- pom.xml | 1 + 15 files changed, 795 insertions(+), 1 deletion(-) create mode 100644 fcapsmanager/alarmmanager/pom.xml create mode 100644 fcapsmanager/alarmmanager/src/main/java/org/opendaylight/vpnservice/fcapsmanager/alarmmanager/Activator.java create mode 100644 fcapsmanager/alarmmanager/src/main/java/org/opendaylight/vpnservice/fcapsmanager/alarmmanager/AlarmNotificationListeners.java create mode 100644 fcapsmanager/countermanager/pom.xml create mode 100644 fcapsmanager/countermanager/src/main/java/org/opendaylight/vpnservice/fcapsmanager/countermanager/Activator.java create mode 100644 fcapsmanager/countermanager/src/main/java/org/opendaylight/vpnservice/fcapsmanager/countermanager/PMRegistrationListener.java create mode 100644 fcapsmanager/countermanager/src/main/java/org/opendaylight/vpnservice/fcapsmanager/countermanager/Poller.java create mode 100644 fcapsmanager/fcaps-api/pom.xml create mode 100644 fcapsmanager/fcaps-api/src/main/java/org/opendaylight/vpnservice/fcapsmanager/Activator.java create mode 100644 fcapsmanager/fcaps-api/src/main/java/org/opendaylight/vpnservice/fcapsmanager/AlarmServiceFacade.java create mode 100644 fcapsmanager/fcaps-api/src/main/java/org/opendaylight/vpnservice/fcapsmanager/PMServiceFacade.java create mode 100644 fcapsmanager/pom.xml diff --git a/fcapsmanager/alarmmanager/pom.xml b/fcapsmanager/alarmmanager/pom.xml new file mode 100644 index 00000000..88db6870 --- /dev/null +++ b/fcapsmanager/alarmmanager/pom.xml @@ -0,0 +1,64 @@ + + + + + + org.opendaylight.vpnservice + config-parent + 0.3.0-SNAPSHOT + ../../commons/config-parent + + + 4.0.0 + org.opendaylight.vpnservice + alarmmanager + ${vpnservices.version} + bundle + + + 2.5.3 + 5.0.0 + + + + org.slf4j + slf4j-api + + + org.osgi + org.osgi.core + ${osgi.version} + provided + + + org.opendaylight.vpnservice + fcaps-api + ${vpnservices.version} + + + + + + org.apache.felix + maven-bundle-plugin + ${maven-bundle-plugin.version} + true + + + ${project.artifactId} + ${project.version} + org.opendaylight.vpnservice.fcapsmanager.alarmmanager.Activator + org.opendaylight.vpnservice.fcapsmanager.alarmmanager*;version=${project.version} + * + + + + + + \ No newline at end of file diff --git a/fcapsmanager/alarmmanager/src/main/java/org/opendaylight/vpnservice/fcapsmanager/alarmmanager/Activator.java b/fcapsmanager/alarmmanager/src/main/java/org/opendaylight/vpnservice/fcapsmanager/alarmmanager/Activator.java new file mode 100644 index 00000000..a133c8dc --- /dev/null +++ b/fcapsmanager/alarmmanager/src/main/java/org/opendaylight/vpnservice/fcapsmanager/alarmmanager/Activator.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.vpnservice.fcapsmanager.alarmmanager; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Activator implements BundleActivator { + static Logger s_logger = LoggerFactory.getLogger(Activator.class); + private Runnable listener; + private Thread listenerThread; + + public void start(BundleContext context) { + s_logger.info("Starting alarmmanager bundle"); + AlarmNotificationListeners notificationListeners = new AlarmNotificationListeners(context); + try { + listener = notificationListeners; + listenerThread = new Thread(listener); + listenerThread.start(); + } catch (Exception e) { + s_logger.error("Exception in alarm thread {}", e); + } + } + + public void stop(BundleContext context) { + s_logger.info("Stopping alarmmanager bundle"); + } +} \ No newline at end of file diff --git a/fcapsmanager/alarmmanager/src/main/java/org/opendaylight/vpnservice/fcapsmanager/alarmmanager/AlarmNotificationListeners.java b/fcapsmanager/alarmmanager/src/main/java/org/opendaylight/vpnservice/fcapsmanager/alarmmanager/AlarmNotificationListeners.java new file mode 100644 index 00000000..7cb87851 --- /dev/null +++ b/fcapsmanager/alarmmanager/src/main/java/org/opendaylight/vpnservice/fcapsmanager/alarmmanager/AlarmNotificationListeners.java @@ -0,0 +1,179 @@ +/* + * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.vpnservice.fcapsmanager.alarmmanager; + +import javax.management.*; +import java.lang.management.ManagementFactory; +import java.util.*; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.opendaylight.vpnservice.fcapsmanager.AlarmServiceFacade; + +public class AlarmNotificationListeners implements Runnable { + static Logger s_logger = LoggerFactory.getLogger(AlarmNotificationListeners.class); + private MBeanServer mbs = null; + private static String DOMAIN = "SDNC.FM"; + + private final DelegateListener delegateListener = new DelegateListener(); + private BundleContext context = null; + + public AlarmNotificationListeners(BundleContext context) { + this.context=context; + } + + /** + * Platform dependent bundle injects its handle and it is retrieved in the method + */ + private AlarmServiceFacade getAlarmServiceSPI (){ + AlarmServiceFacade service =null; + if(context != null) { + try { + ServiceReference serviceReference = context. + getServiceReference(AlarmServiceFacade.class.getName()); + service = (AlarmServiceFacade) context. + getService(serviceReference); + }catch (NullPointerException ex){ + service = null; + }catch (Exception e){ + s_logger.error("Exception {} occurred in getting AlarmServiceSPI",e); + } + } + return service; + } + + /** + * Gets register notification when a mbean is registered in platform Mbeanserver and checks if it is alarm mbean and add attribute notification listener to it. + * Gets attribute notification when alarm mbean is updated by the application. + */ + public class DelegateListener implements NotificationListener { + public void handleNotification(Notification notification, Object obj) { + if (notification instanceof MBeanServerNotification) { + MBeanServerNotification msnotification = + (MBeanServerNotification) notification; + String nType = msnotification.getType(); + ObjectName mbn = msnotification.getMBeanName(); + + if (nType.equals("JMX.mbean.registered")) { + if (mbn.toString().contains(DOMAIN)) { + s_logger.debug("Received registeration of Mbean "+mbn); + try { + mbs.addNotificationListener(mbn,delegateListener, null, null); + s_logger.debug("Added attribute notification listener for Mbean "+ mbn); + } catch (InstanceNotFoundException e) { + s_logger.error("Exception while adding attribute notification of mbean {}", e); + } + } + } + + if (nType.equals("JMX.mbean.unregistered")) { + if (mbn.toString().contains(DOMAIN)) { + s_logger.debug("Time: " + msnotification.getTimeStamp() + "MBean " + msnotification.getMBeanName()+" unregistered successfully"); + } + } + } + else if (notification instanceof AttributeChangeNotification) { + AttributeChangeNotification acn = + (AttributeChangeNotification) notification; + + s_logger.debug("Received attribute notification of Mbean: " + + notification.getSource() + + " for attribute:" + acn.getAttributeName() ); + + if(acn.getAttributeName().toString().equals("raiseAlarmObject")){ + + String value=acn.getNewValue().toString(); + value = value.replace(value.charAt(0), ' '); + value = value.replace(value.charAt(value.lastIndexOf("]")), ' '); + + String[] args =value.split(","); + s_logger.debug("Receive attribute value :"+args[0].trim()+args[1].trim()+args[2].trim()); + if(getAlarmServiceSPI() != null ) { + getAlarmServiceSPI().raiseAlarm(args[0].trim(),args[1].trim(),args[2].trim()); + } else { + s_logger.debug("Alarm service not available"); + } + + } else if(acn.getAttributeName().toString().equals("clearAlarmObject")){ + + String value=acn.getNewValue().toString(); + value = value.replace(value.charAt(0), ' '); + value = value.replace(value.charAt(value.lastIndexOf("]")), ' '); + + String[] args =value.split(","); + s_logger.debug("Receive attribute value :"+args[0].trim()+args[1].trim()+args[2].trim()); + if(getAlarmServiceSPI() != null ) + getAlarmServiceSPI().clearAlarm(args[0].trim(), args[1].trim(), args[2].trim()); + else + s_logger.debug("Alarm service not available"); + } + } + } + } + + /** + * Gets the platform MBeanServer instance and registers to get notification whenever alarm mbean is registered in the mbeanserver + */ + @Override + public void run() { + mbs = ManagementFactory.getPlatformMBeanServer(); + + queryMbeans(); + + ObjectName delegate = null; + try { + delegate = new ObjectName("JMImplementation:type=MBeanServerDelegate"); + } catch (MalformedObjectNameException e) { + e.printStackTrace(); + } + NotificationFilterSupport filter = new NotificationFilterSupport(); + filter.enableType("JMX.mbean.registered"); + filter.enableType("JMX.mbean.unregistered"); + + try { + mbs.addNotificationListener(delegate, delegateListener, filter, null); + s_logger.debug("Added registeration listener for Mbean {}",delegate); + } catch (InstanceNotFoundException e) { + s_logger.error("Failed to add registeration listener {}", e); + } + + waitForNotification(); + } + + /** + * Pre-provisioning case to handle all alarm mbeans which are registered before installation of framework bundle + * Queries the platform Mbeanserver to retrieve registered alarm mbean and add attribute notification listener to it + */ + public void queryMbeans() { + + Set names = + new TreeSet(mbs.queryNames(null, null)); + s_logger.debug("Queried MBeanServer for MBeans:"); + for (ObjectName beanName : names) { + if(beanName.toString().contains(DOMAIN)){ + try { + mbs.addNotificationListener(beanName,delegateListener, null, null); + s_logger.debug("Added attribute notification listener for Mbean "+ beanName); + } catch (InstanceNotFoundException e) { + s_logger.error("Failed to add attribute notification for Mbean {}", e); + } + } + } + } + public void waitForNotification() { + while(true){ + try { + Thread.sleep(50); + } + catch(Exception ex){ + ex.printStackTrace(); + } + } + } +} \ No newline at end of file diff --git a/fcapsmanager/countermanager/pom.xml b/fcapsmanager/countermanager/pom.xml new file mode 100644 index 00000000..63cb6493 --- /dev/null +++ b/fcapsmanager/countermanager/pom.xml @@ -0,0 +1,64 @@ + + + + + + org.opendaylight.vpnservice + config-parent + 0.3.0-SNAPSHOT + ../../commons/config-parent + + + 4.0.0 + org.opendaylight.vpnservice + countermanager + ${vpnservices.version} + bundle + + + 2.5.3 + 5.0.0 + + + + org.slf4j + slf4j-api + + + org.osgi + org.osgi.core + ${osgi.version} + provided + + + org.opendaylight.vpnservice + fcaps-api + ${vpnservices.version} + + + + + + org.apache.felix + maven-bundle-plugin + ${maven-bundle-plugin.version} + true + + + ${project.artifactId} + ${project.version} + org.opendaylight.vpnservice.fcapsmanager.countermanager.Activator + org.opendaylight.vpnservice.fcapsmanager.countermanager*;version=${project.version} + * + + + + + + \ No newline at end of file diff --git a/fcapsmanager/countermanager/src/main/java/org/opendaylight/vpnservice/fcapsmanager/countermanager/Activator.java b/fcapsmanager/countermanager/src/main/java/org/opendaylight/vpnservice/fcapsmanager/countermanager/Activator.java new file mode 100644 index 00000000..6f6928c4 --- /dev/null +++ b/fcapsmanager/countermanager/src/main/java/org/opendaylight/vpnservice/fcapsmanager/countermanager/Activator.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.vpnservice.fcapsmanager.countermanager; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.management.InstanceNotFoundException; +import javax.management.MBeanException; +import javax.management.MalformedObjectNameException; +import javax.management.ReflectionException; +import java.io.IOException; + +public class Activator implements BundleActivator { + private final static org.slf4j.Logger LOG = LoggerFactory.getLogger(Activator.class); + private Runnable listener; + private Thread listenerThread; + + public void start(BundleContext context) throws InstanceNotFoundException, MalformedObjectNameException, MBeanException, ReflectionException, IOException { + LOG.info("Starting countermanager bundle "); + PMRegistrationListener notificationListeners = new PMRegistrationListener(context); + try { + listener = notificationListeners; + listenerThread = new Thread(listener); + listenerThread.start(); + } catch (Exception e) { + LOG.error("Exception in counter thread {}", e); + } + } + + public void stop(BundleContext context) { + LOG.info("Stopping countermanager bundle "); + } +} \ No newline at end of file diff --git a/fcapsmanager/countermanager/src/main/java/org/opendaylight/vpnservice/fcapsmanager/countermanager/PMRegistrationListener.java b/fcapsmanager/countermanager/src/main/java/org/opendaylight/vpnservice/fcapsmanager/countermanager/PMRegistrationListener.java new file mode 100644 index 00000000..cfdbdb47 --- /dev/null +++ b/fcapsmanager/countermanager/src/main/java/org/opendaylight/vpnservice/fcapsmanager/countermanager/PMRegistrationListener.java @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.vpnservice.fcapsmanager.countermanager; + +import java.lang.management.ManagementFactory; +import java.util.HashSet; +import java.util.Set; +import java.util.TreeSet; + +import javax.management.InstanceNotFoundException; +import javax.management.MBeanServer; +import javax.management.MBeanServerNotification; +import javax.management.MalformedObjectNameException; +import javax.management.Notification; +import javax.management.NotificationFilterSupport; +import javax.management.NotificationListener; +import javax.management.ObjectName; + +import org.osgi.framework.BundleContext; +import org.slf4j.LoggerFactory; + +public class PMRegistrationListener implements Runnable { + private final static org.slf4j.Logger LOG = LoggerFactory.getLogger(PMRegistrationListener.class); + static MBeanServer mbs = null; + + private static String DOMAIN = "SDNC.PM"; + public static HashSet beanNames = new HashSet(); + private BundleContext context = null; + + public PMRegistrationListener(BundleContext context){ + this.context=context; + } + + /** + * Gets register notification when a mbean is registered in platform Mbeanserver and checks if it is counter mbean and add it to the map. + */ + public static class DelegateListener implements NotificationListener { + public void handleNotification(Notification notification, Object obj) { + if (notification instanceof MBeanServerNotification) { + MBeanServerNotification msnotification = + (MBeanServerNotification) notification; + String nType = msnotification.getType(); + ObjectName mbn = msnotification.getMBeanName(); + if (nType.equals("JMX.mbean.registered")) { + String mbean = mbn.toString(); + if(mbean.contains(DOMAIN)) { + beanNames.add(mbn); + LOG.debug("Beans are " +beanNames); + } + } + if (nType.equals("JMX.mbean.unregistered")) { + if(mbn.toString().contains(DOMAIN)) { + beanNames.remove(mbn); + LOG.debug(mbn +" MBean has been unregistered"); + } + } + } + } + } + + @Override + public void run(){ + mbs = ManagementFactory.getPlatformMBeanServer(); + queryMbeans(); + DelegateListener delegateListener = new DelegateListener(); + ObjectName delegate = null; + try { + delegate = new ObjectName("JMImplementation:type=MBeanServerDelegate"); + } catch (MalformedObjectNameException e) { + e.printStackTrace(); + } + NotificationFilterSupport filter = new NotificationFilterSupport(); + + filter.enableType("JMX.mbean.registered"); + filter.enableType("JMX.mbean.unregistered"); + + LOG.debug("Add PM Registeration Notification Listener"); + try { + mbs.addNotificationListener(delegate, delegateListener, filter,null); + }catch (InstanceNotFoundException e) { + e.printStackTrace(); + } + Poller poller = new Poller(this.context); + poller.polling(); + waitforNotification(); + } + + /** + * Prepovising case to handle all counter mbeans which are registered before the installation of framework bundle + * Queries the platform Mbeanserver to retrieve registered counter mbean and add it to the map + */ + public void queryMbeans() { + Set names = + new TreeSet(mbs.queryNames(null, null)); + LOG.debug("\nQueried MBeanServer for MBeans:"); + for (ObjectName name : names) { + if(name.toString().contains(DOMAIN)){ + beanNames.add(name); + } + } + } + + private void waitforNotification() { + while(true){ + try { + Thread.sleep(50); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } +} \ No newline at end of file diff --git a/fcapsmanager/countermanager/src/main/java/org/opendaylight/vpnservice/fcapsmanager/countermanager/Poller.java b/fcapsmanager/countermanager/src/main/java/org/opendaylight/vpnservice/fcapsmanager/countermanager/Poller.java new file mode 100644 index 00000000..ad6f8502 --- /dev/null +++ b/fcapsmanager/countermanager/src/main/java/org/opendaylight/vpnservice/fcapsmanager/countermanager/Poller.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.vpnservice.fcapsmanager.countermanager; + +import java.lang.management.ManagementFactory; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; +import org.slf4j.LoggerFactory; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.management.MBeanServer; +import javax.management.ObjectName; +import org.opendaylight.vpnservice.fcapsmanager.PMServiceFacade; + +public class Poller { + private final static org.slf4j.Logger LOG = LoggerFactory.getLogger(Poller.class); + private static BundleContext context = null; + public Poller(){ + } + public Poller(BundleContext bundleContext) { + context = bundleContext; + } + //This method do the Polling every 5 second and retrieves the the counter details + //@Override + public void polling() { + LOG.debug("Poller Polling Mbean List and the content is " + PMRegistrationListener.beanNames); + ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor(); + service.scheduleAtFixedRate(new Pollerthread(), 0, 5, TimeUnit.SECONDS); + } + + /** + * Platform dependent bundle injects its handle and it is retrieved in the method + */ + protected PMServiceFacade getPMServiceSPI (){ + PMServiceFacade service =null; + if(context != null) { + try { + ServiceReference serviceReference = context. + getServiceReference(PMServiceFacade.class.getName()); + service = (PMServiceFacade) context. + getService(serviceReference); + }catch(NullPointerException ex){ + service = null; + }catch (Exception e){ + LOG.error("Exception {} occurred in getting PMServiceSPI",e); + } + } + return service; + } +} + +class Pollerthread implements Runnable { + private final static org.slf4j.Logger LOG = LoggerFactory.getLogger(Pollerthread.class); + MBeanServer mbs = null; + Map getCounter = new HashMap(); + Poller poller = new Poller(); + + /** + * Retrieve countermap from each counter mbean and send to platform + */ + @SuppressWarnings("unchecked") + @Override + public void run() { + try { + mbs = ManagementFactory.getPlatformMBeanServer(); + for (ObjectName objectName : PMRegistrationListener.beanNames) { + getCounter=(Map) mbs.invoke(objectName, "retrieveCounterMap",null,null); + if(poller.getPMServiceSPI() != null) + poller.getPMServiceSPI().connectToPMFactory(getCounter); + else + LOG.debug("PM service not available"); + } + } catch (Exception e) { + LOG.error("Exception caught {} ", e); + } + } +} \ No newline at end of file diff --git a/fcapsmanager/fcaps-api/pom.xml b/fcapsmanager/fcaps-api/pom.xml new file mode 100644 index 00000000..12775911 --- /dev/null +++ b/fcapsmanager/fcaps-api/pom.xml @@ -0,0 +1,59 @@ + + + + + + org.opendaylight.vpnservice + config-parent + 0.3.0-SNAPSHOT + ../../commons/config-parent + + + 4.0.0 + org.opendaylight.vpnservice + fcaps-api + ${vpnservices.version} + bundle + + + 2.5.3 + 5.0.0 + + + + org.slf4j + slf4j-api + + + org.osgi + org.osgi.core + ${osgi.version} + provided + + + + + + org.apache.felix + maven-bundle-plugin + ${maven-bundle-plugin.version} + true + + + ${project.artifactId} + ${project.version} + org.opendaylight.vpnservice.fcapsmanager.Activator + org.opendaylight.vpnservice.fcapsmanager*;version=${project.version} + * + + + + + + \ No newline at end of file diff --git a/fcapsmanager/fcaps-api/src/main/java/org/opendaylight/vpnservice/fcapsmanager/Activator.java b/fcapsmanager/fcaps-api/src/main/java/org/opendaylight/vpnservice/fcapsmanager/Activator.java new file mode 100644 index 00000000..2188390e --- /dev/null +++ b/fcapsmanager/fcaps-api/src/main/java/org/opendaylight/vpnservice/fcapsmanager/Activator.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.vpnservice.fcapsmanager; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator implements BundleActivator { + static Logger s_logger = LoggerFactory.getLogger(Activator.class); + public void start(BundleContext context) { + s_logger.info("Starting fcapsSPI bundle"); + } + + public void stop(BundleContext context) { + s_logger.info("Stopping fcapsSPI bundle"); + } + +} \ No newline at end of file diff --git a/fcapsmanager/fcaps-api/src/main/java/org/opendaylight/vpnservice/fcapsmanager/AlarmServiceFacade.java b/fcapsmanager/fcaps-api/src/main/java/org/opendaylight/vpnservice/fcapsmanager/AlarmServiceFacade.java new file mode 100644 index 00000000..85ec789c --- /dev/null +++ b/fcapsmanager/fcaps-api/src/main/java/org/opendaylight/vpnservice/fcapsmanager/AlarmServiceFacade.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.vpnservice.fcapsmanager; + +public interface AlarmServiceFacade { + /** + * Raises the given alarm in platform environment + * + * @param alarmName + * Alarm to be raised + * @param additionalText + * Additional details describing about the alarm + * @param source + * Source of the alarm ex: dpnId=openflow:1 + * the source node that caused this alarm + */ + public void raiseAlarm(String alarmName, String additionalText, String source); + + /** + * Clears the given alarm in platform environment + * + * @param alarmName + * Alarm to be cleared + * @param additionalText + * Additional details describing about the alarm + * @param source + * Source of the alarm ex: dpnId=openflow:1 + * the source node that caused this alarm + */ + public void clearAlarm(String alarmName, String additionalText, String source); +} \ No newline at end of file diff --git a/fcapsmanager/fcaps-api/src/main/java/org/opendaylight/vpnservice/fcapsmanager/PMServiceFacade.java b/fcapsmanager/fcaps-api/src/main/java/org/opendaylight/vpnservice/fcapsmanager/PMServiceFacade.java new file mode 100644 index 00000000..6bad0202 --- /dev/null +++ b/fcapsmanager/fcaps-api/src/main/java/org/opendaylight/vpnservice/fcapsmanager/PMServiceFacade.java @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.vpnservice.fcapsmanager; + +import java.util.Map; + +public interface PMServiceFacade { + public void connectToPMFactory(Map map); +} diff --git a/fcapsmanager/pom.xml b/fcapsmanager/pom.xml new file mode 100644 index 00000000..6034382e --- /dev/null +++ b/fcapsmanager/pom.xml @@ -0,0 +1,50 @@ + + + + + + org.opendaylight.odlparent + odlparent + 1.7.0-SNAPSHOT + + + + org.opendaylight.vpnservice + fcapsmanager + 0.3.0-SNAPSHOT + fcapsmanager + pom + 4.0.0 + + 3.1.1 + + + fcaps-api + alarmmanager + countermanager + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + org.apache.maven.plugins + maven-install-plugin + + true + + + + + \ No newline at end of file diff --git a/features/pom.xml b/features/pom.xml index 0cd96d4a..e2e05a02 100644 --- a/features/pom.xml +++ b/features/pom.xml @@ -42,6 +42,8 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL ${vpnservices.version} ${vpnservices.version} ${vpnservices.version} + ${vpnservices.version} + @@ -437,5 +439,21 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL config xml + + + ${project.groupId} + alarmmanager + ${fcaps.manager.version} + + + ${project.groupId} + countermanager + ${fcaps.manager.version} + + + ${project.groupId} + fcaps-api + ${fcaps.manager.version} + diff --git a/features/src/main/features/features.xml b/features/src/main/features/features.xml index d92ccda9..1daa7ed3 100644 --- a/features/src/main/features/features.xml +++ b/features/src/main/features/features.xml @@ -119,4 +119,10 @@ and is available at http://www.eclipse.org/legal/epl-v10.html mvn:org.opendaylight.vpnservice/vpnintent-impl/{{VERSION}} mvn:org.opendaylight.vpnservice/vpnintent-impl/{{VERSION}}/xml/config - + + + mvn:org.opendaylight.vpnservice/fcaps-api/${fcaps.manager.version} + mvn:org.opendaylight.vpnservice/alarmmanager/${fcaps.manager.version} + mvn:org.opendaylight.vpnservice/countermanager/${fcaps.manager.version} + + diff --git a/pom.xml b/pom.xml index baa7a319..b35783b2 100644 --- a/pom.xml +++ b/pom.xml @@ -36,6 +36,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL features vpnservice-artifacts vpnintent + fcapsmanager -- 2.36.6