### Database access class for Office DCS ####

For the DCS, we need a database, holding all currently running DCS server connection parameters.
Whenever a DCS is started, it connects to the DCS database and registers itself with the following data within the DCS
database:

- ID (UUID, if not provided via the DCS server config)
- Host (IP Address, automatically obtained after startup of the DCS server)
- Interface (Defaulted, if not provided)
- JMSPort (Defaulted, if not provided)

For this purpose, the class com.openexchange.office.dcs.DCSDatase has been created,
subclassing the DocumentsDatabase class.

The com.openexchange.office.dcs bundle contains a resource directory, having the Liquibase initialization
files in it.

For the DCS database, the location of the related Liquibase files is at the
com.openexchange.office.dcs/resource/dcsdatbase/ folder,
whose content is provided via the DatabaseResource accessor interface (implemented by the class
com.openexchange.office.dcs.DCSDatabaseResourceAccessor) when creating the DCSDatabase.

The DCSDatabase itself offers the following methods for register/unregister and retrieval of all registered DCS servers:

    public @NonNull List<DCSRegistryItem> getRegisteredDCSItems() throws DatabaseException

    public void registerDCSItem(@NonNull final DCSRegistryItem item) throws DatabaseException
    public void unregisterDCSItem(@NonNull final DCSRegistryItem item) throws DatabaseException


The DCSDatabase instance is created and used within the DCS instance only.
After startup, the DCS server registers itself with its own pamareters at the DCS database.
At shutdown, the DCS server unregisters itself at the DCS database.

The list of all currently registered  DCS servers can be obtained via the above mentioned getRegisteredDCSItems() method.

### DCS database creation #####

The open-xchange-documents-collaboration package already contains a script to create a MySQL database, according to other
scripts, already used for the creation of initial databases at Ox. The script is located after deplyoing a DCS server at
the following location:

/opt/open-xchange/documents-collaboration/sbin/initdcsdb.sh

The script needs to be called by the admin before the first DCS server start in order to create the initial DCS database
within a MySQL server.

The name of the database should be 'dcsdb', all needed tables will be created by the DCSDatabase via a Liquibase update
during the DCS server startup.

### DCS configuration #####

The DCS configuration had to be changed, since registering is now done on DCS server side only. If other clients or servers
need to get a list of all running DCS servers, the DCSDatabase has to be used.

For this purpose, the documents-collaboration.properties file (located on DCS server side) has been extended to contain
the DCS server data itself (defaulted as much as possible) as well as the DCSDatabase connection data (defaulted as much as
possible).

In general, the admin of a DCS server deployment needs to change the following items of documents-collaboration.properties,
at least. All other values can be left at their defaults:

com.openexchange.dcs.database.read.connectionURL=
com.openexchange.dcs.database.read.userName=
com.openexchange.dcs.database.read.password=

and

com.openexchange.dcs.database.write.connectionURL=
com.openexchange.dcs.database.write.userName=
com.openexchange.dcs.database.write.password=

A valid documents-collaboration.properties file could look like the following (tested):

************************************************************************************************************************
************************************************************************************************************************

# Define an unique ID for THIS DCS
#
# If no unique ID is provided, a unique one will be generated,
# that is valid and used for the runtime of this DCS instance.
#
# Note : The ID must contain letters in set [-_A-Za-z0-9] only.
#        A malformed ID exception is thrown otherwise at runtime.
# default = generated runtime UUID
com.openexchange.dcs.id=

# Define a network interface binding for THIS DCS
# Use 127.0.0.1 for private binding on local machine only.
# Use 0.0.0.0 for public binding on all interfaces.
# default = 127.0.0.1
com.openexchange.dcs.interface=

# Define the JMS Port for THIS DCS
# default = 61616
com.openexchange.dcs.port.jms=

# Driver class, URL, user name and password for the DCS read database connection
# Default: com.mysql.jdbc.Driver
com.openexchange.dcs.database.driverClass=com.mysql.jdbc.Driver
com.openexchange.dcs.database.connectionURL=jdbc:mysql://localhost:3306/dcsdb
com.openexchange.dcs.database.userName=openexchange
com.openexchange.dcs.database.password=secret

************************************************************************************************************************
************************************************************************************************************************










