Révision 96454bcd
Ajouté par Sylvain Sauvage il y a plus de 11 ans
PSi/src/main/java/fr/unicaen/iota/simulator/model/BaseEvent.java | ||
---|---|---|
*/
|
||
package fr.unicaen.iota.simulator.model;
|
||
|
||
import fr.unicaen.iota.sigma.SigMaFunctions;
|
||
import fr.unicaen.iota.simulator.util.Config;
|
||
import fr.unicaen.iota.simulator.util.ServicePool;
|
||
import fr.unicaen.iota.simulator.util.StatControler;
|
||
... | ... | |
public void setInfrastructure(Infrastructure service) {
|
||
this.infrastructure = service;
|
||
}
|
||
|
||
|
||
protected abstract EPCISEventType prepareEventType();
|
||
|
||
protected abstract void setExtensionsObjects(EPCISEventType event, List<Object> extensions);
|
||
|
||
|
||
public int publish() throws CaptureClientException, IOException, JAXBException {
|
||
EPCISEventType event = prepareEventType();
|
||
// get the current time and set the eventTime
|
||
|
||
// get the current time and set the eventTime
|
||
XMLGregorianCalendar now = null;
|
||
try {
|
||
DatatypeFactory dataFactory = DatatypeFactory.newInstance();
|
||
... | ... | |
}
|
||
|
||
// add extensions
|
||
Map<QName, String> epcisExtensionsAttr = new HashMap<QName, String>();
|
||
List<Object> extensionsObjects = new LinkedList<Object>();
|
||
for (String extensionName : extensions.keySet()) {
|
||
String namespace = "http://api.orange.com/extensions/other"; // TODO: hard value
|
||
... | ... | |
}
|
||
prefix = remainingString;
|
||
}
|
||
epcisExtensionsAttr.put(new QName(namespace, name, prefix), value);
|
||
|
||
Element extensionElemJdom = new Element(name, prefix, namespace);
|
||
extensionElemJdom.setText(value);
|
||
... | ... | |
}
|
||
setExtensionsObjects(event, extensionsObjects);
|
||
|
||
if (Config.sign) {
|
||
SigMaFunctions sigMaFunctions = new SigMaFunctions(Config.keystore, Config.keystore_password);
|
||
try {
|
||
sigMaFunctions.sign(event);
|
||
} catch (Exception ex) {
|
||
log.error("an error has been thrown during the signature of the event", ex);
|
||
}
|
||
}
|
||
|
||
// create the EPCISDocument containing a single ObjectEvent
|
||
EPCISDocumentType epcisDoc = new EPCISDocumentType();
|
||
EPCISBodyType epcisBody = new EPCISBodyType();
|
||
... | ... | |
} catch (InterruptedException ex) {
|
||
log.fatal("Interrupted while releasing capture client", ex);
|
||
}
|
||
return httpResponseCode;
|
||
return httpResponseCode;
|
||
}
|
||
|
||
public abstract String toXML();
|
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