Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for automatically updating capabilities of WMS layers #130

Merged

Conversation

jampukka
Copy link
Member

@jampukka jampukka commented Jan 8, 2018

#86 added possibility to automatically update capabilities of WMTS layers. This PR improves the work done in #86 by adding support for WMS layers. Pulling the information out of WMS Capabilities documents (for both WMS versions 1.1.1 and 1.3.0) is refactored (rewritten).
Also adds possibility to set different update frequency for each and every layer. The update rate is configured via oskari_maplayer.capabilities_update_rate_sec which defaults to 0 (never) making this even more of an opt-in feature.

…rseWMTSCapabilities(String) logic to calling function, did not improve readability
protected static boolean shouldUpdate(OskariLayer layer) {
Date lastUpdated = layer.getCapabilitiesLastUpdated();
if (lastUpdated == null) {
LOG.debug("Should update layer:", layer.getId(), "last updated unknown and update rate is positive");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update rate isn't checked here, but I guess if last update is null we should always update. Maybe change the message a bit?

Copy link
Member Author

@jampukka jampukka Jan 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, the message is a bit misleading, update rate value is just known to be positive because we only requested such layers by calling layerService.findAllWithPositiveUpdateRateSec(). However since that is just known we can just remove that part from the message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants