2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.openflowplugin.api.openflow.md.queue;
10 import java.util.Collection;
11 import java.util.List;
13 import org.opendaylight.openflowplugin.api.openflow.md.core.IMDMessageTranslator;
14 import org.opendaylight.openflowplugin.api.openflow.md.core.TranslatorKey;
17 * This processing mechanism based on queue. Processing consists of 2 steps: translate and publish.
18 * Proposed workflow (might slightly deviate in implementations):
20 * <li>messages of input type are pushed in (via {@link QueueKeeper#push(Object, org.opendaylight.openflowplugin.api.openflow.md.core.ConnectionConductor, org.opendaylight.openflowplugin.api.openflow.md.queue.QueueKeeper.QueueType)} and similar)</li>
21 * <li>ticket (executable task) is build upon each pushed message and enqueued</li>
22 * <li>ticket is translated using appropriate translator</li>
23 * <li>ticket is dequeued and result is published by appropriate popListener</li>
25 * Message order might be not important, e.g. when speed is of the essence
26 * @param <I> source type (IN)
27 * @param <O> result type (OUT)
29 public interface QueueProcessor<I, O> extends MessageSourcePollRegistrator<QueueKeeper<I>>, Enqueuer<QueueItem<I>> {
32 * @param translatorMapping translators for message processing
34 void setTranslatorMapping(Map<TranslatorKey, Collection<IMDMessageTranslator<I, List<O>>>> translatorMapping);
37 * @param popListenersMapping listeners invoked when processing done
39 void setPopListenersMapping(Map<Class<? extends O>, Collection<PopListener<O>>> popListenersMapping);