001/**
002 *
003 * Copyright 2003-2007 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.muc;
018
019import org.jivesoftware.smackx.disco.packet.DiscoverItems;
020
021/**
022 * Hosted rooms by a chat service may be discovered if they are configured to appear in the room
023 * directory . The information that may be discovered is the XMPP address of the room and the room
024 * name. The address of the room may be used for obtaining more detailed information
025 * {@link org.jivesoftware.smackx.muc.MultiUserChat#getRoomInfo(org.jivesoftware.smack.XMPPConnection, String)}
026 * or could be used for joining the room
027 * {@link org.jivesoftware.smackx.muc.MultiUserChat#MultiUserChat(org.jivesoftware.smack.XMPPConnection, String)}
028 * and {@link org.jivesoftware.smackx.muc.MultiUserChat#join(String)}.
029 *
030 * @author Gaston Dombiak
031 */
032public class HostedRoom {
033
034    private String jid;
035
036    private String name;
037
038    public HostedRoom(DiscoverItems.Item item) {
039        super();
040        jid = item.getEntityID();
041        name = item.getName();
042    }
043
044    /**
045     * Returns the XMPP address of the hosted room by the chat service. This address may be used
046     * when creating a <code>MultiUserChat</code> when joining a room.
047     *
048     * @return the XMPP address of the hosted room by the chat service.
049     */
050    public String getJid() {
051        return jid;
052    }
053
054    /**
055     * Returns the name of the room.
056     *
057     * @return the name of the room.
058     */
059    public String getName() {
060        return name;
061    }
062}