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 *******************************************************************************/ 29 30 package gov.nist.javax.sip.header; 31 32 import java.text.ParseException; 33 import javax.sip.header.*; 34 /** 35 * Require SIP Header. 36 * 37 * @version 1.2 $Revision: 1.5 $ $Date: 2009/07/17 18:57:36 $ 38 * 39 * @author M. Ranganathan <br/> 40 * @author Olivier Deruelle <br/> 41 * 42 * 43 */ 44 public class Require extends SIPHeader implements RequireHeader { 45 46 /** 47 * Comment for <code>serialVersionUID</code> 48 */ 49 private static final long serialVersionUID = -3743425404884053281L; 50 /** optionTag field 51 */ 52 protected String optionTag; 53 54 /** 55 * Default constructor 56 */ Require()57 public Require() { 58 super(REQUIRE); 59 } 60 61 /** constructor 62 * @param s String to set 63 */ Require(String s)64 public Require(String s) { 65 super(REQUIRE); 66 optionTag = s; 67 } 68 69 /** 70 * Encode in canonical form. 71 * @return String 72 */ encodeBody()73 public String encodeBody() { 74 return optionTag; 75 } 76 77 /** 78 * Sets the option tag value to the new supplied <var>optionTag</var> 79 * parameter. 80 * 81 * @param optionTag - the new string value of the option tag. 82 * @throws ParseException which signals that an error has been reached 83 * unexpectedly while parsing the optionTag value. 84 */ setOptionTag(String optionTag)85 public void setOptionTag(String optionTag) throws ParseException { 86 if (optionTag == null) 87 throw new NullPointerException( 88 "JAIN-SIP Exception, Require, " 89 + "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 */ getOptionTag()98 public String getOptionTag() { 99 return optionTag; 100 } 101 } 102 /* 103 * $Log: Require.java,v $ 104 * Revision 1.5 2009/07/17 18:57:36 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:22 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