Révision 96454bcd
Ajouté par Sylvain Sauvage il y a plus de 11 ans
EpcILoN/src/main/java/fr/unicaen/iota/epcilon/conf/Configuration.java | ||
---|---|---|
*/
|
||
package fr.unicaen.iota.epcilon.conf;
|
||
|
||
import fr.unicaen.iota.epcilon.util.MD5;
|
||
import java.io.File;
|
||
import java.io.FileWriter;
|
||
import java.io.IOException;
|
||
import java.io.InputStream;
|
||
import java.math.BigInteger;
|
||
import java.security.MessageDigest;
|
||
import java.util.Date;
|
||
import java.util.Properties;
|
||
import java.util.Random;
|
||
... | ... | |
public static long PUBLISHER_MAX_WAIT;
|
||
public static int PUBLISHER_MONITOR_FREQUENCY;
|
||
public static int EPCIS_TO_DS_POOL_EVENT;
|
||
public static String LOGIN;
|
||
public static String PASS;
|
||
public static String IDENTITY;
|
||
public static String DISCOVERY_SERVICE_ADDRESS;
|
||
public static String DEFAULT_EVENT_BUSINESS_STEP;
|
||
public static String DEFAULT_EVENT_CLASS;
|
||
... | ... | |
public static String DEFAULT_EVENT_SC;
|
||
public static String DEFAULT_EVENT_TTL;
|
||
public static int DEFAULT_EVENT_PRIORITY;
|
||
public static Configuration instance = new Configuration();
|
||
public static int PUBLISHER_FREQUENCY;
|
||
public static String DEFAULT_EVENT_EPC;
|
||
public static String DEFAULT_QUERY_CLIENT_ADDRESS;
|
||
... | ... | |
Properties properties = new Properties();
|
||
properties.load(is);
|
||
is.close();
|
||
SUBSCRIPTION_KEY = properties.getProperty("subscription_key");
|
||
SUBSCRIPTION_KEY = properties.getProperty("subscription_key", "");
|
||
if (SUBSCRIPTION_KEY.isEmpty()) {
|
||
Date date = new Date();
|
||
long key = date.getTime();
|
||
long key = new Date().getTime();
|
||
Random random = new Random();
|
||
int rInt = random.nextInt(100);
|
||
String subKey = MD5.MD5_Algo(String.valueOf(key).concat(String.valueOf(rInt)));
|
||
String text = String.valueOf(key).concat(String.valueOf(rInt));
|
||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||
byte[] digest = md.digest(text.getBytes("UTF-8"));
|
||
String subKey = new BigInteger(1, digest).toString(16);
|
||
File f = new File(Configuration.class.getClassLoader().getResource(resource).getFile());
|
||
FileWriter op = new FileWriter(f);
|
||
op.write("subscription_key = " + subKey);
|
||
... | ... | |
PUBLISHER_MAX_WAIT = Long.parseLong(properties.getProperty("publisher-max-wait"));
|
||
PUBLISHER_MONITOR_FREQUENCY = Integer.parseInt(properties.getProperty("publisher-monitor-frequency"));
|
||
EPCIS_TO_DS_POOL_EVENT = Integer.parseInt(properties.getProperty("epcis-to-ds-pool-event"));
|
||
LOGIN = properties.getProperty("login");
|
||
PASS = properties.getProperty("password");
|
||
IDENTITY = properties.getProperty("identity");
|
||
DISCOVERY_SERVICE_ADDRESS = properties.getProperty("discovery-service-address");
|
||
DEFAULT_EVENT_BUSINESS_STEP = properties.getProperty("default-event-business-step");
|
||
DEFAULT_EVENT_CLASS = properties.getProperty("default-event-class");
|
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