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 javax.sip.header.*; 32import java.text.ParseException; 33 34/** 35 * the Priority header. 36 * 37 * @author Olivier Deruelle <br/> 38 * @version 1.2 $Revision: 1.6 $ $Date: 2009/07/17 18:57:33 $ 39 * 40 * 41 * 42 */ 43public class Priority extends SIPHeader implements PriorityHeader { 44 45 /** 46 * Comment for <code>serialVersionUID</code> 47 */ 48 private static final long serialVersionUID = 3837543366074322106L; 49 50 /** constant EMERGENCY field 51 */ 52 public static final String EMERGENCY = ParameterNames.EMERGENCY; 53 54 /** constant URGENT field 55 */ 56 public static final String URGENT = ParameterNames.URGENT; 57 58 /** constant NORMAL field 59 */ 60 public static final String NORMAL = ParameterNames.NORMAL; 61 62 /** constant NON_URGENT field 63 */ 64 public static final String NON_URGENT = ParameterNames.NON_URGENT; 65 /** priority field 66 */ 67 protected String priority; 68 69 /** Default constructor 70 */ 71 public Priority() { 72 super(NAME); 73 } 74 75 /** 76 * Encode into canonical form. 77 * @return String 78 */ 79 public String encodeBody() { 80 return priority; 81 } 82 83 /** 84 * get the priority value. 85 * @return String 86 */ 87 public String getPriority() { 88 return priority; 89 } 90 91 /** 92 * Set the priority member 93 * @param p String to set 94 */ 95 public void setPriority(String p) throws ParseException { 96 if (p == null) 97 throw new NullPointerException( 98 "JAIN-SIP Exception," 99 + "Priority, setPriority(), the priority parameter is null"); 100 priority = p; 101 } 102} 103