|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.agimatec.utility.fileimport.ImportJob
public class ImportJob
Job definition of a dbimport job.
This class can be used to simplify the usage of the APIs of dbimport.
User: roman.stumm
Date: 09.04.2010
Time: 14:06:29
viaboxx GmbH, 2010
ImportController,
ImportControl,
Importer,
ImporterSpec| Field Summary | |
|---|---|
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 Summary | |
|---|---|
ImportJob()
|
|
ImportJob(Connection connection)
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
public ImportJob()
public ImportJob(Connection connection)
| Method Detail |
|---|
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: protocol
MalformedURLException
public void importFromURL(ImporterSpec spec)
throws Exception
Exception
public void importFromStream(ImporterSpec spec)
throws Exception
Exception
public void importFromReader(ImporterSpec spec,
String charset)
throws Exception
Exception
protected void handleException(Exception ex)
throws Exception
Exceptionprotected void handleErrorMessage(Exception ex)
protected void openURL(ImporterSpec spec)
throws IOException
IOException
protected void close()
throws SQLException,
IOException
SQLException
IOException
public 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 -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||