<artifactId>javassist</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools.thirdparty</groupId>
- <artifactId>xtend-lib-osgi</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-container-forked</artifactId>
<netconf.parent.version>0.3.0-SNAPSHOT</netconf.parent.version>
<config.parent.version>0.3.0-SNAPSHOT</config.parent.version>
<build.helper.version>1.8</build.helper.version>
- <xtend.dstdir>src/main/xtend-gen</xtend.dstdir>
<jmxGeneratorPath>src/main/yang-gen-config</jmxGeneratorPath>
<salGeneratorPath>src/main/yang-gen-sal</salGeneratorPath>
<exi.nagasena.version>0000.0002.0038.0</exi.nagasena.version>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
</dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools.thirdparty</groupId>
- <artifactId>xtend-lib-osgi</artifactId>
- <version>2.4.3</version>
- <scope>test</scope>
- </dependency>
</dependencies>
</dependencyManagement>
<artifactId>maven-paxexam-plugin</artifactId>
<version>1.2.4</version>
</plugin>
- <plugin>
- <groupId>org.eclipse.xtend</groupId>
- <artifactId>xtend-maven-plugin</artifactId>
- <version>${xtend.version}</version>
- <executions>
- <execution>
- <goals>
- <goal>compile</goal>
- </goals>
- <configuration>
- <outputDirectory>${xtend.dstdir}</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
- <fileset>
- <directory>${xtend.dstdir}</directory>
- <includes>
- <include>**</include>
- </includes>
- </fileset>
<fileset>
<directory>${jmxGeneratorPath}</directory>
<includes>
<sources>
<source>${jmxGeneratorPath}</source>
<source>${salGeneratorPath}</source>
- <source>${xtend.dstdir}</source>
</sources>
</configuration>
</execution>
<dependency>
<groupId>org.opendaylight.controller.model</groupId>
<artifactId>model-flow-statistics</artifactId>
- </dependency>
- <dependency>
- <groupId>org.eclipse.xtend</groupId>
- <artifactId>org.eclipse.xtend.lib</artifactId>
- <version>${xtend.version}</version>
</dependency>
<dependency>
<groupId>equinoxSDK381</groupId>
</instructions>
</configuration>
</plugin>
- <plugin>
- <groupId>org.eclipse.xtend</groupId>
- <artifactId>xtend-maven-plugin</artifactId>
- </plugin>
</plugins>
</build>
</project>
--- /dev/null
+/**
+ * Copyright (c) 2013 Cisco Systems, Inc. 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.openflowplugin.test;
+
+import java.util.concurrent.Future;
+
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
+import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
+import org.opendaylight.yangtools.concepts.CompositeObjectRegistration;
+import org.opendaylight.yangtools.concepts.CompositeObjectRegistration.CompositeObjectRegistrationBuilder;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable,
+ SalGroupService {
+
+ private final static Logger LOG = LoggerFactory
+ .getLogger(OpenflowpluginGroupTestServiceProvider.class);
+ private RoutedRpcRegistration<SalGroupService> groupRegistration;
+ private NotificationProviderService notificationService;
+
+ /**
+ * get group registration
+ *
+ * @return {@link #groupRegistration}
+ */
+ public RoutedRpcRegistration<SalGroupService> getGroupRegistration() {
+ return groupRegistration;
+ }
+
+ /**
+ * set {@link #groupRegistration}
+ *
+ * @param groupRegistration
+ */
+ public void setGroupRegistration(
+ final RoutedRpcRegistration<SalGroupService> groupRegistration) {
+ this.groupRegistration = groupRegistration;
+ }
+
+ /**
+ * get notification service
+ *
+ * @return {@link #notificationService}
+ */
+ public NotificationProviderService getNotificationService() {
+ return notificationService;
+ }
+
+ /**
+ * set {@link #notificationService}
+ *
+ * @param notificationService
+ */
+ public void setNotificationService(
+ final NotificationProviderService notificationService) {
+ this.notificationService = notificationService;
+ }
+
+ public void start() {
+ OpenflowpluginGroupTestServiceProvider.LOG
+ .info("SalGroupServiceProvider Started.");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.AutoCloseable#close()
+ */
+ @Override
+ public void close() throws Exception {
+ OpenflowpluginGroupTestServiceProvider.LOG
+ .info("SalGroupServiceProvide stopped.");
+ groupRegistration.close();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918
+ * .SalGroupService
+ * #addGroup(org.opendaylight.yang.gen.v1.urn.opendaylight.group
+ * .service.rev130918.AddGroupInput)
+ */
+ @Override
+ public Future<RpcResult<AddGroupOutput>> addGroup(AddGroupInput input) {
+ String plus = ("addGroup - " + input);
+ OpenflowpluginGroupTestServiceProvider.LOG.info(plus);
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918
+ * .SalGroupService
+ * #removeGroup(org.opendaylight.yang.gen.v1.urn.opendaylight
+ * .group.service.rev130918.RemoveGroupInput)
+ */
+ @Override
+ public Future<RpcResult<RemoveGroupOutput>> removeGroup(
+ RemoveGroupInput input) {
+ String plus = ("removeGroup - " + input);
+ OpenflowpluginGroupTestServiceProvider.LOG.info(plus);
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918
+ * .SalGroupService
+ * #updateGroup(org.opendaylight.yang.gen.v1.urn.opendaylight
+ * .group.service.rev130918.UpdateGroupInput)
+ */
+ @Override
+ public Future<RpcResult<UpdateGroupOutput>> updateGroup(
+ UpdateGroupInput input) {
+ String plus = ("updateGroup - " + input);
+ OpenflowpluginGroupTestServiceProvider.LOG.info(plus);
+ return null;
+ }
+
+ /**
+ * @param ctx
+ * @return {@link CompositeObjectRegistrationBuilder #toInstance()}
+ */
+ public CompositeObjectRegistration<OpenflowpluginGroupTestServiceProvider> register(
+ final ProviderContext ctx) {
+ CompositeObjectRegistrationBuilder<OpenflowpluginGroupTestServiceProvider> builder = CompositeObjectRegistration
+ .<OpenflowpluginGroupTestServiceProvider> builderFor(this);
+
+ RoutedRpcRegistration<SalGroupService> addRoutedRpcImplementation = ctx
+ .<SalGroupService> addRoutedRpcImplementation(
+ SalGroupService.class, this);
+ setGroupRegistration(addRoutedRpcImplementation);
+
+ InstanceIdentifierBuilder<Nodes> builder1 = InstanceIdentifier
+ .<Nodes> builder(Nodes.class);
+
+ NodeId nodeId = new NodeId(OpenflowpluginTestActivator.NODE_ID);
+ NodeKey nodeKey = new NodeKey(nodeId);
+
+ InstanceIdentifierBuilder<Node> nodeIndentifier = builder1
+ .<Node, NodeKey> child(Node.class, nodeKey);
+ InstanceIdentifier<Node> instance = nodeIndentifier.build();
+ groupRegistration.registerPath(NodeContext.class, instance);
+ RoutedRpcRegistration<SalGroupService> groupRegistration1 = this
+ .getGroupRegistration();
+ builder.add(groupRegistration1);
+ return builder.build();
+ }
+
+}
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. 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.openflowplugin.test
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInput
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInput
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupInput
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-import org.opendaylight.yangtools.concepts.CompositeObjectRegistration
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
-import org.slf4j.LoggerFactory
-
-class OpenflowpluginGroupTestServiceProvider implements AutoCloseable, SalGroupService {
-
-
- static val LOG = LoggerFactory.getLogger(OpenflowpluginGroupTestServiceProvider);
-
- @Property
- RoutedRpcRegistration<SalGroupService> groupRegistration;
-
-
- @Property
- NotificationProviderService notificationService;
-
-
- def void start() {
- LOG.info("SalGroupServiceProvider Started.");
-
- }
-
-
- override close() {
- LOG.info("SalGroupServiceProvide stopped.");
- groupRegistration.close;
- }
-
- override addGroup(AddGroupInput input) {
- LOG.info("addGroup - " + input);
- return null;
-
- }
-
- override removeGroup(RemoveGroupInput input) {
- LOG.info("removeGroup - " + input);
- return null;
- }
-
- override updateGroup(UpdateGroupInput input) {
- LOG.info("updateGroup - " + input);
- return null;
- }
-
-
- def CompositeObjectRegistration<OpenflowpluginGroupTestServiceProvider> register(ProviderContext ctx) {
- val builder = CompositeObjectRegistration
- .<OpenflowpluginGroupTestServiceProvider> builderFor(this);
-
- groupRegistration = ctx.addRoutedRpcImplementation(SalGroupService, this);
- val nodeIndentifier = InstanceIdentifier.builder(Nodes).child(Node, new NodeKey(new NodeId(OpenflowpluginTestActivator.NODE_ID)));
- groupRegistration.registerPath(NodeContext, nodeIndentifier.toInstance());
- builder.add(groupRegistration);
-
- return builder.toInstance();
- }
-
-}
-
-
--- /dev/null
+/**
+ * Copyright (c) 2013 Cisco Systems, Inc. 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.openflowplugin.test;
+
+import java.util.concurrent.Future;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
+import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.AddMeterInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.AddMeterOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.RemoveMeterInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.RemoveMeterOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.SalMeterService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.UpdateMeterInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.UpdateMeterOutput;
+import org.opendaylight.yangtools.concepts.CompositeObjectRegistration;
+import org.opendaylight.yangtools.concepts.CompositeObjectRegistration.CompositeObjectRegistrationBuilder;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
+ SalMeterService {
+ private final static Logger LOG = LoggerFactory
+ .getLogger(OpenflowpluginMeterTestServiceProvider.class);
+ private DataBroker dataService;
+ private RoutedRpcRegistration<SalMeterService> meterRegistration;
+ private NotificationProviderService notificationService;
+
+ /**
+ * get data service
+ *
+ * @return {@link #dataService}
+ */
+ public DataBroker getDataService() {
+ return this.dataService;
+ }
+
+ /**
+ * set {@link #dataService}
+ *
+ * @param dataService
+ */
+ public void setDataService(final DataBroker dataService) {
+ this.dataService = dataService;
+ }
+
+ /**
+ * get meter registration
+ *
+ * @return {@link #meterRegistration}
+ */
+ public RoutedRpcRegistration<SalMeterService> getMeterRegistration() {
+ return this.meterRegistration;
+ }
+
+ /**
+ * set {@link #meterRegistration}
+ *
+ * @param meterRegistration
+ */
+ public void setMeterRegistration(
+ final RoutedRpcRegistration<SalMeterService> meterRegistration) {
+ this.meterRegistration = meterRegistration;
+ }
+
+ /**
+ * get notification service
+ *
+ * @return {@link #notificationService}
+ */
+ public NotificationProviderService getNotificationService() {
+ return this.notificationService;
+ }
+
+ /**
+ * set {@link #notificationService}
+ *
+ * @param notificationService
+ */
+ public void setNotificationService(
+ final NotificationProviderService notificationService) {
+ this.notificationService = notificationService;
+ }
+
+ public void start() {
+ OpenflowpluginMeterTestServiceProvider.LOG
+ .info("SalMeterServiceProvider Started.");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.AutoCloseable#close()
+ */
+ public void close() {
+ OpenflowpluginMeterTestServiceProvider.LOG
+ .info("SalMeterServiceProvide stopped.");
+ meterRegistration.close();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918
+ * .SalMeterService
+ * #addMeter(org.opendaylight.yang.gen.v1.urn.opendaylight.meter
+ * .service.rev130918.AddMeterInput)
+ */
+ public Future<RpcResult<AddMeterOutput>> addMeter(final AddMeterInput input) {
+ String plus = ("addMeter - " + input);
+ OpenflowpluginMeterTestServiceProvider.LOG.info(plus);
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918
+ * .SalMeterService
+ * #removeMeter(org.opendaylight.yang.gen.v1.urn.opendaylight
+ * .meter.service.rev130918.RemoveMeterInput)
+ */
+ public Future<RpcResult<RemoveMeterOutput>> removeMeter(
+ final RemoveMeterInput input) {
+ String plus = ("removeMeter - " + input);
+ OpenflowpluginMeterTestServiceProvider.LOG.info(plus);
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918
+ * .SalMeterService
+ * #updateMeter(org.opendaylight.yang.gen.v1.urn.opendaylight
+ * .meter.service.rev130918.UpdateMeterInput)
+ */
+ public Future<RpcResult<UpdateMeterOutput>> updateMeter(
+ final UpdateMeterInput input) {
+ String plus = ("updateMeter - " + input);
+ OpenflowpluginMeterTestServiceProvider.LOG.info(plus);
+ return null;
+ }
+
+ /**
+ * @param ctx
+ * @return {@link CompositeObjectRegistrationBuilder #toInstance()}
+ */
+ public CompositeObjectRegistration<OpenflowpluginMeterTestServiceProvider> register(
+ final ProviderContext ctx) {
+ CompositeObjectRegistrationBuilder<OpenflowpluginMeterTestServiceProvider> builder = CompositeObjectRegistration
+ .<OpenflowpluginMeterTestServiceProvider> builderFor(this);
+
+ RoutedRpcRegistration<SalMeterService> addRoutedRpcImplementation = ctx
+ .<SalMeterService> addRoutedRpcImplementation(
+ SalMeterService.class, this);
+
+ setMeterRegistration(addRoutedRpcImplementation);
+
+ InstanceIdentifierBuilder<Nodes> builder1 = InstanceIdentifier
+ .<Nodes> builder(Nodes.class);
+
+ NodeId nodeId = new NodeId(OpenflowpluginTestActivator.NODE_ID);
+ NodeKey nodeKey = new NodeKey(nodeId);
+
+ InstanceIdentifierBuilder<Node> nodeIndentifier = builder1
+ .<Node, NodeKey> child(Node.class, nodeKey);
+
+ InstanceIdentifier<Node> instance = nodeIndentifier.build();
+
+ meterRegistration.registerPath(NodeContext.class, instance);
+
+ RoutedRpcRegistration<SalMeterService> meterRegistration1 = this
+ .getMeterRegistration();
+
+ builder.add(meterRegistration1);
+
+ return builder.build();
+ }
+
+}
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. 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.openflowplugin.test
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService
-import org.opendaylight.controller.md.sal.binding.api.DataBroker
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.AddMeterInput
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.RemoveMeterInput
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.SalMeterService
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.UpdateMeterInput
-import org.opendaylight.yangtools.concepts.CompositeObjectRegistration
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
-import org.slf4j.LoggerFactory
-
-class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, SalMeterService {
-
-
- static val LOG = LoggerFactory.getLogger(OpenflowpluginMeterTestServiceProvider);
-
- @Property
- DataBroker dataService;
-
- @Property
- RoutedRpcRegistration<SalMeterService> meterRegistration;
-
-
- @Property
- NotificationProviderService notificationService;
-
-
- def void start() {
- LOG.info("SalMeterServiceProvider Started.");
-
- }
-
-
- override close() {
- LOG.info("SalMeterServiceProvide stopped.");
- meterRegistration.close;
- }
-
- override addMeter(AddMeterInput input) {
- LOG.info("addMeter - " + input);
- return null;
-
- }
-
- override removeMeter(RemoveMeterInput input) {
- LOG.info("removeMeter - " + input);
- return null;
- }
-
- override updateMeter(UpdateMeterInput input) {
- LOG.info("updateMeter - " + input);
- return null;
- }
-
-
- def CompositeObjectRegistration<OpenflowpluginMeterTestServiceProvider> register(ProviderContext ctx) {
- val builder = CompositeObjectRegistration
- .<OpenflowpluginMeterTestServiceProvider> builderFor(this);
-
- meterRegistration = ctx.addRoutedRpcImplementation(SalMeterService, this);
- val nodeIndentifier = InstanceIdentifier.builder(Nodes).child(Node, new NodeKey(new NodeId(OpenflowpluginTestActivator.NODE_ID)));
- meterRegistration.registerPath(NodeContext, nodeIndentifier.toInstance());
- builder.add(meterRegistration);
- return builder.toInstance();
- }
-
-}
-
-
--- /dev/null
+/**
+ * Copyright (c) 2013 Cisco Systems, Inc. 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.openflowplugin.test;
+
+import java.util.concurrent.Future;
+
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
+import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.SalTableService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableOutput;
+import org.opendaylight.yangtools.concepts.CompositeObjectRegistration;
+import org.opendaylight.yangtools.concepts.CompositeObjectRegistration.CompositeObjectRegistrationBuilder;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class OpenflowpluginTableFeaturesTestServiceProvider implements
+ AutoCloseable, SalTableService {
+
+ private final static Logger LOG = LoggerFactory
+ .getLogger(OpenflowpluginTableFeaturesTestServiceProvider.class);
+ private RoutedRpcRegistration<SalTableService> tableRegistration;
+ private NotificationProviderService notificationService;
+
+ /**
+ * get table registration
+ *
+ * @return {@link #tableRegistration}
+ */
+ public RoutedRpcRegistration<SalTableService> getTableRegistration() {
+ return this.tableRegistration;
+ }
+
+ /**
+ * set {@link #tableRegistration}
+ *
+ * @param tableRegistration
+ */
+ public void setTableRegistration(
+ final RoutedRpcRegistration<SalTableService> tableRegistration) {
+ this.tableRegistration = tableRegistration;
+ }
+
+ /**
+ * get notification service
+ *
+ * @return {@link #notificationService}
+ */
+ public NotificationProviderService getNotificationService() {
+ return this.notificationService;
+ }
+
+ /**
+ * set {@link #notificationService}
+ *
+ * @param notificationService
+ */
+ public void setNotificationService(
+ final NotificationProviderService notificationService) {
+ this.notificationService = notificationService;
+ }
+
+ public void start() {
+ OpenflowpluginTableFeaturesTestServiceProvider.LOG
+ .info("SalTableServiceProvider Started.");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.AutoCloseable#close()
+ */
+ @Override
+ public void close() throws Exception {
+ OpenflowpluginTableFeaturesTestServiceProvider.LOG
+ .info("SalTableServiceProvider stopped.");
+ tableRegistration.close();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026
+ * .SalTableService
+ * #updateTable(org.opendaylight.yang.gen.v1.urn.opendaylight
+ * .table.service.rev131026.UpdateTableInput)
+ */
+ @Override
+ public Future<RpcResult<UpdateTableOutput>> updateTable(
+ UpdateTableInput input) {
+ String plus = ("updateTable - " + input);
+ OpenflowpluginTableFeaturesTestServiceProvider.LOG.info(plus);
+ return null;
+ }
+
+ /**
+ * @param ctx
+ * @return {@link CompositeObjectRegistrationBuilder #toInstance()}
+ */
+ public CompositeObjectRegistration<OpenflowpluginTableFeaturesTestServiceProvider> register(
+ final ProviderContext ctx) {
+ CompositeObjectRegistrationBuilder<OpenflowpluginTableFeaturesTestServiceProvider> builder = CompositeObjectRegistration
+ .<OpenflowpluginTableFeaturesTestServiceProvider> builderFor(this);
+
+ RoutedRpcRegistration<SalTableService> addRoutedRpcImplementation = ctx
+ .<SalTableService> addRoutedRpcImplementation(
+ SalTableService.class, this);
+
+ setTableRegistration(addRoutedRpcImplementation);
+
+ InstanceIdentifierBuilder<Nodes> builder1 = InstanceIdentifier
+ .<Nodes> builder(Nodes.class);
+
+ NodeId nodeId = new NodeId(OpenflowpluginTestActivator.NODE_ID);
+ NodeKey nodeKey = new NodeKey(nodeId);
+
+ InstanceIdentifierBuilder<Node> nodeIndentifier = builder1
+ .<Node, NodeKey> child(Node.class, nodeKey);
+
+ InstanceIdentifier<Node> instance = nodeIndentifier.build();
+
+ tableRegistration.registerPath(NodeContext.class, instance);
+
+ RoutedRpcRegistration<SalTableService> tableRegistration1 = this
+ .getTableRegistration();
+
+ builder.add(tableRegistration1);
+
+ return builder.build();
+ }
+
+}
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. 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.openflowplugin.test
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService
-import org.opendaylight.controller.md.sal.binding.api.DataBroker
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.SalTableService
-//import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalTableService
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableInput
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-import org.opendaylight.yangtools.concepts.CompositeObjectRegistration
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
-import org.slf4j.LoggerFactory
-
-
-class OpenflowpluginTableFeaturesTestServiceProvider implements AutoCloseable, SalTableService {
-
-
- static val LOG = LoggerFactory.getLogger(OpenflowpluginTableFeaturesTestServiceProvider);
-
- @Property
- RoutedRpcRegistration<SalTableService> tableRegistration;
-
-
- @Property
- NotificationProviderService notificationService;
-
-
- def void start() {
- LOG.info("SalTableServiceProvider Started.");
-
- }
-
-
- override close() {
- LOG.info("SalTableServiceProvider stopped.");
- tableRegistration.close;
- }
-
-
- override updateTable(UpdateTableInput input) {
- LOG.info("updateTable - " + input);
- return null;
- }
-
-
- def CompositeObjectRegistration<OpenflowpluginTableFeaturesTestServiceProvider> register(ProviderContext ctx) {
- val builder = CompositeObjectRegistration
- .<OpenflowpluginTableFeaturesTestServiceProvider> builderFor(this);
-
- tableRegistration = ctx.addRoutedRpcImplementation(SalTableService, this);
- val nodeIndentifier = InstanceIdentifier.builder(Nodes).child(Node, new NodeKey(new NodeId(OpenflowpluginTestActivator.NODE_ID)));
- tableRegistration.registerPath(NodeContext, nodeIndentifier.toInstance());
- builder.add(tableRegistration);
-
- return builder.toInstance();
- }
-
-}
\ No newline at end of file
--- /dev/null
+/**
+ * Copyright (c) 2013 Cisco Systems, Inc. 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.openflowplugin.test;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.osgi.framework.BundleContext;
+
+public class OpenflowpluginTestActivator extends AbstractBindingAwareProvider {
+
+ private static OpenflowpluginTestServiceProvider provider = new OpenflowpluginTestServiceProvider();
+ private static OpenflowpluginGroupTestServiceProvider groupProvider = new OpenflowpluginGroupTestServiceProvider();
+ private static OpenflowpluginMeterTestServiceProvider meterProvider = new OpenflowpluginMeterTestServiceProvider();
+ private static OpenflowpluginTableFeaturesTestServiceProvider tableProvider = new OpenflowpluginTableFeaturesTestServiceProvider();
+
+ private OpenflowpluginTestCommandProvider cmdProvider;
+
+ private OpenflowpluginGroupTestCommandProvider cmdGroupProvider;
+
+ private OpenflowpluginMeterTestCommandProvider cmdMeterProvider;
+
+ private OpenflowpluginTableFeaturesTestCommandProvider cmdTableProvider;
+
+ private OpenflowpluginStatsTestCommandProvider cmdStatsProvider;
+
+ private OpenflowpluginTestNodeConnectorNotification cmdNodeConnectorNotification;
+
+ private OpenflowpluginTestTopologyNotification cmdTopologyNotification;
+
+ private OpenflowPluginBulkTransactionProvider bulkCmdProvider;
+
+ private OpenflowPluginBulkGroupTransactionProvider groupCmdProvider;
+
+ public final static String NODE_ID = "foo:node:1";
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.sal.binding.api.BindingAwareProvider#
+ * onSessionInitiated
+ * (org.opendaylight.controller.sal.binding.api.BindingAwareBroker
+ * .ProviderContext)
+ */
+ @Override
+ public void onSessionInitiated(ProviderContext session) {
+ DataBroker salService = session
+ .<DataBroker> getSALService(DataBroker.class);
+ OpenflowpluginTestActivator.provider.setDataService(salService);
+
+ NotificationProviderService salService1 = session
+ .<NotificationProviderService> getSALService(NotificationProviderService.class);
+
+ OpenflowpluginTestActivator.provider
+ .setNotificationService(salService1);
+ OpenflowpluginTestActivator.provider.start();
+ OpenflowpluginTestActivator.provider.register(session);
+
+ OpenflowpluginTestActivator.groupProvider.register(session);
+ OpenflowpluginTestActivator.meterProvider.register(session);
+ OpenflowpluginTestActivator.tableProvider.register(session);
+
+ this.cmdProvider.onSessionInitiated(session);
+ this.cmdGroupProvider.onSessionInitiated(session);
+ this.cmdMeterProvider.onSessionInitiated(session);
+ this.cmdTableProvider.onSessionInitiated(session);
+ this.cmdStatsProvider.onSessionInitiated(session);
+ this.cmdNodeConnectorNotification.onSessionInitiated(session);
+ this.cmdTopologyNotification.onSessionInitiated(session);
+ this.bulkCmdProvider.onSessionInitiated(session);
+ this.groupCmdProvider.onSessionInitiated(session);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.sal.binding.api.AbstractBrokerAwareActivator
+ * #startImpl(org.osgi.framework.BundleContext)
+ */
+ public void startImpl(final BundleContext ctx) {
+ super.startImpl(ctx);
+
+ OpenflowpluginTestCommandProvider _openflowpluginTestCommandProvider = new OpenflowpluginTestCommandProvider(
+ ctx);
+ this.cmdProvider = _openflowpluginTestCommandProvider;
+ OpenflowpluginGroupTestCommandProvider _openflowpluginGroupTestCommandProvider = new OpenflowpluginGroupTestCommandProvider(
+ ctx);
+ this.cmdGroupProvider = _openflowpluginGroupTestCommandProvider;
+ OpenflowpluginMeterTestCommandProvider _openflowpluginMeterTestCommandProvider = new OpenflowpluginMeterTestCommandProvider(
+ ctx);
+ this.cmdMeterProvider = _openflowpluginMeterTestCommandProvider;
+ OpenflowpluginTableFeaturesTestCommandProvider _openflowpluginTableFeaturesTestCommandProvider = new OpenflowpluginTableFeaturesTestCommandProvider(
+ ctx);
+ this.cmdTableProvider = _openflowpluginTableFeaturesTestCommandProvider;
+ OpenflowpluginStatsTestCommandProvider _openflowpluginStatsTestCommandProvider = new OpenflowpluginStatsTestCommandProvider(
+ ctx);
+ this.cmdStatsProvider = _openflowpluginStatsTestCommandProvider;
+ OpenflowpluginTestNodeConnectorNotification _openflowpluginTestNodeConnectorNotification = new OpenflowpluginTestNodeConnectorNotification(
+ ctx);
+ this.cmdNodeConnectorNotification = _openflowpluginTestNodeConnectorNotification;
+ OpenflowpluginTestTopologyNotification _openflowpluginTestTopologyNotification = new OpenflowpluginTestTopologyNotification(
+ ctx);
+ this.cmdTopologyNotification = _openflowpluginTestTopologyNotification;
+ OpenflowPluginBulkTransactionProvider _openflowPluginBulkTransactionProvider = new OpenflowPluginBulkTransactionProvider(
+ ctx);
+ this.bulkCmdProvider = _openflowPluginBulkTransactionProvider;
+ OpenflowPluginBulkGroupTransactionProvider _openflowPluginBulkGroupTransactionProvider = new OpenflowPluginBulkGroupTransactionProvider(
+ ctx);
+ this.groupCmdProvider = _openflowPluginBulkGroupTransactionProvider;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.sal.binding.api.AbstractBrokerAwareActivator
+ * #stopImpl(org.osgi.framework.BundleContext)
+ */
+ protected void stopImpl(final BundleContext context) {
+
+ try {
+ OpenflowpluginTestActivator.provider.close();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+}
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. 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.openflowplugin.test
-
-import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService
-import org.opendaylight.controller.md.sal.binding.api.DataBroker
-import org.osgi.framework.BundleContext
-
-class OpenflowpluginTestActivator extends AbstractBindingAwareProvider {
-
- static var OpenflowpluginTestServiceProvider provider = new OpenflowpluginTestServiceProvider();
- static var OpenflowpluginGroupTestServiceProvider groupProvider = new OpenflowpluginGroupTestServiceProvider();
- static var OpenflowpluginMeterTestServiceProvider meterProvider = new OpenflowpluginMeterTestServiceProvider();
- static var OpenflowpluginTableFeaturesTestServiceProvider tableProvider = new OpenflowpluginTableFeaturesTestServiceProvider();
- var OpenflowpluginTestCommandProvider cmdProvider;
- var OpenflowpluginGroupTestCommandProvider cmdGroupProvider;
- var OpenflowpluginMeterTestCommandProvider cmdMeterProvider;
- var OpenflowpluginTableFeaturesTestCommandProvider cmdTableProvider;
- var OpenflowpluginStatsTestCommandProvider cmdStatsProvider;
- var OpenflowpluginTestNodeConnectorNotification cmdNodeConnectorNotification;
- var OpenflowpluginTestTopologyNotification cmdTopologyNotification;
- var OpenflowPluginBulkTransactionProvider bulkCmdProvider;
- var OpenflowPluginBulkGroupTransactionProvider groupCmdProvider;
- public static final String NODE_ID = "foo:node:1";
-
- override onSessionInitiated(ProviderContext session) {
- provider.dataService = session.getSALService(DataBroker)
- provider.notificationService = session.getSALService(NotificationProviderService)
- provider.start();
- provider.register(session);
- groupProvider.register(session);
- meterProvider.register(session);
- tableProvider.register(session);
- cmdProvider.onSessionInitiated(session);
- cmdGroupProvider.onSessionInitiated(session);
- cmdMeterProvider.onSessionInitiated(session);
- cmdTableProvider.onSessionInitiated(session);
- cmdStatsProvider.onSessionInitiated(session);
- cmdNodeConnectorNotification.onSessionInitiated(session);
- cmdTopologyNotification.onSessionInitiated(session);
- bulkCmdProvider.onSessionInitiated(session);
- groupCmdProvider.onSessionInitiated(session);
- }
-
- override startImpl(BundleContext ctx) {
- super.startImpl(ctx);
- cmdProvider = new OpenflowpluginTestCommandProvider(ctx);
- cmdGroupProvider = new OpenflowpluginGroupTestCommandProvider(ctx);
- cmdMeterProvider = new OpenflowpluginMeterTestCommandProvider(ctx);
- cmdTableProvider = new OpenflowpluginTableFeaturesTestCommandProvider(ctx);
- cmdStatsProvider = new OpenflowpluginStatsTestCommandProvider(ctx);
- cmdNodeConnectorNotification = new OpenflowpluginTestNodeConnectorNotification(ctx);
- cmdTopologyNotification = new OpenflowpluginTestTopologyNotification(ctx);
- bulkCmdProvider = new OpenflowPluginBulkTransactionProvider(ctx);
- groupCmdProvider = new OpenflowPluginBulkGroupTransactionProvider(ctx);
- }
-
- override protected stopImpl(BundleContext context) {
- provider.close();
- }
-
-}
--- /dev/null
+/**
+ * Copyright (c) 2013 Cisco Systems, Inc. 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.openflowplugin.test;
+
+import java.util.concurrent.Future;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
+import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
+import org.opendaylight.yangtools.concepts.CompositeObjectRegistration;
+import org.opendaylight.yangtools.concepts.CompositeObjectRegistration.CompositeObjectRegistrationBuilder;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class OpenflowpluginTestServiceProvider implements AutoCloseable,
+ SalFlowService {
+
+ private final static Logger LOG = LoggerFactory
+ .getLogger(OpenflowpluginTestServiceProvider.class);
+
+ private DataBroker dataService;
+ private RoutedRpcRegistration<SalFlowService> flowRegistration;
+ private NotificationProviderService notificationProviderService;
+
+ /**
+ * get data service
+ *
+ * @return {@link #dataService}
+ */
+ public DataBroker getDataService() {
+ return dataService;
+ }
+
+ /**
+ * set {@link #dataService}
+ *
+ * @param dataService
+ */
+ public void setDataService(final DataBroker dataService) {
+ this.dataService = dataService;
+ }
+
+ /**
+ * get flow registration
+ *
+ * @return {@link #flowRegistration}
+ */
+ public RoutedRpcRegistration<SalFlowService> getFlowRegistration() {
+ return flowRegistration;
+ }
+
+ /**
+ * set {@link #flowRegistration}
+ *
+ * @param flowRegistration
+ */
+ public void setFlowRegistration(
+ final RoutedRpcRegistration<SalFlowService> flowRegistration) {
+ this.flowRegistration = flowRegistration;
+ }
+
+ /**
+ * get notification service
+ *
+ * @return {@link #notificationProviderService}
+ */
+ public NotificationProviderService getNotificationService() {
+ return notificationProviderService;
+ }
+
+ /**
+ * set {@link #notificationProviderService}
+ *
+ * @param notificationProviderService
+ */
+ public void setNotificationService(
+ final NotificationProviderService notificationProviderService) {
+ this.notificationProviderService = notificationProviderService;
+ }
+
+ public void start() {
+ OpenflowpluginTestServiceProvider.LOG
+ .info("SalFlowServiceProvider Started.");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.AutoCloseable#close()
+ */
+ @Override
+ public void close() throws Exception {
+ OpenflowpluginTestServiceProvider.LOG
+ .info("SalFlowServiceProvide stopped.");
+ flowRegistration.close();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.
+ * SalFlowService
+ * #addFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.
+ * service.rev130819.AddFlowInput)
+ */
+ @Override
+ public Future<RpcResult<AddFlowOutput>> addFlow(AddFlowInput input) {
+ String plus = ("addFlow - " + input);
+ OpenflowpluginTestServiceProvider.LOG.info(plus);
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.
+ * SalFlowService
+ * #removeFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow
+ * .service.rev130819.RemoveFlowInput)
+ */
+ @Override
+ public Future<RpcResult<RemoveFlowOutput>> removeFlow(RemoveFlowInput input) {
+ String plus = ("removeFlow - " + input);
+ OpenflowpluginTestServiceProvider.LOG.info(plus);
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.
+ * SalFlowService
+ * #updateFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow
+ * .service.rev130819.UpdateFlowInput)
+ */
+ @Override
+ public Future<RpcResult<UpdateFlowOutput>> updateFlow(UpdateFlowInput input) {
+ String plus = ("updateFlow - " + input);
+ OpenflowpluginTestServiceProvider.LOG.info(plus);
+ return null;
+ }
+
+ /**
+ * @param ctx
+ * @return {@link CompositeObjectRegistrationBuilder #toInstance()}
+ */
+ public CompositeObjectRegistration<OpenflowpluginTestServiceProvider> register(
+ final ProviderContext ctx) {
+ CompositeObjectRegistrationBuilder<OpenflowpluginTestServiceProvider> builder = CompositeObjectRegistration
+ .<OpenflowpluginTestServiceProvider> builderFor(this);
+
+ RoutedRpcRegistration<SalFlowService> addRoutedRpcImplementation = ctx
+ .<SalFlowService> addRoutedRpcImplementation(
+ SalFlowService.class, this);
+
+ setFlowRegistration(addRoutedRpcImplementation);
+
+ InstanceIdentifierBuilder<Nodes> builderII = InstanceIdentifier
+ .<Nodes> builder(Nodes.class);
+
+ NodeId nodeId = new NodeId(OpenflowpluginTestActivator.NODE_ID);
+ NodeKey nodeKey = new NodeKey(nodeId);
+
+ InstanceIdentifierBuilder<Node> nodeIdentifier = builderII
+ .<Node, NodeKey> child(Node.class, nodeKey);
+
+ InstanceIdentifier<Node> instance = nodeIdentifier.build();
+
+ flowRegistration.registerPath(NodeContext.class, instance);
+
+ RoutedRpcRegistration<SalFlowService> flowRegistration2 = getFlowRegistration();
+
+ builder.add(flowRegistration2);
+
+ return builder.build();
+ }
+}
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. 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.openflowplugin.test
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService
-import org.opendaylight.controller.md.sal.binding.api.DataBroker
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInput
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-import org.opendaylight.yangtools.concepts.CompositeObjectRegistration
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
-import org.slf4j.LoggerFactory
-
-class OpenflowpluginTestServiceProvider implements AutoCloseable, SalFlowService {
-
-
- static val LOG = LoggerFactory.getLogger(OpenflowpluginTestServiceProvider);
-
- @Property
- DataBroker dataService;
-
- @Property
- RoutedRpcRegistration<SalFlowService> flowRegistration;
-
-
- @Property
- NotificationProviderService notificationService;
-
-
- def void start() {
- LOG.info("SalFlowServiceProvider Started.");
-
- }
-
- override close() {
- LOG.info("SalFlowServiceProvide stopped.");
- flowRegistration.close;
- }
-
- override addFlow(AddFlowInput input) {
- LOG.info("addFlow - " + input);
- return null;
-
- }
-
- override removeFlow(RemoveFlowInput input) {
- LOG.info("removeFlow - " + input);
- return null;
- }
-
- override updateFlow(UpdateFlowInput input) {
- LOG.info("updateFlow - " + input);
- return null;
- }
-
-
- def CompositeObjectRegistration<OpenflowpluginTestServiceProvider> register(ProviderContext ctx) {
- val builder = CompositeObjectRegistration
- .<OpenflowpluginTestServiceProvider> builderFor(this);
-
- flowRegistration = ctx.addRoutedRpcImplementation(SalFlowService, this);
- val nodeIndentifier = InstanceIdentifier.builder(Nodes).child(Node, new NodeKey(new NodeId(OpenflowpluginTestActivator.NODE_ID)));
- flowRegistration.registerPath(NodeContext, nodeIndentifier.toInstance());
- builder.add(flowRegistration);
-
- return builder.toInstance();
- }
-
-}
-
-