Commit 8e6ecb3b authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Renamed #getChatServerName to #getServiceName and #setChatServerName to #setServiceName.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@157 b35dd754-fafc-0310-a699-88a17e54d16e
parent ecab4fde
......@@ -27,17 +27,17 @@ import org.jivesoftware.messenger.*;
public interface MultiUserChatServer {
/**
* Obtain the name of this chat server.
* Obtain the name of this chat service.
*
* @return The chat server name (host name).
*/
String getChatServerName();
String getServiceName();
/**
* Set the name of this chat server. The new name won't go into effect until the server is
* Set the name of this chat service. The new name won't go into effect until the server is
* restarted.
*
* @param name The chat server name (host name).
* @param name The chat service name (host name).
*/
void setServiceName(String name);
......
......@@ -570,7 +570,7 @@ class MUCPersistentRoomSurrogate implements MUCRoom, Cacheable {
public XMPPAddress getRoleAddress() {
if (crJID == null) {
crJID = new XMPPAddress(room.getName(), server.getChatServerName(), "");
crJID = new XMPPAddress(room.getName(), server.getServiceName(), "");
}
return crJID;
}
......
......@@ -107,7 +107,7 @@ public class MUCRoleImpl implements MUCRole {
this.affiliation = affiliation;
extendedInformation = new MetaDataFragment("http://jabber.org/protocol/muc#user", "x");
calculateExtendedInformation();
rJID = new XMPPAddress(room.getName(), server.getChatServerName(), nick);
rJID = new XMPPAddress(room.getName(), server.getServiceName(), nick);
setPresence(room.createPresence(Presence.STATUS_ONLINE));
}
......@@ -208,7 +208,7 @@ public class MUCRoleImpl implements MUCRole {
public void changeNickname(String nickname) {
this.nick = nickname;
rJID = new XMPPAddress(room.getName(), server.getChatServerName(), nick);
rJID = new XMPPAddress(room.getName(), server.getServiceName(), nick);
}
public MUCUser getChatUser() {
......
......@@ -933,7 +933,7 @@ public class MUCRoomImpl implements MUCRoom {
public XMPPAddress getRoleAddress() {
if (crJID == null) {
crJID = new XMPPAddress(room.getName(), server.getChatServerName(), "");
crJID = new XMPPAddress(room.getName(), server.getServiceName(), "");
}
return crJID;
}
......
......@@ -76,10 +76,10 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha
*/
private static int LOG_BATCH_SIZE = 50;
/**
* the chat server's hostname
* the chat service's hostname
*/
private String chatServerName = null;
private XMPPAddress chatServerAddress = null;
private String chatServiceName = null;
private XMPPAddress chatServiceAddress = null;
/**
* chatrooms managed by this manager, table: key room name (String); value ChatRoom
......@@ -188,7 +188,7 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha
// can just simulate that the user sent an unavailable presence to each room
// that he/she previously joined
// TODO Analyze the side effect caused by PresenceManager.probePresence
presenceManager.probePresence(chatServerAddress, user.getAddress());
presenceManager.probePresence(chatServiceAddress, user.getAddress());
}
}
catch (Exception e) {
......@@ -303,8 +303,8 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha
}
}
public String getChatServerName() {
return chatServerName;
public String getServiceName() {
return chatServiceName;
}
public HistoryStrategy getHistoryStrategy() {
......@@ -371,24 +371,19 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha
public void serviceAdded(Object service) {
if (service instanceof RoutingTable) {
((RoutingTable)service).addRoute(chatServerAddress, this);
((RoutingTable)service).addRoute(chatServiceAddress, this);
ArrayList params = new ArrayList();
params.clear();
params.add(chatServerName);
params.add(chatServiceName);
Log.info(LocaleUtils.getLocalizedString("startup.starting.muc", params));
}
else if (service instanceof IQRegisterHandler) {
((IQRegisterHandler) service).addDelegate(
getChatServerName(),
getServiceName(),
new IQMUCRegisterHandler(this));
}
}
/**
* Set the name of the MUC service.
*
* @param name the new service name.
*/
public void setServiceName(String name) {
JiveGlobals.setProperty("xmpp.muc.service", name);
}
......@@ -440,7 +435,7 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha
public void initialize(Container container) {
super.initialize(container);
chatServerName = JiveGlobals.getProperty("xmpp.muc.service");
chatServiceName = JiveGlobals.getProperty("xmpp.muc.service");
// Trigger the strategy to load itself from the context
historyStrategy.setContext("xmpp.muc.history");
// Load the list of JIDs that are sysadmins of the MUC service
......@@ -487,8 +482,8 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha
Log.error("Wrong number format of property xmpp.muc.tasks.log.batchsize", e);
}
}
if (chatServerName == null) {
chatServerName = "conference";
if (chatServiceName == null) {
chatServiceName = "conference";
}
String serverName = null;
try {
......@@ -505,9 +500,9 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha
Log.error(e);
}
if (serverName != null) {
chatServerName += "." + serverName;
chatServiceName += "." + serverName;
}
chatServerAddress = new XMPPAddress(null, chatServerName, null);
chatServiceAddress = new XMPPAddress(null, chatServiceName, null);
// Run through the users every 5 minutes after a 5 minutes server startup delay (default
// values)
timer.schedule(new UserTimeoutTask(), USER_TIMEOUT, USER_TIMEOUT);
......@@ -523,10 +518,10 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha
public void start() {
super.start();
routingTable = (RoutingTable)lookup.lookup(RoutingTable.class);
routingTable.addRoute(chatServerAddress, this);
routingTable.addRoute(chatServiceAddress, this);
ArrayList params = new ArrayList();
params.clear();
params.add(chatServerName);
params.add(chatServiceName);
Log.info(LocaleUtils.getLocalizedString("startup.starting.muc", params));
}
......@@ -534,15 +529,15 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha
super.stop();
timer.cancel();
if (registerHandler != null) {
registerHandler.removeDelegate(getChatServerName());
registerHandler.removeDelegate(getServiceName());
}
}
public XMPPAddress getAddress() {
if (chatServerAddress == null) {
if (chatServiceAddress == null) {
throw new IllegalStateException("Not initialized");
}
return chatServerAddress;
return chatServiceAddress;
}
public void process(XMPPPacket packet) {
......@@ -577,7 +572,7 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha
items.add(new DiscoServerItem() {
public String getJID() {
return chatServerName;
return chatServiceName;
}
public String getName() {
......
......@@ -51,14 +51,14 @@
errors.put("mucname","mucname");
}
if (errors.size() == 0) {
admin.getMultiUserChatServer().setChatServerName(muc);
admin.getMultiUserChatServer().setServiceName(muc);
success = true;
}
name = admin.getServerInfo().getName() == null ? "" : admin.getServerInfo().getName();
}
else {
name = admin.getServerInfo().getName() == null ? "" : admin.getServerInfo().getName();
muc = admin.getMultiUserChatServer().getChatServerName() == null ? "" : admin.getMultiUserChatServer().getChatServerName();
muc = admin.getMultiUserChatServer().getServiceName() == null ? "" : admin.getMultiUserChatServer().getServiceName();
}
%>
......
......@@ -59,7 +59,7 @@
}
if (errors.size() == 0) {
admin.getChatServer().setChatServerName(chat);
admin.getMultiUserChatServer().setChatServerName(muc);
admin.getMultiUserChatServer().setServiceName(muc);
admin.getXMPPServer().getServerInfo().setName(name);
success = true;
}
......@@ -69,8 +69,8 @@
? "" : admin.getServerInfo().getName();
chat = admin.getChatServer().getChatServerName() == null
? "" : admin.getChatServer().getChatServerName();
muc = admin.getMultiUserChatServer().getChatServerName() == null
? "" : admin.getMultiUserChatServer().getChatServerName();
muc = admin.getMultiUserChatServer().getServiceName() == null
? "" : admin.getMultiUserChatServer().getServiceName();
}
%>
......
......@@ -85,7 +85,7 @@ Below is a list of information for this <fmt:message key="short.title" bundle="$
Multi User Chat Server Name:
</td>
<td colspan=2>
<c:out value="${admin.multiUserChatServer.chatServerName}" />
<c:out value="${admin.multiUserChatServer.serviceName}" />
</td>
</tr>
</c:if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment