Révision 96454bcd
Ajouté par Sylvain Sauvage il y a plus de 11 ans
ETa/ETa/src/main/java/fr/unicaen/iota/eta/capture/CaptureOperationsServlet.java | ||
---|---|---|
/*
|
||
* This program is a part of the IoTa Project.
|
||
*
|
||
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
|
||
* Copyright © 2011-2012 Université de Caen Basse-Normandie, GREYC
|
||
* Copyright © 2011 Orange Labs
|
||
* Copyright © 2007 ETH Zurich
|
||
*
|
||
... | ... | |
package fr.unicaen.iota.eta.capture;
|
||
|
||
import fr.unicaen.iota.eta.constants.Constants;
|
||
import fr.unicaen.iota.sigma.client.SigMaClient;
|
||
import fr.unicaen.iota.xi.client.EPCISPEP;
|
||
import java.io.IOException;
|
||
import java.io.InputStream;
|
||
import java.io.PrintWriter;
|
||
import javax.servlet.http.HttpServlet;
|
||
import javax.servlet.http.HttpServletRequest;
|
||
... | ... | |
cm = new CaptureOperationsModule();
|
||
cm.setEpcisSchemaFile(Constants.EPCIS_SCHEMA_FILE);
|
||
cm.setEpcisMasterDataSchemaFile(Constants.EPCIS_MASTER_DATA_SCHEMA_FILE);
|
||
EPCISPEP epcisPEP = new EPCISPEP(Constants.XACML_URL);
|
||
cm.setCaptureCheck(new CaptureCheck(epcisPEP));
|
||
getServletContext().setAttribute("captureOperationsModule", cm);
|
||
SigMaClient sigMaClient = new SigMaClient(Constants.SIGMA_URL);
|
||
cm.setSigMaClient(sigMaClient);
|
||
} else {
|
||
LOG.debug("Capture module found");
|
||
}
|
||
setCaptureOperationsModule(cm);
|
||
cm.setCaptureCheck(new CaptureCheck());
|
||
}
|
||
|
||
public void setCaptureOperationsModule(CaptureOperationsModule captureOperationsModule) {
|
||
... | ... | |
rsp.setContentType("text/plain");
|
||
final PrintWriter out = rsp.getWriter();
|
||
LOG.debug("EPCIS validating Event ...");
|
||
InputStream is = null;
|
||
// check if we have a POST request with form parameters
|
||
if ("application/x-www-form-urlencoded".equalsIgnoreCase(req.getContentType())) {
|
||
// check if the 'event' or 'dbReset' form parameter are given
|
||
... | ... | |
out.close();
|
||
} else {
|
||
LOG.debug("EPCIS saving and publishing event ...");
|
||
is = req.getInputStream();
|
||
try {
|
||
captureOperationsModule.doCapture(is, rsp);
|
||
captureOperationsModule.doCapture(req, rsp);
|
||
} catch (SAXException e) {
|
||
String msg = "Unable to parse incoming XML due to error: " + e.getMessage();
|
||
LOG.debug(msg, e);
|
Formats disponibles : Unified diff
Version 1.9-mock
This is version 1.9-mock. 1.9 because the API still have changes pending
(principally relative to the Discovery Services). “mock” because TLS
configuration is not yet available and the signatures (SigMa) are not fully
implemented.
- code cleaned and refactored
- lots of bugs fixed
- dependencies checked and trimmed
- documentation added
- Identity handling added
- code refactored
- new, better APIs
- Identity handling added
- use EPCglobal and DS events (no proxy types anymore)
- ETa-Callback modules are now available as web applications
- filtering rules: if a part of an event is not allowed, now the whole
event is deleted from the result (before only the rejectd part was)
- new temporary User web service
- new Xi module: XACML Interrogation web service (was two modules: TCP and
servlet)
- ETa and its Callback modules
- ActiveMQ
- SigMa
- certificate/signing key
- new simplified figures (sans IoTa and simplified IoTa)
- new figure for ETa modules
- show 3rd party clients
- data flows specified
- TLS and link security added
- IDs and trusted IDs added
- color adjusted for printing
- GREYC logo added