All Downloads are FREE. Search and download functionalities are using the official Maven repository.

uk.org.retep.xmpp.muc.builder.MucRoomSetLogicBuilder Maven / Gradle / Ivy

There is a newer version: 10.6
Show newest version
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package uk.org.retep.xmpp.muc.builder;

import uk.org.retep.xmpp.builder.AbstractProtocolLogicSetBuilder;
import uk.org.retep.xmpp.muc.MucRoomSet;
import uk.org.retep.xmpp.muc.MucService;
import uk.org.retep.xmpp.muc.logic.DiscoveryLogic;

/**
 * {@link XMPPLogicBuilder} implementation for building logic for handling core
 * muc protocols
 *
 * @author peter
 * @since 9.12
 */
public class MucRoomSetLogicBuilder
        extends AbstractProtocolLogicSetBuilder
{

    /**
     * Use {@link MucServiceBuilder#getMucRoomSetLogicBuilder()}
     */
    public MucRoomSetLogicBuilder()
    {
    }

    /**
     * Adds the various components needed for a basic Muc implementation.
     *
     * @param  Type of this builder
     * @return this instance
     */
    @Override
    public  T addDefaultLogic()
    {
        addDiscoverMucSupportLogic();
        addDiscoverRoomsLogic();
        @SuppressWarnings( "unchecked" )
        final T ret = (T) this;
        return ret;
    }

    /**
     * Adds logic to enable the detection of component support for Muc.
     * It is usually required for this to be present if the muc service is to
     * comply with XEP-0045
     *
     * @return this instance
     */
    public MucRoomSetLogicBuilder addDiscoverMucSupportLogic()
    {
        return addXMPPLogic( DiscoveryLogic.MUC_SUPPORT );
    }

    /**
     * Adds logic to enable the discovery of rooms handled by this service
     *
     * @return this instance
     */
    public MucRoomSetLogicBuilder addDiscoverRoomsLogic()
    {
        return addXMPPLogic( DiscoveryLogic.ROOMS );
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy