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:

.gitignore
IoTa-Installer/resources/alfa-*-bin-with-dependencies.tar.gz
IoTa-Installer/resources/discovery-phi-*.war
IoTa-Installer/resources/discovery-server-*.war
IoTa-Installer/resources/dseta-server-*.war
IoTa-Installer/resources/epcilon-*.war
IoTa-Installer/resources/epcis-phi-*.war
IoTa-Installer/resources/eta-*.war
IoTa-Installer/resources/user-*.war
IoTa-Installer/resources/eta-callback-receiver-*.war
IoTa-Installer/resources/eta-callback-filter-*.war
IoTa-Installer/resources/eta-callback-sender-*.war
IoTa-Installer/resources/eta-callback-filter-*-bin-with-dependencies.tar.gz
IoTa-Installer/resources/eta-callback-sender-*-bin-with-dependencies.tar.gz
IoTa-Installer/resources/omega-*.war
IoTa-Installer/resources/sigma-*.war
IoTa-Installer/resources/install.ini
ALfA/ALfA-PI/pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fr.unicaen.iota.application</groupId>
<groupId>fr.unicaen.iota</groupId>
<artifactId>alfa-pi</artifactId>
<version>1.0</version>
<version>1.9-mock</version>
<packaging>jar</packaging>
<name>ALfA-PI</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<epcis-version>0.5.0</epcis-version>
</properties>
<dependencies>
<!-- IoTa dependencies -->
<dependency>
<groupId>fr.unicaen.iota</groupId>
<artifactId>nu-pi</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>fr.unicaen.iota</groupId>
<artifactId>tau</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>fr.unicaen.iota</groupId>
<artifactId>dseta-client</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Fosstrak dependencies -->
<dependency>
<groupId>org.fosstrak.epcis</groupId>
<artifactId>epcis-commons</artifactId>
<version>${epcis-version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
ALfA/ALfA-PI/src/main/java/fr/unicaen/iota/application/AccessInterface.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
* Copyright © 2008-2012 Orange Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application;
import fr.unicaen.iota.application.rmi.CallbackClient;
import fr.unicaen.iota.ds.model.TEventItem;
import fr.unicaen.iota.ds.model.TServiceType;
import fr.unicaen.iota.nu.ONSEntryType;
import fr.unicaen.iota.tau.model.Identity;
import java.rmi.RemoteException;
import java.util.List;
import java.util.Map;
import org.fosstrak.epcis.model.EPCISEventType;
/**
* RMI interface for the IoTa platform.
*/
public interface AccessInterface {
/**
* Queries the ONS for all NAPTR entries related to the given EPC code.
*
* @param EPC the EPC code
* @return a mapping of all entries by service type
* @throws RemoteException
*/
public Map<ONSEntryType, String> queryONS(String EPC) throws RemoteException;
/**
* Queries the ONS for the product information URL for the givent EPC code.
*
* @param EPC the EPC code
* @return the URL for the product documentation
* @throws RemoteException
*/
public String getEPCDocURL(String EPC) throws RemoteException;
/**
* Queries the ONS for the URL of the referent Discovery Service for the
* given EPC code.
*
* @param EPC the EPC code
* @return the URL of the referent Discovery Service
* @throws RemoteException
*/
public String getReferentDS(String EPC) throws RemoteException;
/**
* Queries a given Discovery Service for all events concerning a given EPC
* code.
*
* @param identity the client identification
* @param EPC the EPC code
* @param DSAddress the DS URL
* @return a list of DS events
* @throws RemoteException
*/
public List<TEventItem> queryDS(Identity identity, String EPC, String DSAddress) throws RemoteException;
/**
* Queries a given Discovery Service for all events concerning a given EPC
* code.
*
* @param identity the client identification
* @param EPC the EPC code
* @param DSAddress the DS URL
* @param serviceType the service type
* @return a list of DS events
* @throws RemoteException
*/
public List<TEventItem> queryDS(Identity identity, String EPC, String DSAddress, TServiceType serviceType) throws RemoteException;
/**
* Gets all the EPCIS events concerning a given EPC code.
*
* @param identity the client identification
* @param EPC the EPC code
* @return a list of EPCIS events
* @throws RemoteException
*/
public List<EPCISEventType> traceEPC(Identity identity, String EPC) throws RemoteException;
/**
* Gets all the EPCIS events concerning a given EPC code and matching the
* given filters.
*
* @param identity the client identification
* @param EPC the EPC code
* @param filters the filters
* @return a list of EPCIS events
* @throws RemoteException
*/
public List<EPCISEventType> traceEPC(Identity identity, String EPC, Map<String, String> filters) throws RemoteException;
/**
* Asynchronously gets all the EPCIS events concerning a given EPC code.
*
* @param identity the client identification
* @param sessionID the session for the request
* @param client the callback client to whom the events will be sent
* @param EPC the EPC code
* @throws RemoteException
*/
public void traceEPCAsync(Identity identity, String sessionID, CallbackClient client, String EPC) throws RemoteException;
/**
* Gets all the EPCIS events concerning a given EPC code from a given ECPIS
* repository.
*
* @param identity the client identification
* @param EPC the EPC code
* @param EPCISAddress the URL of the EPCIS repository
* @return a list of EPCIS events
* @throws RemoteException
*/
public List<EPCISEventType> queryEPCIS(Identity identity, String EPC, String EPCISAddress) throws RemoteException;
/**
* Gets all the EPCIS events matching the given filters from a given ECPIS
* repository.
*
* @param identity the client identification
* @param filters the EPC code
* @param EPCISAddress the URL of the EPCIS repository
* @return a list of EPCIS events
* @throws RemoteException
*/
public List<EPCISEventType> queryEPCIS(Identity identity, Map<String, String> filters, String EPCISAddress) throws RemoteException;
}
ALfA/ALfA-PI/src/main/java/fr/unicaen/iota/application/model/DSEvent.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
* Copyright © 2008-2012 Orange Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application.model;
import java.io.Serializable;
import java.sql.Timestamp;
/**
*
*/
public class DSEvent implements Serializable {
private final String EPC;
private final String referenceAddress;
private final String BizStep;
private final Timestamp eventTime;
public DSEvent(String EPC, String referenceAddress, String bizStep, Timestamp eventTime) {
this.EPC = EPC;
this.referenceAddress = referenceAddress;
this.BizStep = bizStep;
this.eventTime = eventTime;
}
/**
* @return the EPC
*/
public String getEPC() {
return EPC;
}
/**
* @return the referenceAddress
*/
public String getReferenceAddress() {
return referenceAddress;
}
/**
* @return the BizStep
*/
public String getBizStep() {
return BizStep;
}
/**
* @return the eventTime
*/
public Timestamp getEventTime() {
return eventTime;
}
@Override
public boolean equals(Object that) {
if (that == null) {
return false;
}
if (that == this) {
return true;
}
if (that instanceof DSEvent) {
DSEvent evt = (DSEvent) that;
return this.getBizStep().equals(evt.getBizStep())
&& this.getEPC().equals(evt.getEPC())
&& this.getReferenceAddress().equals(evt.getReferenceAddress());
}
return false;
}
@Override
public int hashCode() {
int hash = 5;
hash = 17 * hash + (this.EPC != null ? this.EPC.hashCode() : 0);
hash = 17 * hash + (this.referenceAddress != null ? this.referenceAddress.hashCode() : 0);
hash = 17 * hash + (this.BizStep != null ? this.BizStep.hashCode() : 0);
return hash;
}
}
ALfA/ALfA-PI/src/main/java/fr/unicaen/iota/application/model/EPCISEvent.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
* Copyright © 2008-2012 Orange Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application.model;
import java.io.Serializable;
import java.util.*;
public class EPCISEvent implements Serializable {
public static enum EventType {
OBJECT,
TRANSACTION,
AGGREGATION,
QUANTITY
}
public static enum ActionType {
ADD,
OBSERVE,
DELETE
}
private EventType type;
private Calendar eventTime;
private Calendar insertedTime;
private String parentID = "";
private ActionType action;
private String bizStep = "";
private String bizLoc = "";
private String disposition = "";
private String readPoint = "";
private String quantity = "";
private String EPCClass = "";
private List<String> children = new ArrayList<String>();
private List<String> epcs = new ArrayList<String>();
private Map<String, String> bizTrans = new HashMap<String, String>();
public EPCISEvent() {
super();
}
@Override
public boolean equals(Object that) {
if (that == null) {
return false;
}
if (this == that) {
return true;
}
if (that instanceof EPCISEvent) {
EPCISEvent e = (EPCISEvent) that;
return type.equals(e.getType())
&& eventTime.equals(e.getEventTime())
&& insertedTime.equals(e.getInsertedTime())
&& parentID.equals(e.getParentID())
&& action.equals(e.getAction())
&& bizStep.equals(e.getBizStep())
&& bizLoc.equals(e.getBizLoc())
&& disposition.equals(e.getDisposition())
&& readPoint.equals(e.getReadPoint())
&& quantity.equals(e.getQuantity())
&& EPCClass.equals(e.getEPCClass())
&& children.equals(e.getChildren()) // List/Map.equals apply
&& epcs.equals(e.getEpcs()) // equals to their elements
&& bizTrans.equals(e.getBizTrans());
}
return false;
}
public boolean isExpedition() {
// TODO: hard value
return bizStep.equals("urn:orange:demo:bizstep:fmcg:expedition");
}
public boolean isReception() {
// TODO: hard value
return bizStep.equals("urn:orange:demo:bizstep:fmcg:reception");
}
public EventType getType() {
return type;
}
public void setType(EventType type) {
this.type = type;
}
public Calendar getEventTime() {
return eventTime;
}
public void setEventTime(Calendar eventTime) {
this.eventTime = eventTime;
}
public Calendar getInsertedTime() {
return insertedTime;
}
public void setInsertedTime(Calendar insertedTime) {
this.insertedTime = insertedTime;
}
public String getParentID() {
return parentID;
}
public void setParentID(String parentID) {
this.parentID = parentID;
}
public List<String> getChildren() {
return children;
}
public void setChildren(Collection<String> childs) {
this.children.clear();
this.children.addAll(childs);
}
public List<String> getEpcs() {
return epcs;
}
public void setEpcs(Collection<String> epcs) {
this.epcs.clear();
this.epcs.addAll(epcs);
}
public ActionType getAction() {
return action;
}
public void setAction(ActionType action) {
this.action = action;
}
public String getBizStep() {
return bizStep;
}
public void setBizStep(String bizStep) {
this.bizStep = bizStep;
}
public String getBizLoc() {
return bizLoc;
}
public void setBizLoc(String bizLoc) {
this.bizLoc = bizLoc;
}
public Map<String, String> getBizTrans() {
return bizTrans;
}
public void setBizTrans(Map<String, String> bizTrans) {
this.bizTrans = bizTrans;
}
public String getDisposition() {
return disposition;
}
public void setDisposition(String disposition) {
this.disposition = disposition;
}
public String getReadPoint() {
return readPoint;
}
public void setReadPoint(String readPoint) {
this.readPoint = readPoint;
}
public String getQuantity() {
return quantity;
}
public void setQuantity(String quantity) {
this.quantity = quantity;
}
public String getEPCClass() {
return EPCClass;
}
public void setEPCClass(String class1) {
EPCClass = class1;
}
public boolean isSameProduct(EPCISEvent event) {
return epcs.equals(event.getEpcs()); // List.equals applique equals en profondeur
}
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append(" | EPCs:");
buf.append(getEpcs());
buf.append("\n");
buf.append(" | Action:");
buf.append(getAction());
buf.append("\n");
buf.append(" | BizLoc:");
buf.append(getBizLoc());
buf.append("\n");
buf.append(" | BizTrans:");
buf.append(getBizTrans());
buf.append("\n");
buf.append(" | Childs:");
buf.append(getChildren());
buf.append("\n");
buf.append(" | Dispo:");
buf.append(getDisposition());
buf.append("\n");
buf.append(" | Class:");
buf.append(getEPCClass());
buf.append("\n");
buf.append(" | EventTime:");
buf.append(getEventTime());
buf.append("\n");
buf.append(" | InsertedTime:");
buf.append(getInsertedTime());
buf.append("\n");
buf.append(" | ParentID:");
buf.append(getParentID());
buf.append("\n");
buf.append(" | Quantity:");
buf.append(getQuantity());
buf.append("\n");
buf.append(" | ReadPoint:");
buf.append(getReadPoint());
buf.append("\n");
buf.append(" | Type:");
buf.append(getType());
buf.append("\n");
return buf.toString();
}
}
ALfA/ALfA-PI/src/main/java/fr/unicaen/iota/application/model/ONSEntryType.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
* Copyright © 2008-2012 Orange Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application.model;
/**
*
*/
public enum ONSEntryType {
ds,
epcis,
spec
}
ALfA/ALfA-PI/src/main/java/fr/unicaen/iota/application/model/Spec.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
* Copyright © 2008-2012 Orange Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application.model;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
public class Spec implements Serializable {
private String epc;
private Map<String, String> manufacturer;
private Map<String, String> product;
private Map<String, String> extension;
public Spec() {
super();
this.epc = "";
this.manufacturer = new HashMap<String, String>();
this.product = new HashMap<String, String>();
this.extension = new HashMap<String, String>();
}
public String getEpc() {
return epc;
}
public void setEpc(String epc) {
this.epc = epc;
}
public Map<String, String> getManufacturer() {
return manufacturer;
}
public void setManufacturer(Map<String, String> manufacturer) {
this.manufacturer = manufacturer;
}
public Map<String, String> getProduct() {
return product;
}
public void setProduct(Map<String, String> product) {
this.product = product;
}
public Map<String, String> getExtension() {
return extension;
}
public void setExtension(Map<String, String> extension) {
this.extension = extension;
}
}
ALfA/ALfA-PI/src/main/java/fr/unicaen/iota/application/rmi/AccessInterface.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
* Copyright © 2008-2012 Orange Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application.rmi;
import fr.unicaen.iota.application.model.ONSEntryType;
import fr.unicaen.iota.application.model.DSEvent;
import fr.unicaen.iota.application.model.EPCISEvent;
import fr.unicaen.iota.application.model.Spec;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.List;
import java.util.Map;
public interface AccessInterface extends Remote {
/**
* Asynchronous tracing
*/
public void traceEPCAsync(String sessionId, CallBackClient client, String EPC) throws RemoteException;
public List<EPCISEvent> traceEPC(String epc) throws RemoteException;
public Map<ONSEntryType, String> queryONS(String ECP) throws RemoteException;
public List<String> getEPCDoc(String epc) throws RemoteException;
public List<EPCISEvent> getEPCEPCIS(String epc) throws RemoteException;
public List<EPCISEvent> queryEPCIS(String epc, String EPCISAddress) throws RemoteException;
public List<DSEvent> queryDS(String epc, String DSAddress, String login, String password) throws RemoteException;
public List<DSEvent> queryDS(String epc, String DSAddress, String login, String password, String serviceType) throws RemoteException;
public Spec getSpecs(String address) throws RemoteException;
public String getReferenteDS(String epc) throws RemoteException;
}
ALfA/ALfA-PI/src/main/java/fr/unicaen/iota/application/rmi/CallBackClient.java
/*
* This program is a part of the IoTa project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application.rmi;
import fr.unicaen.iota.application.model.EPCISEvent;
import java.rmi.RemoteException;
/**
*
*/
public interface CallBackClient extends java.rmi.Remote {
public void pushEvent(String sessionID, EPCISEvent e) throws RemoteException;
}
ALfA/ALfA-PI/src/main/java/fr/unicaen/iota/application/rmi/CallbackClient.java
/*
* This program is a part of the IoTa project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application.rmi;
import java.rmi.RemoteException;
import org.fosstrak.epcis.model.EPCISEventType;
/**
* RMI interface for a càllback client for the asynchronous tracing function of an <code>AccessInterface</code>.
*
* @see AccessInterface
*/
public interface CallbackClient extends java.rmi.Remote {
/**
* This method is remotely called by an <code>AccessInterface</code> when an event is found.
*
* @param sessionID the session for the request
* @param evt a new event
* @throws RemoteException
*/
public void pushEvent(String sessionID, EPCISEventType evt) throws RemoteException;
}
ALfA/ALfA-PI/src/main/java/fr/unicaen/iota/application/rmi/RMIAccessInterface.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
* Copyright © 2008-2012 Orange Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application.rmi;
import fr.unicaen.iota.application.AccessInterface;
import java.rmi.Remote;
/**
* RMI interface for the IoTa platform.
*/
public interface RMIAccessInterface extends Remote, AccessInterface {
}
ALfA/ALfA-RMI/LICENSE
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
ALfA/ALfA-RMI/LISEZMOI
ALfA-RMI - Access Layer For Applications RMI Server
Serveur RMI servant d’interface entre EPCglobal/IoTa et des applications de
haut niveau.
alfa.sh script pour lancer le serveur
Dépendances:
modules IoTa:
- ALfA-PI
- Nu
- DSeTa-Client
- ETa-Client
bibliothèques:
- epcis-commons
- dnsjava
- commons-logging
- log4j
Configuration:
IoTa-Installer installe et configure ALfA.
Voir les fichiers *.properties et java.policy dans le fichier jar ; chacun
de ces fichiers peut être remplacé par un fichier du même nom dans le
répertoire courant.
(application.properties pour cette application,
ds-client.properties pour la bibliothèque cliente IoTa-DiscoveryWS-Client,
commons-logging.properties et log4j.properties pour les journaux)
Dépendances d’utilisation:
- un ONS
- un DWS (p.ex. IoTa-DiscoveryWS)
- un Epcis (p.ex. Fosstrak-Epcis)
- IoTa:
- DSeTa
- EpcILoN
- ETa
- DiscoveryPHI (facultatif)
- EpcisPHI (facultatif)
Utilisation:
nohup ./alfa.sh
voir BETa, DELTa ou OMeGa pour des exemples de clients
ALfA/ALfA-RMI/README
ALfA-RMI - Access Layer For Applications RMI Server
RMI server to serve between EPCglobal/IoTa and top-level applications.
alfa.sh utility script for starting the server
Dependencies:
IoTa modules:
- ALfA
- Nu
- DSeTa-Client
- ETa-Client
libraries:
- epcis-commons
- dnsjava
- commons-logging
- log4j
Configuration:
IoTa-Installer installs and configures ALfA.
See the files *.properties and java.policy in the jar file (each of those
can be overriden by a file with the same name in the current directory).
(application.properties for this application,
ds-client.properties for the client library IoTa-DiscoveryWS-Client,
commons-logging.properties and log4j.properties for the logs)
Usage Dependencies:
- an ONS
- a DWS (eg. IoTa-DiscoveryWS)
- an Epcis (eg. Fosstrak-Epcis)
- IoTa:
- DSeTa
- EpcILoN
- ETa
- DiscoveryPHI (optional)
- EpcisPHI (optional)
Usage:
nohup ./alfa.sh
see BETa, DELTa, or OMeGa for examples
ALfA/ALfA-RMI/alfa.sh
#!/bin/sh
java -cp ".:lib/*" fr.unicaen.iota.application.rmi.RMIServer
ALfA/ALfA-RMI/pom.xml
<?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fr.unicaen.iota</groupId>
<artifactId>alfa-rmi</artifactId>
<version>1.9-mock</version>
<packaging>jar</packaging>
<name>ALfA-RMI</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- IoTa dependencies -->
<dependency>
<groupId>fr.unicaen.iota</groupId>
<artifactId>alfa</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<mainClass>fr.unicaen.iota.application.rmi.RMIServer</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>bin-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/main/assembly/bin-with-dependencies.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>sources</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptorRefs>
<descriptorRef>src</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
ALfA/ALfA-RMI/src/main/assembly/bin-with-dependencies.xml
<assembly>
<id>bin-with-dependencies</id>
<formats>
<format>tar.gz</format>
</formats>
<fileSets>
<fileSet>
<includes>
<include>README</include>
<include>LISEZMOI</include>
<include>LICENSE</include>
<include>alfa.sh</include>
</includes>
</fileSet>
<fileSet>
<directory>target</directory>
<outputDirectory></outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<outputDirectory>/lib</outputDirectory>
<unpack>false</unpack>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</assembly>
ALfA/ALfA-RMI/src/main/java/fr/unicaen/iota/application/rmi/AccessModule.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
* Copyright © 2008-2012 Orange Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application.rmi;
import fr.unicaen.iota.application.ALfA;
import fr.unicaen.iota.ds.model.TEventItem;
import fr.unicaen.iota.ds.model.TServiceType;
import fr.unicaen.iota.nu.ONSEntryType;
import fr.unicaen.iota.tau.model.Identity;
import java.rmi.RemoteException;
import java.util.List;
import java.util.Map;
import org.fosstrak.epcis.model.EPCISEventType;
public class AccessModule implements RMIAccessInterface {
private ALfA controler;
public AccessModule() throws RemoteException {
controler = new ALfA();
}
@Override
public synchronized Map<ONSEntryType, String> queryONS(String EPC) {
return controler.queryONS(EPC);
}
@Override
public synchronized String getReferentDS(String EPC) throws RemoteException {
return controler.getReferentDS(EPC);
}
@Override
public synchronized List<EPCISEventType> traceEPC(Identity identity, String EPC) throws RemoteException {
return controler.traceEPC(identity, EPC);
}
@Override
public synchronized List<EPCISEventType> traceEPC(Identity identity, String EPC, Map<String, String> filters) throws RemoteException {
return controler.traceEPC(identity, EPC, filters);
}
@Override
public synchronized String getEPCDocURL(String EPC) throws RemoteException {
return controler.getEPCDocURL(EPC);
}
@Override
public synchronized void traceEPCAsync(Identity identity, String sessionID, CallbackClient client, String EPC) throws RemoteException {
controler.traceEPCAsync(identity, sessionID, client, EPC);
}
@Override
public synchronized List<EPCISEventType> queryEPCIS(Identity identity, String EPC, String EPCISAddress) throws RemoteException {
return controler.queryEPCIS(identity, EPC, EPCISAddress);
}
@Override
public synchronized List<EPCISEventType> queryEPCIS(Identity identity, Map<String, String> filters, String EPCISAddress) throws RemoteException {
return controler.queryEPCIS(identity, filters, EPCISAddress);
}
@Override
public synchronized List<TEventItem> queryDS(Identity identity, String EPC, String DSAddress) throws RemoteException {
return controler.queryDS(identity, EPC, DSAddress);
}
@Override
public synchronized List<TEventItem> queryDS(Identity identity, String EPC, String DSAddress, TServiceType serviceType) throws RemoteException {
return controler.queryDS(identity, EPC, DSAddress, serviceType);
}
}
ALfA/ALfA-RMI/src/main/java/fr/unicaen/iota/application/rmi/Constants.java
/*
* This program is a part of the IoTa project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application.rmi;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import org.apache.commons.logging.LogFactory;
/**
* Global constants initialized from the file PROPERTIES_CONFIG_FILE on loading.
*/
public final class Constants {
private Constants() {
}
public static final String PROPERTIES_CONFIG_FILE = "/application.properties";
public static final String DEFAULT_SESSION = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
public static final String RMI_SERVER_NAME;
public static final String RMI_SERVER_HOST;
public static final int RMI_SERVER_PORT;
public static final boolean DEBUG = true;
static {
Properties props = new Properties();
try {
InputStream in = Constants.class.getResourceAsStream(PROPERTIES_CONFIG_FILE);
props.load(in);
in.close();
} catch (IOException ex) {
LogFactory.getLog(Constants.class).fatal(null, ex);
}
RMI_SERVER_NAME = props.getProperty("rmi-server-name", "alfa");
RMI_SERVER_HOST = props.getProperty("rmi-server-host", "localhost");
RMI_SERVER_PORT = Integer.parseInt(props.getProperty("rmi-server-port", "1099"));
String ons_domain_prefix = props.getProperty("ons-domain-prefix", "ons-peer.com.");
if (!ons_domain_prefix.endsWith(".")) {
ons_domain_prefix += ".";
}
}
}
ALfA/ALfA-RMI/src/main/java/fr/unicaen/iota/application/rmi/RMIServer.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
* Copyright © 2008-2012 Orange Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application.rmi;
import java.rmi.RMISecurityManager;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class RMIServer {
private static final Log log = LogFactory.getLog(RMIServer.class);
public static void main(String[] args) throws Exception {
String policyFile = RMIServer.class.getClassLoader().getResource("java.policy").toString();
System.setProperty("java.security.policy", policyFile);
System.setProperty("java.rmi.server.hostname", Constants.RMI_SERVER_HOST);
if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
}
log.info("Creating server...");
RMIAccessInterface im = new AccessModule();
log.trace("Exporting...");
RMIAccessInterface ali = (RMIAccessInterface) UnicastRemoteObject.exportObject(im, Constants.RMI_SERVER_PORT);
log.trace("Locating registry...");
Registry registry;
try {
registry = LocateRegistry.getRegistry(Constants.RMI_SERVER_PORT);
registry.list(); // throws if registry not running
} catch (RemoteException e) {
log.trace("Registry not found. We create one...");
registry = LocateRegistry.createRegistry(Constants.RMI_SERVER_PORT);
}
log.trace("Binding...");
registry.rebind(Constants.RMI_SERVER_NAME, ali);
log.info("RMI server started at: rmi://" + Constants.RMI_SERVER_HOST + ":" + Constants.RMI_SERVER_PORT + "/" + Constants.RMI_SERVER_NAME);
}
}
ALfA/ALfA-RMI/src/main/resources/META-INF/LICENSE
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
ALfA/ALfA-RMI/src/main/resources/application.properties
# RMI server configuration
# the host will be used by the clients
rmi-server-name = ALfA
rmi-server-host = localhost
rmi-server-port = 1099
# ONS address or hostname
ons = localhost
# ONS root domain (to construct FQDN from EPCs)
ons-domain-prefix = ons-peer.com.
# ONS specification used.
# 1.0 : original version (10000.30000.sgtin.id.ons-peer.com)
# 2.0 : WINGS version (0.0.0.0.1.0.0.0.0.3.sgtin.id.ons-peer.com)
ons-spec-level = 2.0
# nomenclature of the NAPTR fields
ons-epcis-entry = epc\\+epcis
ons-ds-entry = epc\\+ds
ons-html-entry = epc\\+html
ons-entry-regex = \\!\\^\\.\\*\\$\\!|\\!
ALfA/ALfA-RMI/src/main/resources/commons-logging.properties
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
ALfA/ALfA-RMI/src/main/resources/ds-client.properties
ws-connection-pool-size=10
ALfA/ALfA-RMI/src/main/resources/java.policy
grant {
permission java.util.PropertyPermission "*", "read";
permission java.util.PropertyPermission "java.rmi.server.hostname", "write";
permission java.io.FilePermission "<<ALL FILES>>", "read";
permission java.net.SocketPermission "*:*", "connect,resolve";
permission java.net.SocketPermission "*:*", "accept";
permission javax.xml.bind.JAXBPermission "setDatatypeConverter";
permission java.lang.RuntimePermission "accessDeclaredMembers";
permission java.lang.RuntimePermission "getClassLoader";
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
};
ALfA/ALfA-RMI/src/main/resources/log4j.properties
# LOG4J configuration
# default logging
log4j.rootCategory=INFO, LOGFILE
## CONSOLE is set to be a ConsoleAppender using a PatternLayout.
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[%p] [%C{1}:%L] %m%n
# logging to file
log4j.appender.LOGFILE=org.apache.log4j.RollingFileAppender
log4j.appender.LOGFILE.File=alfa.log
#log4j.appender.LOGFILE.DatePattern='.'yyyy-MM-dd'.log'
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%5p (%d{yyyy-MM-dd HH:mm:ss,SSS}) [%C:%L] - %m%n
ALfA/ALfA/LISEZMOI
ALfA - Access Layer For Applications
Serveur RMI servant d’interface entre EPCglobal/IoTa et des applications de
haut niveau.
launch.sh script pour lancer le serveur
Bibliothèque d’interface entre EPCglobal/IoTa et des applications de haut
niveau.
Dépendances:
modules IoTa:
- ALfA-PI
- IoTa-DiscoveryWS-Client
- Nu
- DSeTa-Client
- ETa-Client
bibliothèques:
- epcis-query-client
- epcis-commons
- dnsjava
- axiom-api
- commons-logging
- log4j
Configuration:
IoTa-Installer installe et configure ALfA.
Voir les fichiers *.properties et java.policy dans le fichier jar ; chacun
de ces fichiers peut être remplacé par un fichier du même nom dans le
répertoire courant.
(application.properties pour cette application,
ds-client.properties pour la bibliothèque cliente IoTa-DiscoveryWS-Client,
commons-logging.properties et log4j.properties pour les journaux)
Dépendances d’utilisation:
- un ONS
- un DWS (p.ex. IoTa-DiscoveryWS)
......
- EpcisPHI (facultatif)
Utilisation:
nohup ./alfa.sh
voir BETa, DELTa ou OMeGa pour des exemples de clients
voir ALfA-RMI ou OMeGa pour des exemples de clients
ALfA/ALfA/README
ALfA - Access Layer For Applications
RMI server to serve between EPCglobal/IoTa and top-level applications.
launch.sh utility script for starting the server
Interface library between EPCglobal/IoTa and top-level applications.
Dependencies:
IoTa modules:
- ALfA-PI
- IoTa-DiscoveryWS-Client
- Nu
- DSeTa-Client
- ETa-Client
libraries:
- epcis-query-client
- epcis-commons
- dnsjava
- axiom-api
- commons-logging
- log4j
Configuration:
IoTa-Installer installs and configures ALfA.
See the files *.properties and java.policy in the jar file (each of those
can be overriden by a file with the same name in the current directory).
(application.properties for this application,
ds-client.properties for the client library IoTa-DiscoveryWS-Client,
commons-logging.properties and log4j.properties for the logs)
Usage Dependencies:
- an ONS
- a DWS (eg. IoTa-DiscoveryWS)
......
- EpcisPHI (optional)
Usage:
nohup ./alfa.sh
see BETa, DELTa, or OMeGa for examples
see ALfA-RMI or OMeGa for examples
ALfA/ALfA/alfa.sh
#!/bin/sh
cp="."
for f in lib/*.jar; do
cp="${cp}:${f}"
done
java -cp ${cp} fr.unicaen.iota.application.rmi.RMIServer
ALfA/ALfA/pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fr.unicaen.iota.application</groupId>
<groupId>fr.unicaen.iota</groupId>
<artifactId>alfa</artifactId>
<version>1.0</version>
<version>1.9-mock</version>
<packaging>jar</packaging>
<name>ALfA</name>
......
<!-- IoTa dependencies -->
<dependency>
<groupId>fr.unicaen.iota.application</groupId>
<groupId>fr.unicaen.iota</groupId>
<artifactId>alfa-pi</artifactId>
<version>1.0</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>fr.unicaen.iota.discovery</groupId>
<artifactId>discovery-client</artifactId>
<version>1.0</version>
<groupId>fr.unicaen.iota</groupId>
<artifactId>nu</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Fosstrak dependencies -->
<dependency>
<groupId>org.fosstrak.epcis</groupId>
<artifactId>epcis-commons</artifactId>
<version>${epcis-version}</version>
<groupId>fr.unicaen.iota</groupId>
<artifactId>dseta-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.fosstrak.epcis</groupId>
<artifactId>epcis-queryclient</artifactId>
<version>${epcis-version}</version>
<groupId>fr.unicaen.iota</groupId>
<artifactId>eta-client</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Log dependencies -->
......
<version>1.2.16</version>
</dependency>
<!-- Other dependencies -->
<dependency>
<groupId>dnsjava</groupId>
<artifactId>dnsjava</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-api</artifactId>
<version>1.2.12</version>
</dependency>
</dependencies>
<build>
......
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>bin-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/main/assembly/bin-with-dependencies.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>sources</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptorRefs>
<descriptorRef>src</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>fosstrak</id>
<name>Fosstrak repository</name>
<url>https://oss.sonatype.org/content/repositories/public</url>
</repository>
</repositories>
</project>
ALfA/ALfA/src/main/java/fr/unicaen/iota/application/ALfA.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
* Copyright © 2008-2012 Orange Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application;
import fr.unicaen.iota.application.operations.DiscoveryOperation;
import fr.unicaen.iota.application.operations.EpcisOperation;
import fr.unicaen.iota.application.operations.TraceEPC;
import fr.unicaen.iota.application.operations.TraceEPCAsync;
import fr.unicaen.iota.application.rmi.CallbackClient;
import fr.unicaen.iota.ds.model.TEventItem;
import fr.unicaen.iota.ds.model.TServiceType;
import fr.unicaen.iota.nu.ONSEntryType;
import fr.unicaen.iota.nu.ONSOperation;
import fr.unicaen.iota.tau.model.Identity;
import java.rmi.RemoteException;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.fosstrak.epcis.model.EPCISEventType;
public class ALfA implements AccessInterface {
private static final Log LOG = LogFactory.getLog(ALfA.class);
@Override
public Map<ONSEntryType, String> queryONS(String EPC) {
LOG.trace("[COMMAND]--[QUERY ONS]");
LOG.trace(EPC);
return new ONSOperation().queryONS(EPC);
}
@Override
public String getReferentDS(String EPC) {
LOG.trace("[COMMAND]--[GET REFERENT DS]");
LOG.trace("EPC = " + EPC);
Map<ONSEntryType, String> res = queryONS(EPC);
return res.get(ONSEntryType.ided_ds);
}
@Override
public List<EPCISEventType> traceEPC(Identity identity, String EPC) throws RemoteException {
LOG.trace("[COMMAND]--[TRACE EPC]");
LOG.trace(EPC);
return new TraceEPC(identity).traceEPC(EPC);
}
@Override
public List<EPCISEventType> traceEPC(Identity identity, String EPC, Map<String, String> filters) throws RemoteException {
LOG.trace("[COMMAND]--[FILTERED TRACE]");
LOG.trace(EPC);
return new TraceEPC(identity).filteredTrace(EPC, filters);
}
@Override
public String getEPCDocURL(String EPC) {
LOG.trace("[COMMAND]--[GET EPC DOC]");
Map<ONSEntryType, String> res = queryONS(EPC);
return res.get(ONSEntryType.html);
}
@Override
public void traceEPCAsync(Identity identity, String sessionID, CallbackClient client, String EPC) throws RemoteException {
LOG.trace("[COMMAND]--[TRACE EPC ASYNC]");
new TraceEPCAsync(EPC, sessionID, client, identity).start();
}
@Override
public List<EPCISEventType> queryEPCIS(Identity identity, String EPC, String EPCISAddress) throws RemoteException {
LOG.trace("[COMMAND]--[QUERY EPCIS]");
EpcisOperation epcisOperation = null;
while (epcisOperation == null) {
try {
epcisOperation = new EpcisOperation(identity, EPCISAddress);
} catch (Exception e) {
epcisOperation = null;
LOG.warn("Unable to create service proxy port! [RETRY]", e);
}
}
return epcisOperation.getEventFromEPC(EPC);
}
@Override
public List<EPCISEventType> queryEPCIS(Identity identity, Map<String, String> filters, String EPCISAddress) throws RemoteException {
LOG.trace("[COMMAND]--[QUERY EPCIS FILTERS]");
EpcisOperation epcisOperation = null;
while (epcisOperation == null) {
try {
epcisOperation = new EpcisOperation(identity, EPCISAddress);
} catch (Exception e) {
epcisOperation = null;
LOG.warn("Unable to create service proxy port! [RETRY]", e);
}
}
List<EPCISEventType> res = epcisOperation.getFilteredEvent(filters);
return res;
}
@Override
public List<TEventItem> queryDS(Identity identity, String EPC, String DSAddress) throws RemoteException {
LOG.trace("[COMMAND]--[QUERY DS]");
DiscoveryOperation dsOperation = new DiscoveryOperation(identity, DSAddress);
List<TEventItem> list = dsOperation.getDSEvents(EPC);
return list;
}
@Override
public List<TEventItem> queryDS(Identity identity, String EPC, String DSAddress, TServiceType serviceType) throws RemoteException {
LOG.trace("[COMMAND]--[QUERY DS]");
try {
DiscoveryOperation dsOperation = new DiscoveryOperation(identity, DSAddress);
List<TEventItem> list = dsOperation.getDSEvents(EPC, serviceType);
return list;
} catch (Exception e) {
LOG.error(null, e);
return null;
}
}
}
ALfA/ALfA/src/main/java/fr/unicaen/iota/application/Controler.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
* Copyright © 2008-2012 Orange Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application;
import fr.unicaen.iota.application.conf.Constants;
import fr.unicaen.iota.application.model.DSEvent;
import fr.unicaen.iota.application.model.EPCISEvent;
import fr.unicaen.iota.application.model.Spec;
import fr.unicaen.iota.application.operations.*;
import fr.unicaen.iota.application.rmi.CallBackClient;
import fr.unicaen.iota.application.model.ONSEntryType;
import fr.unicaen.iota.application.util.EpcisUtil;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.fosstrak.epcis.model.EPCISEventType;
public class Controler {
private static final Log LOG = LogFactory.getLog(Controler.class);
public Map<ONSEntryType, String> queryONS(String epc) {
LOG.trace("[COMMAND]--[QUERY ONS]");
LOG.trace(epc);
return new ONSOperation(Constants.ONS_HOSTS).queryONS(epc);
}
public String getReferenteDS(String epc) throws RemoteException {
LOG.trace("[COMMAND]--[GET REFERENTE DS]");
LOG.trace("EPC = " + epc);
Map<ONSEntryType, String> res = queryONS(epc);
return res.get(ONSEntryType.ds);
}
public List<EPCISEvent> traceEPC(String epc) throws RemoteException {
LOG.trace("[COMMAND]--[TRACE EPC]");
LOG.trace(epc);
return new TraceEPC(Constants.DS_LOGIN, Constants.DS_PASSWORD).traceEPC(epc);
}
public List<String> getEPCDoc(String epc) {
LOG.trace("[COMMAND]--[GET EPC DOC]");
throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#getEPCDoc");
}
public List<EPCISEvent> getEPCEPCIS(String epc) {
LOG.trace("[COMMAND]--[GET EPC EPCIS]");
throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#getEPCEPCIS");
}
public Spec getSpecs(String address) throws RemoteException {
LOG.trace("[COMMAND]--[GET SPEC]");
return GetSpec.getSpecs(address);
}
public void traceEPCAsync(String sessionId, CallBackClient client, String EPC) throws RemoteException {
LOG.trace("[COMMAND]--[TRACE EPC ASYNC]");
new TraceEPCAsync(EPC, client, Constants.DS_LOGIN, Constants.DS_PASSWORD, sessionId).start();
}
public List<EPCISEvent> queryEPCIS(String epc, String EPCISAddress) throws RemoteException {
LOG.trace("[COMMAND]--[QUERY EPCIS]");
List<EPCISEvent> list = new ArrayList<EPCISEvent>();
EpcisOperation epcisOperation = null;
while (epcisOperation == null) {
try {
epcisOperation = new EpcisOperation(EPCISAddress);
} catch (Exception e) {
epcisOperation = null;
LOG.warn("Unable to create service proxy port! [RETRY]");
}
try {
Thread.sleep(1);
} catch (InterruptedException ex) {
}
}
List<EPCISEventType> tmp = new ArrayList<EPCISEventType>();
List<EPCISEventType> l;
if ((l = epcisOperation.getAggregationEventFromEPC(epc)) != null) {
tmp.addAll(l);
}
if ((l = epcisOperation.getObjectEventFromEPC(epc)) != null) {
tmp.addAll(l);
}
for (EPCISEventType o : tmp) {
list.add(EpcisUtil.processEvent(o));
}
return list;
}
public List<DSEvent> queryDS(String epc, String DSAddress, String login, String password) throws RemoteException {
LOG.trace("[COMMAND]--[QUERY DS]");
DiscoveryOperation dsOperation = new DiscoveryOperation(login, password, DSAddress);
List<DSEvent> list = dsOperation.getDSEvents(epc);
return list;
}
public List<DSEvent> queryDS(String epc, String DSAddress, String login, String password, String serviceType) throws RemoteException {
LOG.trace("[COMMAND]--[QUERY DS]");
try {
DiscoveryOperation dsOperation = new DiscoveryOperation(login, password, DSAddress);
List<DSEvent> list = dsOperation.getDSEvents(epc, serviceType);
return list;
} catch (Exception e) {
LOG.error(null, e);
return null;
}
}
}
ALfA/ALfA/src/main/java/fr/unicaen/iota/application/conf/Constants.java
/*
* This program is a part of the IoTa project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application.conf;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import org.apache.commons.logging.LogFactory;
/**
* Constantes globales initialisées depuis le fichier PROPERTIES_CONFIG_FILE au
* chargement.
*/
public final class Constants {
private Constants() {
}
public static final String PROPERTIES_CONFIG_FILE = "/application.properties";
public static String[] ONS_HOSTS;
public static String ONS_EPCIS_ENTRY;
public static String ONS_DS_ENTRY;
public static String ONS_SPEC_ENTRY;
public static String ONS_ENTRY_REGEX;
public static final String DEFAULT_SESSION = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
public static String RMI_SERVER_NAME;
public static String RMI_SERVER_HOST;
public static int RMI_SERVER_PORT;
public static String ONS_DOMAIN_PREFIX;
public static double ONS_SPEC_LEVEL;
public static String DS_LOGIN;
public static String DS_PASSWORD;
public static boolean DEBUG = true;
static {
try {
Properties props = loadProperties();
ONS_HOSTS = props.getProperty("ons").split(",");
for (int i = 0; i < ONS_HOSTS.length; i++) {
ONS_HOSTS[i] = ONS_HOSTS[i].trim();
}
RMI_SERVER_NAME = props.getProperty("rmi-server-name", "alfa");
RMI_SERVER_HOST = props.getProperty("rmi-server-host", "localhost");
RMI_SERVER_PORT = Integer.parseInt(props.getProperty("rmi-server-port", "1099"));
DS_LOGIN = props.getProperty("ds-login", "anonymous");
DS_PASSWORD = props.getProperty("ds-password", "anonymous");
ONS_DOMAIN_PREFIX = props.getProperty("ons-domain-prefix", "ons-peer.com.");
if (!ONS_DOMAIN_PREFIX.endsWith(".")) {
ONS_DOMAIN_PREFIX += ".";
}
ONS_SPEC_LEVEL = Double.parseDouble(props.getProperty("ons-spec-level", "2.0"));
ONS_EPCIS_ENTRY = props.getProperty("ons-epcis-entry", "epc\\+epcis");
ONS_DS_ENTRY = props.getProperty("ons-ds-entry", "epc\\+ds");
ONS_SPEC_ENTRY = props.getProperty("ons-spec-entry", "epc\\+spec");
ONS_ENTRY_REGEX = props.getProperty("ons-entry-regex", "\\!\\^\\.\\*\\$\\!|\\!");
} catch (IOException ex) {
LogFactory.getLog(Constants.class).fatal(null, ex);
}
}
public static Properties loadProperties() throws IOException {
// create and load default properties
Properties props = new Properties();
InputStream in = Constants.class.getResourceAsStream(PROPERTIES_CONFIG_FILE);
props.load(in);
in.close();
return props;
}
}
ALfA/ALfA/src/main/java/fr/unicaen/iota/application/model/Portion.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
* Copyright © 2008-2012 Orange Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application.model;
public class Portion {
private final EPCISEvent start;
private final EPCISEvent end;
public Portion(EPCISEvent start, EPCISEvent end) {
super();
this.start = start;
this.end = end;
}
public EPCISEvent getStart() {
return start;
}
public EPCISEvent getEnd() {
return end;
}
}
ALfA/ALfA/src/main/java/fr/unicaen/iota/application/operations/DiscoveryOperation.java
*/
package fr.unicaen.iota.application.operations;
import fr.unicaen.iota.application.conf.Constants;
import fr.unicaen.iota.application.model.DSEvent;
import fr.unicaen.iota.application.rmi.CallBackClient;
import fr.unicaen.iota.discovery.client.DsClient;
import fr.unicaen.iota.discovery.client.model.Event;
import fr.unicaen.iota.discovery.client.model.Service;
import fr.unicaen.iota.application.rmi.CallbackClient;
import fr.unicaen.iota.discovery.client.util.EnhancedProtocolException;
import fr.unicaen.iota.ds.model.TEventItem;
import fr.unicaen.iota.ds.model.TServiceItem;
import fr.unicaen.iota.ds.model.TServiceType;
import fr.unicaen.iota.dseta.client.DSeTaClient;
import fr.unicaen.iota.tau.model.Identity;
import java.rmi.RemoteException;
import java.sql.Timestamp;
import java.util.*;
import org.apache.axis2.databinding.types.URI.MalformedURIException;
import org.apache.commons.logging.Log;
......
public class DiscoveryOperation {
private static final Log log = LogFactory.getLog(DiscoveryOperation.class);
private final String LOGIN;
private final String PASS;
private final Identity identity;
private String DS_SERVICE_ADDRESS;
private final CallBackClient client;
private final String sessionId;
private final CallbackClient client;
private final String sessionID;
private final Set<String> visitedSet = new HashSet<String>();
private final DSeTaClient dSClient;
public DiscoveryOperation(String login, String pass, String ds_service_address) {
public DiscoveryOperation(Identity identity, String ds_service_address) {
super();
this.LOGIN = login;
this.PASS = pass;
this.identity = identity;
this.DS_SERVICE_ADDRESS = ds_service_address;
this.client = null;
this.sessionId = null;
this.sessionID = null;
this.dSClient = new DSeTaClient(identity, DS_SERVICE_ADDRESS);
}
public DiscoveryOperation(String login, String pass, String dsAddress, CallBackClient client, String sessionId) {
public DiscoveryOperation(Identity identity, String dsAddress, String sessionID, CallbackClient client) {
super();
this.LOGIN = login;
this.PASS = pass;
this.identity = identity;
this.DS_SERVICE_ADDRESS = dsAddress;
this.client = client;
this.sessionId = sessionId;
this.sessionID = sessionID;
this.dSClient = new DSeTaClient(identity, DS_SERVICE_ADDRESS);
}
private transient DsClient dSClient = null;
private transient String dSSessionID = null;
private void login() throws RemoteException {
log.debug("[DS SESSION START]");
log.debug(" -> " + DS_SERVICE_ADDRESS);
dSClient = new DsClient(DS_SERVICE_ADDRESS);
private List<TEventItem> getEvents(String EPC) throws RemoteException {
List<TEventItem> dsClientEventList;
try {
dSSessionID = dSClient.userLogin(Constants.DEFAULT_SESSION, LOGIN, PASS).getSessionId();
} catch (RemoteException ex) {
log.error("Unable to connect to the DS: login or password error!", ex);
throw new RemoteException("Unable to connect to the DS: login or password error!");
} catch (EnhancedProtocolException ex) {
log.error("Unable to connect to the DS: login or password error!", ex);
throw new RemoteException("Unable to connect to the DS: login or password error!");
}
log.debug(" -> " + dSSessionID);
if (dSSessionID == null) {
throw new RemoteException("Unable to connect to the DS: login or password error!");
}
}
private void logout() throws RemoteException {
try {
dSClient.userLogout(dSSessionID);
dSSessionID = null;
dSClient = null;
} catch (RemoteException ex) {
log.error("Unable to logout", ex);
throw new RemoteException("Unable to logout");
} catch (EnhancedProtocolException ex) {
log.error("Unable to logout", ex);
throw new RemoteException("Unable to logout");
}
log.debug("[DS SESSION END]");
}
private List<Event> getEvents(String EPC) throws RemoteException {
List<Event> dsClientEventList;
try {
dsClientEventList = dSClient.eventLookup(dSSessionID, EPC, null, null, null);
dsClientEventList = dSClient.eventLookup(EPC, null, null, null);
} catch (MalformedURIException ex) {
log.error("Unable to process eventLookup", ex);
throw new RemoteException("Unable to process eventLookup");
......
public Set<String> discover(String EPC) {
Set<String> result = new HashSet<String>();
Collection<Event> evtList;
Collection<TEventItem> evtList;
try {
login();
evtList = getEvents(EPC);
} catch (RemoteException e) {
log.error(null, e);
return new HashSet<String>();
}
for (Event evt : evtList) {
log.trace("Source found: " + evt.getPartnerId());
Collection<Service> serviceList = evt.getServiceList();
for (TEventItem evt : evtList) {
log.trace("Source found: " + evt.getP());
Collection<TServiceItem> serviceList = evt.getServiceList().getService();
log.trace(serviceList.size());
for (Service s : serviceList) {
log.trace(" PartnerID: " + evt.getPartnerId());
for (TServiceItem s : serviceList) {
log.trace(" PartnerID: " + evt.getP());
log.trace(" | service type: " + s.getType());
log.trace(" | service address: " + s.getUri());
if ("ds".equals(s.getType())) {
// TODO: also handle TServiceType.DS (?)
if (s.getType() == TServiceType.IDED_DS) {
// TODO: Quick'n'dirty correction
String old_addr = DS_SERVICE_ADDRESS;
DS_SERVICE_ADDRESS = s.getUri().toString();
result.addAll(discover(EPC));
} else {
DS_SERVICE_ADDRESS = old_addr;
} else if (s.getType() == TServiceType.IDED_EPCIS) {
result.add(s.getUri().toString());
if (client != null && !visitedSet.contains(s.getUri().toString())) {
new EpcisRequest(s.getUri().toString(), EPC, LOGIN, PASS, client, sessionId).start();
new EpcisRequest(s.getUri().toString(), EPC, identity, sessionID, client).start();
visitedSet.add(s.getUri().toString());
}
}
} // else: do nothing
}
}
try {
logout();
} catch (RemoteException ex) {
log.fatal(null, ex);
}
return result;
}
public List<DSEvent> getDSEvents(String EPC) throws RemoteException {
List<DSEvent> result = new ArrayList<DSEvent>();
login();
for (Event dsClientEvent : getEvents(EPC)) {
Service first = dsClientEvent.getServiceList().get(0);
public List<TEventItem> getDSEvents(String EPC) throws RemoteException {
List<TEventItem> result = new ArrayList<TEventItem>();
for (TEventItem dsClientEvent : getEvents(EPC)) {
TServiceItem first = dsClientEvent.getServiceList().getService().get(0);
log.debug(EPC + " | partnerID: " + first.getId());
log.debug(EPC + " | partner info size: " + dsClientEvent.getServiceList().size());
log.debug(EPC + " | partner info size: " + dsClientEvent.getServiceList().getService().size());
log.debug(EPC + " | partner type: " + first.getType());
result.add(new DSEvent(EPC, first.getUri().toString(), dsClientEvent.getBizStep(),
new Timestamp(dsClientEvent.getSourceTimeStamp().getTimeInMillis())));
result.add(dsClientEvent);
}
logout();
return result;
}
public List<DSEvent> getDSEvents(String EPC, String serviceType) throws RemoteException {
List<DSEvent> result = new ArrayList<DSEvent>();
login();
for (Event dsClientEvent : getEvents(EPC)) {
if (!dsClientEvent.getServiceList().isEmpty()) {
Service firstService = dsClientEvent.getServiceList().get(0);
public List<TEventItem> getDSEvents(String EPC, TServiceType serviceType) throws RemoteException {
List<TEventItem> result = new ArrayList<TEventItem>();
for (TEventItem dsClientEvent : getEvents(EPC)) {
if (!dsClientEvent.getServiceList().getService().isEmpty()) {
TServiceItem firstService = dsClientEvent.getServiceList().getService().get(0);
log.debug(EPC + " | partnerID:" + firstService.getId());
log.debug(EPC + " | partner info size:" + dsClientEvent.getServiceList().size());
log.debug(EPC + " | partner info size:" + dsClientEvent.getServiceList().getService().size());
log.debug(EPC + " | partner type: " + firstService.getType());
if (firstService.getType().equals(serviceType)) {
result.add(new DSEvent(EPC, firstService.getUri().toString(),
dsClientEvent.getBizStep(), new Timestamp(dsClientEvent.getSourceTimeStamp().getTimeInMillis())));
if (firstService.getType() == serviceType) {
result.add(dsClientEvent);
}
}
}
log.debug(EPC + " -> dsEvents with corresponding type: " + result.size());
logout();
return result;
}
}
ALfA/ALfA/src/main/java/fr/unicaen/iota/application/operations/EpcisOperation.java
*/
package fr.unicaen.iota.application.operations;
import java.net.URL;
import fr.unicaen.iota.eta.query.ETaQueryControlClient;
import fr.unicaen.iota.tau.model.Identity;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.HashMap;
......
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.fosstrak.epcis.model.*;
import org.fosstrak.epcis.queryclient.QueryControlClient;
public class EpcisOperation {
private final String EPCIS_SERVICE_ADDRESS;
private final Identity IDENTITY;
private static final Log log = LogFactory.getLog(EpcisOperation.class);
public EpcisOperation(String epcis_service_address) throws Exception {
public EpcisOperation(Identity identity, String epcis_service_address) {
IDENTITY = identity;
EPCIS_SERVICE_ADDRESS = epcis_service_address;
}
......
return queryParam;
}
private List<EPCISEventType> getFilteredEvent(Map<String, String> filters) throws RemoteException {
public List<EPCISEventType> getFilteredEvent(Map<String, String> filters) throws RemoteException {
log.trace("getFilteredEvent");
try {
QueryControlClient client = new QueryControlClient();
client.configureService(new URL(EPCIS_SERVICE_ADDRESS), null);
ETaQueryControlClient client = new ETaQueryControlClient(IDENTITY, EPCIS_SERVICE_ADDRESS);
QueryParams queryParams = new QueryParams();
for (Map.Entry<String, String> entry : filters.entrySet()) {
queryParams.getParam().add(createEPCISParameter(entry.getKey(), entry.getValue()));
......
public List<EPCISEventType> getEventFromEPC(String EPC) throws RemoteException {
log.trace("getEventFromEPC: " + EPC);
Map<String, String> map = new HashMap<String, String>();
map.put("MATCH_epc", EPC);
return getFilteredEvent(map);
List<EPCISEventType> res = new ArrayList<EPCISEventType>();
res.addAll(getObjectEventFromEPC(EPC, new HashMap<String, String>()));
res.addAll(getAggregationEventFromEPC(EPC, new HashMap<String, String>()));
res.addAll(getQuantityEventFromEPC(EPC, new HashMap<String, String>()));
res.addAll(getTransactionEventFromEPC(EPC, new HashMap<String, String>()));
return res;
}
public List<EPCISEventType> getObjectEventFromEPC(String EPC, Map<String, String> filters) throws RemoteException {
log.trace("getObjectEventFromEPC: " + EPC);
Map<String, String> allFilters = new HashMap<String, String>(filters);
allFilters.put("MATCH_epc", EPC);
allFilters.put("eventType", "ObjectEvent");
return getFilteredEvent(allFilters);
}
public List<EPCISEventType> getTransactionEventFromEPC(String EPC, Map<String, String> filters) throws RemoteException {
log.trace("getObjectEventFromEPC: " + EPC);
Map<String, String> allFilters = new HashMap<String, String>(filters);
allFilters.put("MATCH_parentID", EPC);
allFilters.put("eventType", "TransactionEvent");
return getFilteredEvent(allFilters);
}
public List<EPCISEventType> getObjectEventFromEPC(String EPC) throws RemoteException {
public List<EPCISEventType> getQuantityEventFromEPC(String EPC, Map<String, String> filters) throws RemoteException {
log.trace("getObjectEventFromEPC: " + EPC);
Map<String, String> map = new HashMap<String, String>();
map.put("MATCH_epc", EPC);
map.put("eventType", "ObjectEvent");
return getFilteredEvent(map);
Map<String, String> allFilters = new HashMap<String, String>(filters);
allFilters.put("MATCH_epc", EPC);
allFilters.put("eventType", "QuantityEvent");
return getFilteredEvent(allFilters);
}
public List<EPCISEventType> getAggregationEventFromEPC(String EPC) throws RemoteException {
public List<EPCISEventType> getAggregationEventFromEPC(String EPC, Map<String, String> filters) throws RemoteException {
log.trace("getAggregationEventFromEPC: " + EPC);
Map<String, String> map = new HashMap<String, String>();
map.put("MATCH_parentID", EPC);
map.put("eventType", "AggregationEvent");
return getFilteredEvent(map);
Map<String, String> allFilters = new HashMap<String, String>(filters);
allFilters.put("MATCH_parentID", EPC);
allFilters.put("eventType", "AggregationEvent");
return getFilteredEvent(allFilters);
}
private List<EPCISEventType> getEvents(EventListType eventListType) {
ALfA/ALfA/src/main/java/fr/unicaen/iota/application/operations/EpcisRequest.java
*/
package fr.unicaen.iota.application.operations;
import fr.unicaen.iota.application.model.EPCISEvent;
import fr.unicaen.iota.application.rmi.CallBackClient;
import fr.unicaen.iota.application.util.EpcisUtil;
import fr.unicaen.iota.application.rmi.CallbackClient;
import fr.unicaen.iota.tau.model.Identity;
import java.rmi.RemoteException;
import java.util.Collection;
import org.apache.commons.logging.Log;
......
import org.fosstrak.epcis.model.AggregationEventType;
import org.fosstrak.epcis.model.EPC;
import org.fosstrak.epcis.model.EPCISEventType;
import org.fosstrak.epcis.model.TransactionEventType;
public class EpcisRequest extends Thread {
private final String serviceAddress;
private final String epc;
private final String LOGIN;
private final String PASS;
private final CallBackClient client;
private final String sessionId;
private final Identity identity;
private final String sessionID;
private final CallbackClient client;
private static final boolean isDebug = true; // TODO: hard value
private static final Log log = LogFactory.getLog(EpcisRequest.class);
public EpcisRequest(String serviceAddress, String epc, String LOGIN,
String PASS, CallBackClient client, String sessionId) {
this.LOGIN = LOGIN;
this.PASS = PASS;
public EpcisRequest(String serviceAddress, String epc, Identity identity, String sessionID, CallbackClient client) {
this.identity = identity;
this.epc = epc;
this.sessionID = sessionID;
this.client = client;
this.sessionId = sessionId;
this.serviceAddress = serviceAddress;
}
......
debug.append("\n");
debug.append("Events: \n");
}
EpcisOperation epcisOperation = null;
while (epcisOperation == null) {
EpcisOperation epcisOperation = new EpcisOperation(identity, serviceAddress);
Collection<EPCISEventType> evts = epcisOperation.getEventFromEPC(epc);
for (EPCISEventType evt : evts) {
try {
epcisOperation = new EpcisOperation(serviceAddress);
} catch (Exception e) {
epcisOperation = null;
log.warn("Unable to create service proxy port. Will retry ...");
}
try {
Thread.sleep(1);
} catch (InterruptedException ex) {
}
}
for (EPCISEventType o : epcisOperation.getObjectEventFromEPC(epc)) {
try {
EPCISEvent e = EpcisUtil.processEvent(o);
if (isDebug) {
debug.append("------------------------------------------\n");
debug.append(e.toString());
debug.append(evt.toString());
debug.append("\n------------------------------------------\n");
}
client.pushEvent(sessionId, e);
client.pushEvent(sessionID, evt);
} catch (RemoteException ex) {
log.fatal(null, ex);
}
......
if (isDebug) {
debug.append("Aggregation: \n");
}
Collection<EPCISEventType> aggregationEvents = epcisOperation.getAggregationEventFromEPC(epc);
for (EPCISEventType o : aggregationEvents) {
try {
EPCISEvent e = EpcisUtil.processEvent(o);
if (isDebug) {
debug.append("------------------------------------------\n");
debug.append(e.toString());
debug.append("\n------------------------------------------\n");
}
client.pushEvent(sessionId, e);
} catch (RemoteException ex) {
log.fatal(null, ex);
}
}
if (isDebug) {
debug.append("\n\n");
log.debug(debug);
}
if (aggregationEvents != null) {
for (EPCISEventType o : aggregationEvents) {
for (EPCISEventType o : evts) {
if (o instanceof AggregationEventType) {
AggregationEventType event = (AggregationEventType) o;
for (EPC epc2 : event.getChildEPCs().getEpc()) {
log.trace("new traceEPC: " + epc2.getValue());
new TraceEPCAsync(epc2.getValue(), client, LOGIN, PASS, sessionId).start();
for (EPC childEpc : event.getChildEPCs().getEpc()) {
log.trace("new traceEPC: " + childEpc.getValue());
new TraceEPCAsync(childEpc.getValue(), sessionID, client, identity).start();
}
} else if (o instanceof TransactionEventType) {
TransactionEventType event = (TransactionEventType) o;
for (EPC childEpc : event.getEpcList().getEpc()) {
log.trace("new traceEPC: " + childEpc.getValue());
new TraceEPCAsync(childEpc.getValue(), sessionID, client, identity).start();
}
}
}
ALfA/ALfA/src/main/java/fr/unicaen/iota/application/operations/GetSpec.java
/*
* This program is a part of the IoTa project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application.operations;
import fr.unicaen.iota.application.model.Spec;
import java.io.IOException;
import java.rmi.RemoteException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
/**
*
*/
public class GetSpec {
private GetSpec() {
}
private static final Log log = LogFactory.getLog(GetSpec.class);
public static Spec getSpecs(String address) throws RemoteException {
Spec result = new Spec();
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder;
builder = factory.newDocumentBuilder();
Document document = builder.parse(address);
// epc
Node epcNode = document.getElementsByTagName("epc").item(0);
log.trace(epcNode.getChildNodes().item(0).getNodeValue());
result.setEpc(epcNode.getChildNodes().item(0).getNodeValue());
// manufacturer
Node manufacturerNode = document.getElementsByTagName("manufacturer").item(0);
NodeList manufacterPropertyList = manufacturerNode.getChildNodes();
for (int i = 0; i < manufacterPropertyList.getLength(); i++) {
Node foo = manufacterPropertyList.item(i);
if (foo.getNodeName().equals("#text")) {
continue;
}
NamedNodeMap attr = foo.getAttributes();
log.trace(attr.getNamedItem("name").getNodeValue() + ", " + attr.getNamedItem("value").getNodeValue());
result.getManufacturer().put(attr.getNamedItem("name").getNodeValue(), attr.getNamedItem("value").getNodeValue());
}
// product
Node productNode = document.getElementsByTagName("product").item(0);
NodeList productPropertyList = productNode.getChildNodes();
for (int i = 0; i < productPropertyList.getLength(); i++) {
Node foo = productPropertyList.item(i);
if (foo.getNodeName().equals("#text")) {
continue;
}
NamedNodeMap attr = foo.getAttributes();
log.trace(attr.getNamedItem("name").getNodeValue() + ", " + attr.getNamedItem("value").getNodeValue());
result.getProduct().put(attr.getNamedItem("name").getNodeValue(), attr.getNamedItem("value").getNodeValue());
}
// extension
Node extensionNode = document.getElementsByTagName("product").item(0);
NodeList extensionPropertyList = extensionNode.getChildNodes();
for (int i = 0; i < extensionPropertyList.getLength(); i++) {
Node foo = extensionPropertyList.item(i);
if (foo.getNodeName().equals("#text")) {
continue;
}
NamedNodeMap attr = foo.getAttributes();
log.trace(attr.getNamedItem("name").getNodeValue() + ", " + attr.getNamedItem("value").getNodeValue());
result.getExtension().put(attr.getNamedItem("name").getNodeValue(), attr.getNamedItem("value").getNodeValue());
}
} catch (ParserConfigurationException e) {
log.error(null, e);
return null;
} catch (SAXException e) {
log.error(null, e);
return null;
} catch (IOException e) {
log.error(null, e);
return null;
}
return result;
}
}
ALfA/ALfA/src/main/java/fr/unicaen/iota/application/operations/ONSOperation.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
* Copyright © 2008-2012 Orange Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application.operations;
import fr.unicaen.iota.application.conf.Constants;
import fr.unicaen.iota.application.model.ONSEntryType;
import fr.unicaen.iota.application.util.EPCUtilities;
import fr.unicaen.iota.application.util.EPCUtilities.InvalidFormatException;
import java.io.IOException;
import java.rmi.RemoteException;
import java.util.EnumMap;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.xbill.DNS.*;
/**
*
*/
public class ONSOperation {
private final String[] ONS_ADDRESSES;
private static final Log log = LogFactory.getLog(ONSOperation.class);
public ONSOperation(String[] ONS_ADDRESSES) {
this.ONS_ADDRESSES = ONS_ADDRESSES;
}
public String getReferentDS(String epc) throws RemoteException {
Map<ONSEntryType, String> res = queryONS(epc);
return res.get(ONSEntryType.ds);
}
public Map<ONSEntryType, String> queryONS(String epc) {
log.trace("queryONS: " + epc);
Map<ONSEntryType, String> result = new EnumMap<ONSEntryType, String>(ONSEntryType.class);
Record[] records;
try {
String formatedEPC = Constants.ONS_SPEC_LEVEL >= 2 ? EPCUtilities.formatRevertEpc(epc) : formatEPC(epc);
log.trace(formatedEPC);
records = reverseDns(formatedEPC);
} catch (InvalidFormatException ex) {
log.error(null, ex);
return null;
} catch (IOException e) {
log.error(null, e);
return null;
}
if (records == null) {
return null;
}
for (Record record : records) {
String entry = record.rdataToString();
log.trace(entry);
if (entry.split(Constants.ONS_EPCIS_ENTRY).length > 1) {
String[] tab = entry.split(Constants.ONS_ENTRY_REGEX);
result.put(ONSEntryType.epcis, tab[1]);
}
if (entry.split(Constants.ONS_SPEC_ENTRY).length > 1) {
String[] tab = entry.split(Constants.ONS_ENTRY_REGEX);
result.put(ONSEntryType.spec, tab[1]);
}
if (entry.split(Constants.ONS_DS_ENTRY).length > 1) {
String[] tab = entry.split(Constants.ONS_ENTRY_REGEX);
result.put(ONSEntryType.ds, tab[1]);
}
}
return result;
}
private String formatEPC(String epc) {
String[] tab = epc.split("\\.|:");
if (tab.length != 7) {
return "0.0.0.sgtin.onsepc1.eu.";
}
StringBuilder res = new StringBuilder();
for (int i = 5; i >= 2; i--) {
res.append(tab[i]);
res.append(".");
}
res.append(Constants.ONS_DOMAIN_PREFIX);
return res.toString();
}
private Record[] reverseDns(String hostIp) throws IOException {
log.trace("reverseDns: " + hostIp);
Resolver res = new ExtendedResolver(ONS_ADDRESSES);
Name name = new Name(hostIp);
int type = Type.NAPTR;
int dclass = DClass.IN;
Record rec = Record.newRecord(name, type, dclass);
Message query = Message.newQuery(rec);
Message response = res.send(query);
Record[] answers = response.getSectionArray(Section.ANSWER);
return answers.length == 0 ? null : answers;
}
}
ALfA/ALfA/src/main/java/fr/unicaen/iota/application/operations/TraceEPC.java
*/
package fr.unicaen.iota.application.operations;
import fr.unicaen.iota.application.conf.Constants;
import fr.unicaen.iota.application.model.EPCISEvent;
import fr.unicaen.iota.application.util.EpcisUtil;
import fr.unicaen.iota.nu.ONSOperation;
import fr.unicaen.iota.tau.model.Identity;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.*;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.fosstrak.epcis.model.AggregationEventType;
import org.fosstrak.epcis.model.EPC;
import org.fosstrak.epcis.model.EPCISEventType;
import org.fosstrak.epcis.model.TransactionEventType;
/**
*
*/
public class TraceEPC {
private final String DS_LOGIN;
private final String DS_PASS;
private final Identity identity;
private final ONSOperation onsOperation;
private List<EPCISEventType> eventList;
private static final Log log = LogFactory.getLog(TraceEPC.class);
public TraceEPC(String login, String pass) {
this.DS_LOGIN = login;
this.DS_PASS = pass;
this.onsOperation = new ONSOperation(Constants.ONS_HOSTS);
public TraceEPC(Identity identity) {
this.identity = identity;
this.onsOperation = new ONSOperation();
}
public List<EPCISEvent> traceEPC(String epc) throws RemoteException {
log.trace("EPC = " + epc);
eventList = new ArrayList<EPCISEventType>();
return traceEPCaux(epc);
public List<EPCISEventType> traceEPC(String EPC) throws RemoteException {
log.trace("EPC = " + EPC);
return traceEPCAux(EPC, new HashMap<String, String>());
}
private List<EPCISEvent> traceEPCaux(String epc) throws RemoteException {
log.trace("[TRACE EPC]: " + epc);
log.trace("CALLED METHOD: <traceEPC>");
public List<EPCISEventType> filteredTrace(String EPC, Map<String, String> filters) throws RemoteException {
log.trace("Filters = " + filters);
return traceEPCAux(EPC, filters);
}
private List<EPCISEventType> traceEPCAux(String EPC, Map<String, String> filters) throws RemoteException {
log.trace("[TRACE EPC]: " + EPC);
log.trace("Get Referent ds address");
String dsAddress = onsOperation.getReferentDS(epc);
String dsAddress = onsOperation.getReferentIDedDS(EPC);
if (dsAddress == null) {
log.warn("Unable to retreive referent ds address for this epc code");
return new ArrayList<EPCISEvent>();
return new ArrayList<EPCISEventType>();
} else {
log.trace("referent ds address found: " + dsAddress);
}
log.trace("Start discover");
DiscoveryOperation dsOp = new DiscoveryOperation(DS_LOGIN, DS_PASS, dsAddress);
traceEPC(epc, dsOp);
List<EPCISEvent> tab = processEventList(eventList);
return tab;
DiscoveryOperation dsOp = new DiscoveryOperation(identity, dsAddress);
return traceEPC(dsOp, EPC, filters);
}
private void traceEPC(String epc, DiscoveryOperation dsOp) throws RemoteException {
for (String EPCIS_SERVICE_ADDRESS : dsOp.discover(epc)) {
private List<EPCISEventType> traceEPC(DiscoveryOperation dsOp, String EPC, Map<String, String> filters) throws RemoteException {
List<EPCISEventType> eventList = new ArrayList<EPCISEventType>();
for (String EPCIS_SERVICE_ADDRESS : dsOp.discover(EPC)) {
EpcisOperation epcisOperation = null;
while (epcisOperation == null) {
try {
epcisOperation = new EpcisOperation(EPCIS_SERVICE_ADDRESS);
} catch (Exception e) {
epcisOperation = new EpcisOperation(identity, EPCIS_SERVICE_ADDRESS);
} catch (Exception ex) {
epcisOperation = null;
log.warn("Unable to create service proxy port! [RETRYING]");
}
try {
Thread.sleep(1);
} catch (InterruptedException ex) {
log.warn("Unable to create service proxy port! [RETRYING]", ex);
}
}
Collection<EPCISEventType> list = epcisOperation.getObjectEventFromEPC(epc);
Collection<EPCISEventType> list = epcisOperation.getObjectEventFromEPC(EPC, filters);
eventList.addAll(list);
list = epcisOperation.getQuantityEventFromEPC(EPC, filters);
eventList.addAll(list);
log.trace("nb epc events: " + list.size());
Collection<EPCISEventType> childs = epcisOperation.getAggregationEventFromEPC(epc);
log.trace("nb child events: " + childs.size());
eventList.addAll(childs);
if (childs != null) {
for (EPCISEventType o : childs) {
AggregationEventType event = (AggregationEventType) o;
for (EPC epc2 : event.getChildEPCs().getEpc()) {
log.trace("new traceEPC: " + epc2.getValue());
traceEPCaux(epc2.getValue());
}
log.trace("nbr epc events: " + list.size());
Collection<EPCISEventType> children = epcisOperation.getAggregationEventFromEPC(EPC, filters);
eventList.addAll(children);
log.trace("nbr child events: " + children.size());
for (EPCISEventType o : children) {
AggregationEventType event = (AggregationEventType) o;
for (EPC childEpc : event.getChildEPCs().getEpc()) {
log.trace("new traceEPC: " + childEpc.getValue());
eventList.addAll(traceEPCAux(childEpc.getValue(), filters));
}
}
Collection<EPCISEventType> trans = epcisOperation.getTransactionEventFromEPC(EPC, filters);
eventList.addAll(trans);
for (EPCISEventType o : trans) {
TransactionEventType event = (TransactionEventType) o;
for (EPC childEpc : event.getEpcList().getEpc()) {
log.trace("new traceEPC: " + childEpc.getValue());
eventList.addAll(traceEPCAux(childEpc.getValue(), filters));
}
}
}
}
private List<EPCISEvent> processEventList(Collection<EPCISEventType> eventList) {
List<EPCISEvent> result = new ArrayList<EPCISEvent>();
for (EPCISEventType o : eventList) {
result.add(EpcisUtil.processEvent(o));
}
return result;
return eventList;
}
}
ALfA/ALfA/src/main/java/fr/unicaen/iota/application/operations/TraceEPCAsync.java
*/
package fr.unicaen.iota.application.operations;
import fr.unicaen.iota.application.conf.Constants;
import fr.unicaen.iota.application.rmi.CallBackClient;
import fr.unicaen.iota.application.rmi.CallbackClient;
import fr.unicaen.iota.nu.ONSOperation;
import fr.unicaen.iota.tau.model.Identity;
import java.rmi.RemoteException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class TraceEPCAsync extends Thread {
private final CallBackClient client;
private final String sessionId;
private final String LOGIN;
private final String PASS;
private final CallbackClient client;
private final String sessionID;
private final Identity identity;
private final String EPC;
private final ONSOperation onsOperation;
private static final Log log = LogFactory.getLog(TraceEPCAsync.class);
public TraceEPCAsync(String epc, CallBackClient client, String login, String pass, String sessionId) {
public TraceEPCAsync(String epc, String sessionID, CallbackClient client, Identity identity) {
this.client = client;
this.LOGIN = login;
this.PASS = pass;
this.sessionId = sessionId;
this.sessionID = sessionID;
this.identity = identity;
this.EPC = epc;
this.onsOperation = new ONSOperation(Constants.ONS_HOSTS);
this.onsOperation = new ONSOperation();
}
@Override
......
log.trace("[TRACE EPC]: " + epc);
log.trace("CALLED METHOD: <traceEPC>");
log.trace("Get Referent ds address");
String dsAddress = onsOperation.getReferentDS(epc);
String dsAddress = onsOperation.getReferentIDedDS(epc);
if (dsAddress == null) {
log.warn("Unable to retreive referent ds address for this epc code");
return;
......
log.trace("referent ds address found: " + dsAddress);
}
log.trace("Start discover");
DiscoveryOperation dsOp = new DiscoveryOperation(LOGIN, PASS, dsAddress, client, sessionId);
DiscoveryOperation dsOp = new DiscoveryOperation(identity, dsAddress, sessionID, client);
dsOp.discover(epc);
}
}
ALfA/ALfA/src/main/java/fr/unicaen/iota/application/rmi/AccessModule.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
* Copyright © 2008-2012 Orange Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application.rmi;
import fr.unicaen.iota.application.Controler;
import fr.unicaen.iota.application.model.DSEvent;
import fr.unicaen.iota.application.model.EPCISEvent;
import fr.unicaen.iota.application.model.ONSEntryType;
import fr.unicaen.iota.application.model.Spec;
import java.rmi.RemoteException;
import java.util.List;
import java.util.Map;
public class AccessModule implements AccessInterface {
private Controler controler;
public AccessModule() throws RemoteException {
controler = new Controler();
}
@Override
public synchronized Map<ONSEntryType, String> queryONS(String epc) {
return controler.queryONS(epc);
}
@Override
public synchronized String getReferenteDS(String epc) throws RemoteException {
return controler.getReferenteDS(epc);
}
@Override
public synchronized List<EPCISEvent> traceEPC(String epc) throws RemoteException {
return controler.traceEPC(epc);
}
@Override
public synchronized List<String> getEPCDoc(String epc) {
return controler.getEPCDoc(epc);
}
@Override
public synchronized List<EPCISEvent> getEPCEPCIS(String epc) {
return controler.getEPCEPCIS(epc);
}
@Override
public synchronized Spec getSpecs(String address) throws RemoteException {
return controler.getSpecs(address);
}
@Override
public synchronized void traceEPCAsync(String sessionId, CallBackClient client, String EPC) throws RemoteException {
controler.traceEPCAsync(sessionId, client, EPC);
}
@Override
public synchronized List<EPCISEvent> queryEPCIS(String epc, String EPCISAddress) throws RemoteException {
return controler.queryEPCIS(epc, EPCISAddress);
}
@Override
public synchronized List<DSEvent> queryDS(String epc, String DSAddress, String login, String password) throws RemoteException {
return controler.queryDS(epc, DSAddress, login, password);
}
@Override
public synchronized List<DSEvent> queryDS(String epc, String DSAddress, String login, String password, String serviceType) throws RemoteException {
return controler.queryDS(epc, DSAddress, login, password, serviceType);
}
}
ALfA/ALfA/src/main/java/fr/unicaen/iota/application/rmi/RMIServer.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
* Copyright © 2008-2012 Orange Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application.rmi;
import fr.unicaen.iota.application.conf.Constants;
import java.rmi.RMISecurityManager;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class RMIServer {
private static final Log log = LogFactory.getLog(RMIServer.class);
public static void main(String[] args) throws Exception {
String policyFile = RMIServer.class.getClassLoader().getResource("java.policy").toString();
System.setProperty("java.security.policy", policyFile);
System.setProperty("java.rmi.server.hostname", Constants.RMI_SERVER_HOST);
if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
}
log.info("Creating server...");
AccessInterface im = new AccessModule();
log.trace("Exporting...");
AccessInterface ali = (AccessInterface) UnicastRemoteObject.exportObject(im, Constants.RMI_SERVER_PORT);
log.trace("Locating registry...");
Registry registry;
try {
registry = LocateRegistry.getRegistry(Constants.RMI_SERVER_PORT);
registry.list(); // throws if registry not running
} catch (RemoteException e) {
log.trace("Registry not found. We create one...");
registry = LocateRegistry.createRegistry(Constants.RMI_SERVER_PORT);
}
log.trace("Binding...");
registry.rebind(Constants.RMI_SERVER_NAME, ali);
log.info("RMI server started at: rmi://" + Constants.RMI_SERVER_HOST + ":" + Constants.RMI_SERVER_PORT + "/" + Constants.RMI_SERVER_NAME);
}
}
ALfA/ALfA/src/main/java/fr/unicaen/iota/application/util/EPCUtilities.java
package fr.unicaen.iota.application.util;
import fr.unicaen.iota.application.conf.Constants;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
*
*/
public class EPCUtilities {
private EPCUtilities() {
}
private static final Map<String, Pattern> PATTERNS = new HashMap<String, Pattern>();
static {
PATTERNS.put("gid", Pattern.compile("((0|[1-9][0-9]*)\\.){2}(0|[1-9][0-9]*)"));
Pattern p = Pattern.compile("([0-9]+\\.){2}([0-9]|[A-Z]|[a-z]|[\\!\\(\\)\\*\\+\\-',:;=_]|(%(([0-9]|[A-F])|[a-f]){2}))+");
PATTERNS.put("sgtin", p);
PATTERNS.put("sgln", p);
PATTERNS.put("grai", p);
PATTERNS.put("sscc", Pattern.compile("[0-9]+\\.[0-9]+"));
PATTERNS.put("giai", Pattern.compile("[0-9]+\\.([0-9]|[A-Z]|[a-z]|[\\!\\(\\)\\*\\+\\-',:;=_]|(%(([0-9]|[A-F])|[a-f]){2}))+"));
}
public static boolean checkEpcOrUri(String epcOrUri) throws InvalidFormatException {
boolean isEpc = false;
if (epcOrUri.startsWith("urn:epc:id:")) {
// check if it is a valid EPC
checkEpc(epcOrUri);
isEpc = true;
} else {
// childEPCs in AggregationEvents, and epcList in
// TransactionEvents might also be simple URIs
checkUri(epcOrUri);
}
return isEpc;
}
protected static void checkEpc(String textContent) throws InvalidFormatException {
String uri = textContent;
if (!uri.startsWith("urn:epc:id:")) {
throw new InvalidFormatException("Invalid 'pure identity' EPC format: must start with \"urn:epc:id:\"");
}
uri = uri.substring("urn:epc:id:".length());
// check the patterns for the different EPC types
String epcType = uri.substring(0, uri.indexOf(":"));
uri = uri.substring(epcType.length() + 1);
//log.debug("Checking pattern for EPC type " + epcType + ": " + uri);
if (!PATTERNS.containsKey(epcType)) {
throw new InvalidFormatException("Invalid 'pure identity' EPC format: unknown EPC type: " + epcType);
}
Pattern p = PATTERNS.get(epcType);
Matcher m = p.matcher(uri);
if (!m.matches()) {
throw new InvalidFormatException("Invalid 'pure identity' EPC format: pattern \"" + uri
+ "\" is invalid for EPC type \"" + epcType + "\" - check with Tag Data Standard");
}
// check the number of digits for the different EPC types
boolean exceeded = false;
int count1 = uri.indexOf(".");
if ("sgtin".equals(epcType)) {
int count2 = uri.indexOf(".", count1 + 1) - (count1 + 1);
if (count1 + count2 > 13) {
exceeded = true;
}
} else if ("sgln".equals(epcType)) {
int count2 = uri.indexOf(".", count1 + 1) - (count1 + 1);
if (count1 + count2 > 12) {
exceeded = true;
}
} else if ("grai".equals(epcType)) {
int count2 = uri.indexOf(".", count1 + 1) - (count1 + 1);
if (count1 + count2 > 12) {
exceeded = true;
}
} else if ("sscc".equals(epcType)) {
int count2 = uri.length() - (count1 + 1);
if (count1 + count2 > 17) {
exceeded = true;
}
} else if ("giai".equals(epcType)) {
int count2 = uri.length() - (count1 + 1);
if (count1 + count2 > 30) {
exceeded = true;
}
} else {
// nothing to count
}
if (exceeded) {
throw new InvalidFormatException("Invalid 'pure identity' EPC format: check allowed number of characters for EPC type '" + epcType + "'");
}
}
private static String revertString(String str) {
StringBuilder res = new StringBuilder();
for (int i = str.length() - 1; i >= 0; i--) {
if (str.charAt(i) == '.') {
continue;
}
res.append(str.charAt(i));
res.append('.');
}
return res.toString();
}
public static String formatRevertEpc(String textContent) throws InvalidFormatException {
checkEpc(textContent);
String uri = textContent;
uri = uri.substring("urn:epc:id:".length());
String epcType = uri.substring(0, uri.indexOf(":"));
uri = uri.substring(epcType.length() + 1);
int count1 = uri.indexOf(".");
if ("sgtin".equals(epcType)) {
int count2 = uri.indexOf(".", count1 + 1);
return revertString(uri.substring(0, count2)) + "sgtin.id." + Constants.ONS_DOMAIN_PREFIX;
} else if ("sgln".equals(epcType)) {
int count2 = uri.indexOf(".", count1 + 1);
return revertString(uri.substring(0, count2)) + "sgln.id." + Constants.ONS_DOMAIN_PREFIX;
} else if ("grai".equals(epcType)) {
int count2 = uri.indexOf(".", count1 + 1);
return revertString(uri.substring(0, count2)) + "grai.id." + Constants.ONS_DOMAIN_PREFIX;
} else if ("sscc".equals(epcType)) {
return revertString(uri.substring(0, count1)) + "sscc.id." + Constants.ONS_DOMAIN_PREFIX;
} else if ("giai".equals(epcType)) {
return revertString(uri.substring(0, count1)) + "giai.id." + Constants.ONS_DOMAIN_PREFIX;
}
return null;
}
private static boolean checkUri(String textContent) throws InvalidFormatException {
try {
new URI(textContent);
} catch (URISyntaxException e) {
throw new InvalidFormatException(e.getMessage());
}
return true;
}
public static boolean isReferencable(String epcOrUri) {
try {
checkEpc(epcOrUri);
return true;
} catch (InvalidFormatException ex) {
return false;
}
}
public static class InvalidFormatException extends Exception {
public InvalidFormatException(String msg) {
super(msg);
}
public InvalidFormatException(String msg, Throwable e) {
super(msg, e);
}
}
}
ALfA/ALfA/src/main/java/fr/unicaen/iota/application/util/EpcisUtil.java
/*
* This program is a part of the IoTa project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application.util;
import fr.unicaen.iota.application.model.EPCISEvent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.datatype.XMLGregorianCalendar;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.fosstrak.epcis.model.*;
/**
*
*/
public final class EpcisUtil {
private EpcisUtil() {
}
private static final Log log = LogFactory.getLog(EpcisUtil.class);
private static EPCISEvent.ActionType getActionType(ActionType at) {
if (at == ActionType.ADD) {
return EPCISEvent.ActionType.ADD;
} else if (at == ActionType.DELETE) {
return EPCISEvent.ActionType.DELETE;
} else if (at == ActionType.OBSERVE) {
return EPCISEvent.ActionType.OBSERVE;
} else {
return null;
}
}
/* EPCISEventType are generated, the Visitor design pattern not appliable */
public static EPCISEvent processEvent(EPCISEventType event) {
EPCISEvent epcevent = new EPCISEvent();
XMLGregorianCalendar eventTime = event.getEventTime();
epcevent.setEventTime(eventTime.toGregorianCalendar());
XMLGregorianCalendar recordTime = event.getRecordTime();
epcevent.setInsertedTime(recordTime.toGregorianCalendar());
if (event instanceof ObjectEventType) {
ObjectEventType e = (ObjectEventType) event;
epcevent.setType(EPCISEvent.EventType.OBJECT);
List<String> list = new ArrayList<String>();
for (EPC epc : e.getEpcList().getEpc()) {
list.add(epc.getValue());
}
epcevent.setEpcs(list);
epcevent.setAction(getActionType(e.getAction()));
epcevent.setBizStep(e.getBizStep().toString());
epcevent.setDisposition(e.getDisposition().toString());
if (e.getReadPoint() != null) {
epcevent.setReadPoint(e.getReadPoint().getId().toString());
}
if (e.getBizLocation() != null) {
epcevent.setBizLoc(e.getBizLocation().getId().toString());
}
if (e.getBizTransactionList() != null) {
Map<String, String> map = new HashMap<String, String>();
for (BusinessTransactionType bizTrans : e.getBizTransactionList().getBizTransaction()) {
map.put(bizTrans.getType().toString(), bizTrans.toString());
}
epcevent.setBizTrans(map);
}
} else if (event instanceof TransactionEventType) {
TransactionEventType e = (TransactionEventType) event;
epcevent.setType(EPCISEvent.EventType.TRANSACTION);
epcevent.setParentID(e.getParentID().toString());
List<String> list = new ArrayList<String>();
for (EPC epc : e.getEpcList().getEpc()) {
list.add(epc.getValue());
}
epcevent.setEpcs(list);
epcevent.setAction(getActionType(e.getAction()));
epcevent.setBizStep(e.getBizStep().toString());
epcevent.setDisposition(e.getDisposition().toString());
if (e.getReadPoint() != null) {
epcevent.setReadPoint(e.getReadPoint().getId().toString());
}
if (e.getBizLocation() != null) {
epcevent.setBizLoc(e.getBizLocation().getId().toString());
}
if (e.getBizTransactionList() != null) {
Map<String, String> map = new HashMap<String, String>();
for (BusinessTransactionType bizTrans : e.getBizTransactionList().getBizTransaction()) {
map.put(bizTrans.getType().toString(), bizTrans.toString());
}
epcevent.setBizTrans(map);
}
} else if (event instanceof AggregationEventType) {
AggregationEventType e = (AggregationEventType) event;
log.trace(e.getParentID().toString());
epcevent.setType(EPCISEvent.EventType.AGGREGATION);
epcevent.setParentID(e.getParentID().toString());
List<String> list = new ArrayList<String>();
for (EPC epc : e.getChildEPCs().getEpc()) {
list.add(epc.getValue());
}
epcevent.setChildren(list);
epcevent.setAction(getActionType(e.getAction()));
epcevent.setBizStep(e.getBizStep().toString());
epcevent.setDisposition(e.getDisposition().toString());
if (e.getReadPoint() != null) {
epcevent.setReadPoint(e.getReadPoint().getId().toString());
}
if (e.getBizLocation() != null) {
epcevent.setBizLoc(e.getBizLocation().getId().toString());
}
if (e.getBizTransactionList() != null) {
Map<String, String> map = new HashMap<String, String>();
for (BusinessTransactionType bizTrans : e.getBizTransactionList().getBizTransaction()) {
map.put(bizTrans.getType().toString(), bizTrans.toString());
}
epcevent.setBizTrans(map);
}
} else if (event instanceof QuantityEventType) {
QuantityEventType e = (QuantityEventType) event;
epcevent.setType(EPCISEvent.EventType.QUANTITY);
epcevent.setQuantity(String.valueOf(Integer.valueOf(e.getQuantity())));
epcevent.setEPCClass(e.getEpcClass().toString());
epcevent.setBizStep(e.getBizStep().toString());
epcevent.setDisposition(e.getDisposition().toString());
if (e.getReadPoint() != null) {
epcevent.setReadPoint(e.getReadPoint().getId().toString());
}
if (e.getBizLocation() != null) {
epcevent.setBizLoc(e.getBizLocation().getId().toString());
}
if (e.getBizTransactionList() != null) {
Map<String, String> map = new HashMap<String, String>();
for (BusinessTransactionType bizTrans : e.getBizTransactionList().getBizTransaction()) {
map.put(bizTrans.getType().toString(), bizTrans.toString());
}
epcevent.setBizTrans(map);
}
}
return epcevent;
}
}
ALfA/ALfA/src/main/resources/application.properties
# LOGIN for ds authentification
ds-login = iotauser
# PASSWORD for ds authentification
ds-password = iotauserpw
# RMI server configuration
# the host will be used by the clients
rmi-server-name = ALfA
......
# nomenclature of the NAPTR fields
ons-epcis-entry = epc\\+epcis
ons-ds-entry = epc\\+ds
ons-spec-entry = epc\\+spec
ons-html-entry = epc\\+html
ons-entry-regex = \\!\\^\\.\\*\\$\\!|\\!
BETa/LISEZMOI
- OmICron
Configuration:
Voir le fichier java.policy dans le fichier jar ; ces fichier peut être
remplacé par un fichier du même nom dans le répertoire courant.
Voir les fichiers *.properties et java.policy dans le fichier jar ; chacun
de ces fichiers peut être remplacé par un fichier du même nom dans le
répertoire courant.
(application.properties pour cette application,
commons-logging.properties et log4j.properties pour les journaux)
Dépendances d’utilisation:
- ALfA
- ou OMeGa
Utilisation:
./beta.sh
BETa/README
- OmICron
Configuration:
See the file java.policy in the jar file (it can be overriden by a file with
the same name in the current directory).
See the files *.properties and java.policy in the jar file (each of those
can be overriden by a file with the same name in the current directory).
(application.properties for this application,
commons-logging.properties and log4j.properties for the logs)
Usage Dependencies:
- ALfA
- ALfA-RMI
- or OMeGa
Usage:
./beta.sh
BETa/beta.sh
#!/bin/sh
cp="."
for f in lib/*.jar; do
cp="${cp}:${f}"
done
java -cp ${cp} fr.unicaen.iota.application.client.Main
java -cp ".:lib/*" fr.unicaen.iota.application.client.Main
BETa/make-tar.sh
#!/bin/sh
name=${PWD##*/}
cd ..
tar chf beta.tar $name/dist $name/README $name/LISEZMOI
BETa/pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fr.unicaen.iota.application</groupId>
<groupId>fr.unicaen.iota</groupId>
<artifactId>beta</artifactId>
<version>1.0</version>
<version>1.9-mock</version>
<packaging>jar</packaging>
<name>BETa</name>
......
<dependencies>
<!-- IoTa dependencies -->
<dependency>
<groupId>fr.unicaen.iota.application</groupId>
<groupId>fr.unicaen.iota</groupId>
<artifactId>alfa-pi</artifactId>
<version>1.0</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>fr.unicaen.iota.application</groupId>
<groupId>fr.unicaen.iota</groupId>
<artifactId>mu</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>fr.unicaen.iota</groupId>
<artifactId>omicron</artifactId>
<version>1.0</version>
<version>${project.version}</version>
</dependency>
</dependencies>
BETa/src/main/assembly/bin-with-dependencies.xml
<include>beta.sh</include>
</includes>
</fileSet>
<fileSet>
<directory>src/main/resources</directory>
<outputDirectory></outputDirectory>
<includes>
<include>application.properties</include>
</includes>
</fileSet>
<fileSet>
<directory>target</directory>
<outputDirectory></outputDirectory>
BETa/src/main/java/fr/unicaen/iota/application/client/CallBackClientImpl.java
/*
* This program is a part of the IoTa project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application.client;
import fr.unicaen.iota.application.client.listener.EventDispatcher;
import fr.unicaen.iota.application.model.EPCISEvent;
import fr.unicaen.iota.application.rmi.CallBackClient;
import java.io.Serializable;
import java.rmi.RemoteException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
*
*/
public class CallBackClientImpl extends EventDispatcher implements CallBackClient, Serializable {
private static final Log log = LogFactory.getLog(CallBackClientImpl.class);
public CallBackClientImpl() {
}
@Override
public void pushEvent(String sessionID, EPCISEvent e) throws RemoteException {
log.trace("received in CallBackClientImpl->pushEvent (session: " + sessionID + ")");
addEvent(sessionID, e);
}
}
BETa/src/main/java/fr/unicaen/iota/application/client/CallbackClientImpl.java
/*
* This program is a part of the IoTa project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application.client;
import fr.unicaen.iota.application.client.listener.EventDispatcher;
import fr.unicaen.iota.application.rmi.CallbackClient;
import java.io.Serializable;
import java.rmi.RemoteException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.fosstrak.epcis.model.EPCISEventType;
/**
*
*/
public class CallbackClientImpl extends EventDispatcher implements CallbackClient, Serializable {
private static final Log log = LogFactory.getLog(CallbackClientImpl.class);
public CallbackClientImpl() {
}
@Override
public void pushEvent(String sessionID, EPCISEventType evt) throws RemoteException {
log.trace("received in CallBackClientImpl->pushEvent");
addEvent(sessionID, evt);
}
}
BETa/src/main/java/fr/unicaen/iota/application/client/Configuration.java
*/
public final class Configuration {
private Configuration() {}
private Configuration() {
}
public static final String PROPERTIES_CONFIG_FILE = "/application.properties";
public static String SOAP_SERVICE_URL;
public static String RMI_SERVICE_URL;
public static String RMI_CALLBACK_HOST;
public static int RMI_CALLBACK_PORT;
public static int RMI_CALLBACK_PORT;
public static String DEFAULT_IDENTITY;
static {
try {
......
RMI_SERVICE_URL = props.getProperty("rmi-service-url", "//localhost:1099/ALfA");
RMI_CALLBACK_HOST = props.getProperty("rmi-callback-host", "localhost");
RMI_CALLBACK_PORT = Integer.parseInt(props.getProperty("rmi-callback-port", "1099"));
DEFAULT_IDENTITY = props.getProperty("default-identity", "anonymous");
} catch (IOException ex) {
LogFactory.getLog(Configuration.class).fatal(null, ex);
}
BETa/src/main/java/fr/unicaen/iota/application/client/Main.java
public class Main {
private static final Log log = LogFactory.getLog(Main.class);
public static void main(String[] args) throws RemoteException {
log.info("Starting GUI ...");
String policyFile = Main.class.getClassLoader().getResource("java.policy").toString();
......
if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
}
GUI gui = new GUI();
CallBackClientImpl cbci = new CallBackClientImpl();
CallbackClientImpl cbci = new CallbackClientImpl();
UnicastRemoteObject.exportObject(cbci, Configuration.RMI_CALLBACK_PORT);
gui.setCallBackHandler(cbci);
GUI gui = new GUI(cbci);
gui.setVisible(true);
}
}
BETa/src/main/java/fr/unicaen/iota/application/client/TraceEPCRMIAsync.java
*/
package fr.unicaen.iota.application.client;
import fr.unicaen.iota.application.rmi.AccessInterface;
import fr.unicaen.iota.application.AccessInterface;
import fr.unicaen.iota.tau.model.Identity;
import java.net.URI;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
......
private static final Log log = LogFactory.getLog(TraceEPCRMIAsync.class);
private String epc;
private String sessionId;
private CallBackClientImpl callBackHandler;
private CallbackClientImpl callBackHandler;
private Identity identity;
public TraceEPCRMIAsync(String epc, String sessionId, CallBackClientImpl callBackHandler) {
public TraceEPCRMIAsync(String epc, Identity identity, String sessionID, CallbackClientImpl callBackHandler) {
this.epc = epc;
this.sessionId = sessionId;
this.sessionId = sessionID;
this.identity = identity;
this.callBackHandler = callBackHandler;
}
......
}
try {
log.trace("Calling server.traceEPCAsync");
server.traceEPCAsync(sessionId, callBackHandler, epc);
server.traceEPCAsync(identity, sessionId, callBackHandler, epc);
} catch (RemoteException ex) {
log.fatal(null, ex);
}
BETa/src/main/java/fr/unicaen/iota/application/client/gui/ClosableTabbedPane.java
public TabComponent addClosableTabComponent(Component c) {
this.add(c);
int index = this.indexOfComponent(c);
TabComponent tb = new TabComponent(c.getName(),this);
TabComponent tb = new TabComponent(c.getName(), this);
this.setTabComponentAt(index, tb);
return tb;
}
BETa/src/main/java/fr/unicaen/iota/application/client/gui/GUI.java
*/
package fr.unicaen.iota.application.client.gui;
import fr.unicaen.iota.application.client.CallBackClientImpl;
import fr.unicaen.iota.application.client.CallbackClientImpl;
import fr.unicaen.iota.application.client.Configuration;
import fr.unicaen.iota.application.client.TraceEPCRMIAsync;
import fr.unicaen.iota.application.model.EPCISEvent;
import fr.unicaen.iota.application.rmi.CallBackClient;
import fr.unicaen.iota.application.soap.client.IOTA_ServiceStub;
import fr.unicaen.iota.application.soap.IoTaException;
import fr.unicaen.iota.application.soap.client.IoTaFault;
import fr.unicaen.iota.application.soap.client.OmICron;
import fr.unicaen.iota.application.util.Utils;
import fr.unicaen.iota.tau.model.Identity;
import java.rmi.RemoteException;
import java.util.*;
import java.util.List;
import java.util.Observable;
import java.util.Observer;
import javax.swing.UIManager;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import org.apache.axis2.AxisFault;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.fosstrak.epcis.model.EPCISEventType;
/**
*
......
alpha, omega
};
private String defaultEPC = "";
private CallBackClientImpl callBackHandler;
private static final Log log = LogFactory.getLog(GUI.class);
private String defaultEPC = "";
private final CallbackClientImpl callBackHandler;
/**
* Creates new form mainGui
*
* @param callBackHandler
*/
public GUI() {
public GUI(CallbackClientImpl callBackHandler) {
this.callBackHandler = callBackHandler;
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
/*
......
addComponent(closableTabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE)));
pack();
SearchArea home = new SearchArea("", null, closableTabbedPane);
closableTabbedPane.addClosableTabComponent(home);
home.setTitle("Home");
/*
* SearchArea home = new SearchArea("", closableTabbedPane);
* closableTabbedPane.addClosableTabComponent(home);
* home.setTitle("Home");
*/
jTextField1.setText(defaultEPC);
closableTabbedPane.addChangeListener(this);
this.setTitle("BETa: Basic Epcis Test Application");
......
closableTabbedPane.setSelectedIndex(index);
switch (ao) {
case alpha:
alphaTraceEPC(jTextField1.getText(), sessionID, callBackHandler);
alphaTraceEPC(jTextField1.getText(), sessionID);
break;
case omega:
omegaTraceEPC(jTextField1.getText(), sessionID, callBackHandler);
omegaTraceEPC(jTextField1.getText(), sessionID);
break;
}
}
......
log.trace(arg);
}
/**
* @return the callBackHandler
*/
public CallBackClient getCallBackHandler() {
return callBackHandler;
}
/**
* @param callBackHandler the callBackHandler to set
*/
public void setCallBackHandler(CallBackClientImpl callBackHandler) {
this.callBackHandler = callBackHandler;
}
private void alphaTraceEPC(String text, String sessionID, CallBackClientImpl callBackHandler) {
private void alphaTraceEPC(String text, String sessionID) {
log.trace("Start RMI Asynchronous Trace");
new TraceEPCRMIAsync(text, sessionID, callBackHandler).start();
Identity identity = new Identity();
identity.setAsString(Configuration.DEFAULT_IDENTITY);
new TraceEPCRMIAsync(text, identity, sessionID, callBackHandler).start();
log.trace("Done");
}
private void omegaTraceEPC(String text, String sessionID, CallBackClientImpl callBackHandler) {
private void omegaTraceEPC(String epc, String sessionID) {
log.trace("Processing omegaTraceEPC ...");
IOTA_ServiceStub iota_ServiceStub;
try {
iota_ServiceStub = new IOTA_ServiceStub(Configuration.SOAP_SERVICE_URL);
} catch (AxisFault ex) {
log.fatal(null, ex);
return;
}
IOTA_ServiceStub.TraceEPCRequest traceEPCRequest = new IOTA_ServiceStub.TraceEPCRequest();
IOTA_ServiceStub.TraceEPCRequestIn in = new IOTA_ServiceStub.TraceEPCRequestIn();
in.setEpc(text);
traceEPCRequest.setTraceEPCRequest(in);
IOTA_ServiceStub.TraceEPCResponse respTrac;
Identity identity = new Identity();
identity.setAsString(Configuration.DEFAULT_IDENTITY);
OmICron client = new OmICron(identity, Configuration.SOAP_SERVICE_URL);
try {
respTrac = iota_ServiceStub.traceEPC(traceEPCRequest);
} catch (RemoteException ex) {
log.fatal(null, ex);
return;
}
IOTA_ServiceStub.Event[] events = respTrac.getTraceEPCResponse().getEventList().getEvent();
if (events != null) {
for (IOTA_ServiceStub.Event e : events) {
EPCISEvent evt = new EPCISEvent();
evt.setAction(EPCISEvent.ActionType.valueOf(e.getAction().toString()));
evt.setBizLoc(e.getBizLoc());
evt.setBizStep(e.getBizStep());
List<String> childs = new ArrayList<String>();
if (e.getChildList().getChilds() != null) {
childs.addAll(Arrays.asList(e.getChildList().getChilds()));
}
evt.setChildren(childs);
evt.setDisposition(e.getDisposition());
List<String> epcs = new ArrayList<String>();
if (e.getEpcList().getEpcs() != null) {
epcs.addAll(Arrays.asList(e.getEpcList().getEpcs()));
}
evt.setEpcs(epcs);
evt.setEventTime(e.getRecordTime());
evt.setInsertedTime(e.getEventTime());
evt.setParentID(e.getParentId());
evt.setQuantity(e.getQuantity() + "");
evt.setReadPoint(e.getReadPoint());
evt.setType(EPCISEvent.EventType.valueOf(e.getType().toString()));
try {
callBackHandler.pushEvent(sessionID, evt);
} catch (RemoteException ex) {
log.fatal(null, ex);
List<EPCISEventType> events = client.traceEPC(epc);
if (!events.isEmpty()) {
for (EPCISEventType evt : events) {
try {
callBackHandler.pushEvent(sessionID, evt);
} catch (RemoteException ex) {
log.error("Could not push event to callback client", ex);
}
}
} else {
log.trace("(no events)");
}
} else {
log.trace("(no events)");
} catch (IoTaException ex) {
log.warn("Could not retreive events: " + IoTaFault.explain(ex), ex);
}
log.trace("Done");
}
BETa/src/main/java/fr/unicaen/iota/application/client/gui/SearchArea.java
package fr.unicaen.iota.application.client.gui;
import fr.unicaen.iota.application.client.listener.EPCEventListener;
import fr.unicaen.iota.application.model.EPCISEvent;
import fr.unicaen.iota.application.util.TimeParser;
import fr.unicaen.iota.application.util.TravelTimeTuple;
import fr.unicaen.iota.mu.EPCISEventTypeHelper;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
......
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumn;
import org.fosstrak.epcis.model.EPCISEventType;
/**
*
......
}
@Override
public void eventReveived(String session, EPCISEvent e) {
public void eventReveived(String session, EPCISEventType e) {
if (!session.equals(this.sessionId)) {
return;
}
currentIndex++;
((DefaultTableModel) getJTableGenerated().getModel()).addRow(new String[]{currentIndex + "", formatEPC(e), e.getType().toString(), e.getBizLoc(), e.getBizStep(), TimeParser.format(e.getEventTime())});
EPCISEventTypeHelper he = new EPCISEventTypeHelper(e);
((DefaultTableModel) getJTableGenerated().getModel()).addRow(new String[]{
currentIndex + "",
formatEPC(he),
he.getType().toString(),
he.getBizLocation(),
he.getBizStep(),
TimeParser.format(he.getEventTime())});
}
public void setTerminated() {
......
setTitle(newTitle);
}
private String formatEPC(EPCISEvent e) {
private String formatEPC(EPCISEventTypeHelper e) {
List<String> res = new ArrayList<String>();
List<String> l = e.getEpcs();
List<String> l = e.getEpcList();
for (String s : l) {
res.add(" EPC: " + s + " \n");
}
BETa/src/main/java/fr/unicaen/iota/application/client/listener/EPCEventListener.java
*/
package fr.unicaen.iota.application.client.listener;
import fr.unicaen.iota.application.model.EPCISEvent;
import fr.unicaen.iota.application.util.TravelTimeTuple;
import java.util.EventListener;
import org.fosstrak.epcis.model.EPCISEventType;
/**
*
*/
public interface EPCEventListener extends EventListener {
public void eventReveived(String session, EPCISEvent e);
/**
* Called when a new event is received for a request.
*
* @param sessionID the session ID of the request
* @param evt the event
*/
public void eventReveived(String sessionID, EPCISEventType evt);
public void travelTimeChanged(String session, TravelTimeTuple ttt);
/**
* Called when the travel time tuple changed.
*
* @param sessionID the session ID of the request
* @param ttt the travel time tuple
*/
public void travelTimeChanged(String sessionID, TravelTimeTuple ttt);
public void usedObjectsChanged(String session, int objects);
/**
* Called when object have changed.
*
* @param sessionID the session ID of the request
* @param objects the number of changed objects
*/
public void usedObjectsChanged(String sessionID, int objects);
}
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());
}
BETa/src/main/java/fr/unicaen/iota/application/util/MD5.java
/*
* This program is a part of the IoTa project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.application.util;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public final class MD5 {
private MD5() {
}
private static String convertToHex(byte[] data) {
StringBuilder buf = new StringBuilder();
for (int i = 0; i < data.length; i++) {
int halfbyte = (data[i] >>> 4) & 0x0F;
int two_halfs = 0;
do {
if ((0 <= halfbyte) && (halfbyte <= 9)) {
buf.append((char) ('0' + halfbyte));
} else {
buf.append((char) ('a' + (halfbyte - 10)));
}
halfbyte = data[i] & 0x0F;
} while (two_halfs++ < 1);
}
return buf.toString();
}
public static String MD5_Algo(String text)
throws NoSuchAlgorithmException, UnsupportedEncodingException {
MessageDigest md;
md = MessageDigest.getInstance("MD5");
md.update(text.getBytes("iso-8859-1"), 0, text.length());
return convertToHex(md.digest());
}
}
BETa/src/main/java/fr/unicaen/iota/application/util/Utils.java
package fr.unicaen.iota.application.util;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Date;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
......
public final class Utils {
private static final Log log = LogFactory.getLog(Utils.class);
private Utils() {
}
public static String generateSessionId(){
String sessionID;
java.util.Date today = new java.util.Date();
public static String generateSessionId() {
try {
sessionID = MD5.MD5_Algo(Long.toString(today.getTime()));
} catch (NoSuchAlgorithmException e) {
log.error("Can't generate SessionId", e);
return null;
String date = Long.toString(new Date().getTime());
byte[] digest = MD5.digest(date.getBytes("UTF-8"));
return new BigInteger(1, digest).toString(16);
} catch (UnsupportedEncodingException e) {
log.error("Can't generate SessionId", e);
return null;
}
return sessionID;
}
private static MessageDigest MD5;
static {
try {
MD5 = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
log.fatal("MD5 not avalaible", e);
}
}
}
BETa/src/main/resources/application.properties
soap-service-url = http://localhost:8080/omega/services/IOTA_Service
soap-service-url = http://localhost:8080/omega
rmi-service-url = //localhost:1099/ALfA
rmi-callback-host = localhost
rmi-callback-port = 9901
default-identity = anonymous
BETa/src/main/resources/java.policy
permission java.io.FilePermission "<<ALL FILES>>", "read";
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
permission java.lang.RuntimePermission "accessDeclaredMembers";
permission java.lang.RuntimePermission "getClassLoader";
permission java.util.PropertyPermission "*", "read";
permission java.util.PropertyPermission "java.rmi.server.hostname", "write";
permission javax.xml.bind.JAXBPermission "setDatatypeConverter";
permission java.net.SocketPermission "*:*", "connect,resolve";
permission java.net.SocketPermission "*:*", "accept";
};
CaPPa/DS-Xi-Client/LICENSE
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
CaPPa/DS-Xi-Client/LISEZMOI
DS-Xi-Client
Bibliothèque client pour l'interfaçage avec le service web Xi pour DS.
Dépendances:
bibliothèques:
- sunxacml
- servlet-api
- commons-logging
Dépendances d’utilisation:
- Xi
- DiscoveryPHI
- un DWS
CaPPa/DS-Xi-Client/README
DS-Xi-Client
Common library interfacing with the xi web service for DS.
Dependencies:
libraries:
- sunxacml
- servlet-api
- commons-logging
Usage Dependencies:
- Xi
- DiscoveryPHI
- a DWS
CaPPa/DS-Xi-Client/pom.xml
<?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fr.unicaen.iota</groupId>
<artifactId>ds-xi-client</artifactId>
<version>1.9-mock</version>
<packaging>jar</packaging>
<name>DS-Xi-Client</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- IoTa dependecy -->
<dependency>
<groupId>fr.unicaen.iota</groupId>
<artifactId>libxacml-ds</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Other dependency -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<!-- Log dependency -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>sources</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptorRefs>
<descriptorRef>src</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
CaPPa/DS-Xi-Client/src/main/java/fr/unicaen/iota/xi/client/DSPEP.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
* Copyright © 2008-2012 Orange Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.xi.client;
import com.sun.xacml.ctx.Result;
import fr.unicaen.iota.xacml.pep.MethodNamesCapture;
import fr.unicaen.iota.xacml.pep.MethodNamesQuery;
import fr.unicaen.iota.xacml.pep.XACMLDSEvent;
import fr.unicaen.iota.xacml.policy.Module;
import fr.unicaen.iota.xacml.request.EventRequest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* This class is used to manage the DS access control policy
*/
public class DSPEP extends PEP implements MethodNamesQuery, MethodNamesCapture {
private static final Log log = LogFactory.getLog(DSPEP.class);
public DSPEP(String url) {
super(url);
}
/**
* process access control policy for the Hello method.
*
* @param userId connected user
* @param partnerId corresponding partnerId
* @param module Query, Capture or Admin
* @return
*/
@Override
public int hello(String userId, String partnerId, String module) {
log.trace("process hello policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "hello", partnerId, module);
return processXACMLRequest(eventRequest);
}
/**
* process access control policy for the partnerInfo method.
*
* @param userId connected user
* @param partnerId partner concerned by the request
* @return
*/
@Override
public int partnerInfo(String userId, String partnerId) {
log.trace("process partnerInfo policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "partnerInfo", partnerId, Module.queryModule.getValue());
return processXACMLRequest(eventRequest);
}
/**
* process access control policy for the eventLookup method for each
* retrieved event retriefed.
*
* @param userId connected user
* @param dsEvent the event
* @return
*/
@Override
public int eventLookup(String userId, XACMLDSEvent dsEvent) {
log.trace("process eventLookup policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "eventLookup", dsEvent, Module.queryModule.getValue());
return processXACMLRequest(eventRequest);
}
/**
* process access control policy for the eventInfo method.
*
* @param userId connected user
* @param dsEvent
* @return
*/
@Override
public int eventInfo(String userId, XACMLDSEvent dsEvent) {
log.trace("process eventInfo policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "eventInfo", dsEvent, Module.queryModule.getValue());
return processXACMLRequest(eventRequest);
}
@Override
public int canBe(String userId, String partnerId) {
log.trace("process canBe policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "canBe", partnerId, Module.queryModule.getValue());
return processXACMLRequest(eventRequest);
}
@Override
public int eventCreate(String userId, XACMLDSEvent dsEvent) {
log.trace("process eventCreate policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "eventCreate", dsEvent, Module.captureModule.getValue());
return processXACMLRequest(eventRequest);
}
@Override
public int voidEvent(String userId, XACMLDSEvent dsEvent) {
log.trace("process voidEvent policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "voidEvent", dsEvent, Module.captureModule.getValue());
return processXACMLRequest(eventRequest);
}
@Override
public int multipleEventCreate(String userId, XACMLDSEvent dsEvent) {
log.trace("process multipleEventCreate policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "eventLookup", dsEvent, Module.captureModule.getValue());
return processXACMLRequest(eventRequest);
}
public int userLookup(String userId, String partner) {
log.trace("process userLookup policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "userLookup", partner, Module.administrationModule.getValue());
return processXACMLRequest(eventRequest);
}
public int userCreate(String userId, String partner) {
log.trace("process userCreate policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "userCreate", partner, Module.administrationModule.getValue());
return processXACMLRequest(eventRequest);
}
public int userInfo(String userId, String partner) {
log.trace("process userInfo policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "userInfo", partner, Module.administrationModule.getValue());
return processXACMLRequest(eventRequest);
}
public int userUpdate(String userId, String partner) {
log.trace("process userUpdate policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "userUpdate", partner, Module.administrationModule.getValue());
return processXACMLRequest(eventRequest);
}
public int userDelete(String userId, String partner) {
log.trace("process userDelete policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "userDelete", partner, Module.administrationModule.getValue());
return processXACMLRequest(eventRequest);
}
public int partnerUpdate(String userId, String partner) {
log.trace("process partnerUpdate policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "partnerUpdate", partner, Module.administrationModule.getValue());
return processXACMLRequest(eventRequest);
}
public int partnerLookup(String userId, String partner) {
log.trace("process partnerLookup policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "partnerLookup", partner, Module.administrationModule.getValue());
return processXACMLRequest(eventRequest);
}
public int partnerDelete(String userId, String partner) {
log.trace("process partnerDelete policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "partnerDelete", partner, Module.administrationModule.getValue());
return processXACMLRequest(eventRequest);
}
public int partnerCreate(String userId, String partner) {
log.trace("process partnerCreate policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "partnerCreate", partner, Module.administrationModule.getValue());
return processXACMLRequest(eventRequest);
}
public boolean isRootAccess(String userId, String partnerId) {
log.trace("process checkRootAccess policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "superadmin", partnerId, Module.administrationModule.getValue());
return processXACMLRequest(eventRequest) == Result.DECISION_PERMIT;
}
}
CaPPa/DS-Xi-Client/src/main/java/fr/unicaen/iota/xi/client/PEP.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.xi.client;
import com.sun.xacml.ctx.RequestCtx;
import com.sun.xacml.ctx.Result;
import fr.unicaen.iota.xacml.request.EventRequest;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class PEP {
private String url;
private static final Log log = LogFactory.getLog(PEP.class);
public PEP(String url) {
this.url = url;
}
/**
* Processes an event request and returns XACML response code.
*
* @param eventRequest The event request.
* @return The XACML response code.
*/
public int processXACMLRequest(EventRequest eventRequest) {
int response = Result.DECISION_DENY;
try {
String respInString = sendXACMLRequest(eventRequest.createRequest());
response = Integer.parseInt(respInString);
} catch (Exception ex) {
log.error("", ex);
}
return response;
}
/**
* Sends XACML request to the XACML module and gets the response.
*
* @param xacmlReq The XACML request to send.
* @return The XACML response.
* @throws IOException If an I/O error occurred.
*/
private String sendXACMLRequest(RequestCtx xacmlReq) throws IOException {
HttpURLConnection httpConnection = getConnection("text/plain", url);
log.debug("Sending XACML request...");
xacmlReq.encode(httpConnection.getOutputStream());
log.debug("Getting XACML response...");
int responseCode = httpConnection.getResponseCode();
if (responseCode == HttpServletResponse.SC_OK) {
BufferedReader br = new BufferedReader(new InputStreamReader(httpConnection.getInputStream()));
StringBuilder sb = new StringBuilder();
String line;
while ((line = br.readLine()) != null) {
sb.append(line);
}
br.close();
return sb.toString();
} else {
log.error("XACML module servlet response: " + responseCode);
return String.valueOf(Result.DECISION_DENY);
}
}
/**
* Opens a connection to the xacml module.
*
* @param contentType The HTTP content-type, e.g.,
* <code>text/xml</code>
* @return The HTTP connection object.
* @throws IOException If an error occurred connecting to the XACML module.
*/
private HttpURLConnection getConnection(final String contentType, String url) throws IOException {
URL serviceUrl = new URL(url);
HttpURLConnection connection = (HttpURLConnection) serviceUrl.openConnection();
connection.setRequestProperty("content-type", contentType);
connection.setRequestMethod("POST");
connection.setDoInput(true);
connection.setDoOutput(true);
return connection;
}
}
CaPPa/DS-Xi-Client/src/main/java/fr/unicaen/iota/xi/utils/Utils.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
* Copyright © 2011 Orange Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.xi.utils;
import com.sun.xacml.ctx.Result;
public final class Utils {
/**
* Returns the value of XACML response.
* @param resp The XACML response.
* @return <code>true</code> if the response is positive.
*/
public static boolean responseIsPermit(int resp) {
return Result.DECISION_PERMIT == resp ? true : false;
}
}
CaPPa/DS-Xi-Client/src/main/resources/META-INF/LICENSE
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
CaPPa/EPCIS-Xi-Client/LICENSE
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
CaPPa/EPCIS-Xi-Client/LISEZMOI
EPCIS-Xi-Client
Bibliothèque client pour l'interfaçage avec le service web Xi pour EPCIS.
Dépendances:
bibliothèques:
- sunxacml
- servlet-api
- commons-logging
Dépendances d’utilisation:
- Xi
- EpcisPHI
- ETa
- un EPCIS
CaPPa/EPCIS-Xi-Client/README
EPCIS-Xi-Client
Common library interfacing with the xi web service for EPCIS.
Dependencies:
libraries:
- sunxacml
- servlet-api
- commons-logging
Usage Dependencies:
- Xi
- EpcisPHI
- ETa
- an EPCIS
CaPPa/EPCIS-Xi-Client/pom.xml
<?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fr.unicaen.iota</groupId>
<artifactId>epcis-xi-client</artifactId>
<version>1.9-mock</version>
<packaging>jar</packaging>
<name>EPCIS-Xi-Client</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- IoTa dependecy -->
<dependency>
<groupId>fr.unicaen.iota</groupId>
<artifactId>libxacml-epcis</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Other dependency -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<!-- Log dependency -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>sources</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptorRefs>
<descriptorRef>src</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
CaPPa/EPCIS-Xi-Client/src/main/java/fr/unicaen/iota/xi/client/EPCISPEP.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.xi.client;
import fr.unicaen.iota.xacml.pep.MethodNamesCapture;
import fr.unicaen.iota.xacml.pep.MethodNamesQuery;
import fr.unicaen.iota.xacml.pep.XACMLEPCISEvent;
import fr.unicaen.iota.xacml.pep.XACMLEPCISMasterData;
import fr.unicaen.iota.xacml.policy.Module;
import fr.unicaen.iota.xacml.request.EventRequest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class EPCISPEP extends PEP implements MethodNamesQuery, MethodNamesCapture {
private static final Log log = LogFactory.getLog(EPCISPEP.class);
public EPCISPEP(String url) {
super(url);
}
@Override
public int hello(String userId, String partnerId, String module) {
log.debug("process hello policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "hello", partnerId, module);
return processXACMLRequest(eventRequest);
}
@Override
public int queryEvent(String userId, XACMLEPCISEvent epcisEvent) {
log.debug("process queryEvent policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "queryEvent", epcisEvent, Module.queryModule.getValue());
return processXACMLRequest(eventRequest);
}
@Override
public int queryMasterData(String userId, XACMLEPCISMasterData epcisMasterData) {
log.debug("process queryMasterData policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "queryMasterData", epcisMasterData, Module.queryModule.getValue());
return processXACMLRequest(eventRequest);
}
@Override
public int subscribe(String userId, String partnerId) {
log.debug("process subscribe policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "subscribe", partnerId, Module.queryModule.getValue());
return processXACMLRequest(eventRequest);
}
@Override
public int unsubscribe(String userId, String partnerId) {
log.debug("process unsubscribe policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "unsubscribe", partnerId, Module.queryModule.getValue());
return processXACMLRequest(eventRequest);
}
@Override
public int canBe(String userId, String partnerId) {
log.debug("process canBe policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "canBe", partnerId, Module.queryModule.getValue());
return processXACMLRequest(eventRequest);
}
@Override
public int captureEvent(String userId, XACMLEPCISEvent epcisEvent) {
log.debug("process captureEvent policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "captureEvent", epcisEvent, Module.captureModule.getValue());
return processXACMLRequest(eventRequest);
}
@Override
public int captureMasterData(String userId, XACMLEPCISMasterData epcisMasterData) {
log.debug("process captureMasterDataEvent policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "captureMasterDataEvent", epcisMasterData, Module.captureModule.getValue());
return processXACMLRequest(eventRequest);
}
}
CaPPa/EPCIS-Xi-Client/src/main/java/fr/unicaen/iota/xi/client/PEP.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.xi.client;
import com.sun.xacml.ctx.RequestCtx;
import com.sun.xacml.ctx.Result;
import fr.unicaen.iota.xacml.request.EventRequest;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class PEP {
private String url;
private static final Log log = LogFactory.getLog(PEP.class);
public PEP(String url) {
this.url = url;
}
/**
* Processes an event request and returns XACML response code.
*
* @param eventRequest The event request.
* @return The XACML response code.
*/
public int processXACMLRequest(EventRequest eventRequest) {
int response = Result.DECISION_DENY;
try {
String respInString = sendXACMLRequest(eventRequest.createRequest());
response = Integer.parseInt(respInString);
} catch (Exception ex) {
log.error("", ex);
}
return response;
}
/**
* Sends XACML request to the XACML module and gets the response.
*
* @param xacmlReq The XACML request to send.
* @return The XACML response.
* @throws IOException If an I/O error occurred.
*/
private String sendXACMLRequest(RequestCtx xacmlReq) throws IOException {
HttpURLConnection httpConnection = getConnection("text/plain", url);
log.debug("Sending XACML request...");
xacmlReq.encode(httpConnection.getOutputStream());
log.debug("Getting XACML response...");
int responseCode = httpConnection.getResponseCode();
if (responseCode == HttpServletResponse.SC_OK) {
BufferedReader br = new BufferedReader(new InputStreamReader(httpConnection.getInputStream()));
StringBuilder sb = new StringBuilder();
String line;
while ((line = br.readLine()) != null) {
sb.append(line);
}
br.close();
return sb.toString();
} else {
log.error("XACML module servlet response: " + responseCode);
return String.valueOf(Result.DECISION_DENY);
}
}
/**
* Opens a connection to the xacml module.
*
* @param contentType The HTTP content-type, e.g.,
* <code>text/xml</code>
* @return The HTTP connection object.
* @throws IOException If an error occurred connecting to the XACML module.
*/
private HttpURLConnection getConnection(final String contentType, String url) throws IOException {
URL serviceUrl = new URL(url);
HttpURLConnection connection = (HttpURLConnection) serviceUrl.openConnection();
connection.setRequestProperty("content-type", contentType);
connection.setRequestMethod("POST");
connection.setDoInput(true);
connection.setDoOutput(true);
return connection;
}
}
CaPPa/EPCIS-Xi-Client/src/main/java/fr/unicaen/iota/xi/client/UserPEP.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2008-2012 Université de Caen Basse-Normandie, GREYC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.xi.client;
import com.sun.xacml.ctx.Result;
import fr.unicaen.iota.xacml.policy.Module;
import fr.unicaen.iota.xacml.request.EventRequest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class UserPEP extends PEP {
private static final Log log = LogFactory.getLog(UserPEP.class);
public UserPEP(String url) {
super(url);
}
public int userLookup(String userId, String partner) {
log.debug("process userLookup policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "userLookup", partner, Module.administrationModule.getValue());
return processXACMLRequest(eventRequest);
}
public int userCreate(String userId, String partner) {
log.debug("process userCreate policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "userCreate", partner, Module.administrationModule.getValue());
return processXACMLRequest(eventRequest);
}
public int userInfo(String userId, String partner) {
log.debug("process userInfo policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "userInfo", partner, Module.administrationModule.getValue());
return processXACMLRequest(eventRequest);
}
public int userUpdate(String userId, String partner) {
log.debug("process userUpdate policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "userUpdate", partner, Module.administrationModule.getValue());
return processXACMLRequest(eventRequest);
}
public int userDelete(String userId, String partner) {
log.debug("process userDelete policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "userDelete", partner, Module.administrationModule.getValue());
return processXACMLRequest(eventRequest);
}
public int partnerUpdate(String userId, String partner) {
log.debug("process partnerUpdate policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "partnerUpdate", partner, Module.administrationModule.getValue());
return processXACMLRequest(eventRequest);
}
public int partnerLookup(String userId, String partner) {
log.debug("process partnerLookup policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "partnerLookup", partner, Module.administrationModule.getValue());
return processXACMLRequest(eventRequest);
}
public int partnerDelete(String userId, String partner) {
log.debug("process partnerDelete policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "partnerDelete", partner, Module.administrationModule.getValue());
return processXACMLRequest(eventRequest);
}
public int partnerCreate(String userId, String partner) {
log.debug("process partnerCreate policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "partnerCreate", partner, Module.administrationModule.getValue());
return processXACMLRequest(eventRequest);
}
public boolean isRootAccess(String userId, String partnerId) {
log.trace("process checkRootAccess policy for user: " + userId);
EventRequest eventRequest = new EventRequest(userId, "superadmin", partnerId, Module.administrationModule.getValue());
return processXACMLRequest(eventRequest) == Result.DECISION_PERMIT;
}
}
CaPPa/EPCIS-Xi-Client/src/main/java/fr/unicaen/iota/xi/utils/Utils.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2011-2012 Université de Caen Basse-Normandie, GREYC
* Copyright © 2011 Orange Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.xi.utils;
import com.sun.xacml.ctx.Result;
public final class Utils {
/**
* Returns the value of XACML response.
* @param resp The XACML response.
* @return <code>true</code> if the response is positive.
*/
public static boolean responseIsPermit(int resp) {
return Result.DECISION_PERMIT == resp ? true : false;
}
}
CaPPa/EPCIS-Xi-Client/src/main/resources/META-INF/LICENSE
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
DELTa/delta.sh
#!/bin/sh
cp="."
for f in lib/*.jar; do
cp="${cp}:${f}"
done
java -cp ${cp} fr.unicaen.iota.validator.Main
java -cp ".:lib/*" fr.unicaen.iota.validator.Main
DELTa/pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fr.unicaen.iota.validator</groupId>
<groupId>fr.unicaen.iota</groupId>
<artifactId>delta</artifactId>
<version>1.0</version>
<version>1.9-mock</version>
<packaging>jar</packaging>
<name>DELTa</name>
......
<!-- IoTa dependency -->
<dependency>
<groupId>fr.unicaen.iota.application</groupId>
<groupId>fr.unicaen.iota</groupId>
<artifactId>alfa-pi</artifactId>
<version>1.0</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>fr.unicaen.iota</groupId>
<artifactId>mu</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>fr.unicaen.iota</groupId>
<artifactId>dseta-client</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Fosstrak dependency -->
DELTa/src/main/assembly/bin-with-dependencies.xml
<include>delta.sh</include>
</includes>
</fileSet>
<fileSet>
<directory>src/main/resources</directory>
<outputDirectory></outputDirectory>
<includes>
<include>application.properties</include>
</includes>
</fileSet>
<fileSet>
<directory>target</directory>
<outputDirectory></outputDirectory>
DELTa/src/main/java/fr/unicaen/iota/validator/Configuration.java
private Configuration() {
}
private static final String PROPERTIES_CONFIG_FILE = "/application.properties";
public static String DS_SERVICE_TYPE_FOR_EPCIS = "epcis";
public static String DS_SERVICE_TYPE_FOR_DS = "ds";
public static String EPCIS_CAPTURE_INTERFACE = "/capture";
public static String EPCIS_QUERY_INTERFACE = "/query";
public static String IOTA_XML_SCHEMA = "./resources/iota.xml";
public static String VERIFIED_DIRECTORY = "./repository/verified";
public static String UNVERIFIED_DIRECTORY = "./repository/unverified";
public static String LOG_DIRECTORY = "./repository/logs";
public static String RMI_SERVER_URL = "//localhost:1099/ALfA";
public static String DS_SERVICE_TYPE_FOR_EPCIS;
public static String DS_SERVICE_TYPE_FOR_DS;
public static String EPCIS_CAPTURE_INTERFACE;
public static String EPCIS_QUERY_INTERFACE;
public static String IOTA_XML_SCHEMA;
public static String VERIFIED_DIRECTORY;
public static String UNVERIFIED_DIRECTORY;
public static String LOG_DIRECTORY;
public static String RMI_SERVER_URL;
public static boolean DEBUG = false;
public static int NUMBER_OF_ACTIVE_THREAD = 10;
public static String EPCIS_LOG_TYPE = "epcis";
public static String DS_LOG_TYPE = "ds";
public static String DS_TO_DS_LOG_TYPE = "dstods";
public static boolean ANALYSE_EPCIS_EVENTS = false;
public static boolean ANALYSE_EPCIS_TO_DS_EVENTS = true;
public static boolean ANALYSE_DS_TO_DS_EVENTS = true;
public static String PSI_REPOSITORY = "psi/repository";
public static String XML_EVENT_FOLDER = PSI_REPOSITORY + "/events/";
public static String STATS_FOLDER = PSI_REPOSITORY + "/stats/";
public static String EPCIS_LOG_TYPE;
public static String DS_LOG_TYPE;
public static String DS_TO_DS_LOG_TYPE;
public static boolean ANALYSE_EPCIS_EVENTS;
public static boolean ANALYSE_EPCIS_TO_DS_EVENTS;
public static boolean ANALYSE_DS_TO_DS_EVENTS;
public static String PSI_REPOSITORY;
public static String XML_EVENT_FOLDER;
public static String STATS_FOLDER;
public static String IDENTITY;
static {
try {
Properties props = loadProperties();
DS_SERVICE_TYPE_FOR_EPCIS = props.getProperty("ds-service-type-for-epcis");
DS_SERVICE_TYPE_FOR_DS = props.getProperty("ds-service-type-for-ds");
EPCIS_CAPTURE_INTERFACE = props.getProperty("epcis-capture-interface");
EPCIS_QUERY_INTERFACE = props.getProperty("epcis-query-interface");
IOTA_XML_SCHEMA = props.getProperty("iota-xml-schema");
VERIFIED_DIRECTORY = props.getProperty("verified-directory");
UNVERIFIED_DIRECTORY = props.getProperty("unverified-directory");
LOG_DIRECTORY = props.getProperty("log-directory");
RMI_SERVER_URL = props.getProperty("rmi-server-url");
DEBUG = Boolean.parseBoolean(props.getProperty("debug"));
NUMBER_OF_ACTIVE_THREAD = Integer.parseInt(props.getProperty("thread-number"));
EPCIS_LOG_TYPE = props.getProperty("epcis-log-type");
DS_LOG_TYPE = props.getProperty("ds-log-type");
DS_TO_DS_LOG_TYPE = props.getProperty("ds-to-ds-log-type");
ANALYSE_EPCIS_EVENTS = Boolean.parseBoolean(props.getProperty("analyse-epcis-events"));
ANALYSE_EPCIS_TO_DS_EVENTS = Boolean.parseBoolean(props.getProperty("analyse-epcis-to-ds-events"));
ANALYSE_DS_TO_DS_EVENTS = Boolean.parseBoolean(props.getProperty("analyse-ds-to-ds-events"));
PSI_REPOSITORY = props.getProperty("psi-repository");
DS_SERVICE_TYPE_FOR_EPCIS = props.getProperty("ds-service-type-for-epcis", "epcis");
DS_SERVICE_TYPE_FOR_DS = props.getProperty("ds-service-type-for-ds", "ds");
EPCIS_CAPTURE_INTERFACE = props.getProperty("epcis-capture-interface", "/capture");
EPCIS_QUERY_INTERFACE = props.getProperty("epcis-query-interface", "/query");
IOTA_XML_SCHEMA = props.getProperty("iota-xml-schema", "./resources/iota.xml");
VERIFIED_DIRECTORY = props.getProperty("verified-directory", "./repository/verified");
UNVERIFIED_DIRECTORY = props.getProperty("unverified-directory", "./repository/unverified");
LOG_DIRECTORY = props.getProperty("log-directory", "./repository/logs");
RMI_SERVER_URL = props.getProperty("rmi-server-url", "//localhost:1099/ALfA");
DEBUG = Boolean.parseBoolean(props.getProperty("debug", "false"));
NUMBER_OF_ACTIVE_THREAD = Integer.parseInt(props.getProperty("thread-number", "10"));
EPCIS_LOG_TYPE = props.getProperty("epcis-log-type", "epcis");
DS_LOG_TYPE = props.getProperty("ds-log-type", "ds");
DS_TO_DS_LOG_TYPE = props.getProperty("ds-to-ds-log-type", "dstods");
ANALYSE_EPCIS_EVENTS = Boolean.parseBoolean(props.getProperty("analyse-epcis-events", "false"));
ANALYSE_EPCIS_TO_DS_EVENTS = Boolean.parseBoolean(props.getProperty("analyse-epcis-to-ds-events", "true"));
ANALYSE_DS_TO_DS_EVENTS = Boolean.parseBoolean(props.getProperty("analyse-ds-to-ds-events", "true"));
PSI_REPOSITORY = props.getProperty("psi-repository", "psi/repository");
XML_EVENT_FOLDER = PSI_REPOSITORY + "/events/";
STATS_FOLDER = PSI_REPOSITORY + "/stats/";
IDENTITY = props.getProperty("identity", "anonymous");
} catch (IOException ex) {
LogFactory.getLog(Configuration.class).fatal(null, ex);
}
DELTa/src/main/java/fr/unicaen/iota/validator/Controler.java
*/
package fr.unicaen.iota.validator;
import fr.unicaen.iota.tau.model.Identity;
import fr.unicaen.iota.validator.listener.AnalyserStatus;
import fr.unicaen.iota.validator.operations.Analyser;
import fr.unicaen.iota.validator.operations.ThreadManager;
......
public class Controler extends Thread implements Runnable {
private static final Log log = LogFactory.getLog(Controler.class);
private File xmlEventFolder;
private IOTA iota;
private final IOTA iota;
private final Identity identity;
private AnalyserStatus analyserStatus;
private boolean proceedAnalyse = true;
public static List<String> ACTIVE_FILE_LIST = new ArrayList<String>();
Controler(File f, IOTA iota) {
Controler(Identity identity, File f, IOTA iota) {
this.xmlEventFolder = f;
this.iota = iota;
this.identity = identity;
this.analyserStatus = new AnalyserStatus();
}
......
continue;
}
ACTIVE_FILE_LIST.add(Configuration.XML_EVENT_FOLDER + "/" + file);
Analyser analyser = new Analyser(Configuration.XML_EVENT_FOLDER + "/" + file, getIota(), getAnalyserStatus());
Analyser analyser = new Analyser(Configuration.XML_EVENT_FOLDER + "/" + file, getIdentity(), getIota(), getAnalyserStatus());
try {
threadManager.startThread(analyser);
} catch (InterruptedException ex) {
......
}
/**
* @param iota the iota to set
* @return the identity
*/
public void setIota(IOTA iota) {
this.iota = iota;
public Identity getIdentity() {
return identity;
}
/**
DELTa/src/main/java/fr/unicaen/iota/validator/Main.java
*/
package fr.unicaen.iota.validator;
import fr.unicaen.iota.tau.model.Identity;
import fr.unicaen.iota.validator.gui.GUI;
import java.io.File;
import java.io.IOException;
......
log.error(null, e);
}
AnalyserResult analyserResult = new AnalyserResult();
Controler controler = new Controler(f, iota);
GUI gui = new GUI(controler, iota);
Identity identity = new Identity();
identity.setAsString(Configuration.IDENTITY);
Controler controler = new Controler(identity, f, iota);
GUI gui = new GUI(controler);
controler.getAnalyserStatus().addListener(gui);
controler.getAnalyserStatus().addListener(analyserResult);
gui.setResults(analyserResult);
DELTa/src/main/java/fr/unicaen/iota/validator/gui/DetailsDialog.form
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="245" max="32767" attributes="0"/>
<Component id="jScrollPane1" pref="241" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/>
......
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane2" pref="245" max="32767" attributes="0"/>
<Component id="jScrollPane2" pref="241" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/>
......
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane3" pref="245" max="32767" attributes="0"/>
<Component id="jScrollPane3" pref="241" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jButton4" alignment="3" min="-2" max="-2" attributes="0"/>
DELTa/src/main/java/fr/unicaen/iota/validator/gui/DetailsDialog.java
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
try {
AccessInterface server = (AccessInterface) Naming.lookup(Configuration.RMI_SERVER_URL);
EPCISEntryComparator epcisComparator = new EPCISEntryComparator(server, iota);
EPCISEntryComparator epcisComparator = new EPCISEntryComparator(gui.getIdentity(), server, iota);
List<EPC> list = new ArrayList<EPC>();
list.add(container);
Map<EPC, List<BaseEvent>> result = epcisComparator.getEventNotVerified(list);
......
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
try {
AccessInterface server = (AccessInterface) Naming.lookup(Configuration.RMI_SERVER_URL);
DSEntryComparator dSEntryComparator = new DSEntryComparator(server, gui.getIota());
DSEntryComparator dSEntryComparator = new DSEntryComparator(gui.getIdentity(), server, gui.getIota());
Map<EPC, List<DSEvent>> result = dSEntryComparator.getEventNotVerified(container, gui.getAnalyserResult().get(container.getEpc()).getContainerList());
AnalyserResult analyserResult = gui.getAnalyserResult();
......
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
try {
AccessInterface server = (AccessInterface) Naming.lookup(Configuration.RMI_SERVER_URL);
DSEntryComparator dSEntryComparator = new DSEntryComparator(server, gui.getIota());
DSEntryComparator dSEntryComparator = new DSEntryComparator(gui.getIdentity(), server, gui.getIota());
List<EPC> list = new ArrayList<EPC>();
list.add(container);
Map<EPC, List<DSEvent>> result = dSEntryComparator.verifyDSToDSReferences(list);
DELTa/src/main/java/fr/unicaen/iota/validator/gui/GUI.java
package fr.unicaen.iota.validator.gui;
import fr.unicaen.iota.application.model.DSEvent;
import fr.unicaen.iota.tau.model.Identity;
import fr.unicaen.iota.validator.*;
import fr.unicaen.iota.validator.listener.AnalyserListener;
import fr.unicaen.iota.validator.model.BaseEvent;
......
private static final Log log = LogFactory.getLog(GUI.class);
private int nbFiles;
private Controler controler;
private final Controler controler;
private int tableId = 0;
private IOTA iota;
private final IOTA iota;
private final Identity identity;
private AnalyserResult analyserResult;
private JPanel tree;
private JTabbedPane jTabbedPane;
......
/**
* Creates new form GUI
*/
public GUI() {
public GUI(Controler controler) {
initComponents();
this.setTitle("DELTa");
this.iota = controler.getIota();
this.identity = controler.getIdentity();
nbFiles = new File(Configuration.XML_EVENT_FOLDER).list().length;
jLabel6.setText(nbFiles + "");
}
public GUI(Controler controleur, IOTA iota) {
initComponents();
this.setTitle("DELTa");
this.iota = iota;
nbFiles = new File(Configuration.XML_EVENT_FOLDER).list().length;
jLabel6.setText(nbFiles + "");
this.controler = controleur;
this.controler = controler;
initAnalyserRestricions();
createTable();
createTabbedPane();
......
}
/**
* @param iota the iota to set
* @return the identity
*/
public void setIota(IOTA iota) {
this.iota = iota;
public Identity getIdentity() {
return identity;
}
/**
DELTa/src/main/java/fr/unicaen/iota/validator/model/AggregationEvent.java
*/
package fr.unicaen.iota.validator.model;
import fr.unicaen.iota.application.model.EPCISEvent;
import fr.unicaen.iota.mu.EPCISEventTypeHelper;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.fosstrak.epcis.model.ActionType;
import org.fosstrak.epcis.model.EPCISEventType;
import org.jdom.Element;
/**
......
}
@Override
public boolean isContainedIn(Collection<EPCISEvent> list) {
for (EPCISEvent event : list) {
public boolean isContainedIn(Collection<EPCISEventType> list) {
for (EPCISEventType evt : list) {
EPCISEventTypeHelper event = new EPCISEventTypeHelper(evt);
for (String epc : event.getChildren()) {
if (!getChildEpcs().contains(epc)) {
return false;
}
}
return event.getAction().equals(getAction().value())
&& event.getBizLoc().equals(getInfrastructure().getBizLoc())
return event.getAction() == getAction()
&& event.getBizLocation().equals(getInfrastructure().getBizLoc())
&& event.getBizStep().equals(getBizStep())
&& event.getDisposition().equals(getDisposition())
&& event.getParentID().equals(getParentId());
......
return false;
}
}
return aggEvt.getAction().value().equals(getAction().value())
return aggEvt.getAction() == getAction()
&& aggEvt.getInfrastructure().getBizLoc().equals(getInfrastructure().getBizLoc())
&& aggEvt.getBizStep().equals(getBizStep())
&& aggEvt.getDisposition().equals(getDisposition())
DELTa/src/main/java/fr/unicaen/iota/validator/model/BaseEvent.java
*/
package fr.unicaen.iota.validator.model;
import fr.unicaen.iota.application.model.EPCISEvent;
import org.fosstrak.epcis.model.EPCISEventType;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
......
}
}
public abstract boolean isContainedIn(Collection<EPCISEvent> list);
public abstract boolean isContainedIn(Collection<EPCISEventType> list);
}
DELTa/src/main/java/fr/unicaen/iota/validator/model/EPC.java
*/
package fr.unicaen.iota.validator.model;
import fr.unicaen.iota.application.model.DSEvent;
import fr.unicaen.iota.application.model.EPCISEvent;
import fr.unicaen.iota.ds.model.*;
import org.fosstrak.epcis.model.EPCISEventType;
import fr.unicaen.iota.validator.Configuration;
import fr.unicaen.iota.validator.IOTA;
import java.util.ArrayList;
......
private static final Log log = LogFactory.getLog(EPC.class);
private String epc;
private List<BaseEvent> eventList;
private List<DSEvent> dsToDsReferentList;
private List<TEventItem> dsToDsReferentList;
private String parentId;
public EPC(String epc) {
......
return res;
}
public List<DSEvent> getDSEvents(List<EPC> containerList) throws Exception {
public List<TEventItem> getDSEvents(List<EPC> containerList) throws Exception {
List<BaseEvent> eventListClone = new ArrayList<BaseEvent>();
eventListClone.addAll(this.eventList);
if (this.parentId != null) {
BaseEvent parentEvent = getParentEvent(parentId, containerList);
eventListClone.add(parentEvent);
}
List<DSEvent> events = new ArrayList<DSEvent>();
List<TEventItem> events = new ArrayList<TEventItem>();
for (BaseEvent be : eventListClone) {
events.add(new DSEvent(this.epc, be.getInfrastructure().getServiceAddress(), be.getBizStep(), null));
TEventItem evt = new TEventItem();
TServiceItemList serviceList = new TServiceItemList();
TServiceItem service = new TServiceItem();
service.setUri(be.getInfrastructure().getServiceAddress());
serviceList.getService().add(service);
evt.setServiceList(serviceList);
evt.setC(epc);
evt.setLcs(be.getBizStep());
events.add(evt);
//new DSEvent(this.epc,
// be.getInfrastructure().getServiceAddress(),
// be.getBizStep(),
// null));
}
return events;
}
public Iterable<DSEvent> getDSToDSEvents(List<EPC> containerList) {
public Iterable<TEventItem> getDSToDSEvents(List<EPC> containerList) {
throw new UnsupportedOperationException("Not yet implemented");
}
......
return events;
}
public List<BaseEvent> verifyEPCISEvents(List<EPCISEvent> list, IOTA iota) {
public List<BaseEvent> verifyEPCISEvents(List<EPCISEventType> list, IOTA iota) {
List<BaseEvent> res = new ArrayList<BaseEvent>();
for (BaseEvent be : this.eventList) {
if (!iota.get(be.getInfrastructure().getBizLoc()).isActiveAnalyse()) {
DELTa/src/main/java/fr/unicaen/iota/validator/model/ObjectEvent.java
*/
package fr.unicaen.iota.validator.model;
import fr.unicaen.iota.application.model.EPCISEvent;
import fr.unicaen.iota.mu.EPCISEventTypeHelper;
import org.fosstrak.epcis.model.EPCISEventType;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
......
}
@Override
public boolean isContainedIn(Collection<EPCISEvent> list) {
for (EPCISEvent event : list) {
public boolean isContainedIn(Collection<EPCISEventType> list) {
for (EPCISEventType evt : list) {
EPCISEventTypeHelper event = new EPCISEventTypeHelper(evt);
for (String epc : event.getEpcs()) {
if (!getEpcList().contains(epc)) {
return false;
}
}
if (event.getAction().equals(getAction().value())
&& event.getBizLoc().equals(getInfrastructure().getBizLoc())
if (event.getAction() == getAction()
&& event.getBizLocation().equals(getInfrastructure().getBizLoc())
&& event.getBizStep().equals(getBizStep())
&& event.getDisposition().equals(getDisposition())) {
return true;
......
return false;
}
}
return objEvt.getAction().value().equals(getAction().value())
return objEvt.getAction() == getAction()
&& objEvt.getInfrastructure().getBizLoc().equals(getInfrastructure().getBizLoc())
&& objEvt.getBizStep().equals(getBizStep())
&& objEvt.getDisposition().equals(getDisposition());
DELTa/src/main/java/fr/unicaen/iota/validator/model/QuantityEvent.java
*/
package fr.unicaen.iota.validator.model;
import fr.unicaen.iota.application.model.EPCISEvent;
import fr.unicaen.iota.mu.EPCISEventTypeHelper;
import org.fosstrak.epcis.model.EPCISEventType;
import java.util.Collection;
import org.jdom.Element;
......
}
@Override
public boolean isContainedIn(Collection<EPCISEvent> list) {
for (EPCISEvent event : list) {
if (event.getBizLoc().equals(getInfrastructure().getBizLoc())
public boolean isContainedIn(Collection<EPCISEventType> list) {
for (EPCISEventType evt : list) {
EPCISEventTypeHelper event = new EPCISEventTypeHelper(evt);
if (event.getBizLocation().equals(getInfrastructure().getBizLoc())
&& event.getBizStep().equals(getBizStep())
&& event.getDisposition().equals(getDisposition())
&& event.getEPCClass().equals(getEpcClass())
DELTa/src/main/java/fr/unicaen/iota/validator/model/TransactionEvent.java
*/
package fr.unicaen.iota.validator.model;
import fr.unicaen.iota.application.model.EPCISEvent;
import fr.unicaen.iota.mu.EPCISEventTypeHelper;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import org.fosstrak.epcis.model.ActionType;
import org.fosstrak.epcis.model.BusinessTransactionListType;
import org.fosstrak.epcis.model.BusinessTransactionType;
import org.fosstrak.epcis.model.EPCISEventType;
import org.jdom.Element;
/**
......
}
@Override
public boolean isContainedIn(Collection<EPCISEvent> list) {
for (EPCISEvent event : list) {
for (String epc : event.getEpcs()) {
public boolean isContainedIn(Collection<EPCISEventType> list) {
for (EPCISEventType evt : list) {
EPCISEventTypeHelper event = new EPCISEventTypeHelper(evt);
for (String epc : event.getEpcList()) {
if (!getEpcList().contains(epc)) {
return false;
}
}
if (event.getAction().equals(getAction().value())
&& event.getBizLoc().equals(getInfrastructure().getBizLoc())
if (event.getAction() == getAction()
&& event.getBizLocation().equals(getInfrastructure().getBizLoc())
&& event.getBizStep().equals(getBizStep())
&& event.getDisposition().equals(getDisposition())
&& event.getParentID().equals(getParentId())
&& verifyBizTransList(event.getBizTrans())) {
&& verifyBizTransList(event.getBizTransactions())) {
return true;
}
}
DELTa/src/main/java/fr/unicaen/iota/validator/operations/Analyser.java
import fr.unicaen.iota.application.model.DSEvent;
import fr.unicaen.iota.application.rmi.AccessInterface;
import fr.unicaen.iota.tau.model.Identity;
import fr.unicaen.iota.validator.Configuration;
import fr.unicaen.iota.validator.Controler;
import fr.unicaen.iota.validator.IOTA;
......
*/
public class Analyser extends Thread implements Runnable {
private String XMLPath;
private final String XMLPath;
private AccessInterface server;
private IOTA iota;
private final IOTA iota;
private final Identity identity;
private ThreadManager threadManager;
private AnalyserStatus analyserStatus;
private final AnalyserStatus analyserStatus;
private static final Log log = LogFactory.getLog(Analyser.class);
public Analyser(String XMLPath, IOTA iota, AnalyserStatus analyserStatus) {
public Analyser(String XMLPath, Identity identity, IOTA iota, AnalyserStatus analyserStatus) {
this.iota = iota;
this.XMLPath = XMLPath;
this.analyserStatus = analyserStatus;
this.identity = identity;
try {
server = (AccessInterface) Naming.lookup(Configuration.RMI_SERVER_URL);
this.server = (AccessInterface) Naming.lookup(Configuration.RMI_SERVER_URL);
} catch (Exception e) {
log.fatal("Failed to setup for RMI", e);
return;
}
}
......
List<EPC> containerList = parseEPCSimulated(documentJDOM.getRootElement());
Map<EPC, List<BaseEvent>> epcisResults = null;
if (Configuration.ANALYSE_EPCIS_EVENTS) {
EPCISEntryComparator epcisComparator = new EPCISEntryComparator(server, iota);
EPCISEntryComparator epcisComparator = new EPCISEntryComparator(identity, server, iota);
epcisResults = epcisComparator.getEventNotVerified(containerList);
if (Configuration.DEBUG) {
log.debug("\n\n");
......
}
DSEntryComparator dsComparator = null;
if (Configuration.ANALYSE_DS_TO_DS_EVENTS || Configuration.ANALYSE_EPCIS_TO_DS_EVENTS) {
dsComparator = new DSEntryComparator(server, iota);
dsComparator = new DSEntryComparator(identity, server, iota);
}
Map<EPC, List<DSEvent>> dsResults = null;
if (Configuration.ANALYSE_EPCIS_TO_DS_EVENTS) {
DELTa/src/main/java/fr/unicaen/iota/validator/operations/DSEntryComparator.java
import fr.unicaen.iota.application.model.DSEvent;
import fr.unicaen.iota.application.rmi.AccessInterface;
import fr.unicaen.iota.tau.model.Identity;
import fr.unicaen.iota.validator.Configuration;
import fr.unicaen.iota.validator.IOTA;
import fr.unicaen.iota.validator.model.DSLink;
......
*/
public class DSEntryComparator {
private AccessInterface applicationLevelInterface;
private IOTA iota;
private final AccessInterface applicationLevelInterface;
private final IOTA iota;
private final Identity identity;
private static final Log log = LogFactory.getLog(DSEntryComparator.class);
public DSEntryComparator(AccessInterface applicationLevelInterface, IOTA iota) {
public DSEntryComparator(Identity identity, AccessInterface applicationLevelInterface, IOTA iota) {
this.applicationLevelInterface = applicationLevelInterface;
this.iota = iota;
this.identity = identity;
}
public Map<EPC, List<DSEvent>> getEventNotVerified(EPC container, List<EPC> list) {
......
tmp.add(link.getDsAddress());
Date d1 = new Date();
eventList.addAll(applicationLevelInterface.queryDS(container.getEpc(),
link.getDsAddress(), link.getLogin(), link.getPassword(), Configuration.DS_SERVICE_TYPE_FOR_EPCIS));
link.getDsAddress(), identity, Configuration.DS_SERVICE_TYPE_FOR_EPCIS));
Date d2 = new Date();
link.addTimeResponse(d2.getTime() - d1.getTime());
}
......
List<DSEvent> dsEventList = new ArrayList<DSEvent>();
List<Infrastructure> infrastructures = container.getInfrastructures();
List<String> dsLinks = new ArrayList<String>();
String referentDS = applicationLevelInterface.getReferenteDS(container.getEpc());
String referentDS = applicationLevelInterface.getReferentDS(container.getEpc());
for (Infrastructure infra : infrastructures) {
if (!iota.get(infra.getBizLoc()).getDSLink().isActiveAnalyse()) {
continue;
......
}
if (link.getDsAddress().equals(referentDS)) {
Date d1 = new Date();
List<DSEvent> list = applicationLevelInterface.queryDS(container.getEpc(), link.getDsAddress(), link.getLogin(), link.getPassword(), Configuration.DS_SERVICE_TYPE_FOR_DS);
List<DSEvent> list = applicationLevelInterface.queryDS(container.getEpc(), link.getDsAddress(), identity, Configuration.DS_SERVICE_TYPE_FOR_DS);
Date d2 = new Date();
link.addTimeResponse(d2.getTime() - d1.getTime());
for (DSEvent dSEvent : list) {
DELTa/src/main/java/fr/unicaen/iota/validator/operations/EPCISEntryComparator.java
*/
package fr.unicaen.iota.validator.operations;
import fr.unicaen.iota.application.model.EPCISEvent;
import fr.unicaen.iota.application.rmi.AccessInterface;
import fr.unicaen.iota.tau.model.Identity;
import fr.unicaen.iota.validator.Configuration;
import fr.unicaen.iota.validator.IOTA;
import fr.unicaen.iota.validator.model.BaseEvent;
......
import java.util.*;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.fosstrak.epcis.model.EPCISEventType;
/**
*
......
public class EPCISEntryComparator {
private static final Log log = LogFactory.getLog(EPCISEntryComparator.class);
private AccessInterface applicationLevelInterface;
private IOTA iota;
private final AccessInterface applicationLevelInterface;
private final IOTA iota;
private final Identity identity;
public EPCISEntryComparator(AccessInterface applicationLevelInterface, IOTA iota) {
public EPCISEntryComparator(Identity identity, AccessInterface applicationLevelInterface, IOTA iota) {
this.applicationLevelInterface = applicationLevelInterface;
this.iota = iota;
this.identity = identity;
}
public Map<EPC, List<BaseEvent>> getEventNotVerified(List<EPC> list) throws RemoteException {
......
}
private List<BaseEvent> verifyEPCISEntry(EPC container) throws RemoteException {
List<EPCISEvent> eventList = new ArrayList<EPCISEvent>();
List<EPCISEventType> eventList = new ArrayList<EPCISEventType>();
for (Infrastructure infra : container.getInfrastructures()) {
Link link = iota.get(infra.getBizLoc());
if (!link.isActiveAnalyse()) {
continue;
}
Date d1 = new Date();
eventList.addAll(applicationLevelInterface.queryEPCIS(container.getEpc(), link.getServiceAddress()));
eventList.addAll(applicationLevelInterface.queryEPCIS(identity, container.getEpc(), link.getServiceAddress()));
Date d2 = new Date();
link.addTimeResponse(d2.getTime() - d1.getTime());
}
DELTa/src/main/resources/application.properties
analyse-epcis-to-ds-events = true
analyse-ds-to-ds-events = true
psi-repository = psi/repository
identity = anonymous
DSeTa/DSeTa-Client/LICENSE
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
DSeTa/DSeTa-Client/LISEZMOI
DSeTa-Client
Bibliothèque client pour le web service DSeTa.
Dépendances:
bibliothèques:
- cxf
- commons-logging
- log4j
Dépendances d’utilisation:
- DSeTa
Utilisation:
voir ALfA ou EpcILoN pour des exemples
DSeTa/DSeTa-Client/README
IoTa-DiscoveryWS-Client
Client library for the DSeTa web service.
Dependencies:
libraries:
- cxf
- commons-logging
- log4j
Usage Dependencies:
- DSeTa
Usage:
see ALfA or EpcILoN for examples
DSeTa/DSeTa-Client/pom.xml
<?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fr.unicaen.iota</groupId>
<artifactId>dseta-client</artifactId>
<version>1.9-mock</version>
<packaging>jar</packaging>
<name>DSeTa-Client</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<lib-cxf-version>2.2.12</lib-cxf-version>
</properties>
<dependencies>
<!-- IoTa dependencies -->
<dependency>
<groupId>fr.unicaen.iota</groupId>
<artifactId>tau</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>fr.unicaen.iota</groupId>
<artifactId>discovery-client</artifactId>
<version>${project.version}</version>
</dependency>
<!-- CXF dependencies -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${lib-cxf-version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${lib-cxf-version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-local</artifactId>
<version>${lib-cxf-version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-databinding-jaxb</artifactId>
<version>${lib-cxf-version}</version>
</dependency>
<!-- Log dependencies -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.6.1</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot>
<defaultOptions>
<packagenames>
<packagename>urn:unicaen:iota:tau:xsd=fr.unicaen.iota.tau.model</packagename>
<packagename>urn:unicaen:iota:ds:xsd=fr.unicaen.iota.ds.model</packagename>
<packagename>urn:unicaen:iota:ds:wsdl=fr.unicaen.iota.ds.soap</packagename>
<packagename>urn:unicaen:iota:dseta:xsd=fr.unicaen.iota.dseta.model</packagename>
<packagename>urn:unicaen:iota:dseta:wsdl=fr.unicaen.iota.dseta.soap</packagename>
</packagenames>
</defaultOptions>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/tau-ds.wsdl</wsdl>
<wsdlLocation>classpath:wsdl/tau-ds.wsdl</wsdlLocation>
</wsdlOption>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/ds.wsdl</wsdl>
<wsdlLocation>classpath:wsdl/ds.wsdl</wsdlLocation>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>sources</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptorRefs>
<descriptorRef>src</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
DSeTa/DSeTa-Client/src/main/java/fr/unicaen/iota/dseta/client/DSeTaClient.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2012 Université de Caen Basse-Normandie, GREYC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.dseta.client;
import fr.unicaen.iota.discovery.client.model.EventInfo;
import fr.unicaen.iota.discovery.client.model.Service;
import fr.unicaen.iota.discovery.client.util.EnhancedProtocolException;
import fr.unicaen.iota.discovery.client.util.StatusCodeHelper;
import fr.unicaen.iota.ds.model.*;
import fr.unicaen.iota.dseta.soap.IDedDSService;
import fr.unicaen.iota.dseta.soap.IDedDSServicePortType;
import fr.unicaen.iota.tau.model.Identity;
import java.io.File;
import java.io.FileInputStream;
import java.math.BigInteger;
import java.net.URL;
import java.security.KeyStore;
import java.security.SecureRandom;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.*;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import org.apache.axis2.databinding.types.URI.MalformedURIException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.cxf.configuration.jsse.TLSClientParameters;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.transport.http.HTTPConduit;
import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
//import org.fosstrak.epcis.utils.AuthenticationType;
/**
*
*/
public class DSeTaClient implements X509TrustManager {
private Identity identity;
private IDedDSServicePortType port;
private static final Log log = LogFactory.getLog(DSeTaClient.class);
public DSeTaClient(Identity id, String dsAddress) {
this(id, dsAddress, null, null);
}
public DSeTaClient(Identity id, String address, String pksFilename, String pksPassword) {
log.trace("new DSeTaClient: " + id + " @ " + address);
this.identity = id;
// TODO: TLS
try {
configureService(address, pksFilename, pksPassword);
} catch (Exception e) {
throw new RuntimeException("Can’t configure service: " + e.getMessage(), e);
}
}
// TODO: TLS
public void configureService(String address, String pksFilename, String pksPassword) throws Exception {
URL wsdlUrl = new URL(address + "?wsdl");
IDedDSService service = new IDedDSService(wsdlUrl);
port = service.getPort(IDedDSServicePortType.class);
// turn off chunked transfer encoding
Client client = ClientProxy.getClient(port);
HTTPConduit httpConduit = (HTTPConduit) client.getConduit();
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setAllowChunking(false);
httpConduit.setClient(httpClientPolicy);
// TODO: TLS
if (pksFilename != null) {
//log.debug("Authenticating with certificate in file: " + pksFilename);
if (!wsdlUrl.getProtocol().equalsIgnoreCase("https")) {
throw new Exception("Authentication method requires the use of HTTPS");
}
KeyStore keyStore = KeyStore.getInstance(pksFilename.endsWith(".p12") ? "PKCS12" : "JKS");
keyStore.load(new FileInputStream(new File(pksFilename)), pksPassword.toCharArray());
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance("SunX509");
keyManagerFactory.init(keyStore, pksPassword.toCharArray());
TLSClientParameters tlscp = new TLSClientParameters();
tlscp.setKeyManagers(keyManagerFactory.getKeyManagers());
tlscp.setSecureRandom(new SecureRandom());
tlscp.setDisableCNCheck(true);
tlscp.setTrustManagers(new TrustManager[] { this });
httpConduit.setTlsClientParameters(tlscp);
}
}
public Identity getIdentity() {
return identity;
}
public void setIdentity(Identity id) {
this.identity = id;
}
public List<TEventItem> eventLookup(String objectId, GregorianCalendar start, GregorianCalendar end, String BizStep)
throws EnhancedProtocolException, MalformedURIException {
EventLookupIn in = new EventLookupIn();
in.setSid("not_used"); // session ID, not used in DSeTa
in.setObjectID(objectId);
in.setLifeCycleStepID(BizStep);
try {
DatatypeFactory DF = DatatypeFactory.newInstance();
if (start != null) {
XMLGregorianCalendar xmlCal = DF.newXMLGregorianCalendar(start);
in.setStartingAt(xmlCal);
}
if (end != null) {
XMLGregorianCalendar xmlCal = DF.newXMLGregorianCalendar(end);
in.setEndingAt(xmlCal);
}
} catch (DatatypeConfigurationException ex) {
log.error("Impossible date conversion", ex);
}
EventLookupOut out = port.iDedEventLookup(in, identity);
int statusCode = out.getResult().getCode();
if (StatusCodeHelper.isErrorCode(statusCode)) {
throw new EnhancedProtocolException(statusCode, out.getResult().getDesc());
}
TEventItemList tEventList = out.getEventList();
return tEventList.getEvent();
}
public int eventCreate(String partnerId, String objectId, String bizStep, String eventClass,
GregorianCalendar sourceTimeStamp, int ttl, Collection<String> serviceIds, int priority, Map<String, String> extensions)
throws MalformedURIException, EnhancedProtocolException {
EventCreateIn in = new EventCreateIn();
in.setSid("not_used"); // session ID, not used in DSeTa
in.setEvent(createTObjectEventTypeChoice(objectId, bizStep, eventClass,
sourceTimeStamp, ttl, serviceIds, priority, extensions));
in.setSupplyChainID("not_used");
in.setProxyPartnerID(partnerId);
EventCreateOut out = port.iDedEventCreate(in, identity);
int statusCode = out.getResult().getCode();
if (StatusCodeHelper.isErrorCode(statusCode)) {
throw new EnhancedProtocolException(statusCode, out.getResult().getDesc());
}
return out.getEventID().intValue();
}
public List<Integer> multipleEventCreate(String partnerId, Collection<EventInfo> eventList)
throws MalformedURIException, EnhancedProtocolException {
MultipleEventCreateIn in = new MultipleEventCreateIn();
in.setSid("not_used"); // session ID, not used in DSeTa
in.setProxyPartnerID(partnerId);
in.setSupplyChainID("not_used");
TObjectEventList objectEventList = new TObjectEventList();
for (EventInfo event : eventList) {
TObjectEvent tObjectEvent = createTObjectEventTypeChoice(event.getEvent().getObjectId(),
event.getEvent().getBizStep(),
event.getEvent().getEventClass(),
event.getEvent().getSourceTimeStamp(),
event.getTtl(),
createServiceIds(event.getEvent().getServiceList()),
event.getPriority(),
event.getEvent().getExtensions()).getObjectEvent();
objectEventList.getObjectEvent().add(tObjectEvent);
}
in.setEvents(objectEventList);
MultipleEventCreateOut out = port.iDedMultipleEventCreate(in, identity);
int statusCode = out.getResult().getCode();
if (StatusCodeHelper.isErrorCode(statusCode)) {
throw new EnhancedProtocolException(statusCode, out.getResult().getDesc());
}
List<Integer> result = new ArrayList<Integer>();
if (out.getEventIDList().getEventID() == null) {
return result;
}
for (BigInteger tEventID : out.getEventIDList().getEventID()) {
result.add(tEventID.intValue());
}
return result;
}
private TEventTypeChoice createTObjectEventTypeChoice(String objectId, String bizStep, String eventClass,
Calendar sourceTimeStamp, int ttl, Collection<String> serviceIds, int priority, Map<String, String> extensions)
throws MalformedURIException {
TEventTypeChoice tEventTypeChoice = new TEventTypeChoice();
TObjectEvent tObjectEvent = new TObjectEvent();
TServiceIDList tServiceIDList = new TServiceIDList();
tServiceIDList.getId().addAll(serviceIds);
tObjectEvent.setServiceList(tServiceIDList);
tObjectEvent.setTtl(BigInteger.valueOf(ttl));
try {
DatatypeFactory DF = DatatypeFactory.newInstance();
GregorianCalendar gCal = new GregorianCalendar();
gCal.setTime(sourceTimeStamp.getTime());
XMLGregorianCalendar xmlCal = DF.newXMLGregorianCalendar(gCal);
tObjectEvent.setSourceTS(xmlCal);
} catch (DatatypeConfigurationException ex) {
log.error("Impossible date conversion", ex);
}
tObjectEvent.setPriority(priority);
tObjectEvent.setObjectID(objectId);
tObjectEvent.setLifeCycleStepID(bizStep);
tObjectEvent.setEventClass(eventClass);
// extensions:
if (extensions != null) {
TExtension exts = new TExtension();
for (Map.Entry<String, String> idval : extensions.entrySet()) {
/*
ESDS_ServiceStub.TExtension tExtension = new ESDS_ServiceStub.TExtension();
OMFactory factory = OMAbstractFactory.getOMFactory();
OMElement elemExtension = factory.createOMElement(new QName("fr:unicaen:extension"));
OMElement key = factory.createOMElement(new QName("fr:unicaen:key"));
key.setText(idval.getKey());
OMElement value = factory.createOMElement(new QName("fr:unicaen:value"));
value.setText(idval.getValue());
elemExtension.addChild(key);
elemExtension.addChild(value);
tExtension.addExtraElement(elemExtension);
*/
}
tObjectEvent.setExtension(exts);
}
tEventTypeChoice.setObjectEvent(tObjectEvent);
return tEventTypeChoice;
}
private List<String> createServiceIds(Collection<Service> serviceList) {
List<String> serviceIds = new ArrayList<String>();
for (Service s : serviceList) {
serviceIds.add(s.getId());
}
return serviceIds;
}
@Override
public void checkClientTrusted(X509Certificate[] xcs, String string) throws CertificateException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void checkServerTrusted(X509Certificate[] xcs, String string) throws CertificateException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public X509Certificate[] getAcceptedIssuers() {
throw new UnsupportedOperationException("Not supported yet.");
}
}
DSeTa/DSeTa-Client/src/main/resources/META-INF/LICENSE
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
DSeTa/DSeTa-Client/src/main/resources/commons-logging.properties
# use LOG4J as the underlying logging toolkit
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
DSeTa/DSeTa-Client/src/main/resources/log4j.properties
# LOG4J configuration
# default logging
log4j.rootCategory=INFO, LOGFILE, CONSOLE
# customize logging levels
log4j.logger.fr.unicaen.iota=INFO
# enable logging of incoming/outgoing SOAP requests/responses
#log4j.logger.org.apache.cxf.interceptor.LoggingInInterceptor=INFO
#log4j.logger.org.apache.cxf.interceptor.LoggingOutInterceptor=INFO
# logging to file
#log4j.appender.LOGFILE=org.apache.log4j.DailyRollingFileAppender
#log4j.appender.LOGFILE.File=${catalina.base}/logs/discovery-client.log
#log4j.appender.LOGFILE.File=discovery-client.log
#log4j.appender.LOGFILE.DatePattern='.'yyyy-MM-dd'.log'
#log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
#log4j.appender.LOGFILE.layout.ConversionPattern=%5p (%d{yyyy-MM-dd HH:mm:ss,SSS}) [%C:%L] - %m%n
## CONSOLE is set to be a ConsoleAppender using a PatternLayout.
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[%p] [%C{1}:%L] %m%n
DSeTa/DSeTa-Client/src/main/resources/wsdl/ds.wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="DS"
targetNamespace="urn:unicaen:iota:ds:wsdl"
xmlns:wsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:wds="urn:unicaen:iota:ds:wsdl"
xmlns:xds="urn:unicaen:iota:ds:xsd">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="urn:unicaen:iota:ds:xsd" schemaLocation="ds.xsd"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="multipleEventCreateReq">
<wsdl:part name="parms" element="xds:MultipleEventCreate">
</wsdl:part>
</wsdl:message>
<wsdl:message name="multipleEventCreateRsp">
<wsdl:part name="result" element="xds:MultipleEventCreateResult">
</wsdl:part>
</wsdl:message>
<wsdl:message name="eventLookupReq">
<wsdl:part name="parms" element="xds:EventLookup">
</wsdl:part>
</wsdl:message>
<wsdl:message name="eventLookupRsp">
<wsdl:part name="result" element="xds:EventLookupResult">
</wsdl:part>
</wsdl:message>
<wsdl:message name="eventCreateReq">
<wsdl:part name="parms" element="xds:EventCreate">
</wsdl:part>
</wsdl:message>
<wsdl:message name="eventCreateRsp">
<wsdl:part name="result" element="xds:EventCreateResult">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="DSServicePortType">
<wsdl:operation name="eventLookup">
<wsdl:input name="eventLookupReq" message="wds:eventLookupReq">
</wsdl:input>
<wsdl:output name="eventLookupRsp" message="wds:eventLookupRsp">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="multipleEventCreate">
<wsdl:input name="multipleEventCreateReq" message="wds:multipleEventCreateReq">
</wsdl:input>
<wsdl:output name="multipleEventCreateRsp" message="wds:multipleEventCreateRsp">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="eventCreate">
<wsdl:input name="eventCreateReq" message="wds:eventCreateReq">
</wsdl:input>
<wsdl:output name="eventCreateRsp" message="wds:eventCreateRsp">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="DS" type="wds:DSServicePortType">
<wsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="eventLookup">
<wsoap:operation soapAction=""/>
<wsdl:input name="eventLookupReq">
<wsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="eventLookupRsp">
<wsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="eventCreate">
<wsoap:operation soapAction=""/>
<wsdl:input name="eventCreateReq">
<wsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="eventCreateRsp">
<wsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="multipleEventCreate">
<wsoap:operation soapAction=""/>
<wsdl:input name="multipleEventCreateReq">
<wsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="multipleEventCreateRsp">
<wsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="DS_Service">
<wsdl:port name="DS_Service" binding="wds:DS">
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
DSeTa/DSeTa-Client/src/main/resources/wsdl/ds.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xds="urn:unicaen:iota:ds:xsd"
attributeFormDefault="unqualified"
elementFormDefault="unqualified"
targetNamespace="urn:unicaen:iota:ds:xsd">
<xs:simpleType name="tPassword">
<xs:restriction base="xs:token">
<xs:minLength value="6"/>
<xs:maxLength value="16"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tServiceURI">
<xs:restriction base="xs:anyURI"/>
</xs:simpleType>
<xs:simpleType name="tX509String">
<xs:restriction base="xs:string">
<xs:minLength value="2"/>
<xs:maxLength value="128"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tMessageDigestHexString">
<xs:restriction base="xs:string">
<xs:minLength value="2"/>
<xs:maxLength value="512"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tLeaseSeconds">
<xs:restriction base="xs:int">
<xs:minInclusive value="0"/>
<xs:maxExclusive value="3600"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tEventPriority">
<xs:restriction base="xs:int">
<xs:minInclusive value="0"/>
<xs:maxExclusive value="9"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tEventTTL">
<xs:restriction base="xs:positiveInteger"/>
</xs:simpleType>
<xs:simpleType name="tServiceType">
<xs:restriction base="xs:token">
<xs:enumeration value="ws"/>
<xs:enumeration value="epcis"/>
<xs:enumeration value="html"/>
<xs:enumeration value="xmlrpc"/>
<xs:enumeration value="ds"/>
<xs:enumeration value="ided_ds"/>
<xs:enumeration value="ided_epcis"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tEventType">
<xs:restriction base="xs:token">
<xs:enumeration value="void"/>
<xs:enumeration value="object"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tObject">
<xs:restriction base="xs:token">
<xs:enumeration value="global"/>
<xs:enumeration value="role"/>
<xs:enumeration value="user"/>
<xs:enumeration value="partner"/>
<xs:enumeration value="supplychain"/>
<xs:enumeration value="event"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tMethod">
<xs:restriction base="xs:token">
<xs:enumeration value="hello"/>
<xs:enumeration value="login"/>
<xs:enumeration value="logout"/>
<xs:enumeration value="create"/>
<xs:enumeration value="update"/>
<xs:enumeration value="delete"/>
<xs:enumeration value="info"/>
<xs:enumeration value="lookup"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tPermission">
<xs:restriction base="xs:token">
<xs:enumeration value="execute"/>
<xs:enumeration value="proxy"/>
<xs:enumeration value="void"/>
<xs:enumeration value="admin"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tListAction">
<xs:restriction base="xs:token">
<xs:enumeration value="add"/>
<xs:enumeration value="remove"/>
<xs:enumeration value="replace"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tLoginMode">
<xs:restriction base="xs:token">
<xs:enumeration value="key-and-password"/>
<xs:enumeration value="key-only"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tMessageDigestAlgorithm">
<xs:restriction base="xs:token">
<xs:enumeration value="md5"/>
<xs:enumeration value="md4"/>
<xs:enumeration value="md2"/>
<xs:enumeration value="sha1"/>
<xs:enumeration value="sha"/>
<xs:enumeration value="mdc2"/>
<xs:enumeration value="ripemd160"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tAccessMode">
<xs:restriction base="xs:token">
<xs:enumeration value="read"/>
<xs:enumeration value="write"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tStatus">
<xs:restriction base="xs:token">
<xs:enumeration value="active"/>
<xs:enumeration value="inactive"/>
<xs:enumeration value="pending"/>
<xs:enumeration value="processed"/>
<xs:enumeration value="failed"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tResultCode">
<xs:restriction base="xs:int">
<xs:enumeration value="1000"/>
<xs:enumeration value="1001"/>
<xs:enumeration value="1500"/>
<xs:enumeration value="2000"/>
<xs:enumeration value="2001"/>
<xs:enumeration value="2002"/>
<xs:enumeration value="2003"/>
<xs:enumeration value="2004"/>
<xs:enumeration value="2005"/>
<xs:enumeration value="2100"/>
<xs:enumeration value="2101"/>
<xs:enumeration value="2102"/>
<xs:enumeration value="2103"/>
<xs:enumeration value="2104"/>
<xs:enumeration value="2200"/>
<xs:enumeration value="2201"/>
<xs:enumeration value="2202"/>
<xs:enumeration value="2302"/>
<xs:enumeration value="2303"/>
<xs:enumeration value="2304"/>
<xs:enumeration value="2305"/>
<xs:enumeration value="2306"/>
<xs:enumeration value="2306"/>
<xs:enumeration value="2307"/>
<xs:enumeration value="2400"/>
<xs:enumeration value="2500"/>
<xs:enumeration value="2501"/>
<xs:enumeration value="2502"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tSessionID">
<xs:restriction base="xs:token">
<xs:minLength value="32"/>
<xs:maxLength value="32"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tRoleID">
<xs:restriction base="xs:token">
<xs:minLength value="2"/>
<xs:maxLength value="64"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tUserID">
<xs:restriction base="xs:token">
<xs:minLength value="2"/>
<xs:maxLength value="16"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tPartnerID">
<xs:restriction base="xs:token">
<xs:minLength value="2"/>
<xs:maxLength value="64"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tSupplyChainID">
<xs:restriction base="xs:token">
<xs:minLength value="2"/>
<xs:maxLength value="64"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tEventID">
<xs:restriction base="xs:positiveInteger"/>
</xs:simpleType>
<xs:simpleType name="tEventClass">
<xs:restriction base="xs:token">
<xs:minLength value="2"/>
<xs:maxLength value="64"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tServiceID">
<xs:restriction base="xs:token">
<xs:minLength value="2"/>
<xs:maxLength value="64"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tEventTopicID">
<xs:restriction base="xs:token">
<xs:minLength value="2"/>
<xs:maxLength value="64"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tTableID">
<xs:restriction base="xs:token">
<xs:minLength value="2"/>
<xs:maxLength value="128"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tSmallUID">
<xs:restriction base="xs:int"/>
</xs:simpleType>
<xs:simpleType name="tLargeUID">
<xs:restriction base="xs:positiveInteger"/>
</xs:simpleType>
<xs:simpleType name="tObjectID">
<xs:restriction base="xs:anyURI"/>
</xs:simpleType>
<xs:simpleType name="tObjectIDPattern">
<xs:restriction base="xs:anyURI"/>
</xs:simpleType>
<xs:simpleType name="tLifeCycleStepID">
<xs:restriction base="xs:anyURI"/>
</xs:simpleType>
<xs:simpleType name="tExtensionID">
<xs:restriction base="xs:anyURI"/>
</xs:simpleType>
<xs:simpleType name="tReasonID">
<xs:restriction base="xs:anyURI"/>
</xs:simpleType>
<xs:complexType name="tRoleItem">
<xs:attribute name="id" type="xds:tRoleID" use="required"/>
<xs:attribute name="uid" type="xds:tSmallUID"/>
</xs:complexType>
<xs:complexType name="tRoleItemList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="role" type="xds:tRoleItem"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="tGrantItem">
<xs:attribute name="o" type="xds:tObject" use="required"/>
<xs:attribute name="m" type="xds:tMethod" use="required"/>
<xs:attribute name="p" type="xds:tPermission" use="required"/>
</xs:complexType>
<xs:complexType name="tGrantItemList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="grant" type="xds:tGrantItem"/>
</xs:sequence>
<xs:attribute name="action" type="xds:tListAction"/>
</xs:complexType>
<xs:complexType name="tUserItem">
<xs:attribute name="id" type="xds:tUserID" use="required"/>
<xs:attribute name="uid" type="xds:tSmallUID"/>
</xs:complexType>
<xs:complexType name="tUserItemList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="user" type="xds:tUserItem"/>
</xs:sequence>
<xs:attribute name="action" type="xds:tListAction"/>
</xs:complexType>
<xs:complexType name="tPartnerItem">
<xs:attribute name="id" type="xds:tPartnerID" use="required"/>
<xs:attribute name="uid" type="xds:tSmallUID"/>
<xs:attribute name="authority" type="xs:boolean"/>
</xs:complexType>
<xs:complexType name="tPartnerItemList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="partner" type="xds:tPartnerItem"/>
</xs:sequence>
<xs:attribute name="action" type="xds:tListAction"/>
</xs:complexType>
<xs:complexType name="tSupplyChainItem">
<xs:attribute name="id" type="xds:tSupplyChainID" use="required"/>
<xs:attribute name="uid" type="xds:tSmallUID"/>
</xs:complexType>
<xs:complexType name="tSupplyChainItemList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="supplyChain" type="xds:tSupplyChainItem"/>
</xs:sequence>
<xs:attribute name="action" type="xds:tListAction"/>
</xs:complexType>
<xs:complexType name="tEventItem">
<xs:sequence>
<xs:element name="serviceList" type="xds:tServiceItemList"/>
</xs:sequence>
<xs:attribute name="e" type="xds:tEventID" use="required"/>
<xs:attribute name="o" type="xds:tObjectID" use="required"/>
<xs:attribute name="t" type="xds:tEventType" use="required"/>
<xs:attribute name="c" type="xds:tEventClass" use="required"/>
<xs:attribute name="lcs" type="xds:tLifeCycleStepID" use="required"/>
<xs:attribute name="ets" type="xs:dateTime" use="required"/>
<xs:attribute name="sts" type="xs:dateTime" use="required"/>
<xs:attribute name="u" type="xds:tUserID" use="required"/>
<xs:attribute name="p" type="xds:tPartnerID" use="required"/>
<xs:attribute name="sc" type="xds:tSupplyChainID" use="required"/>
</xs:complexType>
<xs:complexType name="tEventItemList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="event" type="xds:tEventItem"/>
</xs:sequence>
<xs:attribute name="action" type="xds:tListAction"/>
</xs:complexType>
<xs:complexType name="tObjectItem">
<xs:attribute name="id" type="xds:tObjectID" use="required"/>
</xs:complexType>
<xs:complexType name="tObjectItemList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="object" type="xds:tObjectItem"/>
</xs:sequence>
<xs:attribute name="action" type="xds:tListAction"/>
</xs:complexType>
<xs:complexType name="tX509CertItem">
<xs:attribute name="cn" type="xds:tX509String" use="required"/>
<xs:attribute name="o" type="xds:tX509String" use="required"/>
<xs:attribute name="fingerprint" type="xds:tX509String" use="required"/>
</xs:complexType>
<xs:complexType name="tX509CertItemList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="cert" type="xds:tX509CertItem"/>
</xs:sequence>
<xs:attribute name="action" type="xds:tListAction"/>
</xs:complexType>
<xs:complexType name="tServiceItem">
<xs:attribute name="id" type="xds:tServiceID" use="required"/>
<xs:attribute name="type" type="xds:tServiceType" use="required"/>
<xs:attribute name="uri" type="xds:tServiceURI" use="required"/>
</xs:complexType>
<xs:complexType name="tServiceItemList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="service" type="xds:tServiceItem"/>
</xs:sequence>
<xs:attribute name="action" type="xds:tListAction"/>
</xs:complexType>
<xs:complexType name="tServiceIDList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="id" type="xds:tServiceID"/>
</xs:sequence>
<xs:attribute name="action" type="xds:tListAction"/>
</xs:complexType>
<xs:complexType name="tLifeCycleStepItem">
<xs:attribute name="id" type="xds:tLifeCycleStepID" use="required"/>
</xs:complexType>
<xs:complexType name="tLifeCycleStepItemList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="lifeCycleStep" type="xds:tLifeCycleStepItem"/>
</xs:sequence>
<xs:attribute name="action" type="xds:tListAction"/>
</xs:complexType>
<xs:complexType name="tEventClassItem">
<xs:attribute name="id" type="xds:tEventClass" use="required"/>
</xs:complexType>
<xs:complexType name="tEventClassItemList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="eventClass" type="xds:tEventClassItem"/>
</xs:sequence>
<xs:attribute name="action" type="xds:tListAction"/>
</xs:complexType>
<xs:complexType name="tExtensionItem">
<xs:attribute name="id" type="xds:tExtensionID" use="required"/>
</xs:complexType>
<xs:complexType name="tExtensionItemList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="extension" type="xds:tExtensionItem"/>
</xs:sequence>
<xs:attribute name="action" type="xds:tListAction"/>
</xs:complexType>
<xs:complexType name="tEventTopicItem">
<xs:sequence>
<xs:element minOccurs="0" name="lifeCycleStepList" type="xds:tLifeCycleStepItemList"/>
<xs:element minOccurs="0" name="eventClassList" type="xds:tEventClassItemList"/>
</xs:sequence>
<xs:attribute name="id" type="xds:tEventTopicID" use="required"/>
<xs:attribute name="objectIDPattern" type="xds:tObjectIDPattern" use="required"/>
</xs:complexType>
<xs:complexType name="tEventTopicItemList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="eventTopic" type="xds:tEventTopicItem"/>
</xs:sequence>
<xs:attribute name="action" type="xds:tListAction"/>
</xs:complexType>
<xs:complexType name="tTableRowItem">
<xs:attribute name="uid" type="xds:tSmallUID" use="required"/>
<xs:attribute name="id" type="xs:string" use="required"/>
<xs:attribute name="desc" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="tTableRowItemList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="row" type="xds:tTableRowItem"/>
</xs:sequence>
<xs:attribute name="action" type="xds:tListAction"/>
</xs:complexType>
<xs:complexType name="tEventLifeCycleStepAllowItem">
<xs:attribute name="partnerID" type="xds:tPartnerID" use="required"/>
<xs:attribute name="lifeCycleStepID" type="xds:tLifeCycleStepID" use="required"/>
<xs:attribute name="accessMode" type="xds:tAccessMode" use="required"/>
<xs:attribute name="userID" type="xds:tUserID"/>
</xs:complexType>
<xs:complexType name="tEventLifeCycleStepAllowItemList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="allow" type="xds:tEventLifeCycleStepAllowItem"/>
</xs:sequence>
<xs:attribute name="action" type="xds:tListAction"/>
</xs:complexType>
<xs:complexType name="tEventDenyItem">
<xs:attribute name="status" type="xds:tStatus" use="required"/>
<xs:attribute name="supplyChainID" type="xds:tSupplyChainID" use="required"/>
<xs:attribute name="partnerID" type="xds:tPartnerID" use="required"/>
<xs:attribute name="userID" type="xds:tUserID"/>
<xs:attribute name="objectIDPattern" type="xds:tObjectIDPattern"/>
<xs:attribute name="startingAt" type="xs:dateTime"/>
<xs:attribute name="endingAt" type="xs:dateTime"/>
</xs:complexType>
<xs:complexType name="tEventDenyItemList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="deny" type="xds:tEventDenyItem"/>
</xs:sequence>
<xs:attribute name="action" type="xds:tListAction"/>
</xs:complexType>
<xs:complexType name="tExtension">
<xs:sequence>
<xs:any maxOccurs="unbounded" namespace="##other"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="tResult">
<xs:sequence>
<xs:element minOccurs="0" name="value" type="xs:string"/>
</xs:sequence>
<xs:attribute name="code" type="xds:tResultCode" use="required"/>
<xs:attribute name="desc" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="tMessageDigest">
<xs:sequence>
<xs:element name="digest" type="xds:tMessageDigestHexString"/>
</xs:sequence>
<xs:attribute name="alg" type="xds:tMessageDigestAlgorithm" use="required"/>
</xs:complexType>
<xs:complexType abstract="true" name="tAbstractEvent">
<xs:sequence>
<xs:element minOccurs="0" name="extension" type="xds:tExtension"/>
<xs:element minOccurs="0" name="priority" type="xds:tEventPriority"/>
<xs:element minOccurs="0" name="ttl" type="xds:tEventTTL"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="tVoidEvent">
<xs:complexContent>
<xs:extension base="xds:tAbstractEvent">
<xs:sequence>
<xs:element name="eventID" type="xds:tEventID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="tObjectEvent">
<xs:complexContent>
<xs:extension base="xds:tAbstractEvent">
<xs:sequence>
<xs:element name="objectID" type="xds:tObjectID"/>
<xs:element name="lifeCycleStepID" type="xds:tLifeCycleStepID"/>
<xs:element name="eventClass" type="xds:tEventClass"/>
<xs:element name="sourceTS" type="xs:dateTime"/>
<xs:element minOccurs="0" name="serviceList" type="xds:tServiceIDList"/>
<xs:element minOccurs="0" name="messageDigest" type="xds:tMessageDigest"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="tEventTypeChoice">
<xs:choice>
<xs:element name="voidEvent" type="xds:tVoidEvent"/>
<xs:element name="objectEvent" type="xds:tObjectEvent"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="tObjectEventList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="objectEvent" type="xds:tObjectEvent"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="tEventIDList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="eventID" type="xds:tEventID"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="tInfoEvent">
<xs:sequence>
<xs:element name="eventID" type="xds:tEventID"/>
<xs:element name="objectID" type="xds:tObjectID"/>
<xs:element name="eventType" type="xds:tEventType"/>
<xs:element name="eventClass" type="xds:tEventClass"/>
<xs:element name="lifeCycleStepID" type="xds:tLifeCycleStepID"/>
<xs:element name="eventTS" type="xs:dateTime"/>
<xs:element name="sourceTS" type="xs:dateTime"/>
<xs:element name="partnerID" type="xds:tPartnerID"/>
<xs:element name="supplyChainID" type="xds:tSupplyChainID"/>
<xs:element name="userID" type="xds:tUserID"/>
<xs:element minOccurs="0" name="serviceList" type="xds:tServiceItemList"/>
<xs:element minOccurs="0" name="messageDigest" type="xds:tMessageDigest"/>
<xs:element minOccurs="0" name="priority" type="xds:tEventPriority"/>
<xs:element minOccurs="0" name="ttl" type="xds:tEventTTL"/>
</xs:sequence>
</xs:complexType>
<xs:complexType abstract="true" name="tAbstractIn">
<xs:sequence>
<xs:element name="sid" type="xds:tSessionID"/>
<xs:element minOccurs="0" name="extension" type="xds:tExtension"/>
</xs:sequence>
</xs:complexType>
<xs:complexType abstract="true" name="tAbstractOut">
<xs:sequence>
<xs:element name="result" type="xds:tResult"/>
<xs:element minOccurs="0" name="extension" type="xds:tExtension"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="HelloIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="HelloOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence>
<xs:element name="serverIdentity" type="xs:token"/>
<xs:element name="serverTS" type="xs:dateTime"/>
<xs:element minOccurs="0" name="extensionList" type="xds:tExtensionItemList"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="LookupIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="tableID" type="xds:tTableID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="LookupOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence>
<xs:element name="rowList" type="xds:tTableRowItemList"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="RoleLookupIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="roleID" type="xds:tRoleID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="RoleLookupOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence>
<xs:element name="roleList" type="xds:tRoleItemList"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="RoleCreateIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="roleID" type="xds:tRoleID"/>
<xs:element minOccurs="0" name="grantList" type="xds:tGrantItemList"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="RoleCreateOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence>
<xs:element name="roleUID" type="xds:tSmallUID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="RoleInfoIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="roleID" type="xds:tRoleID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="RoleInfoOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence>
<xs:element name="roleUID" type="xds:tSmallUID"/>
<xs:element name="roleID" type="xds:tRoleID"/>
<xs:element minOccurs="0" name="grantList" type="xds:tGrantItemList"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="RoleUpdateIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="roleUID" type="xds:tSmallUID"/>
<xs:element minOccurs="0" name="roleID" type="xds:tRoleID"/>
<xs:element minOccurs="0" name="grantList" type="xds:tGrantItemList"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="RoleUpdateOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="RoleDeleteIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="roleID" type="xds:tRoleID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="RoleDeleteOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="UserLookupIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="userID" type="xds:tUserID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="UserLookupOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence>
<xs:element name="userList" type="xds:tUserItemList"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="UserCreateIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="userID" type="xds:tUserID"/>
<xs:element name="password" type="xds:tPassword"/>
<xs:element name="roleID" type="xds:tRoleID"/>
<xs:element name="partnerID" type="xds:tPartnerID"/>
<xs:element name="loginMode" type="xds:tLoginMode"/>
<xs:element name="sessionLease" type="xds:tLeaseSeconds"/>
<xs:element minOccurs="0" name="authorizedCertList" type="xds:tX509CertItemList"/>
<xs:element minOccurs="0" name="eventNotifyTopicList" type="xds:tEventTopicItemList"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="UserCreateOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence>
<xs:element name="userUID" type="xds:tSmallUID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="UserInfoIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="userID" type="xds:tUserID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="UserInfoOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence>
<xs:element name="userUID" type="xds:tSmallUID"/>
<xs:element name="userID" type="xds:tUserID"/>
<xs:element name="roleID" type="xds:tRoleID"/>
<xs:element name="partnerID" type="xds:tPartnerID"/>
<xs:element name="loginMode" type="xds:tLoginMode"/>
<xs:element name="sessionLease" type="xds:tLeaseSeconds"/>
<xs:element minOccurs="0" name="authorizedCertList" type="xds:tX509CertItemList"/>
<xs:element minOccurs="0" name="eventNotifyTopicList" type="xds:tEventTopicItemList"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="UserUpdateIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="userUID" type="xds:tSmallUID"/>
<xs:element minOccurs="0" name="userID" type="xds:tUserID"/>
<xs:element minOccurs="0" name="password" type="xds:tPassword"/>
<xs:element minOccurs="0" name="roleID" type="xds:tRoleID"/>
<xs:element minOccurs="0" name="partnerID" type="xds:tPartnerID"/>
<xs:element minOccurs="0" name="loginMode" type="xds:tLoginMode"/>
<xs:element minOccurs="0" name="sessionLease" type="xds:tLeaseSeconds"/>
<xs:element minOccurs="0" name="authorizedCertList" type="xds:tX509CertItemList"/>
<xs:element minOccurs="0" name="eventNotifyTopicList" type="xds:tEventTopicItemList"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="UserUpdateOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="UserDeleteIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="userID" type="xds:tUserID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="UserDeleteOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="UserLoginIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="userID" type="xds:tUserID"/>
<xs:element name="password" type="xds:tPassword"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="UserLoginOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence>
<xs:element name="sid" type="xds:tSessionID"/>
<xs:element name="sessionLease" type="xds:tLeaseSeconds"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="UserLogoutIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="UserLogoutOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="PartnerLookupIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="partnerID" type="xds:tPartnerID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="PartnerLookupOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence>
<xs:element name="partnerList" type="xds:tPartnerItemList"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="PartnerCreateIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="partnerID" type="xds:tPartnerID"/>
<xs:element minOccurs="0" name="serviceList" type="xds:tServiceItemList"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="PartnerCreateOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence>
<xs:element name="partnerUID" type="xds:tSmallUID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="PartnerInfoIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="partnerID" type="xds:tPartnerID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="PartnerInfoOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence>
<xs:element name="partnerUID" type="xds:tSmallUID"/>
<xs:element name="partnerID" type="xds:tPartnerID"/>
<xs:element name="supplyChainList" type="xds:tSupplyChainItemList"/>
<xs:element name="serviceList" type="xds:tServiceItemList"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="PartnerUpdateIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="partnerUID" type="xds:tSmallUID"/>
<xs:element minOccurs="0" name="partnerID" type="xds:tPartnerID"/>
<xs:element minOccurs="0" name="serviceList" type="xds:tServiceItemList"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="PartnerUpdateOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="PartnerDeleteIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="partnerID" type="xds:tPartnerID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="PartnerDeleteOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="SupplyChainLookupIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="supplyChainID" type="xds:tSupplyChainID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="SupplyChainLookupOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence>
<xs:element name="supplyChainList" type="xds:tSupplyChainItemList"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="SupplyChainCreateIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="supplyChainID" type="xds:tSupplyChainID"/>
<xs:element minOccurs="0" name="partnerList" type="xds:tPartnerItemList"/>
<xs:element minOccurs="0" name="eventDenyList" type="xds:tEventDenyItemList"/>
<xs:element minOccurs="0" name="lifeCycleAllowList" type="xds:tEventLifeCycleStepAllowItemList"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="SupplyChainCreateOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence>
<xs:element name="supplyChainUID" type="xds:tSmallUID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="SupplyChainInfoIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="supplyChainID" type="xds:tSupplyChainID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="SupplyChainInfoOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence>
<xs:element name="supplyChainUID" type="xds:tSmallUID"/>
<xs:element name="supplyChainID" type="xds:tSupplyChainID"/>
<xs:element minOccurs="0" name="partnerList" type="xds:tPartnerItemList"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="SupplyChainUpdateIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="supplyChainUID" type="xds:tSmallUID"/>
<xs:element minOccurs="0" name="supplyChainID" type="xds:tSupplyChainID"/>
<xs:element minOccurs="0" name="partnerList" type="xds:tPartnerItemList"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="SupplyChainUpdateOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="SupplyChainDeleteIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="supplyChainID" type="xds:tSupplyChainID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="SupplyChainDeleteOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="EventLookupIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="objectID" type="xds:tObjectID"/>
<xs:element minOccurs="0" name="lifeCycleStepID" type="xds:tLifeCycleStepID"/>
<xs:element minOccurs="0" name="startingAt" type="xs:dateTime"/>
<xs:element minOccurs="0" name="endingAt" type="xs:dateTime"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="EventLookupOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence>
<xs:element name="eventList" type="xds:tEventItemList"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="EventCreateIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="event" type="xds:tEventTypeChoice"/>
<xs:element name="supplyChainID" type="xds:tSupplyChainID"/>
<xs:element minOccurs="0" name="proxyPartnerID" type="xds:tPartnerID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="EventCreateOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence>
<xs:element name="eventID" type="xds:tEventID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="MultipleEventCreateIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="events" type="xds:tObjectEventList"/>
<xs:element name="supplyChainID" type="xds:tSupplyChainID"/>
<xs:element minOccurs="0" name="proxyPartnerID" type="xds:tPartnerID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="MultipleEventCreateOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence>
<xs:element name="eventIDList" type="xds:tEventIDList"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="EventInfoIn">
<xs:complexContent>
<xs:extension base="xds:tAbstractIn">
<xs:sequence>
<xs:element name="eventID" type="xds:tEventID"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="EventInfoOut">
<xs:complexContent>
<xs:extension base="xds:tAbstractOut">
<xs:sequence>
<xs:element name="event" type="xds:tInfoEvent"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="Hello" type="xds:HelloIn"/>
<xs:element name="HelloResult" type="xds:HelloOut"/>
<xs:element name="Lookup" type="xds:LookupIn"/>
<xs:element name="LookupResult" type="xds:LookupOut"/>
<xs:element name="RoleLookup" type="xds:RoleLookupIn"/>
<xs:element name="RoleLookupResult" type="xds:RoleLookupOut"/>
<xs:element name="RoleCreate" type="xds:RoleCreateIn"/>
<xs:element name="RoleCreateResult" type="xds:RoleCreateOut"/>
<xs:element name="RoleInfo" type="xds:RoleInfoIn"/>
<xs:element name="RoleInfoResult" type="xds:RoleInfoOut"/>
<xs:element name="RoleUpdate" type="xds:RoleUpdateIn"/>
<xs:element name="RoleUpdateResult" type="xds:RoleUpdateOut"/>
<xs:element name="RoleDelete" type="xds:RoleDeleteIn"/>
<xs:element name="RoleDeleteResult" type="xds:RoleDeleteOut"/>
<xs:element name="UserLookup" type="xds:UserLookupIn"/>
<xs:element name="UserLookupResult" type="xds:UserLookupOut"/>
<xs:element name="UserCreate" type="xds:UserCreateIn"/>
<xs:element name="UserCreateResult" type="xds:UserCreateOut"/>
<xs:element name="UserInfo" type="xds:UserInfoIn"/>
<xs:element name="UserInfoResult" type="xds:UserInfoOut"/>
<xs:element name="UserUpdate" type="xds:UserUpdateIn"/>
<xs:element name="UserUpdateResult" type="xds:UserUpdateOut"/>
<xs:element name="UserDelete" type="xds:UserDeleteIn"/>
<xs:element name="UserDeleteResult" type="xds:UserDeleteOut"/>
<xs:element name="UserLogin" type="xds:UserLoginIn"/>
<xs:element name="UserLoginResult" type="xds:UserLoginOut"/>
<xs:element name="UserLogout" type="xds:UserLogoutIn"/>
<xs:element name="UserLogoutResult" type="xds:UserLogoutOut"/>
<xs:element name="PartnerLookup" type="xds:PartnerLookupIn"/>
<xs:element name="PartnerLookupResult" type="xds:PartnerLookupOut"/>
<xs:element name="PartnerCreate" type="xds:PartnerCreateIn"/>
<xs:element name="PartnerCreateResult" type="xds:PartnerCreateOut"/>
<xs:element name="PartnerInfo" type="xds:PartnerInfoIn"/>
<xs:element name="PartnerInfoResult" type="xds:PartnerInfoOut"/>
<xs:element name="PartnerUpdate" type="xds:PartnerUpdateIn"/>
<xs:element name="PartnerUpdateResult" type="xds:PartnerUpdateOut"/>
<xs:element name="PartnerDelete" type="xds:PartnerDeleteIn"/>
<xs:element name="PartnerDeleteResult" type="xds:PartnerDeleteOut"/>
<xs:element name="SupplyChainLookup" type="xds:SupplyChainLookupIn"/>
<xs:element name="SupplyChainLookupResult" type="xds:SupplyChainLookupOut"/>
<xs:element name="SupplyChainCreate" type="xds:SupplyChainCreateIn"/>
<xs:element name="SupplyChainCreateResult" type="xds:SupplyChainCreateOut"/>
<xs:element name="SupplyChainInfo" type="xds:SupplyChainInfoIn"/>
<xs:element name="SupplyChainInfoResult" type="xds:SupplyChainInfoOut"/>
<xs:element name="SupplyChainUpdate" type="xds:SupplyChainUpdateIn"/>
<xs:element name="SupplyChainUpdateResult" type="xds:SupplyChainUpdateOut"/>
<xs:element name="SupplyChainDelete" type="xds:SupplyChainDeleteIn"/>
<xs:element name="SupplyChainDeleteResult" type="xds:SupplyChainDeleteOut"/>
<xs:element name="EventLookup" type="xds:EventLookupIn"/>
<xs:element name="EventLookupResult" type="xds:EventLookupOut"/>
<xs:element name="EventCreate" type="xds:EventCreateIn"/>
<xs:element name="EventCreateResult" type="xds:EventCreateOut"/>
<xs:element name="MultipleEventCreate" type="xds:MultipleEventCreateIn"/>
<xs:element name="MultipleEventCreateResult" type="xds:MultipleEventCreateOut"/>
<xs:element name="EventInfo" type="xds:EventInfoIn"/>
<xs:element name="EventInfoResult" type="xds:EventInfoOut"/>
<xs:element name="ESDSDocument" type="xds:tESDSDocument"/>
<xs:complexType name="tESDSDocument">
<xs:sequence>
<xs:element name="ESDSBody" type="xds:tESDSBody"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="tESDSBody">
<xs:choice>
<xs:element ref="xds:Hello"/>
<xs:element ref="xds:HelloResult"/>
<xs:element ref="xds:Lookup"/>
<xs:element ref="xds:LookupResult"/>
<xs:element ref="xds:RoleLookup"/>
<xs:element ref="xds:RoleLookupResult"/>
<xs:element ref="xds:RoleCreate"/>
<xs:element ref="xds:RoleCreateResult"/>
<xs:element ref="xds:RoleInfo"/>
<xs:element ref="xds:RoleInfoResult"/>
<xs:element ref="xds:RoleUpdate"/>
<xs:element ref="xds:RoleUpdateResult"/>
<xs:element ref="xds:RoleDelete"/>
<xs:element ref="xds:RoleDeleteResult"/>
<xs:element ref="xds:UserLookup"/>
<xs:element ref="xds:UserLookupResult"/>
<xs:element ref="xds:UserCreate"/>
<xs:element ref="xds:UserCreateResult"/>
<xs:element ref="xds:UserInfo"/>
<xs:element ref="xds:UserInfoResult"/>
<xs:element ref="xds:UserUpdate"/>
<xs:element ref="xds:UserUpdateResult"/>
<xs:element ref="xds:UserDelete"/>
<xs:element ref="xds:UserDeleteResult"/>
<xs:element ref="xds:UserLogin"/>
<xs:element ref="xds:UserLoginResult"/>
<xs:element ref="xds:UserLogout"/>
<xs:element ref="xds:UserLogoutResult"/>
<xs:element ref="xds:PartnerLookup"/>
<xs:element ref="xds:PartnerLookupResult"/>
<xs:element ref="xds:PartnerCreate"/>
<xs:element ref="xds:PartnerCreateResult"/>
<xs:element ref="xds:PartnerInfo"/>
<xs:element ref="xds:PartnerInfoResult"/>
<xs:element ref="xds:PartnerUpdate"/>
<xs:element ref="xds:PartnerUpdateResult"/>
<xs:element ref="xds:PartnerDelete"/>
<xs:element ref="xds:PartnerDeleteResult"/>
<xs:element ref="xds:SupplyChainLookup"/>
<xs:element ref="xds:SupplyChainLookupResult"/>
<xs:element ref="xds:SupplyChainCreate"/>
<xs:element ref="xds:SupplyChainCreateResult"/>
<xs:element ref="xds:SupplyChainInfo"/>
<xs:element ref="xds:SupplyChainInfoResult"/>
<xs:element ref="xds:SupplyChainUpdate"/>
<xs:element ref="xds:SupplyChainUpdateResult"/>
<xs:element ref="xds:SupplyChainDelete"/>
<xs:element ref="xds:SupplyChainDeleteResult"/>
<xs:element ref="xds:EventLookup"/>
<xs:element ref="xds:EventLookupResult"/>
<xs:element ref="xds:EventCreate"/>
<xs:element ref="xds:EventCreateResult"/>
<xs:element ref="xds:MultipleEventCreate"/>
<xs:element ref="xds:MultipleEventCreateResult"/>
<xs:element ref="xds:EventInfo"/>
<xs:element ref="xds:EventInfoResult"/>
</xs:choice>
</xs:complexType>
</xs:schema>
DSeTa/DSeTa-Client/src/main/resources/wsdl/tau-ds.wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:unicaen:iota:dseta:wsdl"
xmlns:wsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:impl="urn:unicaen:iota:ds:wsdl"
xmlns:xds="urn:unicaen:iota:ds:xsd"
xmlns:wds="urn:unicaen:iota:dseta:wsdl"
xmlns:tau="urn:unicaen:iota:tau:xsd">
<wsdl:import namespace="urn:unicaen:iota:ds:wsdl" location="ds.wsdl" />
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" >
<xs:import namespace="urn:unicaen:iota:tau:xsd" schemaLocation="tau.xsd"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="IDed_multipleEventCreateReq">
<wsdl:part name="parms" element="xds:MultipleEventCreate"/>
<wsdl:part name="id" element="tau:identity"/>
</wsdl:message>
<wsdl:message name="IDed_eventLookupReq">
<wsdl:part name="parms" element="xds:EventLookup"/>
<wsdl:part name="id" element="tau:identity"/>
</wsdl:message>
<wsdl:message name="IDed_eventCreateReq">
<wsdl:part name="parms" element="xds:EventCreate"/>
<wsdl:part name="id" element="tau:identity"/>
</wsdl:message>
<wsdl:portType name="IDed_DSServicePortType">
<wsdl:operation name="IDed_eventLookup">
<wsdl:input name="IDed_eventLookupReq" message="wds:IDed_eventLookupReq"/>
<wsdl:output name="eventLookupRsp" message="impl:eventLookupRsp"/>
</wsdl:operation>
<wsdl:operation name="IDed_multipleEventCreate">
<wsdl:input name="IDed_multipleEventCreateReq" message="wds:IDed_multipleEventCreateReq"/>
<wsdl:output name="multipleEventCreateRsp" message="impl:multipleEventCreateRsp"/>
</wsdl:operation>
<wsdl:operation name="IDed_eventCreate">
<wsdl:input name="IDed_eventCreateReq" message="wds:IDed_eventCreateReq"/>
<wsdl:output name="eventCreateRsp" message="impl:eventCreateRsp"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="IDed_DS" type="wds:IDed_DSServicePortType">
<wsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="IDed_eventLookup">
<wsoap:operation/>
<wsdl:input>
<wsoap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<wsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="IDed_eventCreate">
<wsoap:operation/>
<wsdl:input>
<wsoap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<wsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="IDed_multipleEventCreate">
<wsoap:operation/>
<wsdl:input>
<wsoap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<wsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="IDed_DS_Service">
<wsdl:port name="IDed_DS_ServicePort" binding="wds:IDed_DS">
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
DSeTa/DSeTa-Client/src/main/resources/wsdl/tau.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tau="urn:unicaen:iota:tau:xsd"
targetNamespace="urn:unicaen:iota:tau:xsd"
elementFormDefault="unqualified" attributeFormDefault="unqualified">
<xs:element name="identity" type="tau:Identity"/>
<xs:complexType name="Identity">
<xs:sequence>
<xs:element name="asString" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="principal" type="tau:Principal"/>
<xs:complexType name="Principal">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="asString" type="xs:string"/>
<xs:element name="hashCode" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
DSeTa/DSeTa/LICENSE
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
DSeTa/DSeTa/LISEZMOI
DSeTa - Discovery SErvices Trusted Agent
Version bouchon.
Dépendances:
modules IoTa:
- DSeTa-Client
- IoTa-DiscoveryWS-Client
bibliothèques:
- commons-logging
- log4j
Installation and Configuration:
IoTa-Installer installe et configure DSeTa.
Dépendances d’utilisation:
- un DS
Utilisation:
.
DSeTa/DSeTa/README
DSeTa - Discovery SErvices Trusted Agent
Mock version.
Dependencies:
IoTa modules:
- DSeTa-Client
- IoTa-DiscoveryWS-Client
libraries:
- commons-logging
- log4j
Installation and Configuration:
IoTa-Installer installs and configures DSeTa.
Usage Dependencies:
- a DS
Usage:
.
DSeTa/DSeTa/pom.xml
<?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fr.unicaen.iota</groupId>
<artifactId>dseta-server</artifactId>
<version>1.9-mock</version>
<packaging>war</packaging>
<name>DSeTa Server</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<axis2-version>1.5.6</axis2-version>
</properties>
<dependencies>
<!-- IoTa depdencies -->
<dependency>
<groupId>fr.unicaen.iota</groupId>
<artifactId>dseta-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>fr.unicaen.iota</groupId>
<artifactId>discovery-client</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Log dependencies -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<webResources>
<resource>
<directory>${project.basedir}</directory>
<includes>
<include>LICENSE</include>
<include>LISEZMOI</include>
<include>README</include>
</includes>
<targetPath>META-INF</targetPath>
<filtering>false</filtering>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>sources</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptorRefs>
<descriptorRef>src</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
DSeTa/DSeTa/src/main/java/fr/unicaen/iota/dseta/server/Constants.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2012 Université de Caen Basse-Normandie, GREYC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.dseta.server;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public final class Constants {
private Constants() {
}
private static final Log log = LogFactory.getLog(Constants.class);
public static final String SERVICE_ID;
public static final String WINGS_URL;
public static final String WINGS_LOGIN;
public static final String WINGS_PASSWORD;
public static final String DEFAULT_SESSION = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
public static final String XACML_DEFAULT_USER;
static {
log.info("Publisher properties configuration");
Properties properties = new Properties();
InputStream is = Constants.class.getClassLoader().getResourceAsStream("application.properties");
try {
properties.load(is);
} catch (IOException ex) {
log.fatal(null, ex);
}
SERVICE_ID = properties.getProperty("service-id");
WINGS_LOGIN = properties.getProperty("wings-login", "anonymous");
WINGS_PASSWORD = properties.getProperty("wings-password", "anonymous");
WINGS_URL = properties.getProperty("wings-url");
XACML_DEFAULT_USER = properties.getProperty("xacml-default-user");
}
}
DSeTa/DSeTa/src/main/java/fr/unicaen/iota/dseta/server/DSeTaWebService.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2012 Université de Caen Basse-Normandie, GREYC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.dseta.server;
import fr.unicaen.iota.discovery.client.DsClient;
import fr.unicaen.iota.discovery.client.model.Event;
import fr.unicaen.iota.discovery.client.model.EventInfo;
import fr.unicaen.iota.discovery.client.model.Service;
import fr.unicaen.iota.discovery.client.model.UserInfo;
import fr.unicaen.iota.discovery.client.util.EnhancedProtocolException;
import fr.unicaen.iota.ds.model.*;
import fr.unicaen.iota.dseta.soap.IDedDSServicePortType;
import fr.unicaen.iota.tau.model.Identity;
import java.math.BigInteger;
import java.rmi.RemoteException;
import java.util.*;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import org.apache.axis2.databinding.types.URI.MalformedURIException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
*
*/
public class DSeTaWebService implements IDedDSServicePortType {
private static final Log log = LogFactory.getLog(DSeTaWebService.class);
private final DsClient dsClient;
private static DatatypeFactory DF;
protected final Identity anonymous;
static {
try {
DF = DatatypeFactory.newInstance();
} catch (DatatypeConfigurationException ex) {
DF = null;
log.fatal(null, ex);
}
}
public DSeTaWebService() {
anonymous = new Identity();
anonymous.setAsString(Constants.XACML_DEFAULT_USER);
dsClient = new DsClient(Constants.WINGS_URL);
}
private TEventType createEventType(String type) {
return TEventType.valueOf(type.toUpperCase());
}
private TServiceType createServiceType(String type) {
return TServiceType.valueOf(type.toUpperCase());
}
@Override
public EventLookupOut iDedEventLookup(EventLookupIn parms, Identity id) {
try {
String sessionId = dsClient.userLogin(Constants.DEFAULT_SESSION, Constants.WINGS_LOGIN, Constants.WINGS_PASSWORD).getSessionId();
EventLookupOut res = new EventLookupOut();
// tres not used but required
TResult tres = new TResult();
tres.setCode(1000);
tres.setDesc("command successfull");
tres.setValue("10000");
res.setResult(tres);
TEventItemList evtList = new TEventItemList();
res.setEventList(evtList);
List<TEventItem> events = evtList.getEvent();
GregorianCalendar start = parms.getStartingAt() == null ? null : parms.getStartingAt().toGregorianCalendar();
GregorianCalendar end = parms.getEndingAt() == null ? null : parms.getEndingAt().toGregorianCalendar();
List<Event> clientEvents = dsClient.eventLookup(sessionId, parms.getObjectID(), start, end, parms.getLifeCycleStepID());
for (Event evt : clientEvents) {
TEventItem tevt = new TEventItem();
events.add(tevt);
tevt.setC(evt.getEventClass());
tevt.setE(BigInteger.valueOf(evt.getEventId()));
GregorianCalendar gCal = new GregorianCalendar();
gCal.setTime(evt.getEventTimeStamp().getTime());
XMLGregorianCalendar xmlCal = DF.newXMLGregorianCalendar(gCal);
tevt.setEts(xmlCal);
gCal.setTime(evt.getSourceTimeStamp().getTime());
xmlCal = DF.newXMLGregorianCalendar(gCal);
tevt.setSts(xmlCal);
tevt.setLcs(evt.getBizStep());
tevt.setO(evt.getObjectId());
tevt.setP(evt.getPartnerId());
tevt.setT(createEventType(evt.getEventType()));
tevt.setSc("not_used");
tevt.setU(evt.getUserId());
TServiceItemList srvs = new TServiceItemList();
tevt.setServiceList(srvs);
List<TServiceItem> srvlst = srvs.getService();
for (Service srv : evt.getServiceList()) {
TServiceItem tsrv = new TServiceItem();
srvlst.add(tsrv);
tsrv.setId(srv.getId());
tsrv.setType(createServiceType(srv.getType()));
tsrv.setUri(srv.getUri().toString());
}
}
dsClient.userLogout(sessionId);
return res;
} catch (MalformedURIException ex) {
log.fatal(null, ex);
} catch (RemoteException ex) {
log.fatal(null, ex);
} catch (EnhancedProtocolException ex) {
log.fatal(null, ex);
}
return null;
}
@Override
public MultipleEventCreateOut iDedMultipleEventCreate(MultipleEventCreateIn parms, Identity id) {
try {
String sessionId = dsClient.userLogin(Constants.DEFAULT_SESSION, Constants.WINGS_LOGIN, Constants.WINGS_PASSWORD).getSessionId();
UserInfo uInfo = dsClient.userInfo(sessionId, Constants.WINGS_LOGIN);
String userId = uInfo.getUserId();
String partnerId = uInfo.getPartnerId();
List<EventInfo> eventList = new LinkedList<EventInfo>();
for (TObjectEvent oe : parms.getEvents().getObjectEvent()) {
Calendar now = Calendar.getInstance();
now.setTime(new Date());
String etype = TEventType.OBJECT.toString();
Event event = new Event(0, oe.getObjectID(), partnerId, userId, oe.getLifeCycleStepID(),
etype, oe.getEventClass(), oe.getSourceTS().toGregorianCalendar(), now, new HashMap<String, String>());
eventList.add(new EventInfo(event, oe.getPriority(), oe.getTtl().intValue()));
}
List<Integer> idsList = dsClient.multipleEventCreate(sessionId, partnerId, eventList);
MultipleEventCreateOut res = new MultipleEventCreateOut();
TEventIDList teidList = new TEventIDList();
// tres not used but required
TResult tres = new TResult();
tres.setCode(1000);
tres.setDesc("command successfull");
tres.setValue("10000");
res.setResult(tres);
res.setEventIDList(teidList);
List<BigInteger> resIds = teidList.getEventID();
for (int eid : idsList) {
resIds.add(BigInteger.valueOf(eid));
}
dsClient.userLogout(sessionId);
return res;
} catch (MalformedURIException ex) {
log.fatal(null, ex);
} catch (RemoteException ex) {
log.fatal(null, ex);
} catch (EnhancedProtocolException ex) {
log.fatal(null, ex);
}
return null;
}
@Override
public EventCreateOut iDedEventCreate(EventCreateIn parms, Identity id) {
try {
String sessionId = dsClient.userLogin(Constants.DEFAULT_SESSION, Constants.WINGS_LOGIN, Constants.WINGS_PASSWORD).getSessionId();
UserInfo uInfo = dsClient.userInfo(sessionId, Constants.WINGS_LOGIN);
String partnerId = uInfo.getPartnerId();
Calendar now = Calendar.getInstance();
now.setTime(new Date());
TObjectEvent oe = parms.getEvent().getObjectEvent();
int eid = dsClient.eventCreate(sessionId, partnerId, oe.getObjectID(), oe.getLifeCycleStepID(), oe.getEventClass(),
oe.getSourceTS().toGregorianCalendar(), oe.getTtl().intValue(), null, oe.getPriority(), new HashMap<String, String>());
EventCreateOut res = new EventCreateOut();
// tres not used but required
TResult tres = new TResult();
tres.setCode(1000);
tres.setDesc("command successfull");
tres.setValue("10000");
res.setResult(tres);
res.setEventID(BigInteger.valueOf(eid));
dsClient.userLogout(sessionId);
return res;
} catch (MalformedURIException ex) {
log.fatal(null, ex);
} catch (RemoteException ex) {
log.fatal(null, ex);
} catch (EnhancedProtocolException ex) {
log.fatal(null, ex);
}
return null;
}
}
DSeTa/DSeTa/src/main/java/fr/unicaen/iota/dseta/server/DiscoveryWebService.java
/*
* This program is a part of the IoTa Project.
*
* Copyright © 2012 Université de Caen Basse-Normandie, GREYC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <http://www.gnu.org/licenses/>
*
* See AUTHORS for a list of contributors.
*/
package fr.unicaen.iota.dseta.server;
import fr.unicaen.iota.ds.model.*;
import fr.unicaen.iota.ds.soap.DSServicePortType;
/**
*
*/
public class DiscoveryWebService extends DSeTaWebService implements DSServicePortType {
@Override
public EventLookupOut eventLookup(EventLookupIn parms) {
return iDedEventLookup(parms, anonymous);
}
@Override
public MultipleEventCreateOut multipleEventCreate(MultipleEventCreateIn parms) {
return iDedMultipleEventCreate(parms, anonymous);
}
@Override
public EventCreateOut eventCreate(EventCreateIn parms) {
return iDedEventCreate(parms, anonymous);
}
}
DSeTa/DSeTa/src/main/resources/application.properties
service-id=urn:epc:id:gsrn:1.001
session-time-lease=30
session-failed-id = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
ds-service-type = ds
html-service-type = html
epcis-service-type = epcis
ds-ons-type = epc\\+ds
html-ons-type = epc\\+html
epcis-ons-type = epc\\+epcis
use-xacml = false;
xacml-address = localhost
xacml-port = 9999
xacml-ihm-url = http://localhost:8080/xacml-local/
DSeTa/DSeTa/src/main/resources/commons-logging.properties
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
DSeTa/DSeTa/src/main/resources/ds-client.properties
ws-connection-pool-size=10
DSeTa/DSeTa/src/main/resources/log4j.properties
# LOG4J configuration
# default logging
log4j.rootCategory=INFO, LOGFILE
# customize logging levels
log4j.logger.fr.unicaen.iota=INFO
... Ce différentiel a été tronqué car il excède la taille maximale pouvant être affichée.

Formats disponibles : Unified diff