Package ejava.projects.esales.blimpl
Class ESalesIngestor
- java.lang.Object
-
- ejava.projects.esales.blimpl.ESalesIngestor
-
public class ESalesIngestor extends Object
-
-
Field Summary
Fields Modifier and Type Field Description (package private) AccountDAO
accountDAO
(package private) InputStream
is
private static org.slf4j.Logger
log
(package private) ESalesParser
parser
-
Constructor Summary
Constructors Constructor Description ESalesIngestor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
createAccount(Account accountDTO)
This method is called by the main ingest processing loop.void
ingest()
This method will ingest the input data by reading in external DTOs in from the parser, instantiating project business objects, and inserting into database.void
setAccountDAO(AccountDAO accountDAO)
void
setInputStream(InputStream is)
-
-
-
Field Detail
-
log
private static final org.slf4j.Logger log
-
is
InputStream is
-
accountDAO
AccountDAO accountDAO
-
parser
ESalesParser parser
-
-
Method Detail
-
setInputStream
public void setInputStream(InputStream is)
-
setAccountDAO
public void setAccountDAO(AccountDAO accountDAO)
-
ingest
public void ingest() throws javax.xml.bind.JAXBException, XMLStreamException
This method will ingest the input data by reading in external DTOs in from the parser, instantiating project business objects, and inserting into database. Note that the XML Schema is organized such that object references are fully resolved. Therefore, there is no specific need to process the addresses as they come in. They can be stored once we get the accounts they are related to.- Throws:
javax.xml.bind.JAXBException
XMLStreamException
-
createAccount
private void createAccount(Account accountDTO)
This method is called by the main ingest processing loop. The JAXB/StAX parser will already have the Account populated with Address information.- Parameters:
accountDTO
-
-
-