Package javax.sip.header

Examples of javax.sip.header.HeaderFactory


            // Headers: must match according to their definition.
            if(a.getHeaderNames().hasNext() && !b.getHeaderNames().hasNext()) return false;
            if(!a.getHeaderNames().hasNext() && b.getHeaderNames().hasNext()) return false;

            if(a.getHeaderNames().hasNext() && b.getHeaderNames().hasNext()) {
                HeaderFactory headerFactory = null;
                try {
                    headerFactory = SipFactory.getInstance().createHeaderFactory();
                } catch (PeerUnavailableException e) {
                    Debug.logError("Cannot get the header factory to parse the header of the sip uris to compare", e);
                    return false;
                }
                for (Iterator i = a.getHeaderNames(); i.hasNext();) {
                    String hname = (String) i.next();

                    String h1 = a.getHeader(hname);
                    String h2 = b.getHeader(hname);

                    if(h1 == null && h2 != null) return false;
                    if(h2 == null && h1 != null) return false;
                    // The following check should not be needed but we add it for findbugs.
                    if(h1 == null && h2 == null) continue;
                    try {
                        Header header1 = headerFactory.createHeader(hname, UriDecoder.decode(h1));
                        Header header2 = headerFactory.createHeader(hname, UriDecoder.decode(h2));
                        // those present in both must match according to the equals method of the corresponding header
                        if (!header1.equals(header2)) return false;
                    } catch (ParseException e) {
                        Debug.logError("Cannot parse one of the header of the sip uris to compare " + a + " " + b, e);
                        return false;
View Full Code Here


*/
public class Parser {

    public static void main(String[] args) throws Exception {
        SipFactory sipFactory = null;
        HeaderFactory headerFactory;
        AddressFactory addressFactory;
        MessageFactory messageFactory;

        sipFactory = SipFactory.getInstance();
        sipFactory.setPathName("gov.nist");
View Full Code Here

            // Headers: must match according to their definition.
            if(a.getHeaderNames().hasNext() && !b.getHeaderNames().hasNext()) return false;
            if(!a.getHeaderNames().hasNext() && b.getHeaderNames().hasNext()) return false;

            if(a.getHeaderNames().hasNext() && b.getHeaderNames().hasNext()) {
                HeaderFactory headerFactory = null;
                try {
                    headerFactory = SipFactory.getInstance().createHeaderFactory();
                } catch (PeerUnavailableException e) {
                    Debug.logError("Cannot get the header factory to parse the header of the sip uris to compare", e);
                    return false;
                }
                for (Iterator i = a.getHeaderNames(); i.hasNext();) {
                    String hname = (String) i.next();

                    String h1 = a.getHeader(hname);
                    String h2 = b.getHeader(hname);

                    if(h1 == null && h2 != null) return false;
                    if(h2 == null && h1 != null) return false;
                    // The following check should not be needed but we add it for findbugs.
                    if(h1 == null && h2 == null) continue;
                    try {
                        Header header1 = headerFactory.createHeader(hname, UriDecoder.decode(h1));
                        Header header2 = headerFactory.createHeader(hname, UriDecoder.decode(h2));
                        // those present in both must match according to the equals method of the corresponding header
                        if (!header1.equals(header2)) return false;
                    } catch (ParseException e) {
                        Debug.logError("Cannot parse one of the header of the sip uris to compare " + a + " " + b, e);
                        return false;
View Full Code Here

      // Headers: must match according to their definition.
      if(a.getHeaderNames().hasNext() && !b.getHeaderNames().hasNext()) return false;
      if(!a.getHeaderNames().hasNext() && b.getHeaderNames().hasNext()) return false;
     
      if(a.getHeaderNames().hasNext() && b.getHeaderNames().hasNext()) {
        HeaderFactory headerFactory = null;
        try {
          headerFactory = SipFactory.getInstance().createHeaderFactory();
        } catch (PeerUnavailableException e) {
          logger.error("Cannot get the header factory to parse the header of the sip uris to compare", e);
          return false;
        }
        for (Iterator i = a.getHeaderNames(); i.hasNext();) {
          String hname = (String) i.next();
         
          String h1 = a.getHeader(hname);
          String h2 = b.getHeader(hname);
         
          if(h1 == null && h2 != null) return false;
          if(h2 == null && h1 != null) return false;
          try {
            Header header1 = headerFactory.createHeader(hname, RFC2396UrlDecoder.decode(h1));
            Header header2 = headerFactory.createHeader(hname, RFC2396UrlDecoder.decode(h2));
            // those present in both must match according to the equals method of the corresponding header
            if (!header1.equals(header2)) return false;
          } catch (ParseException e) {
            logger.error("Cannot parse one of the header of the sip uris to compare " + a + " " + b, e);
            return false;
View Full Code Here

*/
public class Parser {

  public static void main(String[] args) throws Exception {
    SipFactory sipFactory = null;
    HeaderFactory headerFactory;
    AddressFactory addressFactory;
    MessageFactory messageFactory;

    sipFactory = SipFactory.getInstance();
    sipFactory.setPathName("gov.nist");
View Full Code Here

            // Headers: must match according to their definition.
            if(a.getHeaderNames().hasNext() && !b.getHeaderNames().hasNext()) return false;
            if(!a.getHeaderNames().hasNext() && b.getHeaderNames().hasNext()) return false;

            if(a.getHeaderNames().hasNext() && b.getHeaderNames().hasNext()) {
                HeaderFactory headerFactory = null;
                try {
                    headerFactory = SipFactory.getInstance().createHeaderFactory();
                } catch (PeerUnavailableException e) {
                    Debug.logError("Cannot get the header factory to parse the header of the sip uris to compare", e);
                    return false;
                }
                for (Iterator i = a.getHeaderNames(); i.hasNext();) {
                    String hname = (String) i.next();

                    String h1 = a.getHeader(hname);
                    String h2 = b.getHeader(hname);

                    if(h1 == null && h2 != null) return false;
                    if(h2 == null && h1 != null) return false;
                    // The following check should not be needed but we add it for findbugs.
                    if(h1 == null && h2 == null) continue;
                    try {
                        Header header1 = headerFactory.createHeader(hname, RFC2396UrlDecoder.decode(h1));
                        Header header2 = headerFactory.createHeader(hname, RFC2396UrlDecoder.decode(h2));
                        // those present in both must match according to the equals method of the corresponding header
                        if (!header1.equals(header2)) return false;
                    } catch (ParseException e) {
                        Debug.logError("Cannot parse one of the header of the sip uris to compare " + a + " " + b, e);
                        return false;
View Full Code Here

      // Headers: must match according to their definition.
      if(a.getHeaderNames().hasNext() && !b.getHeaderNames().hasNext()) return false;
      if(!a.getHeaderNames().hasNext() && b.getHeaderNames().hasNext()) return false;
     
      if(a.getHeaderNames().hasNext() && b.getHeaderNames().hasNext()) {
        HeaderFactory headerFactory = null;
        try {
          headerFactory = SipFactory.getInstance().createHeaderFactory();
        } catch (PeerUnavailableException e) {
          logger.error("Cannot get the header factory to parse the header of the sip uris to compare", e);
          return false;
        }
        for (Iterator i = a.getHeaderNames(); i.hasNext();) {
          String hname = (String) i.next();
         
          String h1 = a.getHeader(hname);
          String h2 = b.getHeader(hname);
         
          if(h1 == null && h2 != null) return false;
          if(h2 == null && h1 != null) return false;
          try {
            Header header1 = headerFactory.createHeader(hname, h1);
            Header header2 = headerFactory.createHeader(hname, h2);
            // those present in both must match according to the equals method of the corresponding header
            if (!header1.equals(header2)) return false;
          } catch (ParseException e) {
            logger.error("Cannot parse one of the header of the sip uris to compare " + a + " " + b, e);
            return false;
View Full Code Here

  }

  public SipUtils getSipUtils() throws NamingException {
    MessageFactory messageFactory = null;
    AddressFactory addressFactory = null;
    HeaderFactory headerFactory = null;
    SipProvider sipProvider = null;
   
   
    Context myEnv = (Context) new InitialContext()
        .lookup(jndiEnvPath);
View Full Code Here

            // Headers: must match according to their definition.
            if(a.getHeaderNames().hasNext() && !b.getHeaderNames().hasNext()) return false;
            if(!a.getHeaderNames().hasNext() && b.getHeaderNames().hasNext()) return false;

            if(a.getHeaderNames().hasNext() && b.getHeaderNames().hasNext()) {
                HeaderFactory headerFactory = null;
                try {
                    headerFactory = SipFactory.getInstance().createHeaderFactory();
                } catch (PeerUnavailableException e) {
                    Debug.logError("Cannot get the header factory to parse the header of the sip uris to compare", e);
                    return false;
                }
                for (Iterator i = a.getHeaderNames(); i.hasNext();) {
                    String hname = (String) i.next();

                    String h1 = a.getHeader(hname);
                    String h2 = b.getHeader(hname);

                    if(h1 == null && h2 != null) return false;
                    if(h2 == null && h1 != null) return false;
                    // The following check should not be needed but we add it for findbugs.
                    if(h1 == null && h2 == null) continue;
                    try {
                        Header header1 = headerFactory.createHeader(hname, UriDecoder.decode(h1));
                        Header header2 = headerFactory.createHeader(hname, UriDecoder.decode(h2));
                        // those present in both must match according to the equals method of the corresponding header
                        if (!header1.equals(header2)) return false;
                    } catch (ParseException e) {
                        Debug.logError("Cannot parse one of the header of the sip uris to compare " + a + " " + b, e);
                        return false;
View Full Code Here

            // Headers: must match according to their definition.
            if(a.getHeaderNames().hasNext() && !b.getHeaderNames().hasNext()) return false;
            if(!a.getHeaderNames().hasNext() && b.getHeaderNames().hasNext()) return false;

            if(a.getHeaderNames().hasNext() && b.getHeaderNames().hasNext()) {
                HeaderFactory headerFactory = null;
                try {
                    headerFactory = SipFactory.getInstance().createHeaderFactory();
                } catch (PeerUnavailableException e) {
                    Debug.logError("Cannot get the header factory to parse the header of the sip uris to compare", e);
                    return false;
                }
                for (Iterator i = a.getHeaderNames(); i.hasNext();) {
                    String hname = (String) i.next();

                    String h1 = a.getHeader(hname);
                    String h2 = b.getHeader(hname);

                    if(h1 == null && h2 != null) return false;
                    if(h2 == null && h1 != null) return false;
                    // The following check should not be needed but we add it for findbugs.
                    if(h1 == null && h2 == null) continue;
                    try {
                        Header header1 = headerFactory.createHeader(hname, UriDecoder.decode(h1));
                        Header header2 = headerFactory.createHeader(hname, UriDecoder.decode(h2));
                        // those present in both must match according to the equals method of the corresponding header
                        if (!header1.equals(header2)) return false;
                    } catch (ParseException e) {
                        Debug.logError("Cannot parse one of the header of the sip uris to compare " + a + " " + b, e);
                        return false;
View Full Code Here

TOP

Related Classes of javax.sip.header.HeaderFactory

Copyright © 2018 www.massapicom. 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.