sonatype/nexus-oss — pull request #835 by cwilper (2014-10-29 05:51:09+00:00)
Title: [NEXUS-7519] Part 1 of 2: Extensible Assets & Refactoring

This is part 1 of 2 for
https://issues.sonatype.org/browse/NEXUS-7519

This is a primarily a refactoring to allow Assets' properties to be extensible as Components are now in master. It also cleans up some no longer used code...most notablly, recordstore (which has been abandoned) and assetstore (which will be subsumed by ComponentStore).

Summary of changes to make assets extensible:
* The base "asset" storage class is concrete; the base "component" storage class remains abstract. This is because components of a given format may find the base asset class sufficient without extending it, whereas it is expected that all formats will define their own format-specific properties at the component level.
* Asset and Component are now both types of Entity, and all entities have a system-generated EntityId. Similarly, a root EntityAdapter class has been created, from which AssetEntityAdapter and ComponentEntityAdapter extend.
* A stored Component provides a Set of EntityIds identifying the Assets it contains.
* There is no longer an assumption that all Assets have a path, but subclasses can specify one if it makes sense for them.
* Asset and Component are still interfaces, but have base impls that provide getters/setters of built-in properties. EntityId (the replacement for ComponentId) is also a concrete class now. This is to cut down on boilerplate code.
* The Asset interface is designed to decouple the source of the input stream from the Asset impl, by means of the Supplier.
* Tests have been updated to go against an extension of the Asset class, TestAsset.