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