public class ImportJob extends Object
ImportController,
ImportControl,
Importer,
ImporterSpec| Modifier and Type | Field and Description |
|---|---|
protected static String |
C_ProtocolClassPath |
protected Connection |
connection |
protected ImportControl |
control |
protected ImportController |
controller |
protected Importer |
importer |
static int |
MAX_LENGTH |
protected InputStream |
readStream |
| Constructor and Description |
|---|
ImportJob() |
ImportJob(Connection connection) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
close() |
Connection |
getConnection() |
ImportControl |
getControl()
never null, but optional
|
ImportController |
getController() |
Importer |
getImporter() |
protected void |
handleErrorMessage(Exception ex) |
protected void |
handleException(Exception ex) |
void |
importFromReader(ImporterSpec spec,
String charset)
API -
start the import, close all resources afterwards
|
void |
importFromStream(ImporterSpec spec)
API -
start the import, close all resources afterwards
|
void |
importFromURL(ImporterSpec spec)
API -
start the import, close all resources afterwards
|
void |
join()
API -
wait for other imports of the same kind.
|
protected void |
openURL(ImporterSpec spec) |
void |
setConnection(Connection connection)
set a connection before the import starts
|
void |
setController(ImportController controller)
optional: set the controller for the import
|
void |
setImporter(Importer importer)
need not call this
|
static URL |
toURL(String path)
utility method -
from the resource string create URL.
|
public static int MAX_LENGTH
protected static final String C_ProtocolClassPath
protected final ImportControl control
protected Connection connection
protected ImportController controller
protected Importer importer
protected InputStream readStream
public ImportJob()
public ImportJob(Connection connection)
public static URL toURL(String path) throws MalformedURLException
path - - cp:// for class path resource or and other protocol. if no protocol is given, assume file: protocolMalformedURLExceptionpublic void importFromURL(ImporterSpec spec) throws Exception
Exceptionpublic void importFromStream(ImporterSpec spec) throws Exception
Exceptionpublic void importFromReader(ImporterSpec spec, String charset) throws Exception
Exceptionprotected void handleErrorMessage(Exception ex)
protected void openURL(ImporterSpec spec) throws IOException
IOExceptionprotected void close()
throws SQLException,
IOException
SQLExceptionIOExceptionpublic void join()
throws SQLException
SQLExceptionpublic Connection getConnection()
public void setConnection(Connection connection)
connection - public ImportController getController()
public ImportControl getControl()
public Importer getImporter()
public void setController(ImportController controller)
controller - public void setImporter(Importer importer)
importer - Copyright © 2008-2016. All Rights Reserved.