|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fosstrak.epcis.repository.capture.CaptureOperationsModule
public class CaptureOperationsModule
CaptureOperationsModule implements the core capture operations. Converts XML events delivered by HTTP POST into SQL and inserts them into the database.
TODO: the parsing of the xml inputstream should be done in the CaptureOperationsServlet; this class should implement EpcisCaptureInterface such that CaptureOperationsServlet can call its capture method and provide it with the parsed events.
| Constructor Summary | |
|---|---|
CaptureOperationsModule()
|
|
| Method Summary | |
|---|---|
protected void |
checkEpc(String textContent)
Check EPC according to 'pure identity' URI as specified in Tag Data Standard. |
protected boolean |
checkEpcOrUri(String epcOrUri,
boolean epcRequired)
|
protected String |
checkEventTimeZoneOffset(String textContent)
TODO: javadoc! |
void |
doCapture(InputStream in,
Principal principal)
Implements the EPCIS capture operation. |
void |
doDbReset()
Resets the database. |
Schema |
getMasterDataSchema()
|
VocabularyAttributeElement |
getOrEditVocabularyAttributeElement(org.hibernate.Session session,
String vocabularyType,
Long vocabularyElementID,
String vocabularyAttributeElement,
String vocabularyAttributeElementValue,
String mode)
(nkef) Inserts vocabulary attribute into the database by searching for already existing entries; if found, the corresponding ID is returned. |
VocabularyElement |
getOrEditVocabularyElement(org.hibernate.Session session,
String vocabularyType,
String vocabularyElementURI,
String mode)
(changed by nkef to support MasterDataCapture. |
VocabularyElement |
getOrInsertVocabularyElement(org.hibernate.Session session,
String vocabularyType,
String vocabularyElement)
(depricated) Inserts vocabulary into the database by searching for already existing entries; if found, the corresponding ID is returned. |
Schema |
getSchema()
|
org.hibernate.SessionFactory |
getSessionFactory()
|
boolean |
isDbResetAllowed()
|
boolean |
isInsertMissingVoc()
|
void |
setDbResetAllowed(boolean dbResetAllowed)
|
void |
setDbResetScript(String dbResetScript)
|
void |
setEpcisMasterdataSchemaFile(String epcisMasterdataSchemaFile)
|
void |
setEpcisSchemaFile(String epcisSchemaFile)
|
void |
setInsertMissingVoc(boolean insertMissingVoc)
|
void |
setMasterDataSchema(Schema masterDataSchema)
|
void |
setSchema(Schema schema)
|
void |
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CaptureOperationsModule()
| Method Detail |
|---|
public void doDbReset()
throws SQLException,
IOException,
UnsupportedOperationException
SQLException - If something goes wrong resetting the database.
IOException - If something goes wrong reading the reset script.
UnsupportedOperationsException - If database resets are not allowed.
UnsupportedOperationException
public void doCapture(InputStream in,
Principal principal)
throws SAXException,
InternalBusinessException,
InvalidFormatException
IOException - If an error occurred while validating the request or writing
the response.
ParserConfigurationException
SAXException - If the XML document is malformed or invalid
InvalidFormatException
InternalBusinessException
protected boolean checkEpcOrUri(String epcOrUri,
boolean epcRequired)
throws InvalidFormatException
epcOrUri - The EPC or URI to check.epcRequired - true if an EPC is required (will throw an
InvalidFormatException if the given epcOrUri is
an invalid EPC, but might be a valid URI), false
otherwise.
true if the given epcOrUri is a valid
EPC, false otherwise.
InvalidFormatException
public VocabularyElement getOrInsertVocabularyElement(org.hibernate.Session session,
String vocabularyType,
String vocabularyElement)
throws SAXException
tableName - The name of the vocabulary table.uri - The vocabulary adapting the URI to be inserted into the
vocabulary table.
UnsupportedOperationException - If we are not allowed to insert a missing vocabulary.
SAXException
public VocabularyElement getOrEditVocabularyElement(org.hibernate.Session session,
String vocabularyType,
String vocabularyElementURI,
String mode)
throws SAXException
tableName - The name of the vocabulary table.uri - The vocabulary adapting the URI to be inserted into the
vocabulary table.
UnsupportedOperationException - If we are not allowed to insert a missing vocabulary.
SAXException
public VocabularyAttributeElement getOrEditVocabularyAttributeElement(org.hibernate.Session session,
String vocabularyType,
Long vocabularyElementID,
String vocabularyAttributeElement,
String vocabularyAttributeElementValue,
String mode)
throws SAXException
tableName - The name of the vocabulary table.uri - The vocabulary adapting the URI to be inserted into the
vocabulary table.
UnsupportedOperationException - If we are not allowed to insert a missing vocabulary.
SAXException
protected String checkEventTimeZoneOffset(String textContent)
throws InvalidFormatException
textContent -
InvalidFormatException
protected void checkEpc(String textContent)
throws InvalidFormatException
textContent -
InvalidFormatExceptionpublic org.hibernate.SessionFactory getSessionFactory()
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
public boolean isDbResetAllowed()
public void setDbResetAllowed(boolean dbResetAllowed)
public void setDbResetScript(String dbResetScript)
public boolean isInsertMissingVoc()
public void setInsertMissingVoc(boolean insertMissingVoc)
public Schema getSchema()
public void setSchema(Schema schema)
public void setEpcisSchemaFile(String epcisSchemaFile)
public void setEpcisMasterdataSchemaFile(String epcisMasterdataSchemaFile)
public Schema getMasterDataSchema()
public void setMasterDataSchema(Schema masterDataSchema)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||