PageRenderTime 10ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/protocols/smpp/src/main/java/org/mobicents/protocols/smpp/message/tlv/TagDefinedException.java

http://mobicents.googlecode.com/
Java | 74 lines | 16 code | 8 blank | 50 comment | 0 complexity | 78bbd9f25eb671c0d83da30661934397 MD5 | raw file
 1/*
 2 * JBoss, Home of Professional Open Source
 3 * Copyright 2011, Red Hat, Inc. and individual contributors
 4 * by the @authors tag. See the copyright.txt in the distribution for a
 5 * full listing of individual contributors.
 6 *
 7 * This is free software; you can redistribute it and/or modify it
 8 * under the terms of the GNU Lesser General Public License as
 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software 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 GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */
22
23package org.mobicents.protocols.smpp.message.tlv;
24
25import org.mobicents.protocols.smpp.SMPPRuntimeException;
26
27/**
28 * Tag has already been defined. This exception is thrown by
29 * {@link Tag#defineTag}if an attempt is made to redefine a tag which already
30 * has a definition.
31 * 
32 * @version $Id: TagDefinedException.java 452 2009-01-15 16:56:36Z orank $
33 */
34public class TagDefinedException extends SMPPRuntimeException {
35    static final long serialVersionUID = 3L;
36    
37    /**
38     * The value of the tag that was attempted to be redefined.
39     */
40    private int tagValue = -1;
41
42    /**
43     * Create a new TagDefinedException.
44     * 
45     * @param tagValue
46     *            The tag for which an attempt as made to redefine.
47     */
48    public TagDefinedException(int tagValue) {
49        this.tagValue = tagValue;
50    }
51
52    /**
53     * Create a new TagDefinedException.
54     * 
55     * @param tagValue
56     *            The tag for which an attempt as made to redefine.
57     * @param msg
58     *            The exception message.
59     */
60    public TagDefinedException(int tagValue, String msg) {
61        super(msg);
62        this.tagValue = tagValue;
63    }
64
65    /**
66     * Get the tag for which an attempt as made to redefine.
67     * 
68     * @return The tag for which an attempt as made to redefine.
69     */
70    public int getTagValue() {
71        return tagValue;
72    }
73}
74