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.exception;
23
24 /**
25 * exception class that can be used when there is a duplicate name
26 * subscription.
27 * @author sawielan
28 *
29 */
30 public class LLRPDuplicateNameException extends LLRPRuntimeException {
31
32 /**
33 * serial id.
34 */
35 private static final long serialVersionUID = -5236575385965206938L;
36
37 /** the name that caused the exception. */
38 protected String name = null;
39
40 /**
41 * default constructor.
42 */
43 public LLRPDuplicateNameException() {
44 super();
45 }
46
47 /**
48 * constructor with exception message.
49 * @param message the exception.
50 */
51 public LLRPDuplicateNameException(String message) {
52 super(message);
53 }
54
55 /**
56 * constructor for a detailed exception.
57 * @param name the name that caused the exception.
58 * @param message the exception.
59 */
60 public LLRPDuplicateNameException(String name, String message) {
61 super(message);
62 this.name = name;
63 }
64
65 /**
66 * returns the name that caused the exception.
67 * @return the name that caused the exception.
68 */
69 public String getDuplicateName() {
70 return this.name;
71 }
72 }