1 /** 2 * $RCSfile$ 3 * $Revision$ 4 * $Date$ 5 * 6 * Copyright 2003-2007 Jive Software. 7 * 8 * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 * you may not use this file except in compliance with the License. 10 * You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, software 15 * distributed under the License is distributed on an "AS IS" BASIS, 16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 * See the License for the specific language governing permissions and 18 * limitations under the License. 19 */ 20 package org.jivesoftware.smackx.muc; 21 22 import org.jivesoftware.smackx.packet.DiscoverItems; 23 24 /** 25 * Hosted rooms by a chat service may be discovered if they are configured to appear in the room 26 * directory . The information that may be discovered is the XMPP address of the room and the room 27 * name. The address of the room may be used for obtaining more detailed information 28 * {@link org.jivesoftware.smackx.muc.MultiUserChat#getRoomInfo(org.jivesoftware.smack.Connection, String)} 29 * or could be used for joining the room 30 * {@link org.jivesoftware.smackx.muc.MultiUserChat#MultiUserChat(org.jivesoftware.smack.Connection, String)} 31 * and {@link org.jivesoftware.smackx.muc.MultiUserChat#join(String)}. 32 * 33 * @author Gaston Dombiak 34 */ 35 public class HostedRoom { 36 37 private String jid; 38 39 private String name; 40 41 public HostedRoom(DiscoverItems.Item item) { 42 super(); 43 jid = item.getEntityID(); 44 name = item.getName(); 45 } 46 47 /** 48 * Returns the XMPP address of the hosted room by the chat service. This address may be used 49 * when creating a <code>MultiUserChat</code> when joining a room. 50 * 51 * @return the XMPP address of the hosted room by the chat service. 52 */ 53 public String getJid() { 54 return jid; 55 } 56 57 /** 58 * Returns the name of the room. 59 * 60 * @return the name of the room. 61 */ 62 public String getName() { 63 return name; 64 } 65 } 66