81c72ef6455768f72732763858b3fb5bc1dd7217
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / queue / TicketImpl.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.List;
11
12 import org.opendaylight.openflowplugin.openflow.md.core.ConnectionConductor;
13
14 import com.google.common.util.concurrent.SettableFuture;
15
16 /**
17  * @author mirehak
18  * @param <IN> source type
19  * @param <OUT> result type
20  *
21  */
22 public class TicketImpl<IN, OUT> implements Ticket<IN, OUT> {
23     
24     private IN message;
25     private ConnectionConductor conductor;
26     private SettableFuture<List<OUT>> future;
27     
28     /**
29      * default ctor
30      */
31     public TicketImpl() {
32         future = SettableFuture.create();
33     }
34
35     @Override
36     public SettableFuture<List<OUT>> getResult() {
37         return future;
38     }
39
40     /**
41      * @return the message
42      */
43     @Override
44     public IN getMessage() {
45         return message;
46     }
47
48     /**
49      * @param message the message to set
50      */
51     public void setMessage(IN message) {
52         this.message = message;
53     }
54
55     /**
56      * @return the conductor
57      */
58     @Override
59     public ConnectionConductor getConductor() {
60         return conductor;
61     }
62
63     /**
64      * @param conductor the conductor to set
65      */
66     public void setConductor(ConnectionConductor conductor) {
67         this.conductor = conductor;
68     }
69 }