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

1) Refactoring work

2) Be defaul leaf nodes are now broadcasting payloads
3) Fixed copy/paste error.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@4819 b35dd754-fafc-0310-a699-88a17e54d16e
parent 51e587f8
...@@ -302,8 +302,8 @@ public class PubSubModule extends BasicModule implements ServerItemsProvider, Di ...@@ -302,8 +302,8 @@ public class PubSubModule extends BasicModule implements ServerItemsProvider, Di
String[] jids; String[] jids;
if (property != null) { if (property != null) {
jids = property.split(","); jids = property.split(",");
for (int i = 0; i < jids.length; i++) { for (String jid : jids) {
sysadmins.add(jids[i].trim().toLowerCase()); sysadmins.add(jid.trim().toLowerCase());
} }
} }
nodeCreationRestricted = nodeCreationRestricted =
...@@ -312,8 +312,8 @@ public class PubSubModule extends BasicModule implements ServerItemsProvider, Di ...@@ -312,8 +312,8 @@ public class PubSubModule extends BasicModule implements ServerItemsProvider, Di
property = JiveGlobals.getProperty("xmpp.pubsub.create.jid"); property = JiveGlobals.getProperty("xmpp.pubsub.create.jid");
if (property != null) { if (property != null) {
jids = property.split(","); jids = property.split(",");
for (int i = 0; i < jids.length; i++) { for (String jid : jids) {
allowedToCreate.add(jids[i].trim().toLowerCase()); allowedToCreate.add(jid.trim().toLowerCase());
} }
} }
...@@ -329,28 +329,17 @@ public class PubSubModule extends BasicModule implements ServerItemsProvider, Di ...@@ -329,28 +329,17 @@ public class PubSubModule extends BasicModule implements ServerItemsProvider, Di
leafDefaultConfiguration = new DefaultNodeConfiguration(true); leafDefaultConfiguration = new DefaultNodeConfiguration(true);
leafDefaultConfiguration.setAccessModel(AccessModel.open); leafDefaultConfiguration.setAccessModel(AccessModel.open);
leafDefaultConfiguration.setPublisherModel(PublisherModel.publishers); leafDefaultConfiguration.setPublisherModel(PublisherModel.publishers);
leafDefaultConfiguration.setDeliverPayloads( leafDefaultConfiguration.setDeliverPayloads(true);
JiveGlobals.getBooleanProperty("xmpp.pubsub.default.deliverPayloads", false)); leafDefaultConfiguration.setLanguage("English");
leafDefaultConfiguration.setLanguage( leafDefaultConfiguration.setMaxPayloadSize(5120);
JiveGlobals.getProperty("xmpp.pubsub.default.language", "English")); leafDefaultConfiguration.setNotifyConfigChanges(true);
leafDefaultConfiguration.setMaxPayloadSize( leafDefaultConfiguration.setNotifyDelete(true);
JiveGlobals.getIntProperty("xmpp.pubsub.default.language", 5120)); leafDefaultConfiguration.setNotifyRetract(true);
leafDefaultConfiguration.setNotifyConfigChanges(JiveGlobals.getBooleanProperty( leafDefaultConfiguration.setPersistPublishedItems(false);
"xmpp.pubsub.default.notify.configChanges", true)); leafDefaultConfiguration.setMaxPublishedItems(-1);
leafDefaultConfiguration.setNotifyDelete( leafDefaultConfiguration.setPresenceBasedDelivery(false);
JiveGlobals.getBooleanProperty("xmpp.pubsub.default.notify.delete", true)); leafDefaultConfiguration.setSendItemSubscribe(true);
leafDefaultConfiguration.setNotifyRetract( leafDefaultConfiguration.setSubscriptionEnabled(true);
JiveGlobals.getBooleanProperty("xmpp.pubsub.default.notify.retract", true));
leafDefaultConfiguration.setPersistPublishedItems(
JiveGlobals.getBooleanProperty("xmpp.pubsub.default.persistItems", false));
leafDefaultConfiguration.setMaxPublishedItems(
JiveGlobals.getIntProperty("xmpp.pubsub.default.maxPublishedItems", -1));
leafDefaultConfiguration.setPresenceBasedDelivery(JiveGlobals.getBooleanProperty(
"xmpp.pubsub.default.presenceBasedDelivery", false));
leafDefaultConfiguration.setSendItemSubscribe(
JiveGlobals.getBooleanProperty("xmpp.pubsub.default.sendItemSubscribe", true));
leafDefaultConfiguration.setSubscriptionEnabled(JiveGlobals.getBooleanProperty(
"xmpp.pubsub.default.subscriptionEnabled", true));
leafDefaultConfiguration.setReplyPolicy(null); leafDefaultConfiguration.setReplyPolicy(null);
PubSubPersistenceManager.createDefaultConfiguration(this, leafDefaultConfiguration); PubSubPersistenceManager.createDefaultConfiguration(this, leafDefaultConfiguration);
} }
...@@ -362,25 +351,17 @@ public class PubSubModule extends BasicModule implements ServerItemsProvider, Di ...@@ -362,25 +351,17 @@ public class PubSubModule extends BasicModule implements ServerItemsProvider, Di
collectionDefaultConfiguration = new DefaultNodeConfiguration(false); collectionDefaultConfiguration = new DefaultNodeConfiguration(false);
collectionDefaultConfiguration.setAccessModel(AccessModel.open); collectionDefaultConfiguration.setAccessModel(AccessModel.open);
collectionDefaultConfiguration.setPublisherModel(PublisherModel.publishers); collectionDefaultConfiguration.setPublisherModel(PublisherModel.publishers);
collectionDefaultConfiguration.setDeliverPayloads( collectionDefaultConfiguration.setDeliverPayloads(false);
JiveGlobals.getBooleanProperty("xmpp.pubsub.default.deliverPayloads", false)); collectionDefaultConfiguration.setLanguage("English");
collectionDefaultConfiguration.setLanguage( collectionDefaultConfiguration.setNotifyConfigChanges(true);
JiveGlobals.getProperty("xmpp.pubsub.default.language", "English")); collectionDefaultConfiguration.setNotifyDelete(true);
collectionDefaultConfiguration.setNotifyConfigChanges(JiveGlobals.getBooleanProperty( collectionDefaultConfiguration.setNotifyRetract(true);
"xmpp.pubsub.default.notify.configChanges", true)); collectionDefaultConfiguration.setPresenceBasedDelivery(false);
collectionDefaultConfiguration.setNotifyDelete( collectionDefaultConfiguration.setSubscriptionEnabled(true);
JiveGlobals.getBooleanProperty("xmpp.pubsub.default.notify.delete", true)); collectionDefaultConfiguration.setReplyPolicy(null);
collectionDefaultConfiguration.setNotifyRetract( collectionDefaultConfiguration
JiveGlobals.getBooleanProperty("xmpp.pubsub.default.notify.retract", true));
collectionDefaultConfiguration.setPresenceBasedDelivery(JiveGlobals.getBooleanProperty(
"xmpp.pubsub.default.presenceBasedDelivery", false));
collectionDefaultConfiguration.setSubscriptionEnabled(JiveGlobals.getBooleanProperty(
"xmpp.pubsub.default.subscriptionEnabled", true));
leafDefaultConfiguration.setReplyPolicy(null);
leafDefaultConfiguration
.setAssociationPolicy(CollectionNode.LeafNodeAssociationPolicy.all); .setAssociationPolicy(CollectionNode.LeafNodeAssociationPolicy.all);
leafDefaultConfiguration.setMaxLeafNodes( collectionDefaultConfiguration.setMaxLeafNodes(-1);
JiveGlobals.getIntProperty("xmpp.pubsub.default.maxLeafNodes", -1));
PubSubPersistenceManager PubSubPersistenceManager
.createDefaultConfiguration(this, collectionDefaultConfiguration); .createDefaultConfiguration(this, collectionDefaultConfiguration);
} }
......
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