Commit d3d0d8e5 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Minot touches.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@9638 b35dd754-fafc-0310-a699-88a17e54d16e
parent 10e2d706
......@@ -81,6 +81,8 @@ public class IQPEPHandler extends IQHandler implements ServerIdentitiesProvider,
UserIdentitiesProvider, UserItemsProvider, PresenceEventListener, RemotePresenceEventListener,
RosterEventListener, UserEventListener {
final static String GET_PEP_SERVICE = "SELECT DISTINCT serviceID FROM pubsubNode WHERE serviceID=?";
/**
* Map of PEP services. Table, Key: bare JID (String); Value: PEPService
*/
......@@ -131,7 +133,6 @@ public class IQPEPHandler extends IQHandler implements ServerIdentitiesProvider,
* @return the loaded PEP service, or null if not found.
*/
private PEPService loadPEPServiceFromDB(String jid) {
String GET_PEP_SERVICE = "SELECT DISTINCT serviceID FROM pubsubNode " + "WHERE serviceID='" + jid + "'";
PEPService pepService = null;
Connection con = null;
......@@ -140,6 +141,7 @@ public class IQPEPHandler extends IQHandler implements ServerIdentitiesProvider,
con = DbConnectionManager.getConnection();
// Get all PEP services
pstmt = con.prepareStatement(GET_PEP_SERVICE);
pstmt.setString(1, jid);
ResultSet rs = pstmt.executeQuery();
// Restore old PEPServices
while (rs.next()) {
......@@ -310,8 +312,11 @@ public class IQPEPHandler extends IQHandler implements ServerIdentitiesProvider,
}
/**
* Retrieves a PEP service -- attempting first from memory, then from the database.
* Retrieves a PEP service -- attempting first from memory, then from the database. Note
* that if no PEP service was found the next request of the PEP service will hit the
* database since we are not caching 'no PEP services'.
*
* @param jid the bare JID of the user that owns the PEP service.
* @return the requested PEP service if found or null if not found.
*/
private PEPService getPEPService(String jid) {
......@@ -406,9 +411,6 @@ public class IQPEPHandler extends IQHandler implements ServerIdentitiesProvider,
if (nodeSubscription != null) {
rootNode.cancelSubscription(nodeSubscription);
}
else {
return;
}
}
/**
......
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