Révision 96454bcd
Ajouté par Sylvain Sauvage il y a plus de 11 ans
MuPHI/src/main/java/fr/unicaen/iota/simulator/server/model/PlaceFIFO.java | ||
---|---|---|
*/
|
||
package fr.unicaen.iota.simulator.server.model;
|
||
|
||
import fr.unicaen.iota.simulator.server.util.MD5;
|
||
import java.io.UnsupportedEncodingException;
|
||
import java.math.BigInteger;
|
||
import java.security.MessageDigest;
|
||
import java.security.NoSuchAlgorithmException;
|
||
import java.util.ArrayList;
|
||
import java.util.Date;
|
||
import java.util.List;
|
||
import java.util.concurrent.BlockingQueue;
|
||
import java.util.concurrent.ArrayBlockingQueue;
|
||
import java.util.concurrent.BlockingQueue;
|
||
import org.apache.commons.logging.Log;
|
||
import org.apache.commons.logging.LogFactory;
|
||
|
||
... | ... | |
reserverdID = new ArrayList<String>();
|
||
travelTimeInMilis = travelTime;
|
||
}
|
||
|
||
private boolean fullTruck = false;
|
||
|
||
public synchronized String reserve(int canalSize) {
|
||
... | ... | |
arrival();
|
||
return list;
|
||
}
|
||
private long autoIncrementId = 0;
|
||
|
||
private String generateId() {
|
||
autoIncrementId++;
|
||
try {
|
||
return MD5.MD5_Algo(String.valueOf(new Date().getTime())) + String.valueOf(autoIncrementId);
|
||
} catch (NoSuchAlgorithmException ex) {
|
||
log.error(null, ex);
|
||
return null;
|
||
String text = String.valueOf(new Date().getTime()) + String.valueOf(autoIncrementId);
|
||
byte[] digest = MD5.digest(text.getBytes("UTF-8"));
|
||
return new BigInteger(1, digest).toString(16);
|
||
} catch (UnsupportedEncodingException ex) {
|
||
log.error(null, ex);
|
||
return null;
|
||
}
|
||
}
|
||
private long autoIncrementId = 0;
|
||
private static MessageDigest MD5;
|
||
|
||
static {
|
||
try {
|
||
MD5 = MessageDigest.getInstance("MD5");
|
||
} catch (NoSuchAlgorithmException e) {
|
||
log.fatal("MD5 not avalaible", e);
|
||
}
|
||
}
|
||
|
||
private boolean pipeIsReadyToPeek() {
|
||
if (fullTruck && new Date().getTime() > departureTime + travelTimeInMilis) {
|
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