Scope: client and server, all versions.
This configures a PostgreSQL store. There are several options, but most of them are optional. See the document on setting up the database and follow the instructions there before trying to connect with it. Note that there may be many stores for a configuration if each of them, e.g. requires different connection information.
Attribute | Required? | Default | Description |
username | Y | N/A | The name of the user to use |
password | Y | N/A | The password for the user |
host | N | localhost | The host. (localhost) |
port | N | 5432 | The port for the connection. |
driver | N | org.postgresql.Driver | The JDBC driver (current) |
database | N | spec | The name of the database. |
schema | N | spec | The schema for the database |
tablename | N | spec | The name of the table for this. |
prefix | N | (none) | An optional prefix for the table. |
parameters | N | (none) | An optional extra set of parameters to pass to the JDBC driver. This is of the form key0=value0&key1=value1&key2=value2... Note that each key/value pair is separated with an ampersand. Note that OA4MP does all connections using UTF8 so that parameter is always added. |
useSSL | N | false | Try to connect to the database using SSL support. This presumes you have configured the database to use SSL. |
The spec refers to the specification. Defaults are given there and
applied.
<config> <server address="http://localhost/oauth"> <postgresql username="foo" password="bar" useSSL="true"> <transactions/> <clients/> <clientApprovals/> </postgresql> </server> <config>
Dumps everything into postgresql, uses the defaults for myproxy and disables mail notifications. Note that all the defaults for schemas &c. are used. Also notice that the connection will run over SSL.
In this case, there are multiple users who need specific access to stores.
<config> <server address="https://localhost/oauth"> <postgresql username="client-admin" password="changeme"> <clients/> </postgresql> <postgresql usernname="approver-admin" password="changeme2"> <clientApprovals/> </postgresql> <!-- other configuration as needed --> </server> </config>
This will put the clients and approvals under two different accounts, neither of which requires SSL. The default MyProxy server is used. Since no store for the transactions are specified, they will reside in memory only.
Example 3. A really fancy one.
if you needed to specify a great deal of specific information about a table, here is how you would do it:
<postgresql username="foo" password="bar" driver="org.postgresql.Driver" port="4771" schema="atmos" database="oauth" tablename="trans" prefix="ocd"> <transactions/> </postgresql>
This specifies a (very) non-standard port for PostgreSQL as well as specific information about the database, schema
and tablename. This looks in the database named oauth for the table atmos.ocd_trans
and puts
all transactions there.
In the next example, a fully functional PostgreSQL client asset store is configured.
<config> <client name="my-cfg"> <postgresql username="fionna" password="sekret" schema="oa4mp" database="client"> <assetStore/> </postgresql> <!-- other stuff --> </client> </config>This stores the assets in the schema named "oa4mp" in the database named "client" and in the default table named "assets"