1/*
2* Conditions Of Use
3*
4* This software was developed by employees of the National Institute of
5* Standards and Technology (NIST), an agency of the Federal Government.
6* Pursuant to title 15 Untied States Code Section 105, works of NIST
7* employees are not subject to copyright protection in the United States
8* and are considered to be in the public domain.  As a result, a formal
9* license is not needed to use the software.
10*
11* This software is provided by NIST as a service and is expressly
12* provided "AS IS."  NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
13* OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
14* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
15* AND DATA ACCURACY.  NIST does not warrant or make any representations
16* regarding the use of the software or the results thereof, including but
17* not limited to the correctness, accuracy, reliability or usefulness of
18* the software.
19*
20* Permission to use this software is contingent upon your acceptance
21* of the terms of this agreement
22*
23* .
24*
25*/
26/*******************************************************************************
27* Product of NIST/ITL Advanced Networking Technologies Division (ANTD).        *
28*******************************************************************************/
29package gov.nist.javax.sip.header;
30
31import java.text.ParseException;
32import javax.sip.header.*;
33
34/**
35 * ProxyRequire Header.
36 *
37 * @version 1.2 $Revision: 1.5 $ $Date: 2009/07/17 18:57:34 $
38 *
39 * @author M. Ranganathan   <br/>
40 * @author Olivier Deruelle <br/>
41 *
42 *
43 *
44 */
45public class ProxyRequire extends SIPHeader implements ProxyRequireHeader {
46
47    /**
48     * Comment for <code>serialVersionUID</code>
49     */
50    private static final long serialVersionUID = -3269274234851067893L;
51    /**
52     * Optiontag field
53     */
54    protected String optionTag;
55
56    /**
57     * Default  Constructor
58     */
59    public ProxyRequire() {
60        super(PROXY_REQUIRE);
61    }
62
63    /** Constructor
64     * @param s String to set
65     */
66    public ProxyRequire(String s) {
67        super(PROXY_REQUIRE);
68        optionTag = s;
69    }
70
71    /**
72     * Encode in canonical form.
73     * @return String
74     */
75    public String encodeBody() {
76        return optionTag;
77    }
78
79    /**
80     * Sets the option tag value to the new supplied <var>optionTag</var>
81     * parameter.
82     *
83     * @param optionTag - the new string value of the option tag.
84     * @throws ParseException which signals that an error has been reached
85     * unexpectedly while parsing the optionTag value.
86     */
87    public void setOptionTag(String optionTag) throws ParseException {
88        if (optionTag == null)
89            throw new NullPointerException("JAIN-SIP Exception, ProxyRequire, setOptionTag(), the optionTag parameter is null");
90        this.optionTag = optionTag;
91    }
92
93    /**
94     * Gets the option tag of this OptionTag class.
95     *
96     * @return the string that identifies the option tag value.
97     */
98    public String getOptionTag() {
99        return optionTag;
100    }
101}
102/*
103 * $Log: ProxyRequire.java,v $
104 * Revision 1.5  2009/07/17 18:57:34  emcho
105 * Converts indentation tabs to spaces so that we have a uniform indentation policy in the whole project.
106 *
107 * Revision 1.4  2006/07/13 09:01:26  mranga
108 * Issue number:
109 * Obtained from:
110 * Submitted by:  jeroen van bemmel
111 * Reviewed by:   mranga
112 * Moved some changes from jain-sip-1.2 to java.net
113 *
114 * CVS: ----------------------------------------------------------------------
115 * CVS: Issue number:
116 * CVS:   If this change addresses one or more issues,
117 * CVS:   then enter the issue number(s) here.
118 * CVS: Obtained from:
119 * CVS:   If this change has been taken from another system,
120 * CVS:   then name the system in this line, otherwise delete it.
121 * CVS: Submitted by:
122 * CVS:   If this code has been contributed to the project by someone else; i.e.,
123 * CVS:   they sent us a patch or a set of diffs, then include their name/email
124 * CVS:   address here. If this is your work then delete this line.
125 * CVS: Reviewed by:
126 * CVS:   If we are doing pre-commit code reviews and someone else has
127 * CVS:   reviewed your changes, include their name(s) here.
128 * CVS:   If you have not had it reviewed then delete this line.
129 *
130 * Revision 1.3  2006/06/19 06:47:26  mranga
131 * javadoc fixups
132 *
133 * Revision 1.2  2006/06/16 15:26:28  mranga
134 * Added NIST disclaimer to all public domain files. Clean up some javadoc. Fixed a leak
135 *
136 * Revision 1.1.1.1  2005/10/04 17:12:35  mranga
137 *
138 * Import
139 *
140 *
141 * Revision 1.2  2004/01/22 13:26:29  sverker
142 * Issue number:
143 * Obtained from:
144 * Submitted by:  sverker
145 * Reviewed by:   mranga
146 *
147 * Major reformat of code to conform with style guide. Resolved compiler and javadoc warnings. Added CVS tags.
148 *
149 * CVS: ----------------------------------------------------------------------
150 * CVS: Issue number:
151 * CVS:   If this change addresses one or more issues,
152 * CVS:   then enter the issue number(s) here.
153 * CVS: Obtained from:
154 * CVS:   If this change has been taken from another system,
155 * CVS:   then name the system in this line, otherwise delete it.
156 * CVS: Submitted by:
157 * CVS:   If this code has been contributed to the project by someone else; i.e.,
158 * CVS:   they sent us a patch or a set of diffs, then include their name/email
159 * CVS:   address here. If this is your work then delete this line.
160 * CVS: Reviewed by:
161 * CVS:   If we are doing pre-commit code reviews and someone else has
162 * CVS:   reviewed your changes, include their name(s) here.
163 * CVS:   If you have not had it reviewed then delete this line.
164 *
165 */
166