View Javadoc

1   /*
2    *  
3    *  Fosstrak LLRP Commander (www.fosstrak.org)
4    * 
5    *  Copyright (C) 2008 ETH Zurich
6    *
7    *  This program is free software: you can redistribute it and/or modify
8    *  it under the terms of the GNU General Public License as published by
9    *  the Free Software Foundation, either version 3 of the License, or
10   *  (at your option) any later version.
11   *
12   *  This program is distributed in the hope that it will be useful,
13   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   *  GNU General Public License for more details.
16   *
17   *  You should have received a copy of the GNU General Public License
18   *  along with this program.  If not, see <http://www.gnu.org/licenses/> 
19   *
20   */
21  
22  package org.fosstrak.llrp.adaptor.queue;
23  
24  import org.llrp.ltk.types.LLRPMessage;
25  
26  /**
27   * data structure to store enqueue an LLRPMessage.
28   * @author sawielan
29   *
30   */
31  public class QueueEntry {
32  	/** the llrp message. */
33  	private LLRPMessage message;
34  	
35  	/** the reader that will receive or read the message. */
36  	private String readerName;
37  	
38  	/** the adaptor name that will receive or read the message. */
39  	private String adaptorName;
40  	
41  	/**
42  	 * creates a new queue item for an llrp message.
43  	 * @param message the llrp message.
44  	 * @param readerName the reader that will receive or read the message.
45  	 * @param adaptorName the adaptor name that will receive or read the message.
46  	 */
47  	public QueueEntry(LLRPMessage message, String readerName, String adaptorName) {
48  		super();
49  		this.message = message;
50  		this.readerName = readerName;
51  		this.adaptorName = adaptorName;
52  	}
53  	
54  	/**
55  	 * returns the stored message.
56  	 * @return the stored message.
57  	 */
58  	public LLRPMessage getMessage() {
59  		return message;
60  	}
61  
62  	/**
63  	 * sets the message in the datastructure.
64  	 * @param message an LLRPMessage to set.
65  	 */
66  	public void setMessage(LLRPMessage message) {
67  		this.message = message;
68  	}
69  
70  	/**
71  	 * returns the reader name that either read or will receive the message.
72  	 * @return the reader name that either read or will receive the message.
73  	 */
74  	public String getReaderName() {
75  		return readerName;
76  	}
77  
78  	/**
79  	 * sets the name of the reader that will either receive or read the message.
80  	 * @param readerName the name of the reader that will either receive or read the message.
81  	 */
82  	public void setReaderName(String readerName) {
83  		this.readerName = readerName;
84  	}
85  
86  	/**
87  	 * returns the name of the adaptor that will either receive or read the message.
88  	 * @return the name of the adaptor that will either receive or read the message.
89  	 */
90  	public String getAdaptorName() {
91  		return adaptorName;
92  	}
93  
94  	/**
95  	 *  sets the name of the adaptor that will either receive or read the message.
96  	 * @param adaptorName the name of the adaptor that will either receive or read the message.
97  	 */
98  	public void setAdaptorName(String adaptorName) {
99  		this.adaptorName = adaptorName;
100 	}
101 }