Search in sources :

Example 91 with Received

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.network.instance.protocol.bgp.neighbor_state.augmentation.messages.Received in project openflowplugin by opendaylight.

the class TableForwarder method update.

@Override
public void update(final InstanceIdentifier<TableFeatures> identifier, final TableFeatures original, final TableFeatures update, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
    LOG.debug("Received the Table Update request [Tbl id, node Id, original, upd" + " " + identifier + " " + nodeIdent + " " + original + " " + update);
    final TableFeatures originalTableFeatures = original;
    TableFeatures updatedTableFeatures;
    if (null == update) {
        updatedTableFeatures = original;
    } else {
        updatedTableFeatures = update;
    }
    final UpdateTableInputBuilder builder = new UpdateTableInputBuilder();
    builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
    // TODO: reconsider model - this particular field is not used in service
    // implementation
    builder.setTableRef(new TableRef(identifier));
    builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
    builder.setUpdatedTable(new UpdatedTableBuilder().setTableFeatures(Collections.singletonList(updatedTableFeatures)).build());
    builder.setOriginalTable(new OriginalTableBuilder().setTableFeatures(Collections.singletonList(originalTableFeatures)).build());
    LOG.debug("Invoking SalTableService ");
    if (this.provider.getSalTableService() != null) {
        LOG.debug(" Handle to SalTableServices" + this.provider.getSalTableService());
    }
    final Future<RpcResult<UpdateTableOutput>> resultFuture = this.provider.getSalTableService().updateTable(builder.build());
    JdkFutures.addErrorLogging(resultFuture, LOG, "updateTable");
}
Also used : NodeRef(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef) OriginalTableBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.table.update.OriginalTableBuilder) TableFeatures(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) UpdatedTableBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.table.update.UpdatedTableBuilder) UpdateTableInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableInputBuilder) Uri(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri) TableRef(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableRef)

Example 92 with Received

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.network.instance.protocol.bgp.neighbor_state.augmentation.messages.Received in project openflowplugin by opendaylight.

the class DeviceMastershipManager method onNodeRemoved.

@Override
public void onNodeRemoved(NodeRemoved notification) {
    LOG.debug("NodeRemoved notification received : {}", notification);
    NodeId nodeId = notification.getNodeRef().getValue().firstKeyOf(Node.class).getId();
    final DeviceMastership mastership = deviceMasterships.remove(nodeId);
    if (mastership != null) {
        mastership.close();
        LOG.info("Unregistered FRM cluster singleton service for service id : {}", nodeId.getValue());
    }
}
Also used : FlowCapableNode(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode) Node(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node) NodeId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId)

Example 93 with Received

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.network.instance.protocol.bgp.neighbor_state.augmentation.messages.Received in project openflowplugin by opendaylight.

the class OpenflowProtocolListenerInitialImpl method onEchoRequestMessage.

@Override
public void onEchoRequestMessage(final EchoRequestMessage echoRequestMessage) {
    if (LOG.isDebugEnabled()) {
        LOG.debug("echo request received: {}", echoRequestMessage.getXid());
    }
    EchoReplyInputBuilder builder = new EchoReplyInputBuilder();
    builder.setVersion(echoRequestMessage.getVersion());
    builder.setXid(echoRequestMessage.getXid());
    builder.setData(echoRequestMessage.getData());
    connectionContext.getConnectionAdapter().echoReply(builder.build());
}
Also used : EchoReplyInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoReplyInputBuilder)

Example 94 with Received

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.network.instance.protocol.bgp.neighbor_state.augmentation.messages.Received in project openflowplugin by opendaylight.

the class SwitchConnectionProviderImpl method createAndConfigureServer.

private ServerFacade createAndConfigureServer() {
    LOG.debug("Configuring ..");
    ServerFacade server = null;
    final ChannelInitializerFactory factory = new ChannelInitializerFactory();
    factory.setSwitchConnectionHandler(switchConnectionHandler);
    factory.setSwitchIdleTimeout(connConfig.getSwitchIdleTimeout());
    factory.setTlsConfig(connConfig.getTlsConfiguration());
    factory.setSerializationFactory(serializationFactory);
    factory.setDeserializationFactory(deserializationFactory);
    factory.setUseBarrier(connConfig.useBarrier());
    factory.setChannelOutboundQueueSize(connConfig.getChannelOutboundQueueSize());
    final TransportProtocol transportProtocol = (TransportProtocol) connConfig.getTransferProtocol();
    // Check if Epoll native transport is available.
    // TODO : Add option to disable Epoll.
    boolean isEpollEnabled = Epoll.isAvailable();
    if (TransportProtocol.TCP.equals(transportProtocol) || TransportProtocol.TLS.equals(transportProtocol)) {
        server = new TcpHandler(connConfig.getAddress(), connConfig.getPort());
        final TcpChannelInitializer channelInitializer = factory.createPublishingChannelInitializer();
        ((TcpHandler) server).setChannelInitializer(channelInitializer);
        ((TcpHandler) server).initiateEventLoopGroups(connConfig.getThreadConfiguration(), isEpollEnabled);
        final EventLoopGroup workerGroupFromTcpHandler = ((TcpHandler) server).getWorkerGroup();
        connectionInitializer = new TcpConnectionInitializer(workerGroupFromTcpHandler, isEpollEnabled);
        connectionInitializer.setChannelInitializer(channelInitializer);
        connectionInitializer.run();
    } else if (TransportProtocol.UDP.equals(transportProtocol)) {
        server = new UdpHandler(connConfig.getAddress(), connConfig.getPort());
        ((UdpHandler) server).initiateEventLoopGroups(connConfig.getThreadConfiguration(), isEpollEnabled);
        ((UdpHandler) server).setChannelInitializer(factory.createUdpChannelInitializer());
    } else {
        throw new IllegalStateException("Unknown transport protocol received: " + transportProtocol);
    }
    server.setThreadConfig(connConfig.getThreadConfiguration());
    return server;
}
Also used : EventLoopGroup(io.netty.channel.EventLoopGroup) TransportProtocol(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.TransportProtocol)

Example 95 with Received

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.network.instance.protocol.bgp.neighbor_state.augmentation.messages.Received in project openflowplugin by opendaylight.

the class AggregateFlowsInTableService method transformToNotification.

@Override
public AggregateFlowStatisticsUpdate transformToNotification(List<MultipartReply> result, TransactionId emulatedTxId) {
    final int mpSize = result.size();
    Preconditions.checkArgument(mpSize == 1, "unexpected (!=1) mp-reply size received: {}", mpSize);
    MultipartReply mpReply = result.get(0);
    final TranslatorKey translatorKey = new TranslatorKey(mpReply.getVersion(), MultipartReplyAggregateCase.class.getName());
    final MessageTranslator<MultipartReply, AggregatedFlowStatistics> messageTranslator = translatorLibrary.lookupTranslator(translatorKey);
    final AggregatedFlowStatistics flowStatistics = messageTranslator.translate(mpReply, getDeviceInfo(), null);
    final AggregateFlowStatisticsUpdateBuilder notification = new AggregateFlowStatisticsUpdateBuilder(flowStatistics).setId(getDeviceInfo().getNodeId()).setMoreReplies(Boolean.FALSE).setTransactionId(emulatedTxId);
    return notification.build();
}
Also used : MultipartReplyAggregateCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyAggregateCase) MultipartReply(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply) TranslatorKey(org.opendaylight.openflowplugin.api.openflow.md.core.TranslatorKey) AggregatedFlowStatistics(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.get.aggregate.flow.statistics.from.flow.table._for.given.match.output.AggregatedFlowStatistics) AggregateFlowStatisticsUpdateBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.AggregateFlowStatisticsUpdateBuilder)

Aggregations

ExecutionException (java.util.concurrent.ExecutionException)29 ArrayList (java.util.ArrayList)24 Uint64 (org.opendaylight.yangtools.yang.common.Uint64)23 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)18 BigInteger (java.math.BigInteger)16 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)16 List (java.util.List)13 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)13 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)13 Test (org.junit.Test)12 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)12 Uint32 (org.opendaylight.yangtools.yang.common.Uint32)12 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)11 UnknownHostException (java.net.UnknownHostException)10 TunnelTypeVxlan (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeVxlan)10 Action (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action)9 Network (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.networks.rev150712.networks.attributes.networks.Network)9 Collections (java.util.Collections)8 Map (java.util.Map)8 VpnInterface (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.l3vpn.rev200204.vpn.interfaces.VpnInterface)8