public interface Importer<Entity,ExportedType>
The implementations MUST provide a no-arg public constructor.
| Modifier and Type | Method and Description |
|---|---|
void |
configure(org.rhq.core.domain.configuration.Configuration importConfiguration)
Configures the importer.
|
String |
finishImport()
Finishes the import.
|
Set<EntityValidator<ExportedType>> |
getEntityValidators()
The set of entity validators that should be called on each entity before
the import actually starts.
|
ExportedEntityMatcher<Entity,ExportedType> |
getExportedEntityMatcher()
Returns an entity matcher that can match the entities from the export file
with the real entities in the database.
|
org.rhq.core.domain.configuration.definition.ConfigurationDefinition |
getImportConfigurationDefinition()
A configuration definition describing the configuration of the importer and
the default values for individual properties.
|
ExportedType |
unmarshallExportedEntity(ExportReader reader)
Unmarshalls an entity from the provided reader.
|
void |
update(Entity entity,
ExportedType exportedEntity)
Updates the entity with the data from the export.
|
org.rhq.core.domain.configuration.definition.ConfigurationDefinition getImportConfigurationDefinition()
The returned configuration definition MUST define a default template.
void configure(org.rhq.core.domain.configuration.Configuration importConfiguration)
importConfiguration - the configuration of the import as defined by the getImportConfigurationDefinition()ExportedEntityMatcher<Entity,ExportedType> getExportedEntityMatcher()
Set<EntityValidator<ExportedType>> getEntityValidators()
void update(Entity entity, ExportedType exportedEntity) throws Exception
This method is responsible for persisting the entity in the database
using the provided entityManager. Note that the actual persist can
also be delayed until the finishImport() method is called
so that the importer can take advantage of batching.
entity - the entity to persist (may be null if the getExportedEntityMatcher() returned null of if the entity matcher didn't find a match)exportedEntity - the entity found in the export file that should be used to update the entity in the databaseExceptionExportedType unmarshallExportedEntity(ExportReader reader) throws XMLStreamException
reader - XMLStreamExceptionString finishImport() throws Exception
updated.
This is useful for importers that need to batch the updates to the database.
ExceptionCopyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.