001/**
002 *
003 * Copyright 2003-2006 Jive Software.
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *     http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.jivesoftware.smackx.jingle.nat;
018
019import org.jivesoftware.smack.SmackException.NotConnectedException;
020
021/**
022 * Transport resolver Interface 
023 */
024public abstract interface TransportResolverListener {
025    /**
026     * Resolver listener.
027     */
028    public interface Resolver extends TransportResolverListener {
029        /**
030         * The resolution process has been started.
031         */
032        public void init();
033
034        /**
035         * A transport candidate has been added
036         *
037         * @param cand The transport candidate.
038         * @throws NotConnectedException 
039         */
040        public void candidateAdded(TransportCandidate cand) throws NotConnectedException;
041
042        /**
043         * All the transport candidates have been obtained.
044         */
045        public void end();
046    }
047
048    /**
049     * Resolver checker.
050     */
051    public interface Checker extends TransportResolverListener {
052        /**
053         * A transport candidate has been checked.
054         *
055         * @param cand The transport candidate that has been checked.
056         * @param result True if the candidate is usable.
057         */
058        public void candidateChecked(TransportCandidate cand, boolean result);
059
060        /**
061         * A transport candidate is being checked.
062         *
063         * @param cand The transport candidate that is being checked.
064         */
065        public void candidateChecking(TransportCandidate cand);
066    }
067}