Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for simple read-only WebDAV properties
This patch adds initial support in dCache for supporting WebDAV. Only three read-only file-based properties are added (AccessLatency, RetentionPolicy and Checksums), but I've marked in the code where dCache is notified of any requested changes to property values. Some observations: 1. Milton provides two levels of abstraction when answering queries about properties. One (implemented in this patch) is based on the Resource implementing the MultiNamespaceCustomPropertyResource interface. The other involves creating classes for handling property queries and updates (the former is implemented based on the latter). The latter has the benefit of separating the property-handling code from the other aspects of file and directory management. If the property-handling code grows to dominate the Dcache{File,Directory}Resource classes then this might be a convenient way of factoring out that code. 2. Milton asks for the Resource before parsing the XML body of the client's PROPFIND or PROPPATCH request. After processing the XML, Milton iterates over the list of properties to modify, query or remove. Static metadata is obtained before any operation, so it can filter-out attempts to query an unknown property, or to modify a read-only property. The combination of processing the XML and processing the properties iteratively means the webdav door must either fetch all potentially useful attributes when building the Resource, or it will send a message for each requested property. Neither is terribly appealing; I went for the former for now, but we should fix this in the future. 3. If a client sends a malformed XML statement then Milton will log a stack-trace. This seems overkill, but I've left that as-is for now as it may need to be fixed upstream. 4. I've unilaterally adopted the SRM namespace for reporting access latency and retention policy of the file. The patch also modifies the RFC-3230 support to honour the 'Want-Digest' request header only if the method is GET or HEAD. RFC-3230 is only defined for GET (and HEAD must return the same headers as GET would have returned). The patch adds some support in FileAttributes for returning a Guava Optional object. The semantics are: get<ATTRIBUTE-NAME> method is use when a missing attribute is a bug. get<ATTRIBUTE-NAME>IfPresent is used when a missing attribute is not (necessarily) a bug. Target: master Requires-notes: yes Requires-book: yes Patch: http://rb.dcache.org/r/6270/ Acked-by: Gerd Behrmann
- Loading branch information
1 parent
021b410
commit 6ace876
Showing
6 changed files
with
193 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters