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) AccountDAOaccountDAO(package private) InputStreamisprivate static org.slf4j.Loggerlog(package private) ESalesParserparser
-
Constructor Summary
Constructors Constructor Description ESalesIngestor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcreateAccount(Account accountDTO)This method is called by the main ingest processing loop.voidingest()This method will ingest the input data by reading in external DTOs in from the parser, instantiating project business objects, and inserting into database.voidsetAccountDAO(AccountDAO accountDAO)voidsetInputStream(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, XMLStreamExceptionThis 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.JAXBExceptionXMLStreamException
-
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-
-
-