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