2006-05-10 00:02:29 +02:00
|
|
|
/**
|
|
|
|
* $Revision$
|
|
|
|
* $Date$
|
|
|
|
*
|
|
|
|
* Copyright (C) 1999-2005 Jive Software. All rights reserved.
|
|
|
|
* This software is the proprietary information of Jive Software. Use is subject to license terms.
|
|
|
|
*/
|
|
|
|
package org.jivesoftware.smackx.bookmark;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Respresents a Conference Room bookmarked on the server using JEP-0048 Bookmark Storage JEP.
|
|
|
|
*
|
|
|
|
* @author Derek DeMoro
|
|
|
|
*/
|
2006-06-17 00:58:24 +02:00
|
|
|
public class BookmarkedConference implements SharedBookmark {
|
2006-05-10 00:02:29 +02:00
|
|
|
|
|
|
|
private String name;
|
|
|
|
private boolean autoJoin;
|
2006-06-17 00:58:24 +02:00
|
|
|
private final String jid;
|
2006-05-10 00:02:29 +02:00
|
|
|
|
|
|
|
private String nickname;
|
|
|
|
private String password;
|
2006-06-17 00:58:24 +02:00
|
|
|
private boolean isShared;
|
|
|
|
|
|
|
|
protected BookmarkedConference(String jid) {
|
|
|
|
this.jid = jid;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected BookmarkedConference(String name, String jid, boolean autoJoin, String nickname,
|
|
|
|
String password)
|
|
|
|
{
|
|
|
|
this.name = name;
|
|
|
|
this.jid = jid;
|
|
|
|
this.autoJoin = autoJoin;
|
|
|
|
this.nickname = nickname;
|
|
|
|
this.password = password;
|
|
|
|
}
|
2006-05-10 00:02:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the display label representing the Conference room.
|
|
|
|
*
|
|
|
|
* @return the name of the conference room.
|
|
|
|
*/
|
|
|
|
public String getName() {
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
2006-06-17 00:58:24 +02:00
|
|
|
protected void setName(String name) {
|
2006-05-10 00:02:29 +02:00
|
|
|
this.name = name;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns true if this conference room should be auto-joined on startup.
|
|
|
|
*
|
|
|
|
* @return true if room should be joined on startup, otherwise false.
|
|
|
|
*/
|
|
|
|
public boolean isAutoJoin() {
|
|
|
|
return autoJoin;
|
|
|
|
}
|
|
|
|
|
2006-06-17 00:58:24 +02:00
|
|
|
protected void setAutoJoin(boolean autoJoin) {
|
2006-05-10 00:02:29 +02:00
|
|
|
this.autoJoin = autoJoin;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the full JID of this conference room. (ex.dev@conference.jivesoftware.com)
|
|
|
|
*
|
|
|
|
* @return the full JID of this conference room.
|
|
|
|
*/
|
|
|
|
public String getJid() {
|
|
|
|
return jid;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the nickname to use when joining this conference room. This is an optional
|
|
|
|
* value and may return null.
|
|
|
|
*
|
|
|
|
* @return the nickname to use when joining, null may be returned.
|
|
|
|
*/
|
|
|
|
public String getNickname() {
|
|
|
|
return nickname;
|
|
|
|
}
|
|
|
|
|
2006-06-17 00:58:24 +02:00
|
|
|
protected void setNickname(String nickname) {
|
2006-05-10 00:02:29 +02:00
|
|
|
this.nickname = nickname;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the password to use when joining this conference room. This is an optional
|
|
|
|
* value and may return null.
|
|
|
|
*
|
|
|
|
* @return the password to use when joining this conference room, null may be returned.
|
|
|
|
*/
|
|
|
|
public String getPassword() {
|
|
|
|
return password;
|
|
|
|
}
|
|
|
|
|
2006-06-17 00:58:24 +02:00
|
|
|
protected void setPassword(String password) {
|
2006-05-10 00:02:29 +02:00
|
|
|
this.password = password;
|
|
|
|
}
|
2006-06-17 00:58:24 +02:00
|
|
|
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if(obj == null || !(obj instanceof BookmarkedConference)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
BookmarkedConference conference = (BookmarkedConference)obj;
|
|
|
|
return conference.getJid().equalsIgnoreCase(jid);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void setShared(boolean isShared) {
|
|
|
|
this.isShared = isShared;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isShared() {
|
|
|
|
return isShared;
|
|
|
|
}
|
2006-05-10 00:02:29 +02:00
|
|
|
}
|