Commit 31d27670 authored by Robin Collier's avatar Robin Collier Committed by rcollier

synched with trunk

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/branches/pubsub_clustering@13040 b35dd754-fafc-0310-a699-88a17e54d16e
parents 8c3e40ea 9c8a8f15
......@@ -32,7 +32,7 @@ jaxen.jar | 1.1 beta 4 (from DOM4J 1.6.1)
jdic.jar | 0.9.1 (for windows only) | LGPL
jdom.jar | 1.0 (required by rome) | Apache 1.1
jstl.jar | Jakarta standard taglib 1.1.2 |
jmdns.jar | 3.4.1 | Apache 2.0
jmdns.jar | PRE 1.0, patched | Apache 2.0
jmock.jar | 2.1.0 |
jmock-junit4.jar | 2.1.0 |
jmock-legacy.jar | 2.1.0 |
......
......@@ -61,7 +61,7 @@ public class MulticastDNSService extends BasicModule {
PropertyEventDispatcher.addListener(new PropertyEventListener() {
public void propertySet(String property, Map<String, Object> params) {
public void propertySet(String property, Map params) {
// Restart the service if component settings changes.
if (property.equals("xmpp.component.socket.active") ||
property.equals(" xmpp.component.socket.port"))
......@@ -71,7 +71,7 @@ public class MulticastDNSService extends BasicModule {
}
}
public void propertyDeleted(String property, Map<String, Object> params) {
public void propertyDeleted(String property, Map params) {
// Restart the service if component settings changes.
if (property.equals("xmpp.component.socket.active") ||
property.equals(" xmpp.component.socket.port"))
......@@ -81,10 +81,10 @@ public class MulticastDNSService extends BasicModule {
}
}
public void xmlPropertySet(String property, Map<String, Object> params) {
public void xmlPropertySet(String property, Map params) {
}
public void xmlPropertyDeleted(String property, Map<String, Object> params) {
public void xmlPropertyDeleted(String property, Map params) {
}
});
}
......@@ -116,17 +116,17 @@ public class MulticastDNSService extends BasicModule {
}
try {
if (jmdns == null) {
jmdns = JmDNS.create();
jmdns = new JmDNS();
}
String serverName = XMPPServer.getInstance().getServerInfo().getXMPPDomain();
if (clientPortNum != -1) {
ServiceInfo clientService = ServiceInfo.create("_xmpp-client._tcp.local.",
ServiceInfo clientService = new ServiceInfo("_xmpp-client._tcp.local.",
serverName + "._xmpp-client._tcp.local.", clientPortNum, "XMPP Server");
jmdns.registerService(clientService);
}
if (componentPortNum != -1) {
ServiceInfo componentService = ServiceInfo.create("_xmpp-component._tcp.local.",
ServiceInfo componentService = new ServiceInfo("_xmpp-component._tcp.local.",
serverName + "._xmpp-component._tcp.local.", componentPortNum, "XMPP Component Server");
jmdns.registerService(componentService);
}
......@@ -136,7 +136,7 @@ public class MulticastDNSService extends BasicModule {
}
}
};
// Schedule the task to run in 5 seconds, to give Openfire time to start the ports.
// Schedule the task to run in 5 seconds, to give Wildire time to start the ports.
TaskEngine.getInstance().schedule(startService, 5000);
}
......
......@@ -997,6 +997,7 @@ public class PubSubPersistenceManager {
{
log.debug("Flushing items to database");
boolean abortTransaction = false;
LinkedList addList = null;
LinkedList delList = null;
......@@ -1066,15 +1067,15 @@ public class PubSubPersistenceManager {
delItem = delItem.next;
}
}
con.commit();
}
catch (SQLException sqle)
{
log.error(sqle.getMessage(), sqle);
abortTransaction = true;
}
finally
{
DbConnectionManager.closeConnection(pstmt, con);
DbConnectionManager.closeTransactionConnection(pstmt, con, abortTransaction);
}
}
......@@ -1488,17 +1489,17 @@ public class PubSubPersistenceManager {
String persistentNodeQuery = "SELECT serviceID, nodeID, maxItems FROM ofPubsubNode WHERE "
+ "leaf=1 AND persistItems=1 AND maxItems > 0";
boolean abortTransaction = false;
Connection con = null;
PreparedStatement pstmt = null;
PreparedStatement nodeConfig = null;
ResultSet rs = null;
try
{
con = DbConnectionManager.getTransactionConnection();
PreparedStatement nodeConfig = con.prepareStatement(persistentNodeQuery);
nodeConfig = con.prepareStatement(persistentNodeQuery);
rs = nodeConfig.executeQuery();
PreparedStatement purgeNode = con
.prepareStatement(getPurgeStatement(DbConnectionManager.getDatabaseType()));
......@@ -1510,20 +1511,20 @@ public class PubSubPersistenceManager {
setPurgeParams(DbConnectionManager.getDatabaseType(), purgeNode, svcId, nodeId, maxItems);
int rowsAffected = purgeNode.executeUpdate();
if (log.isDebugEnabled())
log.debug(rowsAffected + " deleted rows from service: " + svcId + " nodeId: " + nodeId);
purgeNode.addBatch();
}
purgeNode.executeBatch();
}
catch (Exception sqle)
{
sqle.printStackTrace();
log.error(sqle.getMessage(), sqle);
abortTransaction = true;
}
finally
{
DbConnectionManager.closeConnection(rs, pstmt, con);
DbConnectionManager.closeResultSet(rs);
DbConnectionManager.closeStatement(rs, nodeConfig);
DbConnectionManager.closeTransactionConnection(pstmt, con, abortTransaction);
}
}
......
......@@ -7,7 +7,7 @@
<name>GoJara</name>
<description>ProtoXEP-xxxx: Remote Roster Management support</description>
<author>Holger Bergunde and Daniel Henninger</author>
<version>1.2.0 Alpha</version>
<version>1.2.1 Alpha</version>
<date>02/17/2012</date>
<databaseKey>gojara</databaseKey>
<databaseVersion>0</databaseVersion>
......
......@@ -45,7 +45,7 @@ public class IQLastInterceptor implements PacketInterceptor {
if (packet instanceof IQ && incoming && processed) {
IQ iqpacket = (IQ) packet;
if (!iqpacket.getTo().toString().contains(_subDomain))
if (iqpacket.getTo() == null || !iqpacket.getTo().toString().contains(_subDomain))
return;
Element root = iqpacket.getChildElement();
......@@ -54,7 +54,6 @@ public class IQLastInterceptor implements PacketInterceptor {
String ns = root.getNamespaceURI();
if (ns.equals("jabber:iq:last") && iqpacket.getType().equals(IQ.Type.get)) {
IQ answer = new IQ();
answer.setType(IQ.Type.error);
answer.setFrom(iqpacket.getTo());
......@@ -73,7 +72,6 @@ public class IQLastInterceptor implements PacketInterceptor {
Log.debug("Auto response to jabber:iq:last for " + _subDomain);
PacketRouter router = XMPPServer.getInstance().getPacketRouter();
router.route(answer);
}
}
......
This diff is collapsed.
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