Examples of HeaderParser


Examples of gov.nist.javax.sip.parser.HeaderParser

     */

    public void addHeader(String sipHeader) {
        String hdrString = sipHeader.trim() + "\n";
        try {
            HeaderParser parser = ParserFactory.createParser(sipHeader);
            SIPHeader sh = parser.parse();
            this.attachHeader(sh, false);
        } catch (ParseException ex) {
            this.unrecognizedHeaders.add(hdrString);
        }
    }
View Full Code Here

Examples of gov.nist.javax.sip.parser.HeaderParser

     */

    public void addHeader(String sipHeader) {
        String hdrString = sipHeader.trim() + "\n";
        try {
            HeaderParser parser = ParserFactory.createParser(sipHeader);
            SIPHeader sh = parser.parse();
            this.attachHeader(sh, false);
        } catch (ParseException ex) {
            this.getUnrecognizedHeadersList().add(hdrString);
        }
    }
View Full Code Here

Examples of gov.nist.javax.sip.parser.HeaderParser

   */

  public void addHeader(String sipHeader) {
    String hdrString = sipHeader.trim() + "\n";
    try {
      HeaderParser parser = ParserFactory.createParser(sipHeader);
      SIPHeader sh = parser.parse();
      this.attachHeader(sh, false);
    } catch (ParseException ex) {
      this.unrecognizedHeaders.add(hdrString);
    }
  }
View Full Code Here

Examples of gov.nist.javax.sip.parser.HeaderParser

    protected void testParser(Class parserClass, String[] headers) {
        try {
            for (int i = 0; i < headers.length; i++) {
                System.out.print(headers[i]);
                HeaderParser hp = createParser(parserClass, headers[i]);
                SIPHeader hdr = (SIPHeader) hp.parse();

                hp = createParser(parserClass, ((SIPHeader) hdr.clone()).encode().trim() + "\n");
                System.out.println("Encoded header = " + hdr.encode());
                assertEquals(hdr, hp.parse());

            }
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
            fail(getClass().getName());
View Full Code Here

Examples of gov.nist.javax.sip.parser.HeaderParser

    protected void testParser(Class parserClass, String[] headers) {
        try {
            for (int i = 0; i < headers.length; i++) {
                System.out.print(headers[i]);
                HeaderParser hp = createParser(parserClass, headers[i]);
                SIPHeader hdr = (SIPHeader) hp.parse();

                if ( hdr instanceof SIPHeaderList<?> ) {
                  SIPHeaderList<?> list = (SIPHeaderList<?>) hdr;
                  assertNotNull( "Header should be added to list", list.getFirst() );
                  // JvB: Should be consistent, some parser classes override getFirst but leave list empty
                  assertTrue( "List should contain at least 1 header", list.size() > 0 )
                }
               
                hp = createParser(parserClass, ((SIPHeader) hdr.clone()).encode().trim() + "\n");
                System.out.println("Encoded header = " + hdr.encode());
                assertEquals(hdr, hp.parse());

            }
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
            fail(getClass().getName());
View Full Code Here

Examples of gov.nist.javax.sip.parser.HeaderParser

     */

    public void addHeader(String sipHeader) {
        String hdrString = sipHeader.trim() + "\n";
        try {
            HeaderParser parser = ParserFactory.createParser(sipHeader);
            SIPHeader sh = parser.parse();
            this.attachHeader(sh, false);
        } catch (ParseException ex) {
            this.unrecognizedHeaders.add(hdrString);
        }
    }
View Full Code Here

Examples of gov.nist.javax.sip.parser.HeaderParser

    protected void testParser(Class parserClass, String[] headers) {
        try {
            for (int i = 0; i < headers.length; i++) {
                System.out.print(headers[i]);
                HeaderParser hp = createParser(parserClass, headers[i]);
                SIPHeader hdr = (SIPHeader) hp.parse();

                hp = createParser(parserClass, ((SIPHeader) hdr.clone()).encode().trim() + "\n");
                System.out.println("Encoded header = " + hdr.encode());
                assertEquals(hdr, hp.parse());

            }
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
            fail(getClass().getName());
View Full Code Here

Examples of gov.nist.javax.sip.parser.HeaderParser

        // Issue 315 : (https://jain-sip.dev.java.net/issues/show_bug.cgi?id=315)
        // header.getParameter() doesn't return quoted value
        try {
            String parameters = "Contact: <sip:127.0.0.1:5056>;+sip.instance=\"<urn:uuid:some-xxxx>\"";
            HeaderParser hp = createParser(ContactParser.class, parameters);
            SIPHeader hdr = (SIPHeader) hp.parse();
            assertEquals("\"<urn:uuid:some-xxxx>\"", ((ParametersExt)((ContactList)hdr).getFirst()).getParameter("+sip.instance", false));
        } catch (ParseException ex) {
            fail(this.getClass().getName());
        }
    }
View Full Code Here

Examples of org.jvnet.glassfish.comms.security.auth.impl.HeaderParser

                }
                if ("PrincipalMapper".equalsIgnoreCase(value.getName())) {
                    principalMapperConfig = value.getValue();
                }
            }
            HeaderParser parser = new HeaderParser();
            if (identityConfigValue != null && identityConfigValue.length() > 0) {
                identityConfig = parser.parse(identityConfigValue);
            }
            if (principalMapperConfig != null && principalMapperConfig.length() > 0) {
                principalProps = parser.parse(principalMapperConfig);

                principalMapper = (String) principalProps.remove("classname");
                if (principalMapper != null) {
                    Class pmClass;
                    try {
View Full Code Here

Examples of sun.net.www.HeaderParser

     * returning true means the request can be retried with the same userid/password
     * returning false means we have to go back to the user to ask for a new
     * username password.
     */
    boolean isAuthorizationStale (String header) {
        HeaderParser p = new HeaderParser (header);
        String s = p.findValue ("stale");
        if (s == null || !s.equals("true"))
            return false;
        String newNonce = p.findValue ("nonce");
        if (newNonce == null || "".equals(newNonce)) {
            return false;
        }
        params.setNonce (newNonce);
        return true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.