src/net/java/sip/communicator/impl/protocol/jabber/CallJabberImpl.java
/**
     * Expires specific (colibri) conference channels used by a specific
     * <tt>CallPeer</tt>.
     *
     * @param peer the <tt>CallPeer</tt> which uses the specified (colibri)
     * conference channels to be expired
     * @param conference a <tt>ColibriConferenceIQ</tt> which specifies the
     * (colibri) conference channels to be expired
     */
Expires specific (colibri) conference channels used by a specific
CallPeer.

@param peer the CallPeer which uses the specified (colibri)
conference channels to be expired
@param conference a ColibriConferenceIQ which specifies the
(colibri) conference channels to be expired
Expires specific ( colibri ) conference channels used by a specific CallPeer . @param peer the CallPeer which uses the specified ( colibri ) conference channels to be expired @param conference a ColibriConferenceIQ which specifies the ( colibri ) conference channels to be expired
public void expireColibriChannels(
            CallPeerJabberImpl peer,
            ColibriConferenceIQ conference)
            throws SmackException.NotConnectedException, InterruptedException
    {
        if (colibri != null)
        {
            String conferenceID = colibri.getID();
            if (conferenceID.equals(conference.getID()))
            {
                ColibriConferenceIQ conferenceRequest
                    = new ColibriConferenceIQ();
                conferenceRequest.setID(conferenceID);
                for (ColibriConferenceIQ.Content content
                        : conference.getContents())
                {
                    ColibriConferenceIQ.Content colibriContent
                        = colibri.getContent(content.getName());
                    if (colibriContent != null)
                    {
                        ColibriConferenceIQ.Content contentRequest
                            = conferenceRequest.getOrCreateContent(
                            colibriContent.getName());
                        for (ColibriConferenceIQ.Channel channel
                                : content.getChannels())
                        {
                            ColibriConferenceIQ.Channel colibriChannel
                                = colibriContent.getChannel(channel.getID());
                            if (colibriChannel != null)
                            {
                                ColibriConferenceIQ.Channel channelRequest
                                    = new ColibriConferenceIQ.Channel();
                                channelRequest.setExpire(0);
                                channelRequest.setID(colibriChannel.getID());
                                contentRequest.addChannel(channelRequest);
                            }
                        }
                    }
                }
                /*
                 * Remove the channels which are to be expired from the internal
                 * state of the conference managed by this CallJabberImpl.
                 */
                for (ColibriConferenceIQ.Content contentRequest
                        : conferenceRequest.getContents())
                {
                    ColibriConferenceIQ.Content colibriContent
                        = colibri.getContent(contentRequest.getName());
                    for (ColibriConferenceIQ.Channel channelRequest
                            : contentRequest.getChannels())
                    {
                        ColibriConferenceIQ.Channel colibriChannel
                            = colibriContent.getChannel(channelRequest.getID());
                        colibriContent.removeChannel(colibriChannel);
                        /*
                         * If the last remote channel is to be expired, expire
                         * the local channel as well.
                         */
                        if (colibriContent.getChannelCount() == 1)
                        {
                            colibriChannel = colibriContent.getChannel(0);
                            channelRequest = new ColibriConferenceIQ.Channel();
                            channelRequest.setExpire(0);
                            channelRequest.setID(colibriChannel.getID());
                            contentRequest.addChannel(channelRequest);
                            colibriContent.removeChannel(colibriChannel);
                            break;
                        }
                    }
                }
                /*
                 * At long last, send the ColibriConferenceIQ request to expire
                 * the channels.
                 */
                conferenceRequest.setTo(colibri.getFrom());
                conferenceRequest.setType(IQ.Type.set);
                getProtocolProvider().getConnection().sendStanza(
                        conferenceRequest);
            }
        }
    }
public void expireColibriChannels ( CallPeerJabberImpl peer , ColibriConferenceIQ conference ) throws SmackException . NotConnectedException , InterruptedException { if ( colibri != null ) { String conferenceID = colibri . getID ( ) ; if ( conferenceID . equals ( conference . getID ( ) ) ) { ColibriConferenceIQ conferenceRequest = new ColibriConferenceIQ ( ) ; conferenceRequest . setID ( conferenceID ) ; for ( ColibriConferenceIQ . Content content : conference . getContents ( ) ) { ColibriConferenceIQ . Content colibriContent = colibri . getContent ( content . getName ( ) ) ; if ( colibriContent != null ) { ColibriConferenceIQ . Content contentRequest = conferenceRequest . getOrCreateContent ( colibriContent . getName ( ) ) ; for ( ColibriConferenceIQ . Channel channel : content . getChannels ( ) ) { ColibriConferenceIQ . Channel colibriChannel = colibriContent . getChannel ( channel . getID ( ) ) ; if ( colibriChannel != null ) { ColibriConferenceIQ . Channel channelRequest = new ColibriConferenceIQ . Channel ( ) ; channelRequest . setExpire ( 0 ) ; channelRequest . setID ( colibriChannel . getID ( ) ) ; contentRequest . addChannel ( channelRequest ) ; } } } } /*
                 * Remove the channels which are to be expired from the internal
                 * state of the conference managed by this CallJabberImpl.
                 */ for ( ColibriConferenceIQ . Content contentRequest : conferenceRequest . getContents ( ) ) { ColibriConferenceIQ . Content colibriContent = colibri . getContent ( contentRequest . getName ( ) ) ; for ( ColibriConferenceIQ . Channel channelRequest : contentRequest . getChannels ( ) ) { ColibriConferenceIQ . Channel colibriChannel = colibriContent . getChannel ( channelRequest . getID ( ) ) ; colibriContent . removeChannel ( colibriChannel ) ; /*
                         * If the last remote channel is to be expired, expire
                         * the local channel as well.
                         */ if ( colibriContent . getChannelCount ( ) == 1 ) { colibriChannel = colibriContent . getChannel ( 0 ) ; channelRequest = new ColibriConferenceIQ . Channel ( ) ; channelRequest . setExpire ( 0 ) ; channelRequest . setID ( colibriChannel . getID ( ) ) ; contentRequest . addChannel ( channelRequest ) ; colibriContent . removeChannel ( colibriChannel ) ; break ; } } } /*
                 * At long last, send the ColibriConferenceIQ request to expire
                 * the channels.
                 */ conferenceRequest . setTo ( colibri . getFrom ( ) ) ; conferenceRequest . setType ( IQ . Type . set ) ; getProtocolProvider ( ) . getConnection ( ) . sendStanza ( conferenceRequest ) ; } } }
Expires specific (colibri) conference channels used by a specific
 <tt>CallPeer</tt>.
Expires specific ( colibri ) conference channels used by a specific <tt > CallPeer< / tt > .
// Formulate the ColibriConferenceIQ request which is to be sent.