Examples of ICECandidate


Examples of nu.fw.jeti.plugins.jingle.jingle.nat.ICECandidate

         * @param parser the structure to parse
         * @return a candidate element
         * @throws Exception
         */
        protected JingleTransportCandidate parseCandidate(Attributes attr){
            ICECandidate mt = new ICECandidate();

            String channel = attr.getValue("channel");
            String generation = attr.getValue("generation");
            String ip = attr.getValue("ip");
            String name = attr.getValue("name");
            String network = attr.getValue("network");
            String username = attr.getValue("username");
            String password = attr.getValue("password");
            String port = attr.getValue("port");
            String preference = attr.getValue("preference");
            String proto = attr.getValue("proto");
            String type = attr.getValue("type");

            if (channel != null) {
                mt.setChannel(new TransportCandidate.Channel(channel));
            }

            if (generation != null) {
                try {
                    mt.setGeneration(Integer.parseInt(generation));
                }
                catch (Exception e) {
                }
            }

            if (ip != null) {
                mt.setIp(ip);
            }
            else {
                return null;
            }

            if (name != null) {
                mt.setName(name);
            }

            if (network != null) {
                try {
                    mt.setNetwork(Integer.parseInt(network));
                }
                catch (Exception e) {
                }
            }

            if (username != null) {
                mt.setUsername(username);
            }

            if (password != null) {
                mt.setPassword(password);
            }

            if (port != null) {
                try {
                    mt.setPort(Integer.parseInt(port));
                }
                catch (Exception e) {
                }
            }

            if (preference != null) {
                try {
                    mt.setPreference(Integer.parseInt(preference));
                }
                catch (Exception e) {
                }
            }

            if (proto != null) {
                mt.setProto(new TransportCandidate.Protocol(proto));
            }

            if (type != null) {
                mt.setType(ICECandidate.Type.valueOf(type));
            }

            return new JingleTransport.Ice.Candidate(mt);
        }
View Full Code Here

Examples of nu.fw.jeti.plugins.jingle.jingle.nat.ICECandidate

             */
            protected String getChildElements() {
                StringBuilder buf = new StringBuilder();

                if (transportCandidate != null) {// && transportCandidate instanceof ICECandidate) {
                    ICECandidate tci = (ICECandidate) transportCandidate;

                    // We convert the transportElement candidate to XML here...
                    buf.append(" generation=\"").append(tci.getGeneration()).append("\"");
                    buf.append(" ip=\"").append(tci.getIp()).append("\"");
                    buf.append(" port=\"").append(tci.getPort()).append("\"");
                    buf.append(" network=\"").append(tci.getNetwork()).append("\"");
                    buf.append(" username=\"").append(tci.getUsername()).append("\"");
                    buf.append(" password=\"").append(tci.getPassword()).append("\"");
                    buf.append(" preference=\"").append(tci.getPreference()).append("\"");
                    buf.append(" type=\"").append(tci.getType()).append("\"");

                    // Optional elements
                    if (transportCandidate.getName() != null) {
                        buf.append(" name=\"").append(tci.getName()).append("\"");
                    }
                }

                return buf.toString();
            }
View Full Code Here

Examples of org.jivesoftware.smackx.jingle.nat.ICECandidate

         * @param parser the structure to parse
         * @return a candidate element
         * @throws Exception
         */
        protected JingleTransportCandidate parseCandidate(XmlPullParser parser) throws Exception {
            ICECandidate mt = new ICECandidate();

            String channel = parser.getAttributeValue("", "channel");
            String generation = parser.getAttributeValue("", "generation");
            String ip = parser.getAttributeValue("", "ip");
            String name = parser.getAttributeValue("", "name");
            String network = parser.getAttributeValue("", "network");
            String username = parser.getAttributeValue("", "username");
            String password = parser.getAttributeValue("", "password");
            String port = parser.getAttributeValue("", "port");
            String preference = parser.getAttributeValue("", "preference");
            String proto = parser.getAttributeValue("", "proto");
            String type = parser.getAttributeValue("", "type");

            if (channel != null) {
                mt.setChannel(new TransportCandidate.Channel(channel));
            }

            if (generation != null) {
                try {
                    mt.setGeneration(Integer.parseInt(generation));
                }
                catch (Exception e) {
                }
            }

            if (ip != null) {
                mt.setIp(ip);
            }
            else {
                return null;
            }

            if (name != null) {
                mt.setName(name);
            }

            if (network != null) {
                try {
                    mt.setNetwork(Integer.parseInt(network));
                }
                catch (Exception e) {
                }
            }

            if (username != null) {
                mt.setUsername(username);
            }

            if (password != null) {
                mt.setPassword(password);
            }

            if (port != null) {
                try {
                    mt.setPort(Integer.parseInt(port));
                }
                catch (Exception e) {
                }
            }

            if (preference != null) {
                try {
                    mt.setPreference(Integer.parseInt(preference));
                }
                catch (Exception e) {
                }
            }

            if (proto != null) {
                mt.setProto(new TransportCandidate.Protocol(proto));
            }

            if (type != null) {
                mt.setType(ICECandidate.Type.valueOf(type));
            }

            return new JingleTransport.Ice.Candidate(mt);
        }
View Full Code Here

Examples of org.jivesoftware.smackx.jingle.nat.ICECandidate

             */
            protected String getChildElements() {
                StringBuilder buf = new StringBuilder();

                if (transportCandidate != null) {// && transportCandidate instanceof ICECandidate) {
                    ICECandidate tci = (ICECandidate) transportCandidate;

                    // We convert the transportElement candidate to XML here...
                    buf.append(" generation=\"").append(tci.getGeneration()).append("\"");
                    buf.append(" ip=\"").append(tci.getIp()).append("\"");
                    buf.append(" port=\"").append(tci.getPort()).append("\"");
                    buf.append(" network=\"").append(tci.getNetwork()).append("\"");
                    buf.append(" username=\"").append(tci.getUsername()).append("\"");
                    buf.append(" password=\"").append(tci.getPassword()).append("\"");
                    buf.append(" preference=\"").append(tci.getPreference()).append("\"");
                    buf.append(" type=\"").append(tci.getType()).append("\"");

                    // Optional elements
                    if (transportCandidate.getName() != null) {
                        buf.append(" name=\"").append(tci.getName()).append("\"");
                    }
                }

                return buf.toString();
            }
View Full Code Here

Examples of org.jivesoftware.smackx.jingle.nat.ICECandidate

             */
            protected String getChildElements() {
                StringBuilder buf = new StringBuilder();

                if (transportCandidate != null) {// && transportCandidate instanceof ICECandidate) {
                    ICECandidate tci = (ICECandidate) transportCandidate;

                    // We convert the transportElement candidate to XML here...
                    buf.append(" generation=\"").append(tci.getGeneration()).append("\"");
                    buf.append(" ip=\"").append(tci.getIp()).append("\"");
                    buf.append(" port=\"").append(tci.getPort()).append("\"");
                    buf.append(" network=\"").append(tci.getNetwork()).append("\"");
                    buf.append(" username=\"").append(tci.getUsername()).append("\"");
                    buf.append(" password=\"").append(tci.getPassword()).append("\"");
                    buf.append(" preference=\"").append(tci.getPreference()).append("\"");
                    buf.append(" type=\"").append(tci.getType()).append("\"");

                    // Optional elements
                    if (transportCandidate.getName() != null) {
                        buf.append(" name=\"").append(tci.getName()).append("\"");
                    }
                }

                return buf.toString();
            }
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.