Class CityGMLImportManager
- java.lang.Object
-
- org.citydb.citygml.importer.database.content.CityGMLImportManager
-
- All Implemented Interfaces:
CityGMLImportHelper
public class CityGMLImportManager extends java.lang.Object implements CityGMLImportHelper
-
-
Constructor Summary
Constructors Constructor Description CityGMLImportManager(java.sql.Connection connection, AbstractDatabaseAdapter databaseAdapter, SchemaMapping schemaMapping, org.citygml4j.builder.jaxb.CityGMLBuilder cityGMLBuilder, WorkerPool<DBXlink> xlinkPool, IdCacheManager idCacheManager, AffineTransformer affineTransformer, InternalConfig internalConfig, Config config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
java.lang.String
convertImplicitGeometryTransformationMatrix(org.citygml4j.model.citygml.core.TransformationMatrix4x4 transformationMatrix)
protected void
delegateToADEImporter(org.citygml4j.model.gml.base.AbstractGML object, long objectId, AbstractObjectType<?> objectType)
void
executeBatch()
void
executeBatch(java.lang.String tableName)
void
executeBatch(AbstractObjectType<?> type)
void
executeBatch(TableEnum table)
java.lang.String
generateNewGmlId()
AbstractObjectType<?>
getAbstractObjectType(org.citygml4j.model.gml.base.AbstractGML object)
AffineTransformer
getAffineTransformer()
java.util.Map<org.citygml4j.model.gml.GMLClass,java.lang.Long>
getAndResetGeometryCounter()
java.util.List<ImportLogger.ImportLogEntry>
getAndResetImportLogEntries()
java.util.Map<java.lang.Integer,java.lang.Long>
getAndResetObjectCounter()
AttributeValueJoiner
getAttributeValueJoiner()
org.citygml4j.builder.jaxb.CityGMLBuilder
getCityGMLBuilder()
AbstractDatabaseAdapter
getDatabaseAdapter()
ExternalFileChecker
getExternalFileChecker()
FeatureType
getFeatureType(org.citygml4j.model.gml.feature.AbstractFeature feature)
GeometryConverter
getGeometryConverter()
long
getGeometryIdFromMemory(java.lang.String gmlId)
ImportConfig
getImportConfig()
<T extends DBImporter>
TgetImporter(java.lang.Class<T> type)
InternalConfig
getInternalConfig()
LocalAppearanceHandler
getLocalAppearanceHandler()
long
getNextSequenceValue(java.lang.String sequence)
int
getObjectClassId(org.citygml4j.model.gml.base.AbstractGML object)
long
getObjectId(java.lang.String gmlId)
java.lang.String
getObjectSignature(org.citygml4j.model.gml.base.AbstractGML object)
protected java.lang.String
getObjectSignature(org.citygml4j.model.gml.base.AbstractGML object, java.lang.String gmlId)
ObjectType
getObjectType(org.citygml4j.model.gml.base.AbstractGML object)
java.lang.String
getTableNameWithSchema(java.lang.String tableName)
long
getTextureImageId(java.lang.String resourceId)
protected boolean
hasADESupport()
void
importExternalReference(org.citygml4j.model.citygml.core.ExternalReference externalReference, long cityObjectId)
void
importGenericAttribute(org.citygml4j.model.citygml.generics.AbstractGenericAttribute genericAttribute, long cityObjectId)
void
importGenericAttribute(org.citygml4j.model.citygml.generics.AbstractGenericAttribute genericAttribute, long parentId, long rootId, long cityObjectId)
long
importGlobalAppearance(org.citygml4j.model.citygml.appearance.Appearance appearance)
long
importImplicitGeometry(org.citygml4j.model.citygml.core.ImplicitGeometry implicitGeometry)
long
importObject(org.citygml4j.model.gml.base.AbstractGML object)
long
importObject(org.citygml4j.model.gml.base.AbstractGML object, ForeignKeys foreignKeys)
long
importSurfaceGeometry(org.citygml4j.model.gml.geometry.AbstractGeometry surfaceGeometry, long cityObjectId)
boolean
isFailOnError()
boolean
isPointOrLineGeometry(org.citygml4j.model.gml.geometry.AbstractGeometry abstractGeometry)
boolean
isSurfaceGeometry(org.citygml4j.model.gml.geometry.AbstractGeometry abstractGeometry)
void
logOrThrowErrorMessage(java.lang.String message)
void
logOrThrowUnsupportedGeometryMessage(org.citygml4j.model.gml.base.AbstractGML from, org.citygml4j.model.gml.geometry.AbstractGeometry geometry)
void
logOrThrowUnsupportedXLinkMessage(org.citygml4j.model.gml.base.AbstractGML from, java.lang.Class<? extends org.citygml4j.model.gml.base.AbstractGML> to, java.lang.String xlink)
protected boolean
lookupAndPutObjectId(java.lang.String gmlId, long id, int objectClassId)
java.lang.String
marshalObject(org.citygml4j.model.common.base.ModelObject object, org.citygml4j.model.module.ModuleType... moduleTypes)
void
propagateObjectXlink(java.lang.String table, long objectId, java.lang.String xlink, java.lang.String propertyColumn)
void
propagateObjectXlink(java.lang.String intermediateTable, long objectId, java.lang.String fromColumn, java.lang.String xlink, java.lang.String toColumn)
void
propagateReverseObjectXlink(java.lang.String toTable, java.lang.String gmlId, long objectId, java.lang.String propertyColumn)
void
propagateSurfaceGeometryXlink(java.lang.String xlink, java.lang.String table, long objectId, java.lang.String propertyColumn)
void
propagateXlink(DBXlink xlink)
void
putGeometryId(java.lang.String gmlId, long id, long rootId, boolean reverse, java.lang.String mapping)
void
putObjectId(java.lang.String gmlId, long id, int objectClassId)
void
putObjectId(java.lang.String gmlId, long id, java.lang.String mapping, int objectClassId)
void
putTextureImageId(java.lang.String resourceId, long id)
void
setFailOnError(boolean failOnError)
protected void
updateGeometryCounter(org.citygml4j.model.gml.GMLClass type)
protected void
updateObjectCounter(org.citygml4j.model.gml.base.AbstractGML object, int objectClassId, long id)
protected void
updateObjectCounter(org.citygml4j.model.gml.base.AbstractGML object, AbstractObjectType<?> type, long id)
-
-
-
Constructor Detail
-
CityGMLImportManager
public CityGMLImportManager(java.sql.Connection connection, AbstractDatabaseAdapter databaseAdapter, SchemaMapping schemaMapping, org.citygml4j.builder.jaxb.CityGMLBuilder cityGMLBuilder, WorkerPool<DBXlink> xlinkPool, IdCacheManager idCacheManager, AffineTransformer affineTransformer, InternalConfig internalConfig, Config config) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
-
Method Detail
-
importObject
public long importObject(org.citygml4j.model.gml.base.AbstractGML object) throws CityGMLImportException, java.sql.SQLException
- Specified by:
importObject
in interfaceCityGMLImportHelper
- Throws:
CityGMLImportException
java.sql.SQLException
-
importObject
public long importObject(org.citygml4j.model.gml.base.AbstractGML object, ForeignKeys foreignKeys) throws CityGMLImportException, java.sql.SQLException
- Specified by:
importObject
in interfaceCityGMLImportHelper
- Throws:
CityGMLImportException
java.sql.SQLException
-
delegateToADEImporter
protected void delegateToADEImporter(org.citygml4j.model.gml.base.AbstractGML object, long objectId, AbstractObjectType<?> objectType) throws CityGMLImportException, java.sql.SQLException
- Throws:
CityGMLImportException
java.sql.SQLException
-
importGlobalAppearance
public long importGlobalAppearance(org.citygml4j.model.citygml.appearance.Appearance appearance) throws CityGMLImportException, java.sql.SQLException
- Specified by:
importGlobalAppearance
in interfaceCityGMLImportHelper
- Throws:
CityGMLImportException
java.sql.SQLException
-
importSurfaceGeometry
public long importSurfaceGeometry(org.citygml4j.model.gml.geometry.AbstractGeometry surfaceGeometry, long cityObjectId) throws CityGMLImportException, java.sql.SQLException
- Specified by:
importSurfaceGeometry
in interfaceCityGMLImportHelper
- Throws:
CityGMLImportException
java.sql.SQLException
-
importImplicitGeometry
public long importImplicitGeometry(org.citygml4j.model.citygml.core.ImplicitGeometry implicitGeometry) throws CityGMLImportException, java.sql.SQLException
- Specified by:
importImplicitGeometry
in interfaceCityGMLImportHelper
- Throws:
CityGMLImportException
java.sql.SQLException
-
importExternalReference
public void importExternalReference(org.citygml4j.model.citygml.core.ExternalReference externalReference, long cityObjectId) throws CityGMLImportException, java.sql.SQLException
- Throws:
CityGMLImportException
java.sql.SQLException
-
importGenericAttribute
public void importGenericAttribute(org.citygml4j.model.citygml.generics.AbstractGenericAttribute genericAttribute, long cityObjectId) throws CityGMLImportException, java.sql.SQLException
- Throws:
CityGMLImportException
java.sql.SQLException
-
importGenericAttribute
public void importGenericAttribute(org.citygml4j.model.citygml.generics.AbstractGenericAttribute genericAttribute, long parentId, long rootId, long cityObjectId) throws CityGMLImportException, java.sql.SQLException
- Throws:
CityGMLImportException
java.sql.SQLException
-
isSurfaceGeometry
public boolean isSurfaceGeometry(org.citygml4j.model.gml.geometry.AbstractGeometry abstractGeometry)
- Specified by:
isSurfaceGeometry
in interfaceCityGMLImportHelper
-
isPointOrLineGeometry
public boolean isPointOrLineGeometry(org.citygml4j.model.gml.geometry.AbstractGeometry abstractGeometry)
- Specified by:
isPointOrLineGeometry
in interfaceCityGMLImportHelper
-
getGeometryConverter
public GeometryConverter getGeometryConverter()
- Specified by:
getGeometryConverter
in interfaceCityGMLImportHelper
-
convertImplicitGeometryTransformationMatrix
public java.lang.String convertImplicitGeometryTransformationMatrix(org.citygml4j.model.citygml.core.TransformationMatrix4x4 transformationMatrix)
- Specified by:
convertImplicitGeometryTransformationMatrix
in interfaceCityGMLImportHelper
-
getDatabaseAdapter
public AbstractDatabaseAdapter getDatabaseAdapter()
- Specified by:
getDatabaseAdapter
in interfaceCityGMLImportHelper
-
propagateObjectXlink
public void propagateObjectXlink(java.lang.String table, long objectId, java.lang.String xlink, java.lang.String propertyColumn)
- Specified by:
propagateObjectXlink
in interfaceCityGMLImportHelper
-
propagateObjectXlink
public void propagateObjectXlink(java.lang.String intermediateTable, long objectId, java.lang.String fromColumn, java.lang.String xlink, java.lang.String toColumn)
- Specified by:
propagateObjectXlink
in interfaceCityGMLImportHelper
-
propagateReverseObjectXlink
public void propagateReverseObjectXlink(java.lang.String toTable, java.lang.String gmlId, long objectId, java.lang.String propertyColumn)
- Specified by:
propagateReverseObjectXlink
in interfaceCityGMLImportHelper
-
propagateSurfaceGeometryXlink
public void propagateSurfaceGeometryXlink(java.lang.String xlink, java.lang.String table, long objectId, java.lang.String propertyColumn)
- Specified by:
propagateSurfaceGeometryXlink
in interfaceCityGMLImportHelper
-
getObjectClassId
public int getObjectClassId(org.citygml4j.model.gml.base.AbstractGML object)
- Specified by:
getObjectClassId
in interfaceCityGMLImportHelper
-
getFeatureType
public FeatureType getFeatureType(org.citygml4j.model.gml.feature.AbstractFeature feature)
- Specified by:
getFeatureType
in interfaceCityGMLImportHelper
-
getObjectType
public ObjectType getObjectType(org.citygml4j.model.gml.base.AbstractGML object)
- Specified by:
getObjectType
in interfaceCityGMLImportHelper
-
getAbstractObjectType
public AbstractObjectType<?> getAbstractObjectType(org.citygml4j.model.gml.base.AbstractGML object)
- Specified by:
getAbstractObjectType
in interfaceCityGMLImportHelper
-
executeBatch
public void executeBatch(java.lang.String tableName) throws CityGMLImportException, java.sql.SQLException
- Specified by:
executeBatch
in interfaceCityGMLImportHelper
- Throws:
CityGMLImportException
java.sql.SQLException
-
executeBatch
public void executeBatch(AbstractObjectType<?> type) throws CityGMLImportException, java.sql.SQLException
- Specified by:
executeBatch
in interfaceCityGMLImportHelper
- Throws:
CityGMLImportException
java.sql.SQLException
-
getTableNameWithSchema
public java.lang.String getTableNameWithSchema(java.lang.String tableName)
- Specified by:
getTableNameWithSchema
in interfaceCityGMLImportHelper
-
getNextSequenceValue
public long getNextSequenceValue(java.lang.String sequence) throws java.sql.SQLException
- Specified by:
getNextSequenceValue
in interfaceCityGMLImportHelper
- Throws:
java.sql.SQLException
-
getAttributeValueJoiner
public AttributeValueJoiner getAttributeValueJoiner()
- Specified by:
getAttributeValueJoiner
in interfaceCityGMLImportHelper
-
logOrThrowUnsupportedXLinkMessage
public void logOrThrowUnsupportedXLinkMessage(org.citygml4j.model.gml.base.AbstractGML from, java.lang.Class<? extends org.citygml4j.model.gml.base.AbstractGML> to, java.lang.String xlink) throws CityGMLImportException
- Specified by:
logOrThrowUnsupportedXLinkMessage
in interfaceCityGMLImportHelper
- Throws:
CityGMLImportException
-
logOrThrowUnsupportedGeometryMessage
public void logOrThrowUnsupportedGeometryMessage(org.citygml4j.model.gml.base.AbstractGML from, org.citygml4j.model.gml.geometry.AbstractGeometry geometry) throws CityGMLImportException
- Specified by:
logOrThrowUnsupportedGeometryMessage
in interfaceCityGMLImportHelper
- Throws:
CityGMLImportException
-
logOrThrowErrorMessage
public void logOrThrowErrorMessage(java.lang.String message) throws CityGMLImportException
- Specified by:
logOrThrowErrorMessage
in interfaceCityGMLImportHelper
- Throws:
CityGMLImportException
-
getObjectSignature
public java.lang.String getObjectSignature(org.citygml4j.model.gml.base.AbstractGML object)
- Specified by:
getObjectSignature
in interfaceCityGMLImportHelper
-
isFailOnError
public boolean isFailOnError()
- Specified by:
isFailOnError
in interfaceCityGMLImportHelper
-
getImportConfig
public ImportConfig getImportConfig()
- Specified by:
getImportConfig
in interfaceCityGMLImportHelper
-
getInternalConfig
public InternalConfig getInternalConfig()
-
setFailOnError
public void setFailOnError(boolean failOnError)
-
hasADESupport
protected boolean hasADESupport()
-
generateNewGmlId
public java.lang.String generateNewGmlId()
-
getLocalAppearanceHandler
public LocalAppearanceHandler getLocalAppearanceHandler()
-
getAffineTransformer
public AffineTransformer getAffineTransformer()
-
getExternalFileChecker
public ExternalFileChecker getExternalFileChecker()
-
propagateXlink
public void propagateXlink(DBXlink xlink)
-
getCityGMLBuilder
public org.citygml4j.builder.jaxb.CityGMLBuilder getCityGMLBuilder()
-
updateObjectCounter
protected void updateObjectCounter(org.citygml4j.model.gml.base.AbstractGML object, int objectClassId, long id)
-
updateObjectCounter
protected void updateObjectCounter(org.citygml4j.model.gml.base.AbstractGML object, AbstractObjectType<?> type, long id)
-
updateGeometryCounter
protected void updateGeometryCounter(org.citygml4j.model.gml.GMLClass type)
-
getAndResetObjectCounter
public java.util.Map<java.lang.Integer,java.lang.Long> getAndResetObjectCounter()
-
getAndResetGeometryCounter
public java.util.Map<org.citygml4j.model.gml.GMLClass,java.lang.Long> getAndResetGeometryCounter()
-
getAndResetImportLogEntries
public java.util.List<ImportLogger.ImportLogEntry> getAndResetImportLogEntries()
-
putObjectId
public void putObjectId(java.lang.String gmlId, long id, java.lang.String mapping, int objectClassId)
-
putObjectId
public void putObjectId(java.lang.String gmlId, long id, int objectClassId)
-
lookupAndPutObjectId
protected boolean lookupAndPutObjectId(java.lang.String gmlId, long id, int objectClassId)
-
getObjectId
public long getObjectId(java.lang.String gmlId)
-
putTextureImageId
public void putTextureImageId(java.lang.String resourceId, long id)
-
getTextureImageId
public long getTextureImageId(java.lang.String resourceId)
-
putGeometryId
public void putGeometryId(java.lang.String gmlId, long id, long rootId, boolean reverse, java.lang.String mapping)
-
getGeometryIdFromMemory
public long getGeometryIdFromMemory(java.lang.String gmlId)
-
getObjectSignature
protected java.lang.String getObjectSignature(org.citygml4j.model.gml.base.AbstractGML object, java.lang.String gmlId)
-
marshalObject
public java.lang.String marshalObject(org.citygml4j.model.common.base.ModelObject object, org.citygml4j.model.module.ModuleType... moduleTypes)
-
executeBatch
public void executeBatch() throws CityGMLImportException, java.sql.SQLException
- Throws:
CityGMLImportException
java.sql.SQLException
-
executeBatch
public void executeBatch(TableEnum table) throws CityGMLImportException, java.sql.SQLException
- Throws:
CityGMLImportException
java.sql.SQLException
-
close
public void close() throws CityGMLImportException, java.sql.SQLException
- Throws:
CityGMLImportException
java.sql.SQLException
-
getImporter
public <T extends DBImporter> T getImporter(java.lang.Class<T> type) throws CityGMLImportException, java.sql.SQLException
- Throws:
CityGMLImportException
java.sql.SQLException
-
-