Closed GoogleCodeExporter closed 8 years ago
Fixed r1637.
Adding a feature where updates to the Manager configuration are locked out if a
lock property is missing or set to 'true' in the applicationContext.properties
file. Also drop a latch when the Connector Manager configuration is
successfully
changed that has to be removed manually.
Note to Users and Developers:
Versions of the Connector Manager built with this patch will now latch the
Connector Manager configuration settings. The SetManagerConfig Servlet will be
locked out if; A) the applicationContext.properties file does not contain a
'manager.locked' property as part of the upgrade, or B) the 'manager.locked'
property is set to 'true' after successfully setting the Connector Manager
configuration.
If an attempt is made to set the Connector Manager configuration to a new host
or port while it's latched the Servlet will reply with a status of 5416 and a
log entry should appear as follows:
WARNING: Attempt has been made to change configuration on a locked Connector
Manager. You must update the locked property on the Connector Manager before
continuing.
Request: feederGateHost=<new_host_value>; feederGatePort=<new_port_value>
To unlock a latched Connector Manager simply edit the
WEB-INF/appliationContext.properties file in the deployed WebApp and change the
value of the 'manager.locked' property to false as follows:
manager.locked=false
NOTE: This can be done while the Connector Manager is running. There is no need
to restart the server or redeploy the Web App. The changes to the property file
will be detected the next time the request is made to the Connector Manager
Servlet to SetManagerConfig.
Tests Passed:
- All Unit Tests
- Tested with two GSAs. Registered CM with first GSA and then tried to register
with second. Second attempt failed with status code 5416. Was able to
reregister the CM with the initial GSA.
Original comment by mgron...@gmail.com
on 4 Apr 2009 at 3:42
Original comment by mgron...@gmail.com
on 4 Apr 2009 at 3:48
Further testing revealed a bug in the Issue 138 changes committed
with r1637. Specifically, Java Properties.store() cannot handle
comments with embedded newlines.
Since we wrap Properties.store() inside PropertiesUtils, I
enhanced PropertiesUtils.storeProperties() to correctly comment
out multiline comments.
I also improved the properties file comment string, providing
better definition as to the names of the properties documented.
I changed the default applicationContext.properties file to
reflect the ehnanced property documentation.
I bumped the googlePropertiesVersion so we can differentiate
older properties files from ones that should have the latch.
Lastly, I enhanced Contex.isManagerLocked() to consider that
older version applicationContext.properties files that have
not been configured (gsa.feed.host is still 'localhost'), as
unlocked.
Change Log:
----------
M
connector-manager/source/java/com/google/enterprise/connector/common/PropertiesU
tils.java
- handle multi-line comments written to Properties files.
- bump googlePropertiesVersion.
M
connector-manager/source/java/com/google/enterprise/connector/manager/Context.ja
va
- clarified properties documentation comment.
- consider old, unconfigured properties files as unlocked.
M connector-manager/etc/applicationContext.properties
- enhanced comments to reflect the one generated by Context.
Fixed on the trunk in Connector Manager Revision r1652 06 April 2009
Fixed on the 1.3.x branch in Connector Manager Revision r1653 06 April 2009
Original comment by Brett.Mi...@gmail.com
on 6 Apr 2009 at 11:49
Original issue reported on code.google.com by
mgron...@gmail.com
on 4 Apr 2009 at 3:38