Skip to content

GSIP 67

Jody Garnett edited this page Jul 12, 2017 · 1 revision

GSIP 67 - Workspace Local Settings

Overview

Storing server settings per workspace.

Proposed By

Justin Deoliveira

Assigned to Release

2.2.x

State

Under Discussion, In Progress, Completed, Rejected, Deferred

Motivation

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.

Proposal

The current patch is available here.

Core configuration api changes

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

SettingsInfo

A new interface, named SettingsInfo is introduced to encapsulate the second set of properties.

GeoServerInfo

The GeoServerInfo interface now has a “settings” property. All properties moved to the new interface are deprecated.

GeoServer

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.

GeoServerInfo.getSettings () vs GeoServer.getSettings ()

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.

Data Directory

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>claudius.ptolomaeus@gmail.com</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>claudius.ptolomaeus@gmail.com</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>

Web UI

Workspace local settings are enabled from the edit page for the workspace.

image

When enabled, a copy of the global settings are made and stored local to the workspace.

image

Feedback

This section should contain feedback provided by PSC members who may have a problem with the proposal.

Backwards Compatibility

The configuration changes are backward compatible but not forward compatible as the global.xml format is changed.

Voting

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:

Links

JIRA Task Email Discussion Wiki Page

Clone this wiki locally