public final class VacuumdConfigFactory extends Object
Constructor and Description |
---|
VacuumdConfigFactory(InputStream stream)
Constructor for VacuumdConfigFactory.
|
VacuumdConfigFactory(VacuumdConfiguration config)
Constructor for VacuumdConfigFactory.
|
Modifier and Type | Method and Description |
---|---|
Optional<Action> |
getAction(String actionName)
Returns an Action with a name matching the string parmater
|
ActionEvent |
getActionEvent(String name)
getActionEvent
|
Collection<ActionEvent> |
getActionEvents()
getActionEvents
|
Collection<Action> |
getActions()
Returns a Collection of actions defined in the config
|
AutoEvent |
getAutoEvent(String name)
Deprecated.
Use
ActionEvent objects instead. Access these objects with getActionEvent(String) . |
Collection<AutoEvent> |
getAutoEvents()
Returns a Collection of named events to that may have
been configured to be sent after an automation has run.
|
Automation |
getAutomation(String autoName)
Returns an Automation with a name matching the string parameter
|
Collection<Automation> |
getAutomations()
Returns a Collection of automations defined in the config
|
static VacuumdConfigFactory |
getInstance()
Return the singleton instance of this factory.
|
int |
getPeriod()
getPeriod
|
String[] |
getSqlStatements()
getSqlStatements
|
List<Statement> |
getStatements()
getStatements
|
Trigger |
getTrigger(String triggerName)
Returns a Trigger with a name matching the string parameter
|
Collection<Trigger> |
getTriggers()
Returns a Collection of triggers defined in the config
|
static void |
init()
Load the config from the default config file and create the singleton
instance of this factory.
|
static void |
reload()
Reload the config from the default config file
|
static void |
setInstance(VacuumdConfigFactory instance)
Set the singleton instance of this factory.
|
public VacuumdConfigFactory(InputStream stream)
Constructor for VacuumdConfigFactory.
stream
- a InputStream
object.public VacuumdConfigFactory(VacuumdConfiguration config)
Constructor for VacuumdConfigFactory.
Calling reload() on a instance created with method will have no effect.config
- The configuration the use.public static void init() throws IOException
IOException
- Thrown if the specified config file cannot be readIOException
- if any.public static void reload() throws IOException
IOException
- Thrown if the specified config file cannot be read/loadedIOException
- if any.public static VacuumdConfigFactory getInstance()
IllegalStateException
- Thrown if the factory has not yet been initialized.public static void setInstance(VacuumdConfigFactory instance)
instance
- The factory instance to set.public Collection<Automation> getAutomations()
Collection
object.public Collection<Trigger> getTriggers()
Collection
object.public Collection<Action> getActions()
Collection
object.public Collection<AutoEvent> getAutoEvents()
Collection
object.public Collection<ActionEvent> getActionEvents()
getActionEvents
Collection
object.public int getPeriod()
getPeriod
public Trigger getTrigger(String triggerName)
public Optional<Action> getAction(String actionName)
public Automation getAutomation(String autoName)
autoName
- a String
object.Automation
object.public AutoEvent getAutoEvent(String name)
ActionEvent
objects instead. Access these objects with getActionEvent(String)
.public String[] getSqlStatements()
getSqlStatements
String
objects.public ActionEvent getActionEvent(String name)
getActionEvent
name
- a String
object.ActionEvent
object.Copyright © 2021. All rights reserved.