@Override
    public void metadata(MetadataBean metadata) throws ImportNotNeededException {
        try {
            currentMetadata.setId(metadata.getExportedOn() != null ? metadata.getExportedOn().getTime() : null);
            currentMetadata.setExportedOn(metadata.getExportedOn());
            currentMetadata.setApimanVersion(metadata.getApimanVersion());

            if (metadata.getId() != null || metadata.getExportedOn() != null) {
                // Try to determine ID (We use the exportedOn timestamp as ID)
                Long id = metadata.getId() != null ? metadata.getId() : metadata.getExportedOn().getTime();
                MetadataBean metadataBean = storage.getMetadata(id);
                if (metadataBean != null) {
                    throw new ImportNotNeededException("Import not needed.");
                }
            }
        } catch (StorageException e) {
            error(e);
        }
    }
@see io.apiman.manager.api.exportimport.read.IImportReaderDispatcher#metadata(MetadataBean)
manager/api/export-import/src/main/java/io/apiman/manager/api/exportimport/manager/StorageImportDispatcher.java