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 import java.util.List; 25 26 /** 27 * a prototype class holding all information to create a adaptor. 28 * @author sawielan 29 * 30 */ 31 public class AdaptorConfiguration { 32 /** the name of the adaptor. */ 33 private String adaptorName = null; 34 35 /** the ip of the adaptor if remote. */ 36 private String ip = null; 37 38 /** flags whether remote or local. */ 39 private boolean isLocal = true; 40 41 /** the configuration of all the readers of this adaptor. */ 42 private List<ReaderConfiguration> readerConfigurations = null; 43 44 /** the prefix (needed in the configurations. only for parsing.)*/ 45 private String prefix = null; 46 47 /** 48 * constructor for a configuration prototype. 49 * @param adaptorName the name of the adaptor. 50 * @param ip the ip of the adaptor if remote. 51 * @param isLocal flags whether remote or local. 52 * @param prefix the prefix (needed in the configurations. only for parsing.) unless you are not 53 * writing your own configuration loader it is safe to pass null here. 54 */ 55 public AdaptorConfiguration(String adaptorName, String ip, boolean isLocal, String prefix) { 56 super(); 57 this.adaptorName = adaptorName; 58 this.ip = ip; 59 this.isLocal = isLocal; 60 this.prefix = prefix; 61 } 62 63 /** 64 * returns the name of the adaptor. 65 * @return the name of the adaptor. 66 */ 67 public String getAdaptorName() { 68 return adaptorName; 69 } 70 71 /** 72 * sets the name of the adaptor. 73 * @param adaptorName the name of the adaptor. 74 */ 75 public void setAdaptorName(String adaptorName) { 76 this.adaptorName = adaptorName; 77 } 78 79 /** 80 * returns the ip of the adaptor if remote. 81 * @return the ip of the adaptor if remote. 82 */ 83 public String getIp() { 84 return ip; 85 } 86 87 /** 88 * flags whether remote or local. 89 * @return whether remote or local. 90 */ 91 public boolean isLocal() { 92 return isLocal; 93 } 94 95 /** 96 * returns the prefix. 97 * @return the prefix. 98 */ 99 public String getPrefix() { 100 return prefix; 101 } 102 103 /** 104 * returns the configuration for all the readers of this adaptor. 105 * @return the configuration for all the readers of this adaptor. 106 */ 107 public List<ReaderConfiguration> getReaderPrototypes() { 108 return readerConfigurations; 109 } 110 111 /** 112 * sets the configuration for all the readers of this adaptor. 113 * @param readerConfigurations the configuration for all the readers of this adaptor. 114 */ 115 public void setReaderConfigurations(List<ReaderConfiguration> readerConfigurations) { 116 this.readerConfigurations = readerConfigurations; 117 } 118 119 }