Package org.jivesoftware.openfire.muc

Examples of org.jivesoftware.openfire.muc.MultiUserChatService


    public void run() {
        // If it's registered already, no need to create it.  Most likely this is because the service
        // is provided by an internal component that registered at startup.  This scenario, however,
        // should really never occur.
        if (!XMPPServer.getInstance().getMultiUserChatManager().isServiceRegistered(subdomain)) {
            MultiUserChatService service = new MultiUserChatServiceImpl(subdomain, description, isHidden);
            XMPPServer.getInstance().getMultiUserChatManager().registerMultiUserChatService(service);
        }
    }
View Full Code Here


    public Object getResult() {
        return null;
    }

    public void run() {
        MultiUserChatService service = XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService(subdomain);
        if (service != null) {
            if (service instanceof MultiUserChatServiceImpl) {
                MUCPersistenceManager.refreshProperties(subdomain);
                ((MultiUserChatServiceImpl)service).initializeSettings();
            }
View Full Code Here

    public Object getResult() {
        return null;
    }

    public void run() {
        MultiUserChatService mucService = room.getMUCService();
        mucService.chatRoomRemoved(room);
    }
View Full Code Here

        this.roomName = room.getName();
        this.subdomain = room.getMUCService().getServiceName();
    }

    public LocalMUCRoom getRoom() {
        MultiUserChatService mucService = XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService(subdomain);
        if (mucService == null) {
            throw new IllegalArgumentException("MUC service not found for subdomain: "+subdomain);
        }
        LocalMUCRoom room = (LocalMUCRoom) mucService.getChatRoom(roomName);
        if (room == null) {
            throw new IllegalArgumentException("Room not found: " + roomName);
        }
        return room;
    }
View Full Code Here

                // Add occupant count updates to packet
                // TODO: Refactor out into a different class
                MultiUserChatManager mucManager = XMPPServer.getInstance().getMultiUserChatManager();
                for (String roomJid : presenceRoomJids) {
                    JID jid = new JID(roomJid);
                    MultiUserChatService mucService = mucManager.getMultiUserChatService(jid);
                    MUCRoom room = mucService.getChatRoom(jid.getNode());
                    // Not count room owners as occupants
                    int totalOccupants = room.getOccupantsCount();
                    for (String owner : room.getOwners()) {
                        try {
                            if (!room.getOccupantsByBareJID(owner).isEmpty()) {
View Full Code Here

    private boolean isRoomOwner(JID roomJID, JID user) {
        if (user == null || roomJID == null) {
            return false;
        }
        MultiUserChatService chatService =
                XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService(roomJID);
        MUCRoom room = chatService.getChatRoom(roomJID.getNode());
        return room != null && room.getOwners().contains(user.toBareJID());
    }
View Full Code Here

            note.setText("Service name must be specified.");
            return;
        }
        // Remove the server's domain name from the passed hostname
        String servicename = servicehostname.replace("."+XMPPServer.getInstance().getServerInfo().getXMPPDomain(), "");
        MultiUserChatService mucService;
        mucService = XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService(servicename);
        if (mucService == null) {
            note.addAttribute("type", "error");
            note.setText("Invalid service name specified.");
            return;
        }
        if (!mucService.isServiceEnabled()) {
            note.addAttribute("type", "error");
            note.setText("Multi user chat is disabled for specified service.");
            return;
        }
        // Let's create the jid and check that they are a local user
        String roomname = get(data, "roomname", 0);
        if (roomname == null) {
            note.addAttribute("type", "error");
            note.setText("Room name must be specified.");
            return;
        }
        JID admin = admins.iterator().next();
        MUCRoom room;
        try {
            room = mucService.getChatRoom(roomname, admin);
        }
        catch (NotAllowedException e) {
            note.addAttribute("type", "error");
            note.setText("No permission to create rooms.");
            return;
View Full Code Here

    public Object getResult() {
        return null;
    }

    public void run() {
        MultiUserChatService mucService = room.getMUCService();
        mucService.chatRoomAdded(room);
    }
View Full Code Here

TOP

Related Classes of org.jivesoftware.openfire.muc.MultiUserChatService

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.