Bug 1764 - created new bundle responsible for default OF switch configuration
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / queue / QueueProcessor.java
1 /**
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.openflowplugin.openflow.md.queue;
9
10 import java.util.Collection;
11 import java.util.List;
12 import java.util.Map;
13
14 import org.opendaylight.openflowplugin.openflow.md.core.ConnectionConductor;
15 import org.opendaylight.openflowplugin.openflow.md.core.IMDMessageTranslator;
16 import org.opendaylight.openflowplugin.api.openflow.md.core.TranslatorKey;
17
18 /**
19  * This processing mechanism based on queue. Processing consists of 2 steps: translate and publish. 
20  * Proposed workflow (might slightly deviate in implementations):
21  * <ol>
22  * <li>messages of input type are pushed in (via {@link QueueProcessor#push(Object, ConnectionConductor)} and similar)</li>
23  * <li>ticket (executable task) is build upon each pushed message and enqueued</li>
24  * <li>ticket is translated using appropriate translator</li>
25  * <li>ticket is dequeued and result is published by appropriate popListener</li>
26  * </ol>
27  * Message order might be not important, e.g. when speed is of the essence
28  * @param <IN> source type
29  * @param <OUT> result type
30  */
31 public interface QueueProcessor<IN, OUT> extends MessageSourcePollRegistrator<QueueKeeper<IN>>, Enqueuer<QueueItem<IN>> {
32     
33     /**
34      * @param translatorMapping translators for message processing
35      */
36     void setTranslatorMapping(Map<TranslatorKey, Collection<IMDMessageTranslator<IN, List<OUT>>>> translatorMapping);
37
38     /**
39      * @param popListenersMapping listeners invoked when processing done
40      */
41     void setPopListenersMapping(Map<Class<? extends OUT>, Collection<PopListener<OUT>>> popListenersMapping);
42 }