Projet

Général

Profil

« Précédent | Suivant » 

Révision 96454bcd

Ajouté par Sylvain Sauvage il y a plus de 11 ans

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.

  • All:
    - code cleaned and refactored
    - lots of bugs fixed
    - dependencies checked and trimmed
    - documentation added
    - Identity handling added
  • New library modules (Mu, Nu)
  • New signature modules (SigMa)
  • Access Layer and User interfaces (ALfA and OMeGa):
    - code refactored
    - new, better APIs
    - Identity handling added
    - use EPCglobal and DS events (no proxy types anymore)
  • New tempororay DSeTa web service (pending new DS)
  • ETa corrected and added to the IoTa-Installer
    - 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)
  • CaPPa: overall refactoring of XACML handling
    - new temporary User web service
    - new Xi module: XACML Interrogation web service (was two modules: TCP and
    servlet)
  • PSi now signs its events
  • Installer, now also installs or configures:
    - ETa and its Callback modules
    - ActiveMQ
    - SigMa
    - certificate/signing key
  • Greyc letters figures:
    - 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

Voir les différences:

BETa/src/main/java/fr/unicaen/iota/application/client/listener/EventDispatcher.java
*/
package fr.unicaen.iota.application.client.listener;
import fr.unicaen.iota.application.model.EPCISEvent;
import fr.unicaen.iota.application.util.TimeParser;
import fr.unicaen.iota.application.util.TravelTimeTuple;
import java.util.*;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import javax.swing.event.EventListenerList;
import org.fosstrak.epcis.model.*;
/**
*
*/
public class EventDispatcher {
private Map<String, Set<EPCISEvent>> eventHashtable = new HashMap<String, Set<EPCISEvent>>();
private Map<String, TravelTimeTuple> travelTime = new HashMap<String, TravelTimeTuple>();
private Map<String, ArrayList<String>> usedObjects = new HashMap<String, ArrayList<String>>();
private Map<String, Set<String>> usedObjects = new HashMap<String, Set<String>>();
private final EventListenerList listeners = new EventListenerList();
public EventDispatcher() {
}
public synchronized void addEvent(String session, EPCISEvent e) {
if (eventHashtable.get(session) == null) {
eventHashtable.put(session, new HashSet<EPCISEvent>());
public synchronized void addEvent(String session, EPCISEventType e) {
if (!travelTime.containsKey(session)) {
travelTime.put(session, new TravelTimeTuple());
usedObjects.put(session, new ArrayList<String>());
usedObjects.put(session, new HashSet<String>());
}
eventHashtable.get(session).add(e);
TravelTimeTuple ttt = travelTime.get(session);
ArrayList<String> nbObjects = usedObjects.get(session);
Set<String> nbObjects = usedObjects.get(session);
processNbObjects(session, e, nbObjects);
ttt.addEventTimestamp(TimeParser.convert(e.getEventTime()));
ttt.addEventTimestamp(TimeParser.convert(e.getEventTime().toGregorianCalendar()));
fireEventReiceved(session, e);
fireTravelTimeChanged(session, ttt);
}
......
listeners.remove(EPCEventListener.class, listener);
}
public EPCEventListener[] getEPCEventListeners() {
private EPCEventListener[] getEPCEventListeners() {
return listeners.getListeners(EPCEventListener.class);
}
protected void fireEventReiceved(String session, EPCISEvent e) {
protected void fireEventReiceved(String session, EPCISEventType e) {
for (EPCEventListener listener : getEPCEventListeners()) {
listener.eventReveived(session, e);
}
......
}
}
private void processNbObjects(String session, EPCISEvent e, ArrayList<String> nbObjects) {
if (EPCISEvent.ActionType.ADD == e.getAction()) {
switch (e.getType()) {
case OBJECT:
{
String epc = e.getEpcs().get(0);
if (!nbObjects.contains(epc)) {
nbObjects.add(epc);
}
break;
}
case AGGREGATION:
{
String epc = e.getParentID();
if (!nbObjects.contains(epc)) {
nbObjects.add(epc);
}
break;
}
case TRANSACTION:
throw new UnsupportedOperationException("Not yet implemented (Transaction) class: eventDispatcher");
//break;
case QUANTITY:
throw new UnsupportedOperationException("Not yet implemented (Quantity) class: eventDispatcher");
//break;
private void processNbObjects(String session, EPCISEventType e, Set<String> nbObjects) {
if (e instanceof ObjectEventType) {
ObjectEventType oe = (ObjectEventType) e;
if (oe.getAction() == ActionType.ADD) {
String epc = oe.getEpcList().getEpc().get(0).getValue();
nbObjects.add(epc);
}
} else if (e instanceof AggregationEventType) {
AggregationEventType ae = (AggregationEventType) e;
if (ae.getAction() == ActionType.ADD) {
String epc = ae.getParentID();
nbObjects.add(epc);
}
} else if (e instanceof TransactionEventType) {
throw new UnsupportedOperationException("Not yet implemented (Transaction) class: eventDispatcher");
} else if (e instanceof QuantityEventType) {
throw new UnsupportedOperationException("Not yet implemented (Quantity) class: eventDispatcher");
}
fireUsedObjectsChanged(session, nbObjects.size());
}

Formats disponibles : Unified diff