Skip to content

Commit ad4c1ec

Browse files
committed
Merge branch 'surevine-issues/218'
2 parents 6db0c88 + ee775c1 commit ad4c1ec

7 files changed

Lines changed: 30 additions & 63 deletions

File tree

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,16 @@ Please see [the example configuration file](https://github.com/buddycloud/buddyc
5757

5858
| Property | Default value | Required | Description |
5959
| ----------------------------------------- | -------------- | :--------: |---------------------------------------------- |
60-
| xmpp.host | | | The XMPP server host (IP address or hostname) |
61-
| xmpp.port | | | XMPP server component port |
60+
| xmpp.host | 127.0.0.1 | | The XMPP server host (IP address or hostname) |
61+
| xmpp.port | 5347 | | XMPP server component port |
6262
| xmpp.secretkey | || Component secret |
6363
| server.domain | || XMPP server domain |
6464
| server.domain.channels | || Buddycloud server domain / Component address |
6565
| server.domain.topics | | | Topics component address |
66-
| jdbc.proxool.alias | || Database connection name |
6766
| jdbc.proxool.driver-url | || Database connection string |
68-
| jdbc.proxool.driver-class | || Database connection class |
6967
| jdbc.user | || Database username |
7068
| jdbc.password | || Database password |
7169
| jdbc.proxool.maximum-connection-count | || Database connection pool size |
72-
| jdbc.proxool.house-keeping-test-sql | || Database house keeping test |
7370
| users.admin | | | Admin users (list of jids). Are sent all notifications and are able to see everything in **/firehose** |
7471
| notifications.sendTo | | | List of JIDs to send event messages to |
7572
| notifications.connected | | | Send event of component connecting to XMPP server |
@@ -83,6 +80,7 @@ Please see [the example configuration file](https://github.com/buddycloud/buddyc
8380
| channel.configuration.[**posts** or **status** or **geo.next**, etc].description | %jid%'s status | | Override default node description on the node type |
8481
| discovery.dns.enabled | true | | Allow DNS discovery of other channel servers |
8582
| sync.purge-on-start | false | | Purge remote data on server start |
83+
| users.presence.persist | false | | If **true** then user presence status is stored in the database rather than in memory |
8684

8785
## Additional content-type plugins
8886
The buddycloud server supports validation of custom content types by means of a plugin system. By default the buddycloud server supports Atom content. Additional content types can be supported by creating an appropriate validator and packaging it as a plugin.

configuration.properties.example

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,10 @@
1-
xmpp.host=127.0.0.1
2-
xmpp.port=5347
31
xmpp.secretkey=tellnoone
42

53
server.domain=example.com
64
server.domain.channels=buddycloud.example.com
75
server.domain.topics=topics.example.com
86

9-
jdbc.proxool.alias=channelserver
107
jdbc.proxool.driver-url=jdbc:postgresql://localhost:5432/buddycloud
11-
jdbc.proxool.driver-class=org.postgresql.Driver
128
jdbc.user=buddycloud
139
jdbc.password=password
14-
jdbc.proxool.maximum-connection-count=10
15-
jdbc.proxool.house-keeping-test-sql=select CURRENT_DATE
16-
17-
# Admin users are sent all notiifcations as well as having access
18-
# to all posts from the /firehose node (not just from open channels)
19-
users.admin = user1@example.com;crawler@searchengine.org
20-
21-
# Notifications that can be sent out to JIDs on the
22-
#notifications.sendTo = user1@example.com;sysadmin@ops.net
23-
#notifications.connected = true
24-
25-
# A list of channels (local or remote) to which to subscribe new users
26-
# Note that the channels will not be created - they must already exist
27-
channels.autosubscribe=lounge@example.com;welcome@example.com
28-
29-
# If any of the 'channels.autosubscribe' channels are private local channels,
30-
# then whether to automatically approve the user.
31-
# NOTE: This will only work on local private channels
32-
channels.autosubscribe.autoapprove=false
33-
34-
# Channel configuration related to access model and affiliation
35-
36-
channel.configuration.default.accessmodel=open
37-
channel.configuration.default.affiliation=member
38-
39-
# Overrides for default configuration
40-
channel.configuration.posts.affiliation=publisher
41-
42-
channel.configuration.geo.next.accessmodel=authorize
43-
channel.configuration.geo.current.accessmodel=authorize
44-
channel.configuration.geo.previous.accessmodel=authorize
45-
46-
channel.configuration.status.description=%jid%'s status
47-
channel.configuration.status.description=The current status of %jid%
48-
49-
50-
# Allow DNS discovery of other channel servers (default: true)
51-
discovery.dns.enabled = true
10+
jdbc.proxool.maximum-connection-count=10

src/main/java/org/buddycloud/channelserver/Configuration.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ public class Configuration extends Properties {
4343

4444
private static final String CONFIGURATION_FILE = "configuration.properties";
4545

46+
public static final String PURGE_REMOTE_ON_START = "sync.purge-on-start";
47+
48+
public static final String XMPP_PORT = "xmpp.port";
49+
50+
public static final String XMPP_HOST = "xmpp.host";
4651

4752
private static Configuration instance = null;
4853

@@ -182,4 +187,12 @@ public boolean getBooleanProperty(final String key,
182187

183188
return defaultValue;
184189
}
190+
191+
public String getComponentPort() {
192+
return this.getProperty(XMPP_PORT, "5347");
193+
}
194+
195+
public String getXmppHost() {
196+
return this.getProperty(XMPP_HOST, "127.0.0.1");
197+
}
185198
}

src/main/java/org/buddycloud/channelserver/Main.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ private static void startComponents() throws Exception {
1919
PropertyConfigurator.configure("log4j.properties");
2020
LOGGER.info("Starting Buddycloud channel mockup version...");
2121

22-
Configuration conf = Configuration.getInstance();
22+
Configuration configuration = Configuration.getInstance();
2323

24-
LOGGER.info("Connecting to '" + conf.getProperty("xmpp.host") + ":"
25-
+ conf.getProperty("xmpp.port")
24+
LOGGER.info("Connecting to '" + configuration.getXmppHost() + ":"
25+
+ configuration.getComponentPort()
2626
+ "' and trying to claim address '"
27-
+ conf.getProperty("server.domain") + "'.");
27+
+ configuration.getProperty("server.domain") + "'.");
2828

29-
String channelDomain = conf.getProperty("server.domain.channels");
30-
String topicDomain = conf.getProperty("server.domain.topics");
29+
String channelDomain = configuration.getProperty(Configuration.CONFIGURATION_SERVER_CHANNELS_DOMAIN);
30+
String topicDomain = configuration.getProperty(Configuration.CONFIGURATION_SERVER_TOPICS_DOMAIN);
3131

3232
if (channelDomain == null) {
3333
throw new IllegalArgumentException("Property server.domain.channels is mandatory.");
3434
}
35-
new XmppComponent(conf, channelDomain).run();
35+
new XmppComponent(configuration, channelDomain).run();
3636

3737
if (topicDomain != null) {
38-
new TopicsComponent(conf, topicDomain).run();
38+
new TopicsComponent(configuration, topicDomain).run();
3939
}
4040
hang();
4141
}

src/main/java/org/buddycloud/channelserver/TopicsComponent.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package org.buddycloud.channelserver;
22

3-
import java.util.Properties;
4-
53
import org.jivesoftware.whack.ExternalComponentManager;
64
import org.xmpp.component.ComponentException;
75

@@ -14,9 +12,9 @@ public class TopicsComponent {
1412
private String password;
1513
private TopicsEngine topicsEngine;
1614

17-
public TopicsComponent(Properties configuration, String domain) {
18-
hostname = configuration.getProperty("xmpp.host");
19-
socket = Integer.valueOf(configuration.getProperty("xmpp.port"));
15+
public TopicsComponent(Configuration configuration, String domain) {
16+
hostname = configuration.getXmppHost();
17+
socket = Integer.valueOf(configuration.getComponentPort());
2018
this.domain = domain;
2119
password = configuration.getProperty("xmpp.secretkey");
2220
topicsEngine = new TopicsEngine(configuration);

src/main/java/org/buddycloud/channelserver/XmppComponent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public class XmppComponent {
1515
private ChannelsEngine channelsEngine;
1616

1717
public XmppComponent(Configuration configuration, String domain) throws ProxoolException {
18-
hostname = configuration.getProperty("xmpp.host");
19-
socket = Integer.valueOf(configuration.getProperty("xmpp.port"));
18+
hostname = configuration.getXmppHost();
19+
socket = Integer.valueOf(configuration.getComponentPort());
2020
this.domain = domain;
2121
password = configuration.getProperty("xmpp.secretkey");
2222
channelsEngine = new ChannelsEngine(configuration);

src/test/resources/configuration.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ jdbc.proxool.driver-class=org.hsqldb.jdbcDriver
77
jdbc.user=sa
88
jdbc.password=
99
jdbc.proxool.maximum-connection-count=10
10-
jdbc.proxool.house-keeping-test-sql=select CURRENT_DATE
1110

1211
channel.user.open = true
1312
channel.topics.open = true

0 commit comments

Comments
 (0)