public class Configuration
extends java.lang.Object
~/.metrics-bot.xml
The XML file contains credentials for the various accounts that are connected to metrics-bot, so you should probably chmod it and make sure that it's kept away from evil.
An example XML file looks like:
<metrics-bot>
<twitter>
<account name="@TorAtlas" network="true"
relay="true">
<consumerkey>xxxxxxxxx</consumerkey>
<consumersecret>xxxxxxxxxx</consumersecret>
<token>xxxxxxxxxxx</token>
<tokensecret>xxxxxxxxxxxx</tokensecret>
</account>
</twitter>
<mastodon>
<account name="@metrics-bot@botsin.space"
network="true" relay="true">
<instancehost>botsin.space</instancehost>
<token>xxxxxxxxxxxx</token>
</account>
</mastodon>
<irc>
<nick>metrics-bot</nick>
<password>xxxxxxxxx</password>
<channel name="#tor-test" alert="true" />
</irc>
</metrics-bot>
| Constructor and Description |
|---|
Configuration()
Create a new configuration object.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<IrcChannelConfiguration> |
getIrcChannels()
Returns a list of IRC channel configurations that could
be used to instantiate IRC channel objects.
|
java.lang.String |
getIrcNick() |
java.lang.String |
getIrcNickServPassword() |
java.util.List<MastodonAccountConfiguration> |
getMastodonAccounts()
Returns a list of Mastodon account configurations that could
be used to instantiate Mastodon account objects.
|
static Configuration |
getSingleton() |
java.util.List<TwitterAccountConfiguration> |
getTwitterAccounts()
Returns a list of Twitter account configurations that could
be used to instantiate Twitter account objects.
|
public Configuration()
throws java.io.IOException,
org.apache.commons.configuration.ConfigurationException
~/.metrics-bot.xml. It is expected that
this constructor will only ever be called at runtime by the
getSingleton() static method.java.io.IOException - if there are errors reading the XML configuration
from diskorg.apache.commons.configuration.ConfigurationException - if there are errors parsing the XML
configurationpublic static Configuration getSingleton()
public java.util.List<TwitterAccountConfiguration> getTwitterAccounts()
public java.util.List<MastodonAccountConfiguration> getMastodonAccounts()
public java.lang.String getIrcNick()
public java.lang.String getIrcNickServPassword()
public java.util.List<IrcChannelConfiguration> getIrcChannels()