-
Notifications
You must be signed in to change notification settings - Fork 1
GSIP 67
Storing server settings per workspace.
Justin Deoliveira
2.2.x
Under Discussion, In Progress, Completed, Rejected, Deferred
This proposal is the next iteration of having GeoServer support “multi tenancy”, the ability to have multiple “virtual servers” reside in one physical server. To achieve this one must be able to configure each virtual server independently.
This proposal is an extension of the two previously completed proposals:
- [GSIP 44 - Virtual services with workspaces]
- [GSIP 66 - Workspace Local Services]
The first proposal laid most of the groundwork in order to make use of workspace as the virtual services mechanism. The second added the ability to configure OGC services differently per worksapce / virtual service. This proposal allows for configuring other “global” settings per workspace.
The current patch is available here.
The GeoServerInfo
interface encompasses what are referred to as
“global geoserver settings”. This includes things like logging
configuration, JAI settings, server proxy url, etc… Its properties can
be organized into two groups.
- those that are truly global, including: *** logging *** jai *** coverage access *** admin username/password *** update sequence *** feature type cache size *** xml post request log buffer size *** global services flag
- those that could be made specific to a virtual service, including: *** contact information *** title *** number of decimals *** verbose and verbose exceptions *** proxy base url *** charset *** schema base url *** online resource
A new interface, named SettingsInfo is introduced to encapsulate the second set of properties.
The GeoServerInfo interface now has a “settings” property. All properties moved to the new interface are deprecated.
A new method getSettings
is added to the GeoServer
facade. Along with some new methods for
adding,saving, and removing a SettingsInfo
instance.
The get settings method uses the same thread local instance,
LocalWorkspace
, in order to choose the correct settings based on the
current virtual service.
It is important that all client code call GeoServer.getSettings ()
,
and not GeoServerInfo.getSettings ()
in order to obtain the correct
settings based on the local workspace / virtual service. The latter
method will always return the true global settings.
Workspace specific settings are stored in the workspace directory in a
file named settings.xml
data_dir/
global.xml (global)
...
workspaces/
topp/
settings.xml (workspace specific)
...
No settings.xml
is introduced at the top level, rather the settings
are serialized “inline” in the existing global.xml
file. The
contents of global.xml
change from:
<global>
<contact>
<addressCity>Alexandria</addressCity>
<addressCountry>Egypt</addressCountry>
<addressType>Work</addressType>
<contactEmail>[email protected]</contactEmail>
<contactOrganization>The ancient geographes INC</contactOrganization>
<contactPerson>Claudius Ptolomaeus</contactPerson>
<contactPosition>Chief geographer</contactPosition>
</contact>
<charset>UTF-8</charset>
<numDecimals>8</numDecimals>
<onlineResource>http://geoserver.org</onlineResource>
<verbose>false</verbose>
<verboseExceptions>false</verboseExceptions>
<jai>
...
</global>
To:
<global>
<settings>
<contact>
<addressCity>Alexandria</addressCity>
<addressCountry>Egypt</addressCountry>
<addressType>Work</addressType>
<contactEmail>[email protected]</contactEmail>
<contactOrganization>The ancient geographes INC</contactOrganization>
<contactPerson>Claudius Ptolomaeus</contactPerson>
<contactPosition>Chief geographer</contactPosition>
</contact>
<charset>UTF-8</charset>
<numDecimals>8</numDecimals>
<onlineResource>http://geoserver.org</onlineResource>
<verbose>false</verbose>
<verboseExceptions>false</verboseExceptions>
</settings>
...
</global>
Workspace local settings are enabled from the edit page for the workspace.
When enabled, a copy of the global settings are made and stored local to the workspace.
This section should contain feedback provided by PSC members who may have a problem with the proposal.
The configuration changes are backward compatible but not forward
compatible as the global.xml
format is changed.
Andrea Aime: +1 Alessio Fabiani: +1 Ben Caradoc Davies: Gabriel Roldan: +1 Justin Deoliveira: +1 Jody Garnett: +1 Mark Leslie: +1 Rob Atkinson: Simone Giannecchini:
JIRA Task Email Discussion Wiki Page
©2020 Open Source Geospatial Foundation