#1305 closed enhancement (fixed)
Maestro API: Pluggable server connection implementations
Reported by: | jng | Owned by: | jng |
---|---|---|---|
Priority: | high | Milestone: | Maestro-3.0 |
Component: | Maestro | Version: | |
Severity: | major | Keywords: | maestro, connection, api |
Cc: | External ID: |
Description
The current ServerConnectionI interface has 2 known implementations:
What would be really useful is if we can create these specific implementations in a generic/consistent manner. This way, we allow room to plug in different implementations (say a GeoREST wrapper) in the near future.
To achieve this, we can follow the way it is done in FDO, using a connection provider "registry". Each specific implementation is identified in the registry by a unique name. For example:
- Maestro.HTTP for the HttpServerConnection
- Maestro.Local for the LocalNativeConnection
Initialization parameters can be encapsulated in the form of a connection string. A connection string for a Maestro.HTTP connection may look like:
MapAgent=http://localhost:8008/mapguide/mapagent/mapagent.fcgi;Username=Administrator;Password=admin
A connection string for Maestro.Local may look like:
ConfigPath=C:\MapGuide\webconfig.ini;Username=Administrator;Password=admin
The syntax to obtaining a ServerConnectionI reference without having to instantiate the specific type would be something like:
ServerConnectionI httpConn = ConnectionProviderRegistry.CreateConnection("Maestro.HTTP", "MapAgent=http://localhost:8008/mapguide/mapagent/mapagent.fcgi;Username=Administrator;Password=admin");
To guide users to using this new API, the constructors of HttpServerConnection and LocalNativeConnection will be marked with the Obsolete attribute, indicating that it will be removed in a future version.
Fixed in r4739