Home | History | Annotate | Download | only in parser
      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 package gov.nist.javax.sip.parser;
     27 import java.text.ParseException;
     28 import gov.nist.javax.sip.header.*;
     29 
     30 /**
     31  * Parser for WWW authenitcate header.
     32  *
     33  * @version 1.2 $Revision: 1.7 $ $Date: 2009/07/17 18:58:07 $
     34  *
     35  * @author Olivier Deruelle   <br/>
     36  * @author M. Ranganathan   <br/>
     37  *
     38  *
     39  */
     40 public class WWWAuthenticateParser extends ChallengeParser {
     41 
     42     /**
     43      * Constructor
     44      * @param wwwAuthenticate -  message to parse
     45      */
     46     public WWWAuthenticateParser(String wwwAuthenticate) {
     47         super(wwwAuthenticate);
     48     }
     49 
     50     /**
     51      * Cosntructor
     52      * @param  lexer - lexer to use.
     53      */
     54     protected WWWAuthenticateParser(Lexer lexer) {
     55         super(lexer);
     56     }
     57 
     58     /**
     59      * parse the String message
     60      * @return SIPHeader (WWWAuthenticate object)
     61      * @throws SIPParseException if the message does not respect the spec.
     62      */
     63     public SIPHeader parse() throws ParseException {
     64         if (debug)
     65             dbg_enter("parse");
     66         try {
     67             headerName(TokenTypes.WWW_AUTHENTICATE);
     68             WWWAuthenticate wwwAuthenticate = new WWWAuthenticate();
     69             super.parse(wwwAuthenticate);
     70             return wwwAuthenticate;
     71         } finally {
     72             if (debug)
     73                 dbg_leave("parse");
     74         }
     75     }
     76 }
     77 /*
     78  * $Log: WWWAuthenticateParser.java,v $
     79  * Revision 1.7  2009/07/17 18:58:07  emcho
     80  * Converts indentation tabs to spaces so that we have a uniform indentation policy in the whole project.
     81  *
     82  * Revision 1.6  2006/07/13 09:02:15  mranga
     83  * Issue number:
     84  * Obtained from:
     85  * Submitted by:  jeroen van bemmel
     86  * Reviewed by:   mranga
     87  * Moved some changes from jain-sip-1.2 to java.net
     88  *
     89  * CVS: ----------------------------------------------------------------------
     90  * CVS: Issue number:
     91  * CVS:   If this change addresses one or more issues,
     92  * CVS:   then enter the issue number(s) here.
     93  * CVS: Obtained from:
     94  * CVS:   If this change has been taken from another system,
     95  * CVS:   then name the system in this line, otherwise delete it.
     96  * CVS: Submitted by:
     97  * CVS:   If this code has been contributed to the project by someone else; i.e.,
     98  * CVS:   they sent us a patch or a set of diffs, then include their name/email
     99  * CVS:   address here. If this is your work then delete this line.
    100  * CVS: Reviewed by:
    101  * CVS:   If we are doing pre-commit code reviews and someone else has
    102  * CVS:   reviewed your changes, include their name(s) here.
    103  * CVS:   If you have not had it reviewed then delete this line.
    104  *
    105  * Revision 1.3  2006/06/19 06:47:27  mranga
    106  * javadoc fixups
    107  *
    108  * Revision 1.2  2006/06/16 15:26:28  mranga
    109  * Added NIST disclaimer to all public domain files. Clean up some javadoc. Fixed a leak
    110  *
    111  * Revision 1.1.1.1  2005/10/04 17:12:36  mranga
    112  *
    113  * Import
    114  *
    115  *
    116  * Revision 1.4  2004/01/22 13:26:32  sverker
    117  * Issue number:
    118  * Obtained from:
    119  * Submitted by:  sverker
    120  * Reviewed by:   mranga
    121  *
    122  * Major reformat of code to conform with style guide. Resolved compiler and javadoc warnings. Added CVS tags.
    123  *
    124  * CVS: ----------------------------------------------------------------------
    125  * CVS: Issue number:
    126  * CVS:   If this change addresses one or more issues,
    127  * CVS:   then enter the issue number(s) here.
    128  * CVS: Obtained from:
    129  * CVS:   If this change has been taken from another system,
    130  * CVS:   then name the system in this line, otherwise delete it.
    131  * CVS: Submitted by:
    132  * CVS:   If this code has been contributed to the project by someone else; i.e.,
    133  * CVS:   they sent us a patch or a set of diffs, then include their name/email
    134  * CVS:   address here. If this is your work then delete this line.
    135  * CVS: Reviewed by:
    136  * CVS:   If we are doing pre-commit code reviews and someone else has
    137  * CVS:   reviewed your changes, include their name(s) here.
    138  * CVS:   If you have not had it reviewed then delete this line.
    139  *
    140  */
    141