Package xyz.srnyx.annoyingapi.storage
Class StorageConfig
java.lang.Object
xyz.srnyx.annoyingapi.storage.StorageConfig
The
storage.yml configuration file parser-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassOptions for the data cache (stored differently per method)classThe remote connection details/propertiesstatic enumValid values forstorage.yml'scache.save-onoption -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal @NotNull StorageConfig.CacheThedata cacheoptionsfinal @NotNull AnnoyingFile<?> Thestorage configuration filefinal @NotNull StorageMethodThestorage methodfinal @NotNull StringFriendly name when migrating between methods for logging
Format:FILE_PATH (METHOD)final @Nullable StorageConfig.RemoteConnectionTheremote connectiondetails/properties -
Constructor Summary
ConstructorsConstructorDescriptionStorageConfig(@NotNull AnnoyingFile<?> file) Construct a newStorageConfiginstance to parse a storage configuration file -
Method Summary
Modifier and TypeMethodDescription@NotNull ConnectionCreate a newConnectionto the configured database
-
Field Details
-
file
Thestorage configuration file -
method
Thestorage method -
cache
Thedata cacheoptions -
remoteConnection
Theremote connectiondetails/properties -
migrationLogPrefix
Friendly name when migrating between methods for logging
Format:FILE_PATH (METHOD)
-
-
Constructor Details
-
StorageConfig
Construct a newStorageConfiginstance to parse a storage configuration file- Parameters:
file-file
-
-
Method Details
-
createConnection
Create a newConnectionto the configured database- Returns:
- a new
Connectionto the database - Throws:
ConnectionException- if the connection to the database fails for any reason
-