Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 335865

Summary: [metadata] Provide serialization API
Product: [Eclipse Project] Equinox Reporter: Pascal Rapicault <pascal>
Component: p2Assignee: Pascal Rapicault <pascal>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: antonel.pazargic, dj.houghton, igor, jeffmcaffer, kim.moir, slewis
Version: 3.7   
Target Milestone: 3.7 M6   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Pascal Rapicault CLA 2011-01-31 11:32:39 EST
There are cases where ppl just need to store IUs on disk into a file without having to go through the complexity (and potential scalability issues) of the repository manager.
Comment 1 Igor Fedorenko CLA 2011-01-31 11:46:12 EST
Would it be possible to also add API to serialize/deserialize List<IArtifact>?
Comment 2 Jeff McAffer CLA 2011-01-31 22:39:01 EST
understood but we do need to take care of API contract issues. If they are written out then they have to be readable.  Haven't we recreated the repository structure then?
Comment 3 Pascal Rapicault CLA 2011-01-31 22:47:17 EST
> understood but we do need to take care of API contract issues. If they are written out then they have to be readable.  Haven't we recreated the repository structure then?
  Please detail your concerns.
  This API will write out a set of IUs and read them back. Nothing is to be specified about the format of the file. The only contract will be that we want the reader to be able to read back some old formats
The current implementation (not committed) uses the MetadataWriter class which generates something equivalent to the <units/> element found in a repo.
Comment 4 Jeff McAffer CLA 2011-01-31 22:56:01 EST
i see.  So the serialized form will not be API.  great.  Thanks for the clarification.
Comment 5 Pascal Rapicault CLA 2011-02-01 14:25:58 EST
I have released two classes called IUSerializer and IUDeserializer in a package called org.eclipse.equinox.p2.metadata.io in the p2.metadata.repository bundle.
Comment 6 Pascal Rapicault CLA 2011-02-01 15:33:10 EST
Reopening, I missed the need to serialize IArtifactDescriptor...
Comment 7 Pascal Rapicault CLA 2011-02-05 00:28:01 EST
Given that it does not really make sense to just be able to store artifact descriptors by themselves, the only API that will be provided is for IUs.