Package io.atlasmap.core
Class ADMArchiveHandler
java.lang.Object
io.atlasmap.core.ADMArchiveHandler
The API for handling ADM archive. It encapsulates ADM archive structure
and format and isolate file/stream I/O from other part.
ADM archive is a zipped archive file or its exploded directory which contains
- Mapping Definition file (atlasmapping-UI.n.json)
- Gzipped digest file which contains all non-Java document metadata and mapping definition in a single JSON file (adm-catalog-files-n.gz)
- Java libraries (jar files in lib/ directory)
load(Path)
export(OutputStream)
This handler follows lazy loading strategy as much as
possible, i.e. defer to serialize/deserialize until it is really required.
Also note that at this moment Java library directory is not managed by this class.
Only when it imports/exports ADM archive file, library jars are extracted/bundled
if
isIgnoreLibrary()
is set to false
.
TODO
https://github.com/atlasmap/atlasmap/issues/1476
A gzipped digest file have to be splitted into individual schemas and a catalog file.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
void
export
(OutputStream out) Export into an ADM archive.getDataSourceMetadata
(boolean isSource, String documentId) byte[]
byte[]
boolean
void
load
(AtlasContextFactory.Format format, InputStream in) Load an ADM archive or mapping definition from stream.void
load
(InputStream in) Load an ADM archive from stream.void
Load an ADM archive file, an exploded directory or mapping definition JSON file.void
persist()
Persist ADM archive into a directory.void
void
setIgnoreLibrary
(boolean ignoreLib) void
setLibraryDirectory
(Path dir) void
setMappingDefinition
(AtlasMapping mapping) void
void
void
setPersistDirectory
(Path dir)
-
Constructor Details
-
ADMArchiveHandler
public ADMArchiveHandler() -
ADMArchiveHandler
-
-
Method Details
-
load
Load an ADM archive file, an exploded directory or mapping definition JSON file.- Parameters:
path
-java.nio.file.Path
of the ADM archive file or an exploded directory- Throws:
AtlasException
- If it fails to load
-
load
Load an ADM archive from stream.- Parameters:
in
- InputStream to read an ADM Archive- Throws:
AtlasException
- If it fails to load
-
load
Load an ADM archive or mapping definition from stream.- Parameters:
format
-AtlasContextFactory.Format
to indicate stream formatin
- InputStream to read an ADM Archive- Throws:
AtlasException
- If it fails to load
-
export
Export into an ADM archive.- Parameters:
out
- OutputStream to write an ADM archive- Throws:
AtlasException
- If it fails to export
-
persist
Persist ADM archive into a directory.- Throws:
AtlasException
- If it fails to persist
-
getMappingDefinition
-
setMappingDefinition
-
setMappingDefinitionBytes
- Throws:
AtlasException
-
getMappingDefinitionBytes
- Throws:
AtlasException
-
setGzippedADMDigest
- Throws:
AtlasException
-
getGzippedADMDigestBytes
public byte[] getGzippedADMDigestBytes() -
getDataSourceMetadata
public DataSourceMetadata getDataSourceMetadata(boolean isSource, String documentId) throws AtlasException - Throws:
AtlasException
-
getDataSourceMetadata
- Throws:
AtlasException
-
getDataSourceMetadataMap
- Throws:
AtlasException
-
cloneMappingDefinition
- Throws:
AtlasException
-
clear
public void clear() -
setIgnoreLibrary
public void setIgnoreLibrary(boolean ignoreLib) -
isIgnoreLibrary
public boolean isIgnoreLibrary() -
setPersistDirectory
- Throws:
AtlasException
-
setLibraryDirectory
- Throws:
AtlasException
-
setMappingDefinitionId
-
getGzippedADMDigestFileName
-
getMappingDefinitionFileName
-