import com.google.common.base.Preconditions;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.NotificationService;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.openflowplugin.testcommon.DropTestDsProvider;
import org.opendaylight.openflowplugin.testcommon.DropTestRpcProvider;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.NotificationService;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.openflowplugin.droptestkaraf.DropTestProviderImpl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
import org.slf4j.Logger;
public class DropTestProviderModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.config.openflow.test.droptest.rev150327.AbstractDropTestProviderModule {
private static final Logger LOG = LoggerFactory.getLogger(DropTestProviderModule.class);
+
public DropTestProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
super(identifier, dependencyResolver);
}
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-new-notification-service</type>
<name>binding-notification-adapter</name>
</notification-adapter>
- <!--notification-service>
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-notification-service</type>
- <name>binding-notification-broker</name>
- </notification-service-->
</module>
</modules>
</data>
}
}
}
- /*
- container notification-service {
- uses config:service-ref {
- refine type {
- mandatory true;
- config:required-identity md-sal-binding:binding-notification-service;
- }
- }
- }
- */
}
}
}
import org.opendaylight.controller.md.sal.binding.api.NotificationService;
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.openflowplugin.outputtest.OutputTestCommandProvider;
import org.opendaylight.openflowplugin.testcommon.DropTestDsProvider;
import org.opendaylight.openflowplugin.testcommon.DropTestRpcProvider;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
import org.opendaylight.controller.md.sal.binding.api.NotificationService;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.api.types.rev150327.OfpRole;
void setRpcProviderRegistry(RpcProviderRegistry rpcProviderRegistry);
void setNotificationProviderService(NotificationService notificationProviderService);
+
void setNotificationPublishService(NotificationPublishService notificationPublishService);
/**
import org.opendaylight.controller.md.sal.binding.api.NotificationService;
import org.opendaylight.controller.md.sal.binding.api.ReadTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginTimer;
import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceContextClosedHandler;
*/
void setNotificationService(NotificationService notificationService);
- void setNotificationPublishService(NotificationPublishService notificationPublishService);
+ void setNotificationPublishService(NotificationPublishService notificationPublishService);
MessageSpy getMessageSpy();
import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
import org.opendaylight.controller.md.sal.binding.api.NotificationService;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-
import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceConnectedHandler;
import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceContextClosedHandler;
import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceInitializationPhaseHandler;
* This interface is responsible for instantiating DeviceContext and
* registering transaction chain for each DeviceContext. Each device
* has its own device context managed by this manager.
- * <p>
* Created by Martin Bobak <mbobak@cisco.com> on 25.2.2015.
*/
public interface DeviceManager extends DeviceConnectedHandler,
/**
* Sets notification receiving service
+ *
* @param notificationService
*/
void setNotificationService(NotificationService notificationService);
/**
* Sets notification publish service
+ *
* @param notificationPublishService
*/
- void setNotificationPublishService(NotificationPublishService notificationPublishService);
+ void setNotificationPublishService(NotificationPublishService notificationPublishService);
}
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
<name>binding-rpc-broker</name>
</rpc-registry>
- <!--notification-service>
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-notification-service</type>
- <name>binding-notification-broker</name>
- </notification-service-->
<notification-adapter>
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-new-notification-service</type>
<name>binding-notification-adapter</name>
//TODO : this is the point, where we can discover that add flow operation failed and where we should
//TODO : remove this flow from deviceFlowRegistry
final Error error = (Error) ofHeader;
- final String message = "Operation on device failed with xid "+ofHeader.getXid()+".";
+ final String message = "Operation on device failed with xid " + ofHeader.getXid() + ".";
rpcResult = RpcResultBuilder
.<OfHeader>failed()
.withError(RpcError.ErrorType.APPLICATION, message, new DeviceDataException(message, error))
final TranslatorKey translatorKey = new TranslatorKey(packetInMessage.getVersion(), PacketIn.class.getName());
final MessageTranslator<PacketInMessage, PacketReceived> messageTranslator = translatorLibrary.lookupTranslator(translatorKey);
final PacketReceived packetReceived = messageTranslator.translate(packetInMessage, this, null);
- if (!notificationPublishService.offerNotification(packetReceived)){
+ if (!notificationPublishService.offerNotification(packetReceived)) {
LOG.debug("Notification offer refused by notification service.");
}
import org.opendaylight.controller.md.sal.binding.api.NotificationService;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
}
@Override
- public void setNotificationPublishService (final NotificationPublishService notificationService) {
+ public void setNotificationPublishService(final NotificationPublishService notificationService) {
this.notificationPublishService = notificationService;
}
}
}
}
- /*
- container notification-service {
- uses config:service-ref {
- refine type {
- mandatory true;
- config:required-identity md-sal-binding:binding-notification-service;
- }
- }
- }
- */
list openflow-switch-connection-provider {
uses config:service-ref {
refine type {
final FlowBuilder fb = BUILDER.get();
fb.setMatch(match);
fb.setInstructions(instructions);
- fb.setId(new FlowId(String.valueOf(fb.hashCode()) +"."+ ID_COUNTER.getAndIncrement()));
+ fb.setId(new FlowId(String.valueOf(fb.hashCode()) + "." + ID_COUNTER.getAndIncrement()));
// Construct the flow instance id
final InstanceIdentifier<Flow> flowInstanceId =
InstanceIdentifier.builder(Nodes.class)
// A particular node identified by nodeKey
.child(Node.class, node)
- // That is flow capable, only FlowCapableNodes have tables
+ // That is flow capable, only FlowCapableNodes have tables
.augmentation(FlowCapableNode.class)
- // In the table identified by TableKey
+ // In the table identified by TableKey
.child(Table.class, new TableKey((short) 0))
- // A flow identified by flowKey
+ // A flow identified by flowKey
.child(Flow.class, new FlowKey(fb.getId()))
.build();
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.NotificationService;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
package org.opendaylight.openflowplugin.testcommon;
import org.opendaylight.controller.md.sal.binding.api.NotificationService;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.NotificationListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
// Finally build our flow
fb.setMatch(match);
fb.setInstructions(instructions);
- //fb.setId(new FlowId(Long.toString(fb.hashCode)));
// Construct the flow instance id
final InstanceIdentifier<Node> flowInstanceId = InstanceIdentifier
// File under nodes
.builder(Nodes.class)
- // A particular node identified by nodeKey
+ // A particular node identified by nodeKey
.child(Node.class, node).build();
fb.setNode(new NodeRef(flowInstanceId));