Switch from using a Long for FlowId to an Uri
[openflowplugin.git] / drop-test / src / main / java / org / opendaylight / openflowplugin / droptest / DropTestProvider.xtend
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  * 
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.openflowplugin.droptest
9
10 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext
11 import org.opendaylight.controller.sal.binding.api.NotificationProviderService
12 import org.opendaylight.controller.sal.binding.api.data.DataProviderService
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInput
17 import org.opendaylight.yangtools.concepts.CompositeObjectRegistration
18 import org.opendaylight.yangtools.concepts.Registration
19 import org.slf4j.LoggerFactory
20 import org.opendaylight.yangtools.yang.binding.NotificationListener
21
22 class DropTestProvider implements AutoCloseable {
23
24
25     static val LOG = LoggerFactory.getLogger(DropTestProvider);
26
27     @Property
28     DataProviderService dataService;        
29
30     @Property
31     NotificationProviderService notificationService;
32
33     val DropTestCommiter commiter = new DropTestCommiter(this);
34
35     Registration<NotificationListener> listenerRegistration
36
37     def void start() {
38         listenerRegistration = notificationService.registerNotificationListener(commiter);
39         LOG.info("DropTestProvider Started.");
40         
41     }   
42     
43     override close() {
44        LOG.info("DropTestProvider stopped.");
45         listenerRegistration?.close();
46     }
47     
48 }
49
50