Search in sources :

Example 6 with RpcResultBuilder

use of org.opendaylight.yangtools.yang.common.RpcResultBuilder in project openflowplugin by opendaylight.

the class SalFlowServiceImpl method updateFlow.

@Override
public Future<RpcResult<UpdateFlowOutput>> updateFlow(final UpdateFlowInput input) {
    final UpdatedFlow updated = input.getUpdatedFlow();
    final OriginalFlow original = input.getOriginalFlow();
    final List<FlowModInputBuilder> allFlowMods = new ArrayList<>();
    final List<FlowModInputBuilder> ofFlowModInputs;
    ListenableFuture<RpcResult<UpdateFlowOutput>> future;
    if (flowUpdateMessage.canUseSingleLayerSerialization()) {
        if (!FlowCreatorUtil.canModifyFlow(original, updated, flowUpdateMessage.getVersion())) {
            final SettableFuture<RpcResult<UpdateFlowOutput>> objectSettableFuture = SettableFuture.create();
            final ListenableFuture<List<RpcResult<UpdateFlowOutput>>> listListenableFuture = Futures.successfulAsList(flowUpdateMessage.handleServiceCall(input.getOriginalFlow()), flowUpdateMessage.handleServiceCall(input.getUpdatedFlow()));
            Futures.addCallback(listListenableFuture, new FutureCallback<List<RpcResult<UpdateFlowOutput>>>() {

                @Override
                public void onSuccess(@Nonnull final List<RpcResult<UpdateFlowOutput>> results) {
                    final ArrayList<RpcError> errors = new ArrayList();
                    for (RpcResult<UpdateFlowOutput> flowModResult : results) {
                        if (flowModResult == null) {
                            errors.add(RpcResultBuilder.newError(RpcError.ErrorType.PROTOCOL, OFConstants.APPLICATION_TAG, "unexpected flowMod result (null) occurred"));
                        } else if (!flowModResult.isSuccessful()) {
                            errors.addAll(flowModResult.getErrors());
                        }
                    }
                    final RpcResultBuilder<UpdateFlowOutput> rpcResultBuilder;
                    if (errors.isEmpty()) {
                        rpcResultBuilder = RpcResultBuilder.success();
                    } else {
                        rpcResultBuilder = RpcResultBuilder.<UpdateFlowOutput>failed().withRpcErrors(errors);
                    }
                    objectSettableFuture.set(rpcResultBuilder.build());
                }

                @Override
                public void onFailure(final Throwable throwable) {
                    RpcResultBuilder<UpdateFlowOutput> rpcResultBuilder = RpcResultBuilder.failed();
                    objectSettableFuture.set(rpcResultBuilder.build());
                }
            }, MoreExecutors.directExecutor());
            future = objectSettableFuture;
        } else {
            future = flowUpdateMessage.handleServiceCall(input.getUpdatedFlow());
        }
    } else {
        if (!FlowCreatorUtil.canModifyFlow(original, updated, flowUpdate.getVersion())) {
            // We would need to remove original and add updated.
            // remove flow
            final RemoveFlowInputBuilder removeflow = new RemoveFlowInputBuilder(original);
            final List<FlowModInputBuilder> ofFlowRemoveInput = flowUpdate.toFlowModInputs(removeflow.build());
            // remove flow should be the first
            allFlowMods.addAll(ofFlowRemoveInput);
            final AddFlowInputBuilder addFlowInputBuilder = new AddFlowInputBuilder(updated);
            ofFlowModInputs = flowUpdate.toFlowModInputs(addFlowInputBuilder.build());
        } else {
            ofFlowModInputs = flowUpdate.toFlowModInputs(updated);
        }
        allFlowMods.addAll(ofFlowModInputs);
        future = flowUpdate.processFlowModInputBuilders(allFlowMods);
    }
    Futures.addCallback(future, new UpdateFlowCallback(input), MoreExecutors.directExecutor());
    return future;
}
Also used : RpcResultBuilder(org.opendaylight.yangtools.yang.common.RpcResultBuilder) UpdatedFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.flow.update.UpdatedFlow) ArrayList(java.util.ArrayList) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) OriginalFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.flow.update.OriginalFlow) FlowModInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInputBuilder) UpdateFlowOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutput) RemoveFlowInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInputBuilder) AddFlowInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInputBuilder) ArrayList(java.util.ArrayList) List(java.util.List)

Example 7 with RpcResultBuilder

use of org.opendaylight.yangtools.yang.common.RpcResultBuilder in project openflowplugin by opendaylight.

the class SyncPlanPushStrategyIncrementalImpl method removeRedundantGroups.

ListenableFuture<RpcResult<Void>> removeRedundantGroups(final NodeId nodeId, final InstanceIdentifier<FlowCapableNode> nodeIdent, final List<ItemSyncBox<Group>> groupsRemovalPlan, final SyncCrudCounters counters) {
    if (groupsRemovalPlan.isEmpty()) {
        LOG.trace("no groups on device for node: {} -> SKIPPING", nodeId.getValue());
        return RpcResultBuilder.<Void>success().buildFuture();
    }
    final CrudCounts groupCrudCounts = counters.getGroupCrudCounts();
    ListenableFuture<RpcResult<Void>> chainedResult = RpcResultBuilder.<Void>success().buildFuture();
    try {
        groupCrudCounts.setRemoved(ReconcileUtil.countTotalPushed(groupsRemovalPlan));
        if (LOG.isDebugEnabled()) {
            LOG.debug("removing groups: planSteps={}, toRemoveTotal={}", groupsRemovalPlan.size(), groupCrudCounts.getRemoved());
        }
        Collections.reverse(groupsRemovalPlan);
        for (final ItemSyncBox<Group> groupsPortion : groupsRemovalPlan) {
            chainedResult = Futures.transformAsync(chainedResult, input -> {
                final ListenableFuture<RpcResult<Void>> result;
                if (input.isSuccessful()) {
                    result = flushRemoveGroupPortionAndBarrier(nodeIdent, groupsPortion);
                } else {
                    // pass through original unsuccessful rpcResult
                    result = Futures.immediateFuture(input);
                }
                return result;
            }, MoreExecutors.directExecutor());
        }
    } catch (IllegalStateException e) {
        chainedResult = RpcResultBuilder.<Void>failed().withError(RpcError.ErrorType.APPLICATION, "failed to add missing groups", e).buildFuture();
    }
    return chainedResult;
}
Also used : CrudCounts(org.opendaylight.openflowplugin.applications.frsync.util.CrudCounts) AddFlowOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowOutput) Iterables(com.google.common.collect.Iterables) MoreExecutors(com.google.common.util.concurrent.MoreExecutors) ListenableFuture(com.google.common.util.concurrent.ListenableFuture) Table(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) MeterKey(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.MeterKey) CrudCounts(org.opendaylight.openflowplugin.applications.frsync.util.CrudCounts) LoggerFactory(org.slf4j.LoggerFactory) FlowCapableTransactionService(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.FlowCapableTransactionService) Flow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow) FlowCapableNode(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode) Meter(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter) JdkFutureAdapters(com.google.common.util.concurrent.JdkFutureAdapters) RemoveGroupOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupOutput) UpdateGroupOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupOutput) ArrayList(java.util.ArrayList) GroupKey(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupKey) UpdateMeterOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.UpdateMeterOutput) FlowKey(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey) Map(java.util.Map) RemoveMeterOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.RemoveMeterOutput) SyncPlanPushStrategy(org.opendaylight.openflowplugin.applications.frsync.SyncPlanPushStrategy) PathUtil(org.opendaylight.openflowplugin.applications.frsync.util.PathUtil) ItemSyncBox(org.opendaylight.openflowplugin.applications.frsync.util.ItemSyncBox) UpdateTableOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableOutput) Logger(org.slf4j.Logger) Group(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group) FxChainUtil(org.opendaylight.openflowplugin.applications.frsync.util.FxChainUtil) TableKey(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey) Futures(com.google.common.util.concurrent.Futures) List(java.util.List) RemoveFlowOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutput) AddGroupOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupOutput) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) RpcResultBuilder(org.opendaylight.yangtools.yang.common.RpcResultBuilder) SyncCrudCounters(org.opendaylight.openflowplugin.applications.frsync.util.SyncCrudCounters) KeyedInstanceIdentifier(org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier) AddMeterOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.AddMeterOutput) ReconcileUtil(org.opendaylight.openflowplugin.applications.frsync.util.ReconcileUtil) Collections(java.util.Collections) UpdateFlowOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutput) NodeId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId) RpcError(org.opendaylight.yangtools.yang.common.RpcError) Group(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) ListenableFuture(com.google.common.util.concurrent.ListenableFuture)

Example 8 with RpcResultBuilder

use of org.opendaylight.yangtools.yang.common.RpcResultBuilder in project genius by opendaylight.

the class AlivenessMonitor method monitorStart.

@Override
public Future<RpcResult<MonitorStartOutput>> monitorStart(MonitorStartInput input) {
    RpcResultBuilder<MonitorStartOutput> rpcResultBuilder;
    final Config in = input.getConfig();
    Long profileId = in.getProfileId();
    LOG.debug("Monitor Start invoked with Config: {}, Profile Id: {}", in, profileId);
    try {
        if (in.getMode() != MonitoringMode.OneOne) {
            throw new UnsupportedConfigException("Unsupported Monitoring mode. Currently one-one mode is supported");
        }
        Optional<MonitorProfile> optProfile = SingleTransactionDataBroker.syncReadOptionalAndTreatReadFailedExceptionAsAbsentOptional(dataBroker, LogicalDatastoreType.OPERATIONAL, getMonitorProfileId(profileId));
        final MonitorProfile profile;
        if (!optProfile.isPresent()) {
            String errMsg = String.format("No monitoring profile associated with Id: %d", profileId);
            LOG.error("Monitor start failed. {}", errMsg);
            throw new RuntimeException(errMsg);
        } else {
            profile = optProfile.get();
        }
        final EtherTypes ethType = profile.getProtocolType();
        String interfaceName = null;
        EndpointType srcEndpointType = in.getSource().getEndpointType();
        if (srcEndpointType instanceof Interface) {
            Interface endPoint = (Interface) srcEndpointType;
            interfaceName = endPoint.getInterfaceName();
        } else {
            throw new UnsupportedConfigException("Unsupported source Endpoint type. Only Interface Endpoint currently supported for monitoring");
        }
        if (Strings.isNullOrEmpty(interfaceName)) {
            throw new RuntimeException("Interface Name not defined in the source Endpoint");
        }
        // Initially the support is for one monitoring per interface.
        // Revisit the retrieving monitor id logic when the multiple
        // monitoring for same interface is needed.
        EndpointType destEndpointType = null;
        if (in.getDestination() != null) {
            destEndpointType = in.getDestination().getEndpointType();
        }
        String idKey = getUniqueKey(interfaceName, ethType.toString(), srcEndpointType, destEndpointType);
        final long monitorId = getUniqueId(idKey);
        Optional<MonitoringInfo> optKey = SingleTransactionDataBroker.syncReadOptionalAndTreatReadFailedExceptionAsAbsentOptional(dataBroker, LogicalDatastoreType.OPERATIONAL, getMonitoringInfoId(monitorId));
        final AlivenessProtocolHandler<?> handler;
        if (optKey.isPresent()) {
            String message = String.format("Monitoring for the interface %s with this configuration " + "is already registered.", interfaceName);
            LOG.warn("Monitoring for the interface {} with this configuration is already registered.", interfaceName);
            MonitorStartOutput output = new MonitorStartOutputBuilder().setMonitorId(monitorId).build();
            rpcResultBuilder = RpcResultBuilder.success(output).withWarning(ErrorType.APPLICATION, "config-exists", message);
            return Futures.immediateFuture(rpcResultBuilder.build());
        } else {
            // Construct the monitor key
            final MonitoringInfo monitoringInfo = new MonitoringInfoBuilder().setId(monitorId).setMode(in.getMode()).setProfileId(profileId).setDestination(in.getDestination()).setSource(in.getSource()).build();
            // Construct the initial monitor state
            handler = alivenessProtocolHandlerRegistry.get(ethType);
            final String monitoringKey = handler.getUniqueMonitoringKey(monitoringInfo);
            MonitoringStateBuilder monitoringStateBuilder = new MonitoringStateBuilder().setMonitorKey(monitoringKey).setMonitorId(monitorId).setState(LivenessState.Unknown).setStatus(MonitorStatus.Started);
            if (ethType != EtherTypes.Bfd) {
                monitoringStateBuilder.setRequestCount(INITIAL_COUNT).setResponsePendingCount(INITIAL_COUNT);
            }
            MonitoringState monitoringState = monitoringStateBuilder.build();
            Futures.addCallback(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
                tx.put(LogicalDatastoreType.OPERATIONAL, getMonitoringInfoId(monitorId), monitoringInfo, CREATE_MISSING_PARENT);
                LOG.debug("adding oper monitoring info {}", monitoringInfo);
                tx.put(LogicalDatastoreType.OPERATIONAL, getMonitorStateId(monitoringKey), monitoringState, CREATE_MISSING_PARENT);
                LOG.debug("adding oper monitoring state {}", monitoringState);
                MonitoridKeyEntry mapEntry = new MonitoridKeyEntryBuilder().setMonitorId(monitorId).setMonitorKey(monitoringKey).build();
                tx.put(LogicalDatastoreType.OPERATIONAL, getMonitorMapId(monitorId), mapEntry, CREATE_MISSING_PARENT);
                LOG.debug("adding oper map entry {}", mapEntry);
            }), new FutureCallback<Void>() {

                @Override
                public void onFailure(Throwable error) {
                    String errorMsg = String.format("Adding Monitoring info: %s in Datastore failed", monitoringInfo);
                    LOG.warn("Adding Monitoring info: {} in Datastore failed", monitoringInfo, error);
                    throw new RuntimeException(errorMsg, error);
                }

                @Override
                public void onSuccess(Void noarg) {
                    lockMap.put(monitoringKey, new Semaphore(1, true));
                    if (ethType == EtherTypes.Bfd) {
                        handler.startMonitoringTask(monitoringInfo);
                        return;
                    }
                    // Schedule task
                    LOG.debug("Scheduling monitor task for config: {}", in);
                    scheduleMonitoringTask(monitoringInfo, profile.getMonitorInterval());
                }
            }, callbackExecutorService);
        }
        associateMonitorIdWithInterface(monitorId, interfaceName);
        MonitorStartOutput output = new MonitorStartOutputBuilder().setMonitorId(monitorId).build();
        rpcResultBuilder = RpcResultBuilder.success(output);
    } catch (UnsupportedConfigException e) {
        LOG.error("Start Monitoring Failed. ", e);
        rpcResultBuilder = RpcResultBuilder.<MonitorStartOutput>failed().withError(ErrorType.APPLICATION, e.getMessage(), e);
    }
    return Futures.immediateFuture(rpcResultBuilder.build());
}
Also used : IpAddress(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.endpoint.endpoint.type.IpAddress) LoadingCache(com.google.common.cache.LoadingCache) EventData(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.event.EventData) PacketInReason(org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketInReason) EventDataBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.event.EventDataBuilder) Future(java.util.concurrent.Future) MonitoringInfo(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.configs.MonitoringInfo) Optional(com.google.common.base.Optional) MonitoringState(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitoring.states.MonitoringState) CreateIdPoolInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.CreateIdPoolInput) ReleaseIdInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput) Ethernet(org.opendaylight.genius.mdsalutil.packet.Ethernet) InterfaceMonitorEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411._interface.monitor.map.InterfaceMonitorEntry) ErrorType(org.opendaylight.yangtools.yang.common.RpcError.ErrorType) AlivenessProtocolHandler(org.opendaylight.genius.alivenessmonitor.protocols.AlivenessProtocolHandler) Executors(java.util.concurrent.Executors) DataBroker(org.opendaylight.controller.md.sal.binding.api.DataBroker) MonitorProfileCreateOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileCreateOutput) Predicate(com.google.common.base.Predicate) AlivenessMonitorService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.AlivenessMonitorService) MonitorUnpauseInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorUnpauseInput) InterfaceMonitorEntryKey(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411._interface.monitor.map.InterfaceMonitorEntryKey) InterfaceMonitorEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411._interface.monitor.map.InterfaceMonitorEntryBuilder) MonitorProfileGetOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileGetOutput) MonitoringStateBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitoring.states.MonitoringStateBuilder) Interface(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.endpoint.endpoint.type.Interface) MonitorProfileDeleteInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileDeleteInput) PacketReceived(org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceived) ReadWriteTransaction(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction) AllocateIdOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.AllocateIdOutput) MonitorStatus(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorStatus) ArrayList(java.util.ArrayList) AlivenessProtocolHandlerRegistry(org.opendaylight.genius.alivenessmonitor.protocols.AlivenessProtocolHandlerRegistry) Strings(com.google.common.base.Strings) MonitorProfileCreateOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileCreateOutputBuilder) MonitorEventBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorEventBuilder) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) MonitorPauseInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorPauseInput) EtherTypes(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.EtherTypes) AlivenessMonitorUtil.getInterfaceMonitorMapId(org.opendaylight.genius.alivenessmonitor.internal.AlivenessMonitorUtil.getInterfaceMonitorMapId) FutureCallback(com.google.common.util.concurrent.FutureCallback) ExecutionException(java.util.concurrent.ExecutionException) MonitorStopInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorStopInput) Futures(com.google.common.util.concurrent.Futures) MonitorStartInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorStartInput) MonitoringMode(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitoringMode) Preconditions(com.google.common.base.Preconditions) MonitorProfileGetInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileGetInput) PacketException(org.opendaylight.openflowplugin.libraries.liblldp.PacketException) AlivenessMonitorUtil.getMonitorProfileId(org.opendaylight.genius.alivenessmonitor.internal.AlivenessMonitorUtil.getMonitorProfileId) MonitorProfileCreateInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileCreateInput) SingleTransactionDataBroker(org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker) ScheduledFuture(java.util.concurrent.ScheduledFuture) MonitoridKeyEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitorid.key.map.MonitoridKeyEntry) LoggerFactory(org.slf4j.LoggerFactory) NotificationPublishService(org.opendaylight.controller.md.sal.binding.api.NotificationPublishService) SettableFuture(com.google.common.util.concurrent.SettableFuture) MonitorEvent(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorEvent) ThreadFactoryProvider(org.opendaylight.infrautils.utils.concurrent.ThreadFactoryProvider) PreDestroy(javax.annotation.PreDestroy) MonitoringInfoBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.configs.MonitoringInfoBuilder) ManagedNewTransactionRunner(org.opendaylight.genius.infra.ManagedNewTransactionRunner) AlivenessMonitorUtil.getMonitoringInfoId(org.opendaylight.genius.alivenessmonitor.internal.AlivenessMonitorUtil.getMonitoringInfoId) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) LogicalDatastoreType(org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType) Packet(org.opendaylight.openflowplugin.libraries.liblldp.Packet) AlivenessMonitorUtil.getMonitorMapId(org.opendaylight.genius.alivenessmonitor.internal.AlivenessMonitorUtil.getMonitorMapId) AllocateIdInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.AllocateIdInput) CacheLoader(com.google.common.cache.CacheLoader) List(java.util.List) EndpointType(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.endpoint.EndpointType) CacheBuilder(com.google.common.cache.CacheBuilder) MonitorStartOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorStartOutputBuilder) MoreExecutors(com.google.common.util.concurrent.MoreExecutors) ListenableFuture(com.google.common.util.concurrent.ListenableFuture) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) PacketProcessingListener(org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingListener) LivenessState(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.LivenessState) MonitorProfileGetOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileGetOutputBuilder) Singleton(javax.inject.Singleton) JdkFutureAdapters(com.google.common.util.concurrent.JdkFutureAdapters) NetUtils(org.opendaylight.openflowplugin.libraries.liblldp.NetUtils) ConcurrentMap(java.util.concurrent.ConcurrentMap) Inject(javax.inject.Inject) ReadOnlyTransaction(org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction) SendToController(org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.SendToController) CreateIdPoolInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.CreateIdPoolInputBuilder) Profile(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.profile.create.input.Profile) ManagedNewTransactionRunnerImpl(org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl) Config(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.start.input.Config) Nonnull(javax.annotation.Nonnull) ExecutorService(java.util.concurrent.ExecutorService) MonitoridKeyEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitorid.key.map.MonitoridKeyEntryBuilder) Logger(org.slf4j.Logger) Semaphore(java.util.concurrent.Semaphore) MonitorStartOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorStartOutput) ReleaseIdInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInputBuilder) MonitorProfile(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.profiles.MonitorProfile) IdManagerService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.IdManagerService) TimeUnit(java.util.concurrent.TimeUnit) MonitorProfileBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.profiles.MonitorProfileBuilder) RpcResultBuilder(org.opendaylight.yangtools.yang.common.RpcResultBuilder) AllocateIdInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.AllocateIdInputBuilder) Collections(java.util.Collections) AlivenessMonitorUtil.getMonitorStateId(org.opendaylight.genius.alivenessmonitor.internal.AlivenessMonitorUtil.getMonitorStateId) Config(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.start.input.Config) MonitoringStateBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitoring.states.MonitoringStateBuilder) MonitoringInfoBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.configs.MonitoringInfoBuilder) Semaphore(java.util.concurrent.Semaphore) EtherTypes(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.EtherTypes) MonitoringState(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitoring.states.MonitoringState) MonitorStartOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorStartOutputBuilder) EndpointType(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.endpoint.EndpointType) MonitorStartOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorStartOutput) MonitoringInfo(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.configs.MonitoringInfo) MonitorProfile(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.profiles.MonitorProfile) MonitoridKeyEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitorid.key.map.MonitoridKeyEntryBuilder) Interface(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.endpoint.endpoint.type.Interface) MonitoridKeyEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitorid.key.map.MonitoridKeyEntry)

Example 9 with RpcResultBuilder

use of org.opendaylight.yangtools.yang.common.RpcResultBuilder in project genius by opendaylight.

the class AlivenessMonitor method monitorStop.

@Override
public Future<RpcResult<Void>> monitorStop(MonitorStopInput input) {
    LOG.debug("Monitor Stop operation for monitor id - {}", input.getMonitorId());
    SettableFuture<RpcResult<Void>> result = SettableFuture.create();
    final Long monitorId = input.getMonitorId();
    Optional<MonitoringInfo> optInfo = SingleTransactionDataBroker.syncReadOptionalAndTreatReadFailedExceptionAsAbsentOptional(dataBroker, LogicalDatastoreType.OPERATIONAL, getMonitoringInfoId(monitorId));
    if (optInfo.isPresent()) {
        // Stop the monitoring task
        stopMonitoringTask(monitorId);
        String monitorKey = monitorIdKeyCache.getUnchecked(monitorId);
        // Cleanup the Data store
        Futures.addCallback(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
            if (monitorKey != null) {
                tx.delete(LogicalDatastoreType.OPERATIONAL, getMonitorStateId(monitorKey));
                monitorIdKeyCache.invalidate(monitorId);
            }
            tx.delete(LogicalDatastoreType.OPERATIONAL, getMonitoringInfoId(monitorId));
        }), new FutureCallbackImpl(String.format("Delete monitor state with Id %d", monitorId)), MoreExecutors.directExecutor());
        MonitoringInfo info = optInfo.get();
        String interfaceName = getInterfaceName(info.getSource().getEndpointType());
        if (interfaceName != null) {
            removeMonitorIdFromInterfaceAssociation(monitorId, interfaceName);
        }
        releaseIdForMonitoringInfo(info);
        if (monitorKey != null) {
            lockMap.remove(monitorKey);
        }
        result.set(RpcResultBuilder.<Void>success().build());
    } else {
        String errorMsg = String.format("Do not have monitoring information associated with key %d", monitorId);
        LOG.error("Delete monitoring operation Failed - {}", errorMsg);
        result.set(RpcResultBuilder.<Void>failed().withError(ErrorType.APPLICATION, errorMsg).build());
    }
    return result;
}
Also used : IpAddress(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.endpoint.endpoint.type.IpAddress) LoadingCache(com.google.common.cache.LoadingCache) EventData(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.event.EventData) PacketInReason(org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketInReason) EventDataBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.event.EventDataBuilder) Future(java.util.concurrent.Future) MonitoringInfo(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.configs.MonitoringInfo) Optional(com.google.common.base.Optional) MonitoringState(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitoring.states.MonitoringState) CreateIdPoolInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.CreateIdPoolInput) ReleaseIdInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput) Ethernet(org.opendaylight.genius.mdsalutil.packet.Ethernet) InterfaceMonitorEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411._interface.monitor.map.InterfaceMonitorEntry) ErrorType(org.opendaylight.yangtools.yang.common.RpcError.ErrorType) AlivenessProtocolHandler(org.opendaylight.genius.alivenessmonitor.protocols.AlivenessProtocolHandler) Executors(java.util.concurrent.Executors) DataBroker(org.opendaylight.controller.md.sal.binding.api.DataBroker) MonitorProfileCreateOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileCreateOutput) Predicate(com.google.common.base.Predicate) AlivenessMonitorService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.AlivenessMonitorService) MonitorUnpauseInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorUnpauseInput) InterfaceMonitorEntryKey(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411._interface.monitor.map.InterfaceMonitorEntryKey) InterfaceMonitorEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411._interface.monitor.map.InterfaceMonitorEntryBuilder) MonitorProfileGetOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileGetOutput) MonitoringStateBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitoring.states.MonitoringStateBuilder) Interface(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.endpoint.endpoint.type.Interface) MonitorProfileDeleteInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileDeleteInput) PacketReceived(org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceived) ReadWriteTransaction(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction) AllocateIdOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.AllocateIdOutput) MonitorStatus(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorStatus) ArrayList(java.util.ArrayList) AlivenessProtocolHandlerRegistry(org.opendaylight.genius.alivenessmonitor.protocols.AlivenessProtocolHandlerRegistry) Strings(com.google.common.base.Strings) MonitorProfileCreateOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileCreateOutputBuilder) MonitorEventBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorEventBuilder) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) MonitorPauseInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorPauseInput) EtherTypes(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.EtherTypes) AlivenessMonitorUtil.getInterfaceMonitorMapId(org.opendaylight.genius.alivenessmonitor.internal.AlivenessMonitorUtil.getInterfaceMonitorMapId) FutureCallback(com.google.common.util.concurrent.FutureCallback) ExecutionException(java.util.concurrent.ExecutionException) MonitorStopInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorStopInput) Futures(com.google.common.util.concurrent.Futures) MonitorStartInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorStartInput) MonitoringMode(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitoringMode) Preconditions(com.google.common.base.Preconditions) MonitorProfileGetInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileGetInput) PacketException(org.opendaylight.openflowplugin.libraries.liblldp.PacketException) AlivenessMonitorUtil.getMonitorProfileId(org.opendaylight.genius.alivenessmonitor.internal.AlivenessMonitorUtil.getMonitorProfileId) MonitorProfileCreateInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileCreateInput) SingleTransactionDataBroker(org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker) ScheduledFuture(java.util.concurrent.ScheduledFuture) MonitoridKeyEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitorid.key.map.MonitoridKeyEntry) LoggerFactory(org.slf4j.LoggerFactory) NotificationPublishService(org.opendaylight.controller.md.sal.binding.api.NotificationPublishService) SettableFuture(com.google.common.util.concurrent.SettableFuture) MonitorEvent(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorEvent) ThreadFactoryProvider(org.opendaylight.infrautils.utils.concurrent.ThreadFactoryProvider) PreDestroy(javax.annotation.PreDestroy) MonitoringInfoBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.configs.MonitoringInfoBuilder) ManagedNewTransactionRunner(org.opendaylight.genius.infra.ManagedNewTransactionRunner) AlivenessMonitorUtil.getMonitoringInfoId(org.opendaylight.genius.alivenessmonitor.internal.AlivenessMonitorUtil.getMonitoringInfoId) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) LogicalDatastoreType(org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType) Packet(org.opendaylight.openflowplugin.libraries.liblldp.Packet) AlivenessMonitorUtil.getMonitorMapId(org.opendaylight.genius.alivenessmonitor.internal.AlivenessMonitorUtil.getMonitorMapId) AllocateIdInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.AllocateIdInput) CacheLoader(com.google.common.cache.CacheLoader) List(java.util.List) EndpointType(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.endpoint.EndpointType) CacheBuilder(com.google.common.cache.CacheBuilder) MonitorStartOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorStartOutputBuilder) MoreExecutors(com.google.common.util.concurrent.MoreExecutors) ListenableFuture(com.google.common.util.concurrent.ListenableFuture) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) PacketProcessingListener(org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingListener) LivenessState(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.LivenessState) MonitorProfileGetOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileGetOutputBuilder) Singleton(javax.inject.Singleton) JdkFutureAdapters(com.google.common.util.concurrent.JdkFutureAdapters) NetUtils(org.opendaylight.openflowplugin.libraries.liblldp.NetUtils) ConcurrentMap(java.util.concurrent.ConcurrentMap) Inject(javax.inject.Inject) ReadOnlyTransaction(org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction) SendToController(org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.SendToController) CreateIdPoolInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.CreateIdPoolInputBuilder) Profile(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.profile.create.input.Profile) ManagedNewTransactionRunnerImpl(org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl) Config(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.start.input.Config) Nonnull(javax.annotation.Nonnull) ExecutorService(java.util.concurrent.ExecutorService) MonitoridKeyEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitorid.key.map.MonitoridKeyEntryBuilder) Logger(org.slf4j.Logger) Semaphore(java.util.concurrent.Semaphore) MonitorStartOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorStartOutput) ReleaseIdInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInputBuilder) MonitorProfile(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.profiles.MonitorProfile) IdManagerService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.IdManagerService) TimeUnit(java.util.concurrent.TimeUnit) MonitorProfileBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.profiles.MonitorProfileBuilder) RpcResultBuilder(org.opendaylight.yangtools.yang.common.RpcResultBuilder) AllocateIdInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.AllocateIdInputBuilder) Collections(java.util.Collections) AlivenessMonitorUtil.getMonitorStateId(org.opendaylight.genius.alivenessmonitor.internal.AlivenessMonitorUtil.getMonitorStateId) MonitoringInfo(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.configs.MonitoringInfo) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult)

Example 10 with RpcResultBuilder

use of org.opendaylight.yangtools.yang.common.RpcResultBuilder in project genius by opendaylight.

the class ArpUtilImpl method getMac.

@Override
public Future<RpcResult<GetMacOutput>> getMac(GetMacInput input) {
    try {
        final String dstIpAddress = getIpAddressInString(input.getIpaddress());
        LOG.trace("getMac rpc invoked for ip {}", dstIpAddress);
        if (macAddrs.get(dstIpAddress) != null) {
            if (LOG.isInfoEnabled()) {
                LOG.info("get mac already in progress for the ip {}", dstIpAddress);
            }
            return macAddrs.get(dstIpAddress);
        }
        SendArpRequestInputBuilder builder = new SendArpRequestInputBuilder().setInterfaceAddress(input.getInterfaceAddress()).setIpaddress(input.getIpaddress());
        Future<RpcResult<Void>> arpReqFt = sendArpRequest(builder.build());
        final SettableFuture<RpcResult<GetMacOutput>> ft = SettableFuture.create();
        Futures.addCallback(JdkFutureAdapters.listenInPoolThread(arpReqFt, threadPool), new FutureCallback<RpcResult<Void>>() {

            @Override
            public void onFailure(Throwable ex) {
                RpcResultBuilder<GetMacOutput> resultBuilder = RpcResultBuilder.<GetMacOutput>failed().withError(ErrorType.APPLICATION, ex.getMessage(), ex);
                ft.set(resultBuilder.build());
            }

            @Override
            public void onSuccess(RpcResult<Void> result) {
                LOG.trace("Successfully sent the arp pkt out for ip {}", dstIpAddress);
            }
        }, MoreExecutors.directExecutor());
        macAddrs.put(dstIpAddress, ft);
        return ft;
    } catch (UnknownHostException e) {
        LOG.error("Failed to handle getMac request for {}", input.getIpaddress(), e);
        RpcResultBuilder<GetMacOutput> resultBuilder = RpcResultBuilder.<GetMacOutput>failed().withError(ErrorType.APPLICATION, e.getMessage(), e);
        return Futures.immediateFuture(resultBuilder.build());
    }
}
Also used : RpcResultBuilder(org.opendaylight.yangtools.yang.common.RpcResultBuilder) UnknownHostException(java.net.UnknownHostException) SendArpRequestInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.arputil.rev160406.SendArpRequestInputBuilder) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) GetMacOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.arputil.rev160406.GetMacOutput)

Aggregations

RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)12 RpcResultBuilder (org.opendaylight.yangtools.yang.common.RpcResultBuilder)12 ArrayList (java.util.ArrayList)7 List (java.util.List)7 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)6 Futures (com.google.common.util.concurrent.Futures)5 MoreExecutors (com.google.common.util.concurrent.MoreExecutors)5 Collections (java.util.Collections)5 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)5 Logger (org.slf4j.Logger)5 LoggerFactory (org.slf4j.LoggerFactory)5 JdkFutureAdapters (com.google.common.util.concurrent.JdkFutureAdapters)4 Optional (com.google.common.base.Optional)3 FutureCallback (com.google.common.util.concurrent.FutureCallback)3 SettableFuture (com.google.common.util.concurrent.SettableFuture)3 Future (java.util.concurrent.Future)3 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)3 TransportZones (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.TransportZones)3 TransportZone (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.TransportZone)3 TransportZoneKey (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.TransportZoneKey)3