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.config; 23 24 /** 25 * a prototype holding all the settings needed for a reader. 26 * @author sawielan 27 * 28 */ 29 public class ReaderConfiguration { 30 /** the name of the reader. */ 31 private String readerName = null; 32 33 /** the ip of the reader. */ 34 private String readerIp = null; 35 36 /** the port of the reader. */ 37 private int readerPort = -1; 38 39 /** flags whether this reader opens the connection or not. */ 40 private boolean readerClientInitiated = false; 41 42 /** flags whether this reader connects immediately after setup. */ 43 private boolean connectImmediately = false; 44 45 /** 46 * constructor for the prototype. 47 * @param readerName the name of the reader. 48 * @param readerIp the ip of the reader. 49 * @param readerPort the port of the reader. 50 * @param readerClientInitiated flags whether this reader opens the connection or not. 51 * @param connectImmediately flags whether this reader connects immediately after setup. 52 */ 53 public ReaderConfiguration(String readerName, String readerIp, int readerPort, 54 boolean readerClientInitiated, boolean connectImmediately) { 55 super(); 56 this.readerName = readerName; 57 this.readerIp = readerIp; 58 this.readerPort = readerPort; 59 this.readerClientInitiated = readerClientInitiated; 60 this.connectImmediately = connectImmediately; 61 } 62 63 /** 64 * returns the name of the reader. 65 * @return the name of the reader. 66 */ 67 public String getReaderName() { 68 return readerName; 69 } 70 71 /** 72 * returns the ip of the reader. 73 * @return the ip of the reader. 74 */ 75 public String getReaderIp() { 76 return readerIp; 77 } 78 79 /** 80 * returns the port of the reader. 81 * @return the port of the reader. 82 */ 83 public int getReaderPort() { 84 return readerPort; 85 } 86 87 /** 88 * flags whether this reader opens the connection or not. 89 * @return whether this reader opens the connection or not. 90 */ 91 public boolean isReaderClientInitiated() { 92 return readerClientInitiated; 93 } 94 95 /** 96 * flags whether this reader connects immediately after setup. 97 * @return whether this reader connects immediately after setup. 98 */ 99 public boolean isConnectImmediately() { 100 return connectImmediately; 101 } 102 }