«
Précédent
|
Suivant
»
Révision 2e0a7cb1
Ajouté par Sylvain Sauvage il y a environ 12 ans
- ID 2e0a7cb19e8f1f477667faad3978e4bfe7157e89
- Enfant 96454bcd
.gitignore | ||
---|---|---|
.directory
|
||
*~
|
||
*.bak
|
||
*.class
|
||
*.pyc
|
||
*.log
|
||
target
|
||
|
||
# installer links
|
||
IoTa-Installer/resources/alfa-*-bin-with-dependencies.tar.gz
|
||
IoTa-Installer/resources/discovery-phi-*.war
|
||
IoTa-Installer/resources/discovery-server-*.war
|
||
IoTa-Installer/resources/epcilon-*.war
|
||
IoTa-Installer/resources/epcis-phi-*.war
|
||
IoTa-Installer/resources/eta-*.war
|
||
IoTa-Installer/resources/omega-*.war
|
||
IoTa-Installer/resources/install.ini
|
ALfA/ALfA-PI/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-PI/LISEZMOI | ||
---|---|---|
ALfA-PI - ALfA Programming Interface
|
||
|
||
Interface de programmation RMI commune entre ALfA et des applications de haut
|
||
niveau.
|
||
|
||
Dépendances: aucune
|
||
|
||
Configuration: aucune
|
||
|
||
Dépendances d’utilisation:
|
||
- ALfA
|
||
|
||
Utilisation:
|
||
voir BETa, DELTa ou OMeGa pour des exemples de clients
|
ALfA/ALfA-PI/README | ||
---|---|---|
ALfA-PI - ALfA Programming Interface
|
||
|
||
Common RMI programming interface between ALfA and top-level applications.
|
||
|
||
Dependencies: none
|
||
|
||
Configuration: none
|
||
|
||
Usage Dependencies:
|
||
- ALfA
|
||
|
||
Usage:
|
||
see BETa, DELTa, or OMeGa for examples
|
ALfA/ALfA-PI/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.application</groupId>
|
||
<artifactId>alfa-pi</artifactId>
|
||
<version>1.0</version>
|
||
<packaging>jar</packaging>
|
||
|
||
<name>ALfA-PI</name>
|
||
|
||
<properties>
|
||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||
</properties>
|
||
|
||
<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>
|
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/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/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/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
|
||
|
||
Dépendances:
|
||
modules IoTa:
|
||
- ALfA-PI
|
||
- IoTa-DiscoveryWS-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)
|
||
- 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/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
|
||
|
||
Dependencies:
|
||
IoTa modules:
|
||
- ALfA-PI
|
||
- IoTa-DiscoveryWS-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)
|
||
- 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/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 | ||
---|---|---|
<?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.application</groupId>
|
||
<artifactId>alfa</artifactId>
|
||
<version>1.0</version>
|
||
<packaging>jar</packaging>
|
||
|
||
<name>ALfA</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.application</groupId>
|
||
<artifactId>alfa-pi</artifactId>
|
||
<version>1.0</version>
|
||
</dependency>
|
||
|
||
<dependency>
|
||
<groupId>fr.unicaen.iota.discovery</groupId>
|
||
<artifactId>discovery-client</artifactId>
|
||
<version>1.0</version>
|
||
</dependency>
|
||
|
||
<!-- Fosstrak dependencies -->
|
||
<dependency>
|
||
<groupId>org.fosstrak.epcis</groupId>
|
||
<artifactId>epcis-commons</artifactId>
|
||
<version>${epcis-version}</version>
|
||
</dependency>
|
||
|
||
<dependency>
|
||
<groupId>org.fosstrak.epcis</groupId>
|
||
<artifactId>epcis-queryclient</artifactId>
|
||
<version>${epcis-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>
|
||
|
||
<!-- 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>
|
||
<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>
|
||
|
||
<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/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/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 | ||
---|---|---|
/*
|
||
* 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.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.discovery.client.util.EnhancedProtocolException;
|
||
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;
|
||
import org.apache.commons.logging.LogFactory;
|
||
|
||
public class DiscoveryOperation {
|
||
|
||
private static final Log log = LogFactory.getLog(DiscoveryOperation.class);
|
||
private final String LOGIN;
|
||
private final String PASS;
|
||
private String DS_SERVICE_ADDRESS;
|
||
private final CallBackClient client;
|
||
private final String sessionId;
|
||
private final Set<String> visitedSet = new HashSet<String>();
|
||
|
||
public DiscoveryOperation(String login, String pass, String ds_service_address) {
|
||
super();
|
||
this.LOGIN = login;
|
||
this.PASS = pass;
|
||
this.DS_SERVICE_ADDRESS = ds_service_address;
|
||
this.client = null;
|
||
this.sessionId = null;
|
||
}
|
||
|
||
public DiscoveryOperation(String login, String pass, String dsAddress, CallBackClient client, String sessionId) {
|
||
super();
|
||
this.LOGIN = login;
|
||
this.PASS = pass;
|
||
this.DS_SERVICE_ADDRESS = dsAddress;
|
||
this.client = client;
|
||
this.sessionId = sessionId;
|
||
}
|
||
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);
|
||
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);
|
||
} catch (MalformedURIException ex) {
|
||
log.error("Unable to process eventLookup", ex);
|
||
throw new RemoteException("Unable to process eventLookup");
|
||
} catch (EnhancedProtocolException ex) {
|
||
log.error("Unable to process eventLookup", ex);
|
||
throw new RemoteException("Unable to process eventLookup");
|
||
}
|
||
log.debug(EPC + " -> dsEvents in repository: " + dsClientEventList.size());
|
||
return dsClientEventList;
|
||
}
|
||
|
||
public Set<String> discover(String EPC) {
|
||
Set<String> result = new HashSet<String>();
|
||
Collection<Event> 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();
|
||
log.trace(serviceList.size());
|
||
|
||
for (Service s : serviceList) {
|
||
log.trace(" PartnerID: " + evt.getPartnerId());
|
||
log.trace(" | service type: " + s.getType());
|
||
log.trace(" | service address: " + s.getUri());
|
||
if ("ds".equals(s.getType())) {
|
||
DS_SERVICE_ADDRESS = s.getUri().toString();
|
||
result.addAll(discover(EPC));
|
||
} else {
|
||
result.add(s.getUri().toString());
|
||
if (client != null && !visitedSet.contains(s.getUri().toString())) {
|
||
new EpcisRequest(s.getUri().toString(), EPC, LOGIN, PASS, client, sessionId).start();
|
||
visitedSet.add(s.getUri().toString());
|
||
}
|
||
}
|
||
}
|
||
}
|
||
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);
|
||
log.debug(EPC + " | partnerID: " + first.getId());
|
||
log.debug(EPC + " | partner info size: " + dsClientEvent.getServiceList().size());
|
||
log.debug(EPC + " | partner type: " + first.getType());
|
||
result.add(new DSEvent(EPC, first.getUri().toString(), dsClientEvent.getBizStep(),
|
||
new Timestamp(dsClientEvent.getSourceTimeStamp().getTimeInMillis())));
|
||
}
|
||
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);
|
||
log.debug(EPC + " | partnerID:" + firstService.getId());
|
||
log.debug(EPC + " | partner info size:" + dsClientEvent.getServiceList().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())));
|
||
}
|
||
}
|
||
}
|
||
log.debug(EPC + " -> dsEvents with corresponding type: " + result.size());
|
||
logout();
|
||
return result;
|
||
}
|
||
}
|
ALfA/ALfA/src/main/java/fr/unicaen/iota/application/operations/EpcisOperation.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 java.net.URL;
|
||
import java.rmi.RemoteException;
|
||
import java.util.ArrayList;
|
||
import java.util.HashMap;
|
||
import java.util.List;
|
||
import java.util.Map;
|
||
import javax.xml.bind.JAXBElement;
|
||
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 static final Log log = LogFactory.getLog(EpcisOperation.class);
|
||
|
||
public EpcisOperation(String epcis_service_address) throws Exception {
|
||
EPCIS_SERVICE_ADDRESS = epcis_service_address;
|
||
}
|
||
|
||
public QueryParam createEPCISParameter(String name, String value) {
|
||
QueryParam queryParam = new QueryParam();
|
||
queryParam.setName(name);
|
||
ArrayOfString queryParamValue = new ArrayOfString();
|
||
queryParamValue.getString().add(value);
|
||
queryParam.setValue(queryParamValue);
|
||
return queryParam;
|
||
}
|
||
|
||
private 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);
|
||
QueryParams queryParams = new QueryParams();
|
||
for (Map.Entry<String, String> entry : filters.entrySet()) {
|
||
queryParams.getParam().add(createEPCISParameter(entry.getKey(), entry.getValue()));
|
||
}
|
||
|
||
Poll poll = new Poll();
|
||
poll.setQueryName("SimpleEventQuery");
|
||
poll.setParams(queryParams);
|
||
|
||
QueryResults results = client.poll(poll);
|
||
EventListType eventListType = results.getResultsBody().getEventList();
|
||
return getEvents(eventListType);
|
||
} catch (Exception ex) {
|
||
log.error(null, ex);
|
||
throw new RemoteException(ex.getMessage());
|
||
}
|
||
}
|
||
|
||
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);
|
||
}
|
||
|
||
public List<EPCISEventType> getObjectEventFromEPC(String EPC) 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);
|
||
}
|
||
|
||
public List<EPCISEventType> getAggregationEventFromEPC(String EPC) 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);
|
||
}
|
||
|
||
private List<EPCISEventType> getEvents(EventListType eventListType) {
|
||
List<EPCISEventType> res = new ArrayList<EPCISEventType>();
|
||
if (eventListType.getObjectEventOrAggregationEventOrQuantityEvent() != null) {
|
||
for (Object o : eventListType.getObjectEventOrAggregationEventOrQuantityEvent()) {
|
||
EPCISEventType eltc = (EPCISEventType) (o instanceof JAXBElement ? ((JAXBElement) o).getValue() : o);
|
||
res.add(eltc);
|
||
}
|
||
}
|
||
return res;
|
||
}
|
||
}
|
ALfA/ALfA/src/main/java/fr/unicaen/iota/application/operations/EpcisRequest.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.model.EPCISEvent;
|
||
import fr.unicaen.iota.application.rmi.CallBackClient;
|
||
import fr.unicaen.iota.application.util.EpcisUtil;
|
||
import java.rmi.RemoteException;
|
||
import java.util.Collection;
|
||
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;
|
||
|
||
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 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;
|
||
this.epc = epc;
|
||
this.client = client;
|
||
this.sessionId = sessionId;
|
||
this.serviceAddress = serviceAddress;
|
||
}
|
||
|
||
@Override
|
||
public void run() {
|
||
try {
|
||
StringBuilder debug = new StringBuilder();
|
||
if (isDebug) {
|
||
debug.append("\n\n");
|
||
debug.append("EPCIS request -> service address: ");
|
||
debug.append(serviceAddress);
|
||
debug.append(" | epc: ");
|
||
debug.append(epc);
|
||
debug.append("\n");
|
||
debug.append("Events: \n");
|
||
}
|
||
EpcisOperation epcisOperation = null;
|
||
while (epcisOperation == null) {
|
||
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("\n------------------------------------------\n");
|
||
}
|
||
client.pushEvent(sessionId, e);
|
||
} 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) {
|
||
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();
|
||
}
|
||
}
|
||
}
|
||
} catch (RemoteException ex) {
|
||
log.fatal(null, ex);
|
||
}
|
||
}
|
||
}
|
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 | ||
---|---|---|
/*
|
||
* 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.conf.Constants;
|
||
import fr.unicaen.iota.application.model.EPCISEvent;
|
||
import fr.unicaen.iota.application.util.EpcisUtil;
|
||
import java.rmi.RemoteException;
|
||
import java.util.ArrayList;
|
||
import java.util.Collection;
|
||
import java.util.List;
|
||
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;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class TraceEPC {
|
||
|
||
private final String DS_LOGIN;
|
||
private final String DS_PASS;
|
||
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 List<EPCISEvent> traceEPC(String epc) throws RemoteException {
|
||
log.trace("EPC = " + epc);
|
||
eventList = new ArrayList<EPCISEventType>();
|
||
return traceEPCaux(epc);
|
||
}
|
||
|
||
private List<EPCISEvent> traceEPCaux(String epc) throws RemoteException {
|
||
log.trace("[TRACE EPC]: " + epc);
|
||
log.trace("CALLED METHOD: <traceEPC>");
|
||
log.trace("Get Referent ds address");
|
||
String dsAddress = onsOperation.getReferentDS(epc);
|
||
if (dsAddress == null) {
|
||
log.warn("Unable to retreive referent ds address for this epc code");
|
||
return new ArrayList<EPCISEvent>();
|
||
} 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;
|
||
}
|
||
|
||
private void traceEPC(String epc, DiscoveryOperation dsOp) throws RemoteException {
|
||
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 = null;
|
||
log.warn("Unable to create service proxy port! [RETRYING]");
|
||
}
|
||
try {
|
||
Thread.sleep(1);
|
||
} catch (InterruptedException ex) {
|
||
}
|
||
}
|
||
Collection<EPCISEventType> list = epcisOperation.getObjectEventFromEPC(epc);
|
||
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());
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
private List<EPCISEvent> processEventList(Collection<EPCISEventType> eventList) {
|
||
List<EPCISEvent> result = new ArrayList<EPCISEvent>();
|
||
|
||
for (EPCISEventType o : eventList) {
|
||
result.add(EpcisUtil.processEvent(o));
|
||
}
|
||
return result;
|
||
}
|
||
}
|
ALfA/ALfA/src/main/java/fr/unicaen/iota/application/operations/TraceEPCAsync.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.conf.Constants;
|
||
import fr.unicaen.iota.application.rmi.CallBackClient;
|
||
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 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) {
|
||
this.client = client;
|
||
this.LOGIN = login;
|
||
this.PASS = pass;
|
||
this.sessionId = sessionId;
|
||
this.EPC = epc;
|
||
this.onsOperation = new ONSOperation(Constants.ONS_HOSTS);
|
||
}
|
||
|
||
@Override
|
||
public void run() {
|
||
try {
|
||
traceEPC(EPC);
|
||
} catch (RemoteException ex) {
|
||
log.fatal(null, ex);
|
||
}
|
||
}
|
||
|
||
private void traceEPC(String epc) throws RemoteException {
|
||
log.trace("[TRACE EPC]: " + epc);
|
||
log.trace("CALLED METHOD: <traceEPC>");
|
||
log.trace("Get Referent ds address");
|
||
String dsAddress = onsOperation.getReferentDS(epc);
|
||
if (dsAddress == null) {
|
||
log.warn("Unable to retreive referent ds address for this epc code");
|
||
return;
|
||
} else {
|
||
log.trace("referent ds address found: " + dsAddress);
|
||
}
|
||
log.trace("Start discover");
|
||
DiscoveryOperation dsOp = new DiscoveryOperation(LOGIN, PASS, dsAddress, client, sessionId);
|
||
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/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/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
|
||
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-spec-entry = epc\\+spec
|
||
ons-entry-regex = \\!\\^\\.\\*\\$\\!|\\!
|
ALfA/ALfA/src/main/resources/commons-logging.properties | ||
---|---|---|
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
|
ALfA/ALfA/src/main/resources/ds-client.properties | ||
---|---|---|
ws-connection-pool-size=10
|
ALfA/ALfA/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/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/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>.
|
AUTHORS | ||
---|---|---|
Major contributors:
|
||
|
||
GREYC Université de Caen Basse-Normandie
|
||
J. Chauveau (2009)
|
||
A. Laurence (2009-2012)
|
||
J. Le Moulec (2008-2012)
|
||
J. Madelaine (2008-2012)
|
||
R. Ménard (2011-2012)
|
||
S. Sauvage (2012)
|
||
|
||
Orange Labs
|
||
M.-A. Mouilleron (2011-2012)
|
||
|
BETa/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>.
|
BETa/LISEZMOI | ||
---|---|---|
BETa - Basic EPC Test Application
|
||
|
||
Exemple d’application cliente de haut niveau.
|
||
|
||
Dépendances:
|
||
modules IoTa:
|
||
- ALfA-PI
|
||
- 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.
|
||
|
||
Dépendances d’utilisation:
|
||
- ALfA
|
||
|
||
Utilisation:
|
||
./beta.sh
|
BETa/README | ||
---|---|---|
BETa - Basic EPC Test Application
|
||
|
||
Top-level application query client example.
|
||
|
||
Dependencies:
|
||
IoTa modules:
|
||
- ALfA-PI
|
||
- 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).
|
||
|
||
Usage Dependencies:
|
||
- ALfA
|
||
|
||
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
|
BETa/make-tar.sh | ||
---|---|---|
#!/bin/sh
|
||
|
||
name=${PWD##*/}
|
||
cd ..
|
||
tar chf beta.tar $name/dist $name/README $name/LISEZMOI
|
BETa/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.application</groupId>
|
||
<artifactId>beta</artifactId>
|
||
<version>1.0</version>
|
||
<packaging>jar</packaging>
|
||
|
||
<name>BETa</name>
|
||
|
||
<properties>
|
||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||
</properties>
|
||
|
||
<dependencies>
|
||
|
||
<dependency>
|
||
<groupId>fr.unicaen.iota.application</groupId>
|
||
<artifactId>alfa-pi</artifactId>
|
||
<version>1.0</version>
|
||
</dependency>
|
||
|
||
<dependency>
|
||
<groupId>fr.unicaen.iota.application</groupId>
|
||
<artifactId>omicron</artifactId>
|
||
<version>1.0</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.client.Main</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>
|
BETa/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>beta.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>
|
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/Configuration.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 java.io.IOException;
|
||
import java.io.InputStream;
|
||
import java.util.Properties;
|
||
import org.apache.commons.logging.LogFactory;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public final class 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;
|
||
|
||
static {
|
||
try {
|
||
Properties props = loadProperties();
|
||
SOAP_SERVICE_URL = props.getProperty("soap-service-url", "http://localhost:8080/omega/services/IOTA_Service/");
|
||
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"));
|
||
} catch (IOException ex) {
|
||
LogFactory.getLog(Configuration.class).fatal(null, ex);
|
||
}
|
||
}
|
||
|
||
public static Properties loadProperties() throws IOException {
|
||
// create and load default properties
|
||
Properties props = new Properties();
|
||
InputStream in = Configuration.class.getResourceAsStream(PROPERTIES_CONFIG_FILE);
|
||
props.load(in);
|
||
in.close();
|
||
return props;
|
||
}
|
||
}
|
BETa/src/main/java/fr/unicaen/iota/application/client/Main.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.gui.GUI;
|
||
import java.rmi.RMISecurityManager;
|
||
import java.rmi.RemoteException;
|
||
import java.rmi.server.UnicastRemoteObject;
|
||
import org.apache.commons.logging.Log;
|
||
import org.apache.commons.logging.LogFactory;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
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();
|
||
System.setProperty("java.security.policy", policyFile);
|
||
System.setProperty("java.rmi.server.hostname", Configuration.RMI_CALLBACK_HOST);
|
||
if (System.getSecurityManager() == null) {
|
||
System.setSecurityManager(new RMISecurityManager());
|
||
}
|
||
GUI gui = new GUI();
|
||
CallBackClientImpl cbci = new CallBackClientImpl();
|
||
UnicastRemoteObject.exportObject(cbci, Configuration.RMI_CALLBACK_PORT);
|
||
gui.setCallBackHandler(cbci);
|
||
gui.setVisible(true);
|
||
}
|
||
}
|
BETa/src/main/java/fr/unicaen/iota/application/client/TraceEPCRMIAsync.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.rmi.AccessInterface;
|
||
import java.net.URI;
|
||
import java.rmi.RemoteException;
|
||
import java.rmi.registry.LocateRegistry;
|
||
import java.rmi.registry.Registry;
|
||
import org.apache.commons.logging.Log;
|
||
import org.apache.commons.logging.LogFactory;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class TraceEPCRMIAsync extends Thread {
|
||
|
||
private static final Log log = LogFactory.getLog(TraceEPCRMIAsync.class);
|
||
private String epc;
|
||
private String sessionId;
|
||
private CallBackClientImpl callBackHandler;
|
||
|
||
public TraceEPCRMIAsync(String epc, String sessionId, CallBackClientImpl callBackHandler) {
|
||
this.epc = epc;
|
||
this.sessionId = sessionId;
|
||
this.callBackHandler = callBackHandler;
|
||
}
|
||
|
||
@Override
|
||
public void run() {
|
||
AccessInterface server;
|
||
try {
|
||
log.debug("Looking up server at " + Configuration.RMI_SERVICE_URL);
|
||
URI uri = new URI(Configuration.RMI_SERVICE_URL);
|
||
int port = uri.getPort();
|
||
port = port == -1 ? 1099 : port;
|
||
String name = uri.getPath().substring(1);
|
||
String host = uri.getHost();
|
||
log.trace("that is: rmi://" + host + ":" + port + "/" + name);
|
||
Registry registry = LocateRegistry.getRegistry(host, port);
|
||
server = (AccessInterface) registry.lookup(name);
|
||
} catch (Exception e) {
|
||
log.fatal("Failed to get RMI server", e);
|
||
return;
|
||
}
|
||
try {
|
||
log.trace("Calling server.traceEPCAsync");
|
||
server.traceEPCAsync(sessionId, callBackHandler, epc);
|
||
} catch (RemoteException ex) {
|
||
log.fatal(null, ex);
|
||
}
|
||
}
|
||
}
|
BETa/src/main/java/fr/unicaen/iota/application/client/gui/ClosableTabbedPane.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.gui;
|
||
|
||
import java.awt.Component;
|
||
import javax.swing.JTabbedPane;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class ClosableTabbedPane extends JTabbedPane {
|
||
|
||
public TabComponent addClosableTabComponent(Component c) {
|
||
this.add(c);
|
||
int index = this.indexOfComponent(c);
|
||
TabComponent tb = new TabComponent(c.getName(),this);
|
||
this.setTabComponentAt(index, tb);
|
||
return tb;
|
||
}
|
||
|
||
public void setTitleAt(Component aThis, String newTitle) {
|
||
int i = this.indexOfComponent(aThis);
|
||
Component comp = this.getTabComponentAt(i);
|
||
if (comp instanceof TabComponent) {
|
||
TabComponent tc = (TabComponent) comp;
|
||
tc.setTitle(newTitle);
|
||
} else {
|
||
this.setTitleAt(i, newTitle);
|
||
}
|
||
}
|
||
|
||
@Override
|
||
public void setTitleAt(int i, String newTitle) {
|
||
Component comp = this.getTabComponentAt(i);
|
||
if (comp instanceof TabComponent) {
|
||
TabComponent tc = (TabComponent) comp;
|
||
tc.setTitle(newTitle);
|
||
} else {
|
||
super.setTitleAt(i, newTitle);
|
||
}
|
||
}
|
||
|
||
public void closeTab(Component comp) {
|
||
int i = this.indexOfTabComponent(comp);
|
||
this.remove(i);
|
||
}
|
||
}
|
BETa/src/main/java/fr/unicaen/iota/application/client/gui/EventRowEditor.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.gui;
|
||
|
||
import java.awt.Component;
|
||
import java.awt.event.ActionEvent;
|
||
import java.awt.event.ActionListener;
|
||
import javax.swing.AbstractCellEditor;
|
||
import javax.swing.JTable;
|
||
import javax.swing.JTextArea;
|
||
import javax.swing.table.TableCellEditor;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class EventRowEditor extends AbstractCellEditor
|
||
implements TableCellEditor, ActionListener {
|
||
|
||
private String currentValue;
|
||
private JTextArea textArea;
|
||
|
||
public EventRowEditor() {
|
||
textArea = new JTextArea();
|
||
}
|
||
|
||
@Override
|
||
public void actionPerformed(ActionEvent e) {
|
||
}
|
||
|
||
//Implement the one CellEditor method that AbstractCellEditor doesn't.
|
||
@Override
|
||
public Object getCellEditorValue() {
|
||
return currentValue;
|
||
}
|
||
|
||
//Implement the one method defined by TableCellEditor.
|
||
@Override
|
||
public Component getTableCellEditorComponent(JTable table, Object value,
|
||
boolean isSelected, int row, int column) {
|
||
textArea.setText((String) value);
|
||
return textArea;
|
||
}
|
||
}
|
BETa/src/main/java/fr/unicaen/iota/application/client/gui/GUI.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.gui;
|
||
|
||
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.util.Utils;
|
||
import java.rmi.RemoteException;
|
||
import java.util.*;
|
||
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;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class GUI extends javax.swing.JFrame implements ChangeListener, Observer {
|
||
|
||
private static enum AO {
|
||
|
||
alpha, omega
|
||
};
|
||
private String defaultEPC = "";
|
||
private CallBackClientImpl callBackHandler;
|
||
private static final Log log = LogFactory.getLog(GUI.class);
|
||
|
||
/**
|
||
* Creates new form mainGui
|
||
*/
|
||
public GUI() {
|
||
try {
|
||
UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
|
||
/*
|
||
* 1.7 } catch (ClassNotFoundException| InstantiationException|
|
||
* IllegalAccessException| UnsupportedLookAndFeelException ex) {
|
||
*/
|
||
} catch (Exception ex) {
|
||
log.warn(null, ex);
|
||
}
|
||
initComponents();
|
||
log.trace("GUI started");
|
||
}
|
||
|
||
/**
|
||
* This method is called from within the constructor to initialize the form.
|
||
*/
|
||
@SuppressWarnings("unchecked")
|
||
private void initComponents() {
|
||
jLabel1 = new javax.swing.JLabel();
|
||
jTextField1 = new javax.swing.JTextField();
|
||
jButtona = new javax.swing.JButton();
|
||
jButtonw = new javax.swing.JButton();
|
||
closableTabbedPane = new ClosableTabbedPane();
|
||
|
||
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
||
|
||
jLabel1.setText("EPC:");
|
||
jButtonw.setText("ω-search");
|
||
jButtonw.addActionListener(new java.awt.event.ActionListener() {
|
||
|
||
@Override
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jButtonActionPerformed(evt, AO.omega);
|
||
}
|
||
});
|
||
jButtona.setText("α-search");
|
||
jButtona.addActionListener(new java.awt.event.ActionListener() {
|
||
|
||
@Override
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jButtonActionPerformed(evt, AO.alpha);
|
||
}
|
||
});
|
||
|
||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||
getContentPane().setLayout(layout);
|
||
layout.setHorizontalGroup(
|
||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).
|
||
addGroup(
|
||
layout.createSequentialGroup().
|
||
addContainerGap().addComponent(jLabel1).
|
||
addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).
|
||
addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE).
|
||
addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).
|
||
addComponent(jButtona, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE).
|
||
addComponent(jButtonw, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)).
|
||
addComponent(closableTabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 655, Short.MAX_VALUE));
|
||
layout.setVerticalGroup(
|
||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).
|
||
addGroup(layout.createSequentialGroup().
|
||
addContainerGap().
|
||
addGroup(
|
||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).
|
||
addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).
|
||
addComponent(jLabel1).
|
||
addComponent(jButtona).
|
||
addComponent(jButtonw)).
|
||
addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).
|
||
addComponent(closableTabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE)));
|
||
|
||
pack();
|
||
SearchArea home = new SearchArea("", null, closableTabbedPane);
|
||
closableTabbedPane.addClosableTabComponent(home);
|
||
home.setTitle("Home");
|
||
jTextField1.setText(defaultEPC);
|
||
closableTabbedPane.addChangeListener(this);
|
||
this.setTitle("BETa: Basic Epcis Test Application");
|
||
this.setSize(800, 600);
|
||
}
|
||
|
||
private void jButtonActionPerformed(java.awt.event.ActionEvent evt, AO ao) {
|
||
String sessionID = Utils.generateSessionId();
|
||
SearchArea searchArea = new SearchArea(jTextField1.getText(), sessionID, closableTabbedPane);
|
||
callBackHandler.addEPCEventListener(searchArea);
|
||
closableTabbedPane.addClosableTabComponent(searchArea);
|
||
searchArea.setProcessing();
|
||
int index = closableTabbedPane.indexOfComponent(searchArea);
|
||
closableTabbedPane.setSelectedIndex(index);
|
||
switch (ao) {
|
||
case alpha:
|
||
alphaTraceEPC(jTextField1.getText(), sessionID, callBackHandler);
|
||
break;
|
||
case omega:
|
||
omegaTraceEPC(jTextField1.getText(), sessionID, callBackHandler);
|
||
break;
|
||
}
|
||
}
|
||
// Variables declaration
|
||
private javax.swing.JButton jButtona;
|
||
private javax.swing.JButton jButtonw;
|
||
private javax.swing.JLabel jLabel1;
|
||
private javax.swing.JTextField jTextField1;
|
||
private ClosableTabbedPane closableTabbedPane;
|
||
|
||
@Override
|
||
public void stateChanged(ChangeEvent e) {
|
||
if (e.getSource() == closableTabbedPane) {
|
||
for (int i = 0; i < closableTabbedPane.getTabCount(); i++) {
|
||
if (i == closableTabbedPane.getSelectedIndex()) {
|
||
continue;
|
||
}
|
||
SearchArea sa = (SearchArea) closableTabbedPane.getComponentAt(i);
|
||
int toCut = Math.min(sa.getTitle().length(), 4);
|
||
closableTabbedPane.setTitleAt(i, sa.getTitle().substring(0, toCut) + "...");
|
||
}
|
||
int j = closableTabbedPane.getSelectedIndex();
|
||
SearchArea sa = (SearchArea) closableTabbedPane.getComponentAt(j);
|
||
closableTabbedPane.setTitleAt(j, sa.getTitle());
|
||
}
|
||
}
|
||
|
||
@Override
|
||
public void update(Observable o, Object arg) {
|
||
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) {
|
||
log.trace("Start RMI Asynchronous Trace");
|
||
new TraceEPCRMIAsync(text, sessionID, callBackHandler).start();
|
||
log.trace("Done");
|
||
}
|
||
|
||
private void omegaTraceEPC(String text, String sessionID, CallBackClientImpl callBackHandler) {
|
||
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;
|
||
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);
|
||
}
|
||
}
|
||
} else {
|
||
log.trace("(no events)");
|
||
}
|
||
log.trace("Done");
|
||
}
|
||
}
|
BETa/src/main/java/fr/unicaen/iota/application/client/gui/IdRenderer.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.gui;
|
||
|
||
import java.awt.Component;
|
||
import javax.swing.JLabel;
|
||
import javax.swing.JTable;
|
||
import javax.swing.table.TableCellRenderer;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class IdRenderer extends JLabel implements TableCellRenderer {
|
||
|
||
public IdRenderer() {
|
||
this.setOpaque(false);
|
||
}
|
||
|
||
@Override
|
||
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
|
||
String content = (String) value;
|
||
this.setText(content);
|
||
this.setHorizontalAlignment(JLabel.CENTER);
|
||
if (isSelected) {
|
||
this.setOpaque(true);
|
||
this.setBackground(table.getSelectionBackground());
|
||
this.setForeground(table.getSelectionForeground());
|
||
} else {
|
||
this.setOpaque(false);
|
||
this.setForeground(table.getForeground());
|
||
}
|
||
return this;
|
||
}
|
||
}
|
BETa/src/main/java/fr/unicaen/iota/application/client/gui/SearchArea.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.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 java.awt.BorderLayout;
|
||
import java.awt.Color;
|
||
import java.awt.FlowLayout;
|
||
import java.util.ArrayList;
|
||
import java.util.List;
|
||
import javax.swing.*;
|
||
import javax.swing.table.DefaultTableModel;
|
||
import javax.swing.table.TableColumn;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class SearchArea extends JPanel implements EPCEventListener {
|
||
|
||
private JTable jTableGenerated = new JTable();
|
||
private String epc;
|
||
private String sessionId;
|
||
private int currentIndex = 0;
|
||
private ClosableTabbedPane jtp;
|
||
private String title = "";
|
||
private JLabel travelTime;
|
||
private JLabel nbObjects;
|
||
private JButton details;
|
||
|
||
public SearchArea(String epc, String sessionId, ClosableTabbedPane jtp) {
|
||
travelTime = new JLabel("0");
|
||
nbObjects = new JLabel("0");
|
||
this.sessionId = sessionId;
|
||
this.jtp = jtp;
|
||
this.epc = epc;
|
||
this.setName(epc);
|
||
JScrollPane jsp = new JScrollPane();
|
||
JPanel statusbar = new JPanel();
|
||
jTableGenerated.setModel(new javax.swing.table.DefaultTableModel(
|
||
new Object[][]{},
|
||
new String[]{
|
||
"ID", "EPCs", "Event Type", "BizLoc", "BizStep", "Event Time"
|
||
}));
|
||
jTableGenerated.setAutoCreateRowSorter(true);
|
||
TableColumn column2 = jTableGenerated.getColumnModel().getColumn(1);
|
||
column2.setCellRenderer(new TextAreaRenderer());
|
||
column2.setMaxWidth(400);
|
||
column2.setPreferredWidth(400);
|
||
TableColumn column1 = jTableGenerated.getColumnModel().getColumn(0);
|
||
column1.setCellRenderer(new IdRenderer());
|
||
column1.setPreferredWidth(27);
|
||
column1.setMaxWidth(27);
|
||
TableColumn column3 = jTableGenerated.getColumnModel().getColumn(2);
|
||
column3.setPreferredWidth(90);
|
||
column3.setMaxWidth(90);
|
||
jsp.setViewportView(jTableGenerated);
|
||
details = new JButton("details...");
|
||
FlowLayout fl = new FlowLayout();
|
||
fl.setAlignment(FlowLayout.RIGHT);
|
||
statusbar.setLayout(fl);
|
||
statusbar.add(new JLabel("used objects: "));
|
||
statusbar.add(nbObjects);
|
||
statusbar.add(new JLabel(" | "));
|
||
statusbar.add(new JLabel("Complet travel time: "));
|
||
statusbar.add(travelTime);
|
||
statusbar.add(details);
|
||
this.setLayout(new BorderLayout());
|
||
this.add(jsp, BorderLayout.CENTER);
|
||
this.add(statusbar, BorderLayout.SOUTH);
|
||
jTableGenerated.setSelectionBackground(Color.WHITE);
|
||
jTableGenerated.setForeground(Color.BLACK);
|
||
jTableGenerated.setSelectionForeground(Color.RED);
|
||
}
|
||
|
||
/**
|
||
* @return the jTableGenerated
|
||
*/
|
||
public JTable getJTableGenerated() {
|
||
return jTableGenerated;
|
||
}
|
||
|
||
/**
|
||
* @param jTableGenerated the jTableGenerated to set
|
||
*/
|
||
public void setJTableGenerated(JTable jTableGenerated) {
|
||
this.jTableGenerated = jTableGenerated;
|
||
}
|
||
|
||
/**
|
||
* @return the title
|
||
*/
|
||
public String getEPC() {
|
||
return epc;
|
||
}
|
||
|
||
/**
|
||
* @param title the title to set
|
||
*/
|
||
public void setEPC(String epc) {
|
||
this.epc = epc;
|
||
}
|
||
|
||
@Override
|
||
public void usedObjectsChanged(String session, int objects) {
|
||
if (!session.equals(this.sessionId)) {
|
||
return;
|
||
}
|
||
nbObjects.setText(objects + "");
|
||
}
|
||
|
||
@Override
|
||
public void travelTimeChanged(String session, TravelTimeTuple ttt) {
|
||
if (!session.equals(this.sessionId)) {
|
||
return;
|
||
}
|
||
int d = (int) (ttt.getTravelTime() / (3600000 * 24));
|
||
int h = (int) (ttt.getTravelTime() / (3600000)) - d * 8640;
|
||
int m = (int) (ttt.getTravelTime() / (60000)) - h * 3600 - d * 8640;
|
||
int s = (int) (ttt.getTravelTime() / (1000)) - m * 60 - h * 3600 - d * 8640;
|
||
|
||
travelTime.setText(d + " D " + h + " H " + m + " M " + s + " s ");
|
||
}
|
||
|
||
@Override
|
||
public void eventReveived(String session, EPCISEvent 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())});
|
||
}
|
||
|
||
public void setTerminated() {
|
||
String newTitle = getEPC();
|
||
setTitle(newTitle);
|
||
}
|
||
|
||
public void setProcessing() {
|
||
String newTitle = getEPC();
|
||
setTitle(newTitle);
|
||
}
|
||
|
||
private String formatEPC(EPCISEvent e) {
|
||
List<String> res = new ArrayList<String>();
|
||
List<String> l = e.getEpcs();
|
||
for (String s : l) {
|
||
res.add(" EPC: " + s + " \n");
|
||
}
|
||
if (!e.getParentID().equals("")) {
|
||
res.add(" Parent ID: " + e.getParentID() + " \n");
|
||
}
|
||
l = e.getChildren();
|
||
for (String s : l) {
|
||
res.add(" | child: " + s + " \n");
|
||
}
|
||
StringBuilder str = new StringBuilder();
|
||
for (String s : res) {
|
||
str.append(s);
|
||
}
|
||
return str.toString();
|
||
}
|
||
|
||
/**
|
||
* @return the title
|
||
*/
|
||
public String getTitle() {
|
||
return title;
|
||
}
|
||
|
||
/**
|
||
* @param title the title to set
|
||
*/
|
||
public void setTitle(String title) {
|
||
this.title = title;
|
||
jtp.setTitleAt(this, title);
|
||
jtp.setSelectedIndex(jtp.indexOfComponent(this));
|
||
}
|
||
}
|
BETa/src/main/java/fr/unicaen/iota/application/client/gui/TabComponent.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.gui;
|
||
|
||
import java.awt.BorderLayout;
|
||
import java.awt.event.ActionEvent;
|
||
import java.awt.event.ActionListener;
|
||
import javax.swing.BorderFactory;
|
||
import javax.swing.JButton;
|
||
import javax.swing.JLabel;
|
||
import javax.swing.JPanel;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class TabComponent extends JPanel implements ActionListener {
|
||
|
||
private JLabel title;
|
||
private JButton closeButton;
|
||
private ClosableTabbedPane parent;
|
||
|
||
public TabComponent(String label, ClosableTabbedPane parent) {
|
||
this.parent = parent;
|
||
this.setLayout(new BorderLayout());
|
||
title = new JLabel(label);
|
||
title.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 10));
|
||
this.add(title, BorderLayout.CENTER);
|
||
closeButton = new JButton("c");
|
||
closeButton.addActionListener(this);
|
||
this.add(closeButton, BorderLayout.EAST);
|
||
this.setOpaque(false);
|
||
}
|
||
|
||
void setTitle(String newTitle) {
|
||
title.setText(newTitle);
|
||
}
|
||
|
||
@Override
|
||
public void actionPerformed(ActionEvent e) {
|
||
if (e.getSource() == closeButton) {
|
||
parent.closeTab(this);
|
||
}
|
||
}
|
||
}
|
BETa/src/main/java/fr/unicaen/iota/application/client/gui/TextAreaRenderer.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.gui;
|
||
|
||
import java.awt.Component;
|
||
import javax.swing.JTable;
|
||
import javax.swing.JTextArea;
|
||
import javax.swing.table.TableCellRenderer;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class TextAreaRenderer extends JTextArea implements TableCellRenderer {
|
||
|
||
public TextAreaRenderer() {
|
||
this.setOpaque(false);
|
||
}
|
||
|
||
@Override
|
||
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
|
||
String content = value.toString();
|
||
this.setText(content);
|
||
if (isSelected) {
|
||
this.setOpaque(true);
|
||
this.setBackground(table.getSelectionBackground());
|
||
this.setForeground(table.getSelectionForeground());
|
||
int nbLigne = content.split("\\n").length;
|
||
if (nbLigne != 1) {
|
||
table.setRowHeight(row, nbLigne * 17);
|
||
}
|
||
} else {
|
||
this.setOpaque(false);
|
||
this.setForeground(table.getForeground());
|
||
table.setRowHeight(row, 17);
|
||
}
|
||
return this;
|
||
}
|
||
}
|
BETa/src/main/java/fr/unicaen/iota/application/client/listener/EPCEventListener.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.listener;
|
||
|
||
import fr.unicaen.iota.application.model.EPCISEvent;
|
||
import fr.unicaen.iota.application.util.TravelTimeTuple;
|
||
import java.util.EventListener;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public interface EPCEventListener extends EventListener {
|
||
|
||
public void eventReveived(String session, EPCISEvent e);
|
||
|
||
public void travelTimeChanged(String session, TravelTimeTuple ttt);
|
||
|
||
public void usedObjectsChanged(String session, int objects);
|
||
}
|
BETa/src/main/java/fr/unicaen/iota/application/client/listener/EventDispatcher.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.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 javax.swing.event.EventListenerList;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
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 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>());
|
||
travelTime.put(session, new TravelTimeTuple());
|
||
usedObjects.put(session, new ArrayList<String>());
|
||
}
|
||
eventHashtable.get(session).add(e);
|
||
TravelTimeTuple ttt = travelTime.get(session);
|
||
ArrayList<String> nbObjects = usedObjects.get(session);
|
||
processNbObjects(session, e, nbObjects);
|
||
ttt.addEventTimestamp(TimeParser.convert(e.getEventTime()));
|
||
fireEventReiceved(session, e);
|
||
fireTravelTimeChanged(session, ttt);
|
||
}
|
||
|
||
public void addEPCEventListener(EPCEventListener listener) {
|
||
listeners.add(EPCEventListener.class, listener);
|
||
}
|
||
|
||
public void removeTemperatureListener(EPCEventListener listener) {
|
||
listeners.remove(EPCEventListener.class, listener);
|
||
}
|
||
|
||
public EPCEventListener[] getEPCEventListeners() {
|
||
return listeners.getListeners(EPCEventListener.class);
|
||
}
|
||
|
||
protected void fireEventReiceved(String session, EPCISEvent e) {
|
||
for (EPCEventListener listener : getEPCEventListeners()) {
|
||
listener.eventReveived(session, e);
|
||
}
|
||
}
|
||
|
||
private void fireTravelTimeChanged(String session, TravelTimeTuple ttt) {
|
||
for (EPCEventListener listener : getEPCEventListeners()) {
|
||
listener.travelTimeChanged(session, ttt);
|
||
}
|
||
}
|
||
|
||
private void fireUsedObjectsChanged(String session, int objects) {
|
||
for (EPCEventListener listener : getEPCEventListeners()) {
|
||
listener.usedObjectsChanged(session, objects);
|
||
}
|
||
}
|
||
|
||
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;
|
||
}
|
||
}
|
||
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/TimeParser.java | ||
---|---|---|
/*
|
||
* Copyright (C) 2007 ETH Zurich
|
||
*
|
||
* This file is part of Accada (www.accada.org).
|
||
*
|
||
* Accada is free software; you can redistribute it and/or
|
||
* modify it under the terms of the GNU Lesser General Public
|
||
* License version 2.1, as published by the Free Software Foundation.
|
||
*
|
||
* Accada 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
|
||
* Lesser General Public License for more details.
|
||
*
|
||
* You should have received a copy of the GNU Lesser General Public
|
||
* License along with Accada; if not, write to the Free
|
||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
* Boston, MA 02110-1301 USA
|
||
*/
|
||
package fr.unicaen.iota.application.util;
|
||
|
||
import java.sql.Timestamp;
|
||
import java.text.DecimalFormat;
|
||
import java.text.ParseException;
|
||
import java.util.Calendar;
|
||
import java.util.Date;
|
||
import java.util.GregorianCalendar;
|
||
import java.util.TimeZone;
|
||
|
||
/**
|
||
* The <code>TimeParser</code> utility class provides helper methods to deal
|
||
* with date/time formatting using a specific ISO8601-compliant format (see <a
|
||
* href="http://www.w3.org/TR/NOTE-datetime">ISO 8601</a>). <p/> The currently
|
||
* supported format is:
|
||
*
|
||
* <pre>
|
||
* &plusmnYYYY-MM-DDThh:mm:ss[.S]TZD
|
||
* </pre>
|
||
*
|
||
* where:
|
||
*
|
||
* <pre>
|
||
* &plusmnYYYY = four-digit year with optional sign where values <= 0 are
|
||
* denoting years BCE and values > 0 are denoting years CE,
|
||
* e.g. -0001 denotes the year 2 BCE, 0000 denotes the year 1 BCE,
|
||
* 0001 denotes the year 1 CE, and so on...
|
||
* MM = two-digit month (01=January, etc.)
|
||
* DD = two-digit day of month (01 through 31)
|
||
* hh = two digits of hour (00 through 23) (am/pm NOT allowed)
|
||
* mm = two digits of minute (00 through 59)
|
||
* ss = two digits of second (00 through 59)
|
||
* S = optional one or more digits representing a decimal fraction of a second
|
||
* TZD = time zone designator, Z for Zulu (i.e. UTC) or an offset from UTC
|
||
* in the form of +hh:mm or -hh:mm
|
||
* </pre>
|
||
*/
|
||
public final class TimeParser {
|
||
|
||
/**
|
||
* Miscellaneous numeric formats used in formatting.
|
||
*/
|
||
private static final DecimalFormat XX_FORMAT = new DecimalFormat("00");
|
||
private static final DecimalFormat XXX_FORMAT = new DecimalFormat("000");
|
||
private static final DecimalFormat XXXX_FORMAT = new DecimalFormat("0000");
|
||
|
||
/**
|
||
* Empty private constructor to hide default constructor.
|
||
*/
|
||
private TimeParser() {
|
||
}
|
||
|
||
/**
|
||
* Parses an ISO8601-compliant date/time string into a <code>Calendar</code>.
|
||
*
|
||
* @param text
|
||
* The date/time string to be parsed.
|
||
* @return A <code>Calendar</code> representing the date/time.
|
||
* @throws ParseException
|
||
* If the date/time could not be parsed.
|
||
*/
|
||
public static Calendar parseAsCalendar(final String text) throws ParseException {
|
||
return parse(text);
|
||
}
|
||
|
||
/**
|
||
* Parses an ISO8601-compliant date/time string into a <code>Date</code>.
|
||
*
|
||
* @param text
|
||
* The date/time string to be parsed.
|
||
* @return A <code>Date</code> representing the date/time.
|
||
* @throws ParseException
|
||
* If the date/time could not be parsed.
|
||
*/
|
||
public static Date parseAsDate(final String text) throws ParseException {
|
||
return parse(text).getTime();
|
||
}
|
||
|
||
/**
|
||
* Parses an ISO8601-compliant date/time string into a
|
||
* <code>Timestamp</code>.
|
||
*
|
||
* @param text
|
||
* The date/time string to be parsed.
|
||
* @return A <code>Timestamp</code> representing the date/time.
|
||
* @throws ParseException
|
||
* If the date/time could not be parsed.
|
||
*/
|
||
public static Timestamp parseAsTimestamp(final String text) throws ParseException {
|
||
return convert(parse(text));
|
||
}
|
||
|
||
/**
|
||
* Parses an ISO8601-compliant date/time string into a <code>Calendar</code>.
|
||
*
|
||
* @param text
|
||
* The date/time string to be parsed.
|
||
* @return A <code>Calendar</code> representing the date/time.
|
||
* @throws ParseException
|
||
* If the date/time could not be parsed.
|
||
*/
|
||
private static Calendar parse(final String text) throws ParseException {
|
||
try {
|
||
String time = text;
|
||
if (time == null || time.length() == 0) {
|
||
throw new IllegalArgumentException("Date/Time string may not be null or empty.");
|
||
}
|
||
time = time.trim();
|
||
char sign;
|
||
int curPos;
|
||
if (time.startsWith("-")) {
|
||
sign = '-';
|
||
curPos = 1;
|
||
} else if (time.startsWith("+")) {
|
||
sign = '+';
|
||
curPos = 1;
|
||
} else {
|
||
sign = '+'; // no sign specified, implied '+'
|
||
curPos = 0;
|
||
}
|
||
|
||
int year, month, day, hour, min, sec, ms;
|
||
String tzID;
|
||
char delimiter;
|
||
|
||
// parse year
|
||
try {
|
||
year = Integer.parseInt(time.substring(curPos, curPos + 4));
|
||
} catch (NumberFormatException e) {
|
||
throw new ParseException("Year (YYYY) has wrong format: " + e.getMessage(), curPos);
|
||
}
|
||
curPos += 4;
|
||
delimiter = '-';
|
||
if (curPos >= time.length() || time.charAt(curPos) != delimiter) {
|
||
throw new ParseException("expected delimiter '" + delimiter + "' at position " + curPos, curPos);
|
||
}
|
||
curPos++;
|
||
|
||
// parse month
|
||
try {
|
||
month = Integer.parseInt(time.substring(curPos, curPos + 2));
|
||
} catch (NumberFormatException e) {
|
||
throw new ParseException("Month (MM) has wrong format: " + e.getMessage(), curPos);
|
||
}
|
||
curPos += 2;
|
||
delimiter = '-';
|
||
if (curPos >= time.length() || time.charAt(curPos) != delimiter) {
|
||
throw new ParseException("expected delimiter '" + delimiter + "' at position " + curPos, curPos);
|
||
}
|
||
curPos++;
|
||
|
||
// parse day
|
||
try {
|
||
day = Integer.parseInt(time.substring(curPos, curPos + 2));
|
||
} catch (NumberFormatException e) {
|
||
throw new ParseException("Day (DD) has wrong format: " + e.getMessage(), curPos);
|
||
}
|
||
curPos += 2;
|
||
delimiter = 'T';
|
||
if (curPos >= time.length() || time.charAt(curPos) != delimiter) {
|
||
throw new ParseException("expected delimiter '" + delimiter + "' at position " + curPos, curPos);
|
||
}
|
||
curPos++;
|
||
|
||
// parse hours
|
||
try {
|
||
hour = Integer.parseInt(time.substring(curPos, curPos + 2));
|
||
} catch (NumberFormatException e) {
|
||
throw new ParseException("Hour (hh) has wrong format: " + e.getMessage(), curPos);
|
||
}
|
||
curPos += 2;
|
||
delimiter = ':';
|
||
if (curPos >= time.length() || time.charAt(curPos) != delimiter) {
|
||
throw new ParseException("expected delimiter '" + delimiter + "' at position " + curPos, curPos);
|
||
}
|
||
curPos++;
|
||
|
||
// parse minute
|
||
try {
|
||
min = Integer.parseInt(time.substring(curPos, curPos + 2));
|
||
} catch (NumberFormatException e) {
|
||
throw new ParseException("Minute (mm) has wrong format: " + e.getMessage(), curPos);
|
||
}
|
||
curPos += 2;
|
||
delimiter = ':';
|
||
if (curPos >= time.length() || time.charAt(curPos) != delimiter) {
|
||
throw new ParseException("expected delimiter '" + delimiter + "' at position " + curPos, curPos);
|
||
}
|
||
curPos++;
|
||
|
||
// parse second
|
||
try {
|
||
sec = Integer.parseInt(time.substring(curPos, curPos + 2));
|
||
} catch (NumberFormatException e) {
|
||
throw new ParseException("Second (ss) has wrong format: " + e.getMessage(), curPos);
|
||
}
|
||
curPos += 2;
|
||
|
||
// parse millisecond
|
||
delimiter = '.';
|
||
if (curPos < time.length() && time.charAt(curPos) == delimiter) {
|
||
curPos++;
|
||
try {
|
||
// read all digits (number of digits unknown)
|
||
StringBuilder millis = new StringBuilder();
|
||
while (curPos < time.length() && isNumeric(time.charAt(curPos))) {
|
||
millis.append(time.charAt(curPos));
|
||
curPos++;
|
||
}
|
||
// convert to milliseconds (max 3 digits)
|
||
if (millis.length() == 1) {
|
||
ms = 100 * Integer.parseInt(millis.toString());
|
||
} else if (millis.length() == 2) {
|
||
ms = 10 * Integer.parseInt(millis.toString());
|
||
} else if (millis.length() >= 3) {
|
||
ms = Integer.parseInt(millis.substring(0, 3));
|
||
if (millis.length() > 3) {
|
||
// round
|
||
if (Integer.parseInt(String.valueOf(millis.charAt(3))) >= 5) {
|
||
ms++;
|
||
}
|
||
}
|
||
} else {
|
||
ms = 0;
|
||
}
|
||
} catch (NumberFormatException e) {
|
||
throw new ParseException("Millisecond (S) has wrong format: " + e.getMessage(), curPos);
|
||
}
|
||
} else {
|
||
ms = 0;
|
||
}
|
||
|
||
// parse time zone designator (Z or +00:00 or -00:00)
|
||
if (curPos < time.length() && (time.charAt(curPos) == '+' || time.charAt(curPos) == '-')) {
|
||
// offset to UTC specified in the format +00:00/-00:00
|
||
tzID = "GMT" + time.substring(curPos);
|
||
} else if (curPos < time.length() && time.substring(curPos).equals("Z")) {
|
||
tzID = "UTC";
|
||
} else {
|
||
// throw new ParseException("invalid time zone designator",
|
||
// curPos);
|
||
// no time zone designator found, using default 'UTC'
|
||
tzID = "UTC";
|
||
}
|
||
|
||
TimeZone tz = TimeZone.getTimeZone(tzID);
|
||
// verify id of returned time zone (getTimeZone defaults to "UTC")
|
||
if (!tz.getID().equals(tzID)) {
|
||
throw new ParseException("invalid time zone '" + tzID + "'", curPos);
|
||
}
|
||
|
||
// initialize Calendar object
|
||
Calendar cal = GregorianCalendar.getInstance(tz);
|
||
cal.setLenient(false);
|
||
if (sign == '-' || year == 0) {
|
||
// not CE, need to set era (BCE) and adjust year
|
||
cal.set(Calendar.YEAR, year + 1);
|
||
cal.set(Calendar.ERA, GregorianCalendar.BC);
|
||
} else {
|
||
cal.set(Calendar.YEAR, year);
|
||
cal.set(Calendar.ERA, GregorianCalendar.AD);
|
||
}
|
||
cal.set(Calendar.MONTH, month - 1); // month is 0-based
|
||
cal.set(Calendar.DAY_OF_MONTH, day);
|
||
cal.set(Calendar.HOUR_OF_DAY, hour);
|
||
cal.set(Calendar.MINUTE, min);
|
||
cal.set(Calendar.SECOND, sec);
|
||
cal.set(Calendar.MILLISECOND, ms);
|
||
|
||
// the following will trigger an IllegalArgumentException if any of
|
||
// the set values are illegal or out of range
|
||
cal.getTime();
|
||
|
||
return cal;
|
||
} catch (StringIndexOutOfBoundsException e) {
|
||
throw new ParseException("date/time value has invalid format", -1);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Formats a <code>Date</code> value into an ISO8601-compliant date/time
|
||
* string.
|
||
*
|
||
* @param date
|
||
* The time value to be formatted into a date/time string.
|
||
* @return The formatted date/time string.
|
||
*/
|
||
public static String format(final Date date) {
|
||
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
|
||
cal.setTimeInMillis(date.getTime());
|
||
return format(cal);
|
||
}
|
||
|
||
/**
|
||
* Formats a <code>Timestamp</code> value into an ISO8601-compliant
|
||
* date/time string.
|
||
*
|
||
* @param ts
|
||
* The time value to be formatted into a date/time string.
|
||
* @return The formatted date/time string.
|
||
*/
|
||
public static String format(final Timestamp ts) {
|
||
return format(convert(ts));
|
||
}
|
||
|
||
/**
|
||
* Formats a <code>Calendar</code> value into an ISO8601-compliant
|
||
* date/time string.
|
||
*
|
||
* @param cal
|
||
* The time value to be formatted into a date/time string.
|
||
* @return The formatted date/time string.
|
||
*/
|
||
public static String format(final Calendar cal) {
|
||
if (cal == null) {
|
||
throw new IllegalArgumentException("argument can not be null");
|
||
}
|
||
|
||
// determine era and adjust year if necessary
|
||
int year = cal.get(Calendar.YEAR);
|
||
if (cal.isSet(Calendar.ERA) && cal.get(Calendar.ERA) == GregorianCalendar.BC) {
|
||
/**
|
||
* calculate year using astronomical system: year n BCE =>
|
||
* astronomical year -n + 1
|
||
*/
|
||
year = 0 - year + 1;
|
||
}
|
||
|
||
/**
|
||
* the format of the date/time string is: YYYY-MM-DDThh:mm:ss.SSSTZD
|
||
* note that we cannot use java.text.SimpleDateFormat for formatting
|
||
* because it can't handle years <= 0 and TZD's
|
||
*/
|
||
StringBuilder buf = new StringBuilder();
|
||
// year ([-]YYYY)
|
||
buf.append(XXXX_FORMAT.format(year));
|
||
buf.append('-');
|
||
// month (MM)
|
||
buf.append(XX_FORMAT.format(cal.get(Calendar.MONTH) + 1));
|
||
buf.append('-');
|
||
// day (DD)
|
||
buf.append(XX_FORMAT.format(cal.get(Calendar.DAY_OF_MONTH)));
|
||
buf.append('T');
|
||
// hour (hh)
|
||
buf.append(XX_FORMAT.format(cal.get(Calendar.HOUR_OF_DAY)));
|
||
buf.append(':');
|
||
// minute (mm)
|
||
buf.append(XX_FORMAT.format(cal.get(Calendar.MINUTE)));
|
||
buf.append(':');
|
||
// second (ss)
|
||
buf.append(XX_FORMAT.format(cal.get(Calendar.SECOND)));
|
||
buf.append('.');
|
||
// millisecond (SSS)
|
||
buf.append(XXX_FORMAT.format(cal.get(Calendar.MILLISECOND)));
|
||
// time zone designator (Z or +00:00 or -00:00)
|
||
TimeZone tz = cal.getTimeZone();
|
||
// determine offset of timezone from UTC (incl. daylight saving)
|
||
int offset = tz.getOffset(cal.getTimeInMillis());
|
||
if (offset != 0) {
|
||
int hours = Math.abs((offset / (60 * 1000)) / 60);
|
||
int minutes = Math.abs((offset / (60 * 1000)) % 60);
|
||
buf.append(offset < 0 ? '-' : '+');
|
||
buf.append(XX_FORMAT.format(hours));
|
||
buf.append(':');
|
||
buf.append(XX_FORMAT.format(minutes));
|
||
} else {
|
||
buf.append('Z');
|
||
}
|
||
return buf.toString();
|
||
}
|
||
|
||
/**
|
||
* Checks whether the given character is Numeric.
|
||
*
|
||
* @param c
|
||
* The character to check.
|
||
* @return <code>true</code> if the given character is numeric,
|
||
* <code>false</code> otherwise.
|
||
*/
|
||
private static boolean isNumeric(final char c) {
|
||
return (((c >= '0') && (c <= '9')) ? true : false);
|
||
}
|
||
|
||
/**
|
||
* Converts an SQL timestamp value into a Calendar object.
|
||
*
|
||
* @param ts
|
||
* The java.sql.Timestamp to convert.
|
||
* @return The Calendar object representing the given timestamp.
|
||
*/
|
||
public static Calendar convert(final Timestamp ts) {
|
||
Calendar cal = GregorianCalendar.getInstance(TimeZone.getTimeZone("UTC"));
|
||
cal.setTimeInMillis(ts.getTime());
|
||
return cal;
|
||
}
|
||
|
||
/**
|
||
* Converts a Calendar object into an SQL Timestamp value.
|
||
*
|
||
* @param cal
|
||
* The Calendar object to convert.
|
||
* @return The java.sql.Timestamp representing the given Calendar value.
|
||
*/
|
||
public static Timestamp convert(final Calendar cal) {
|
||
return new Timestamp(cal.getTimeInMillis());
|
||
}
|
||
}
|
BETa/src/main/java/fr/unicaen/iota/application/util/TravelTimeTuple.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.sql.Timestamp;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class TravelTimeTuple {
|
||
|
||
private Timestamp older;
|
||
private double travelTime;
|
||
private Timestamp newer;
|
||
|
||
public TravelTimeTuple() {
|
||
travelTime = 0;
|
||
older = null;
|
||
newer = null;
|
||
}
|
||
|
||
public void addEventTimestamp(Timestamp time) {
|
||
if (older == null) {
|
||
older = time;
|
||
return;
|
||
} else if (newer == null) {
|
||
if (older.after(time)) {
|
||
newer = older;
|
||
older = time;
|
||
} else {
|
||
newer = time;
|
||
}
|
||
} else if (time.before(older)) {
|
||
older = time;
|
||
} else if (time.after(newer)) {
|
||
newer = time;
|
||
}
|
||
travelTime = newer.getTime() - older.getTime();
|
||
}
|
||
|
||
/**
|
||
* @return the older
|
||
*/
|
||
public Timestamp getOlder() {
|
||
return older;
|
||
}
|
||
|
||
/**
|
||
* @param older the older to set
|
||
*/
|
||
public void setOlder(Timestamp older) {
|
||
this.older = older;
|
||
}
|
||
|
||
/**
|
||
* @return the travelTime
|
||
*/
|
||
public double getTravelTime() {
|
||
return travelTime;
|
||
}
|
||
|
||
/**
|
||
* @param travelTime the travelTime to set
|
||
*/
|
||
public void setTravelTime(double travelTime) {
|
||
this.travelTime = travelTime;
|
||
}
|
||
|
||
/**
|
||
* @return the newer
|
||
*/
|
||
public Timestamp getNewer() {
|
||
return newer;
|
||
}
|
||
|
||
/**
|
||
* @param newer the newer to set
|
||
*/
|
||
public void setNewer(Timestamp newer) {
|
||
this.newer = newer;
|
||
}
|
||
}
|
BETa/src/main/java/fr/unicaen/iota/application/util/Utils.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.NoSuchAlgorithmException;
|
||
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();
|
||
try {
|
||
sessionID = MD5.MD5_Algo(Long.toString(today.getTime()));
|
||
} catch (NoSuchAlgorithmException e) {
|
||
log.error("Can't generate SessionId", e);
|
||
return null;
|
||
} catch (UnsupportedEncodingException e) {
|
||
log.error("Can't generate SessionId", e);
|
||
return null;
|
||
}
|
||
return sessionID;
|
||
}
|
||
|
||
}
|
BETa/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>.
|
BETa/src/main/resources/application.properties | ||
---|---|---|
soap-service-url = http://localhost:8080/omega/services/IOTA_Service
|
||
rmi-service-url = //localhost:1099/ALfA
|
||
rmi-callback-host = localhost
|
||
rmi-callback-port = 9901
|
BETa/src/main/resources/commons-logging.properties | ||
---|---|---|
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
|
BETa/src/main/resources/java.policy | ||
---|---|---|
grant {
|
||
permission java.awt.AWTPermission "accessClipboard";
|
||
|
||
permission java.io.FilePermission "<<ALL FILES>>", "read";
|
||
|
||
permission java.util.PropertyPermission "*", "read";
|
||
permission java.util.PropertyPermission "java.rmi.server.hostname", "write";
|
||
|
||
permission java.net.SocketPermission "*:*", "connect,resolve";
|
||
permission java.net.SocketPermission "*:*", "accept";
|
||
};
|
BETa/src/main/resources/log4j.properties | ||
---|---|---|
# LOG4J configuration
|
||
|
||
# default logging
|
||
log4j.rootCategory=INFO, CONSOLE, LOGFILE
|
||
|
||
# logging to file
|
||
log4j.appender.LOGFILE=org.apache.log4j.RollingFileAppender
|
||
log4j.appender.LOGFILE.File=beta.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
|
DELTa/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/LISEZMOI | ||
---|---|---|
DELTa - Deep Event Layer Testing Application
|
||
|
||
Application de haut niveau pour vérifier les événements générés et traités.
|
||
|
||
Dépendances:
|
||
modules IoTa:
|
||
- ALfA-PI
|
||
bibliothèques:
|
||
- epcis-commons
|
||
- jfreechart
|
||
- jdom
|
||
- xerces
|
||
|
||
Configuration:
|
||
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
|
||
|
||
Utilisation:
|
||
./delta.sh
|
DELTa/README | ||
---|---|---|
DELTa - Deep Event Layer Testing Application
|
||
|
||
Top-level application to check generated and processed events.
|
||
|
||
Dependencies:
|
||
IoTa modules:
|
||
- ALfA-PI
|
||
libraries:
|
||
- epcis-commons
|
||
- jfreechart
|
||
- jdom
|
||
- xerces
|
||
|
||
Configuration:
|
||
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
|
||
|
||
Usage:
|
||
./delta.sh
|
DELTa/delta.sh | ||
---|---|---|
#!/bin/sh
|
||
|
||
cp="."
|
||
for f in lib/*.jar; do
|
||
cp="${cp}:${f}"
|
||
done
|
||
|
||
java -cp ${cp} fr.unicaen.iota.validator.Main
|
DELTa/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.validator</groupId>
|
||
<artifactId>delta</artifactId>
|
||
<version>1.0</version>
|
||
<packaging>jar</packaging>
|
||
|
||
<name>DELTa</name>
|
||
|
||
<properties>
|
||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||
</properties>
|
||
|
||
<dependencies>
|
||
|
||
<!-- IoTa dependency -->
|
||
<dependency>
|
||
<groupId>fr.unicaen.iota.application</groupId>
|
||
<artifactId>alfa-pi</artifactId>
|
||
<version>1.0</version>
|
||
</dependency>
|
||
|
||
<!-- Fosstrak dependency -->
|
||
<dependency>
|
||
<groupId>org.fosstrak.epcis</groupId>
|
||
<artifactId>epcis-commons</artifactId>
|
||
<version>0.5.0</version>
|
||
</dependency>
|
||
|
||
<!-- Other dependencies -->
|
||
<dependency>
|
||
<groupId>org.jdom</groupId>
|
||
<artifactId>jdom</artifactId>
|
||
<version>1.1.3</version>
|
||
</dependency>
|
||
|
||
<dependency>
|
||
<groupId>org.jfree</groupId>
|
||
<artifactId>jfreechart</artifactId>
|
||
<version>1.0.14</version>
|
||
</dependency>
|
||
|
||
<dependency>
|
||
<groupId>xerces</groupId>
|
||
<artifactId>xercesImpl</artifactId>
|
||
<version>2.10.0</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-jar-plugin</artifactId>
|
||
<version>2.4</version>
|
||
<configuration>
|
||
<archive>
|
||
<manifest>
|
||
<mainClass>fr.unicaen.iota.validator.Main</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>
|
||
|
||
<repositories>
|
||
<repository>
|
||
<id>fosstrak</id>
|
||
<name>Fosstrak repository</name>
|
||
<url>https://oss.sonatype.org/content/repositories/public</url>
|
||
</repository>
|
||
</repositories>
|
||
|
||
</project>
|
DELTa/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>delta.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>
|
DELTa/src/main/java/fr/unicaen/iota/validator/AnalyserResult.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.validator;
|
||
|
||
import fr.unicaen.iota.application.model.DSEvent;
|
||
import fr.unicaen.iota.validator.listener.AnalyserListener;
|
||
import fr.unicaen.iota.validator.model.BaseEvent;
|
||
import fr.unicaen.iota.validator.model.EPC;
|
||
import java.util.HashMap;
|
||
import java.util.List;
|
||
import java.util.Map;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class AnalyserResult extends HashMap<String, ResultRaw> implements AnalyserListener {
|
||
|
||
public AnalyserResult() {
|
||
}
|
||
|
||
@Override
|
||
public void analysedObject() {
|
||
}
|
||
|
||
@Override
|
||
public void errorFound() {
|
||
}
|
||
|
||
public int getErrorCount(String epc) {
|
||
ResultRaw result = this.get(epc);
|
||
return result.getDsEvents().size()
|
||
+ result.getEpcisEvents().size()
|
||
+ result.getDsToDsEvents().size();
|
||
}
|
||
|
||
@Override
|
||
public void logFileAnalysed(Map<String, Integer> epcisResult, Map<String, Integer> dsResult, Map<String, Integer> dsToDsResult) {
|
||
}
|
||
|
||
@Override
|
||
public void publishResults(List<EPC> containerList, Map<EPC, List<BaseEvent>> epcisResults, Map<EPC, List<DSEvent>> dsResults, Map<EPC, List<DSEvent>> dsToDsResults) {
|
||
ResultRaw resultRaw = new ResultRaw(containerList);
|
||
for (EPC container : containerList) {
|
||
if (Configuration.ANALYSE_EPCIS_EVENTS) {
|
||
resultRaw.getEpcisEvents().addAll(epcisResults.get(container));
|
||
}
|
||
if (Configuration.ANALYSE_EPCIS_TO_DS_EVENTS) {
|
||
resultRaw.getDsEvents().addAll(dsResults.get(container));
|
||
}
|
||
if (Configuration.ANALYSE_DS_TO_DS_EVENTS) {
|
||
resultRaw.getDsToDsEvents().addAll(dsToDsResults.get(container));
|
||
}
|
||
this.put(container.getEpc(), resultRaw);
|
||
}
|
||
}
|
||
|
||
public void updateRawForDStoDS(EPC cont, List<DSEvent> dsEvents) {
|
||
ResultRaw resultRaw = this.get(cont.getEpc());
|
||
resultRaw.getDsToDsEvents().clear();
|
||
resultRaw.getDsToDsEvents().addAll(dsEvents);
|
||
}
|
||
|
||
public void updateRawForDStoEPCIS(EPC cont, List<DSEvent> dsEvents) {
|
||
ResultRaw resultRaw = this.get(cont.getEpc());
|
||
resultRaw.getDsEvents().clear();
|
||
resultRaw.getDsEvents().addAll(dsEvents);
|
||
}
|
||
|
||
public void updateRawForEPCIS(EPC cont, List<BaseEvent> epcisEvt) {
|
||
ResultRaw resultRaw = this.get(cont.getEpc());
|
||
resultRaw.getEpcisEvents().clear();
|
||
resultRaw.getEpcisEvents().addAll(epcisEvt);
|
||
}
|
||
}
|
DELTa/src/main/java/fr/unicaen/iota/validator/Configuration.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.validator;
|
||
|
||
import java.io.IOException;
|
||
import java.io.InputStream;
|
||
import java.util.Properties;
|
||
import org.apache.commons.logging.LogFactory;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public final class Configuration {
|
||
|
||
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 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/";
|
||
|
||
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");
|
||
XML_EVENT_FOLDER = PSI_REPOSITORY + "/events/";
|
||
STATS_FOLDER = PSI_REPOSITORY + "/stats/";
|
||
} catch (IOException ex) {
|
||
LogFactory.getLog(Configuration.class).fatal(null, ex);
|
||
}
|
||
}
|
||
|
||
private static Properties loadProperties() throws IOException {
|
||
// create and load default properties
|
||
Properties props = new Properties();
|
||
InputStream in = Configuration.class.getResourceAsStream(PROPERTIES_CONFIG_FILE);
|
||
props.load(in);
|
||
in.close();
|
||
return props;
|
||
}
|
||
}
|
DELTa/src/main/java/fr/unicaen/iota/validator/Controler.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.validator;
|
||
|
||
import fr.unicaen.iota.validator.listener.AnalyserStatus;
|
||
import fr.unicaen.iota.validator.operations.Analyser;
|
||
import fr.unicaen.iota.validator.operations.ThreadManager;
|
||
import java.io.File;
|
||
import java.util.ArrayList;
|
||
import java.util.List;
|
||
import org.apache.commons.logging.Log;
|
||
import org.apache.commons.logging.LogFactory;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class Controler extends Thread implements Runnable {
|
||
|
||
private static final Log log = LogFactory.getLog(Controler.class);
|
||
|
||
private File xmlEventFolder;
|
||
private IOTA iota;
|
||
private AnalyserStatus analyserStatus;
|
||
private boolean proceedAnalyse = true;
|
||
public static List<String> ACTIVE_FILE_LIST = new ArrayList<String>();
|
||
|
||
Controler(File f, IOTA iota) {
|
||
this.xmlEventFolder = f;
|
||
this.iota = iota;
|
||
this.analyserStatus = new AnalyserStatus();
|
||
}
|
||
|
||
@Override
|
||
public void run() {
|
||
log.trace("Initialising Thread manager... ");
|
||
ThreadManager threadManager = new ThreadManager();
|
||
log.trace("Analysing files... ");
|
||
while ((xmlEventFolder = new File(Configuration.XML_EVENT_FOLDER)).list().length > 0) {
|
||
String[] files = getXmlEventFolder().list();
|
||
for (String file : files) {
|
||
if (ACTIVE_FILE_LIST.contains(Configuration.XML_EVENT_FOLDER + "/" + file)) {
|
||
continue;
|
||
}
|
||
ACTIVE_FILE_LIST.add(Configuration.XML_EVENT_FOLDER + "/" + file);
|
||
Analyser analyser = new Analyser(Configuration.XML_EVENT_FOLDER + "/" + file, getIota(), getAnalyserStatus());
|
||
try {
|
||
threadManager.startThread(analyser);
|
||
} catch (InterruptedException ex) {
|
||
log.fatal(null, ex);
|
||
}
|
||
try {
|
||
synchronized (this) {
|
||
while (!proceedAnalyse) {
|
||
wait();
|
||
}
|
||
}
|
||
} catch (InterruptedException ex) {
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
/**
|
||
* @return the xmlEventFolder
|
||
*/
|
||
public File getXmlEventFolder() {
|
||
return xmlEventFolder;
|
||
}
|
||
|
||
/**
|
||
* @param xmlEventFolder the xmlEventFolder to set
|
||
*/
|
||
public void setXmlEventFolder(File xmlEventFolder) {
|
||
this.xmlEventFolder = xmlEventFolder;
|
||
}
|
||
|
||
/**
|
||
* @return the iota
|
||
*/
|
||
public IOTA getIota() {
|
||
return iota;
|
||
}
|
||
|
||
/**
|
||
* @param iota the iota to set
|
||
*/
|
||
public void setIota(IOTA iota) {
|
||
this.iota = iota;
|
||
}
|
||
|
||
/**
|
||
* @return the analyserStatus
|
||
*/
|
||
public AnalyserStatus getAnalyserStatus() {
|
||
return analyserStatus;
|
||
}
|
||
|
||
/**
|
||
* @param analyserStatus the analyserStatus to set
|
||
*/
|
||
public void setAnalyserStatus(AnalyserStatus analyserStatus) {
|
||
this.analyserStatus = analyserStatus;
|
||
}
|
||
|
||
public synchronized void suspendAnalyse() {
|
||
proceedAnalyse = false;
|
||
}
|
||
|
||
public synchronized void resumeAnalyse() {
|
||
proceedAnalyse = true;
|
||
notify();
|
||
}
|
||
}
|
DELTa/src/main/java/fr/unicaen/iota/validator/IOTA.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.validator;
|
||
|
||
import fr.unicaen.iota.validator.model.DSLink;
|
||
import fr.unicaen.iota.validator.model.EPCISLink;
|
||
import fr.unicaen.iota.validator.model.Infrastructure;
|
||
import fr.unicaen.iota.validator.model.Link;
|
||
import java.io.IOException;
|
||
import java.util.ArrayList;
|
||
import java.util.HashMap;
|
||
import java.util.List;
|
||
import org.apache.commons.logging.Log;
|
||
import org.apache.commons.logging.LogFactory;
|
||
import org.apache.xerces.parsers.DOMParser;
|
||
import org.jdom.Element;
|
||
import org.jdom.input.DOMBuilder;
|
||
import org.w3c.dom.Document;
|
||
import org.xml.sax.SAXException;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class IOTA extends HashMap<String, EPCISLink> {
|
||
|
||
private static final Log log = LogFactory.getLog(IOTA.class);
|
||
|
||
public List<Link> getAllLinks() {
|
||
List<Link> res = new ArrayList<Link>();
|
||
for (EPCISLink l : values()) {
|
||
res.add(l);
|
||
if (!res.contains(l.getDSLink())) {
|
||
res.add(l.getDSLink());
|
||
}
|
||
}
|
||
return res;
|
||
}
|
||
|
||
public String toXML() {
|
||
StringBuilder result = new StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
|
||
result.append("<iota>\n");
|
||
for (String key : this.keySet()) {
|
||
result.append(this.get(key).toXML());
|
||
}
|
||
result.append("</iota>\n");
|
||
return result.toString();
|
||
}
|
||
|
||
public synchronized DSLink getDSLink(Infrastructure infra) {
|
||
if (!this.containsKey(infra.getBizLoc())) {
|
||
return null;
|
||
}
|
||
return this.get(infra.getBizLoc()).getDSLink();
|
||
}
|
||
|
||
public void loadFromXML() throws SAXException, IOException {
|
||
DOMParser parser = new DOMParser();
|
||
parser.parse(Configuration.IOTA_XML_SCHEMA);
|
||
Document documentDOM = parser.getDocument();
|
||
DOMBuilder builder = new DOMBuilder();
|
||
org.jdom.Document documentJDOM = builder.build(documentDOM);
|
||
log.trace("Parsing file " + Configuration.IOTA_XML_SCHEMA + " ... ");
|
||
List<DSLink> witnessList = new ArrayList<DSLink>();
|
||
for (Object obj : documentJDOM.getRootElement().getChildren("epcis")) {
|
||
Element elem = (Element) obj;
|
||
String key = elem.getChild("infrastructure").getChild("bizLoc").getValue();
|
||
DSLink value = new DSLink(elem.getChild("dsLink").getChild("serviceAddress").getValue(),
|
||
elem.getChild("dsLink").getChild("wildCardAccount").getChild("login").getValue(),
|
||
elem.getChild("dsLink").getChild("wildCardAccount").getChild("password").getValue(),
|
||
Boolean.parseBoolean(elem.getChild("dsLink").getAttribute("activeAnalyse").getValue()));
|
||
int index;
|
||
if ((index = witnessList.indexOf(value)) != -1) {
|
||
value = witnessList.get(index);
|
||
} else {
|
||
witnessList.add(value);
|
||
}
|
||
EPCISLink epcisLink = new EPCISLink(elem.getChild("infrastructure").getChild("serviceAddress").getValue(),
|
||
key, value, Boolean.parseBoolean(elem.getAttribute("activeAnalyse").getValue()));
|
||
this.put(key, epcisLink);
|
||
}
|
||
}
|
||
}
|
DELTa/src/main/java/fr/unicaen/iota/validator/Main.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.validator;
|
||
|
||
import fr.unicaen.iota.validator.gui.GUI;
|
||
import java.io.File;
|
||
import java.io.IOException;
|
||
import javax.swing.UIManager;
|
||
import org.apache.commons.logging.Log;
|
||
import org.apache.commons.logging.LogFactory;
|
||
import org.xml.sax.SAXException;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class Main {
|
||
|
||
private static final Log log = LogFactory.getLog(Main.class);
|
||
|
||
/**
|
||
* @param args the command line arguments
|
||
*/
|
||
public static void main(String[] args) {
|
||
String policyFile = Main.class.getClassLoader().getResource("java.policy").toString();
|
||
System.setProperty("java.security.policy", policyFile);
|
||
File f = new File(Configuration.XML_EVENT_FOLDER);
|
||
if (!f.exists()) {
|
||
log.fatal(Configuration.XML_EVENT_FOLDER + " does not exist!");
|
||
System.exit(-1);
|
||
}
|
||
if (!f.isDirectory()) {
|
||
log.fatal(Configuration.XML_EVENT_FOLDER + " is not a folder!");
|
||
System.exit(-1);
|
||
}
|
||
IOTA iota = new IOTA();
|
||
try {
|
||
iota.loadFromXML();
|
||
} catch (SAXException ex) {
|
||
log.fatal(null, ex);
|
||
} catch (IOException ex) {
|
||
log.fatal(null, ex);
|
||
}
|
||
try {
|
||
UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
|
||
} catch (Exception e) {
|
||
log.error(null, e);
|
||
}
|
||
AnalyserResult analyserResult = new AnalyserResult();
|
||
Controler controler = new Controler(f, iota);
|
||
GUI gui = new GUI(controler, iota);
|
||
controler.getAnalyserStatus().addListener(gui);
|
||
controler.getAnalyserStatus().addListener(analyserResult);
|
||
gui.setResults(analyserResult);
|
||
gui.setVisible(true);
|
||
}
|
||
}
|
DELTa/src/main/java/fr/unicaen/iota/validator/ResultRaw.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.validator;
|
||
|
||
import fr.unicaen.iota.application.model.DSEvent;
|
||
import fr.unicaen.iota.validator.model.BaseEvent;
|
||
import fr.unicaen.iota.validator.model.EPC;
|
||
import java.util.ArrayList;
|
||
import java.util.List;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class ResultRaw {
|
||
|
||
private List<BaseEvent> epcisEvents;
|
||
private List<DSEvent> dsEvents;
|
||
private List<DSEvent> dsToDsEvents;
|
||
private List<EPC> containerList;
|
||
|
||
public ResultRaw(List<EPC> containerList) {
|
||
epcisEvents = new ArrayList<BaseEvent>();
|
||
dsEvents = new ArrayList<DSEvent>();
|
||
dsToDsEvents = new ArrayList<DSEvent>();
|
||
this.containerList = containerList;
|
||
}
|
||
|
||
public List<EPC> getContainerList() {
|
||
return containerList;
|
||
}
|
||
|
||
/**
|
||
* @return the epcisEvents
|
||
*/
|
||
public List<BaseEvent> getEpcisEvents() {
|
||
return epcisEvents;
|
||
}
|
||
|
||
/**
|
||
* @param epcisEvents the epcisEvents to set
|
||
*/
|
||
public void setEpcisEvents(List<BaseEvent> epcisEvents) {
|
||
this.epcisEvents = epcisEvents;
|
||
}
|
||
|
||
/**
|
||
* @return the dsEvents
|
||
*/
|
||
public List<DSEvent> getDsEvents() {
|
||
return dsEvents;
|
||
}
|
||
|
||
/**
|
||
* @param dsEvents the dsEvents to set
|
||
*/
|
||
public void setDsEvents(List<DSEvent> dsEvents) {
|
||
this.dsEvents = dsEvents;
|
||
}
|
||
|
||
/**
|
||
* @return the dsToDsEvents
|
||
*/
|
||
public List<DSEvent> getDsToDsEvents() {
|
||
return dsToDsEvents;
|
||
}
|
||
|
||
/**
|
||
* @param dsToDsEvents the dsToDsEvents to set
|
||
*/
|
||
public void setDsToDsEvents(List<DSEvent> dsToDsEvents) {
|
||
this.dsToDsEvents = dsToDsEvents;
|
||
}
|
||
|
||
/**
|
||
* @return the containerList
|
||
*/
|
||
public EPC getContainer(String epc) {
|
||
for (EPC container : containerList) {
|
||
if (container.getEpc().equals(epc)) {
|
||
return container;
|
||
}
|
||
}
|
||
return null;
|
||
}
|
||
|
||
/**
|
||
* @param containerList the containerList to set
|
||
*/
|
||
public void setContainerList(List<EPC> containerList) {
|
||
this.containerList = containerList;
|
||
}
|
||
}
|
DELTa/src/main/java/fr/unicaen/iota/validator/gui/AnalyseTreeNode.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.validator.gui;
|
||
|
||
import java.awt.Component;
|
||
import java.io.File;
|
||
import java.text.ParseException;
|
||
import java.text.SimpleDateFormat;
|
||
import java.util.Date;
|
||
import java.util.Locale;
|
||
import javax.swing.Icon;
|
||
import javax.swing.ImageIcon;
|
||
import javax.swing.JLabel;
|
||
import javax.swing.tree.DefaultMutableTreeNode;
|
||
import org.apache.commons.logging.Log;
|
||
import org.apache.commons.logging.LogFactory;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class AnalyseTreeNode extends DefaultMutableTreeNode implements Comparable {
|
||
|
||
private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM d hh:mm:ss z yyyy", Locale.US);
|
||
private File userFile;
|
||
private Icon icon;
|
||
private Component component;
|
||
private int type;
|
||
private static final Log log = LogFactory.getLog(AnalyseTreeNode.class);
|
||
// TODO: @SLS enum?
|
||
public static final int NODE_TYPE = 0;
|
||
public static final int LEAF_TYPE = 1;
|
||
|
||
public AnalyseTreeNode(String userObject, File userFile, ImageIcon icon, int type) {
|
||
super(userObject);
|
||
this.userFile = userFile;
|
||
this.icon = icon;
|
||
JLabel label = new JLabel(userObject);
|
||
label.setIcon(icon);
|
||
this.component = label;
|
||
this.type = type;
|
||
}
|
||
|
||
public File getFile() {
|
||
return userFile;
|
||
}
|
||
|
||
@Override
|
||
public int compareTo(Object o) {
|
||
if (!(o instanceof AnalyseTreeNode)) {
|
||
return -1;
|
||
}
|
||
try {
|
||
Date d1 = simpleDateFormat.parse(userFile.getName());
|
||
Date d2 = simpleDateFormat.parse(((AnalyseTreeNode) o).getFile().getName());
|
||
return d1.compareTo(d2);
|
||
} catch (ParseException ex) {
|
||
log.error(null, ex);
|
||
return -1;
|
||
}
|
||
}
|
||
|
||
/**
|
||
* @return the icon
|
||
*/
|
||
public Icon getIcon() {
|
||
return icon;
|
||
}
|
||
|
||
public Component getComponent() {
|
||
return component;
|
||
}
|
||
|
||
/**
|
||
* @return the type
|
||
*/
|
||
public int getType() {
|
||
return type;
|
||
}
|
||
}
|
DELTa/src/main/java/fr/unicaen/iota/validator/gui/CellDetailsEditor.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.validator.gui;
|
||
|
||
import fr.unicaen.iota.validator.IOTA;
|
||
import java.awt.Component;
|
||
import java.awt.event.ActionEvent;
|
||
import java.awt.event.ActionListener;
|
||
import javax.swing.AbstractCellEditor;
|
||
import javax.swing.ImageIcon;
|
||
import javax.swing.JFrame;
|
||
import javax.swing.JTable;
|
||
import javax.swing.table.TableCellEditor;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class CellDetailsEditor extends AbstractCellEditor
|
||
implements TableCellEditor, ActionListener {
|
||
|
||
private JFrame parent;
|
||
private IOTA iota;
|
||
|
||
public CellDetailsEditor(JFrame f, IOTA iota) {
|
||
this.parent = f;
|
||
this.iota = iota;
|
||
}
|
||
|
||
@Override
|
||
public void actionPerformed(ActionEvent e) {
|
||
DetailsButton button = (DetailsButton) e.getSource();
|
||
DetailsDialog detailsDialog = new DetailsDialog(parent, true, button.getEpc(), button.getRaw(), iota);
|
||
detailsDialog.setVisible(true);
|
||
}
|
||
|
||
//Implement the one CellEditor method that AbstractCellEditor doesn't.
|
||
@Override
|
||
public Object getCellEditorValue() {
|
||
return null;
|
||
}
|
||
|
||
//Implement the one method defined by TableCellEditor.
|
||
@Override
|
||
public Component getTableCellEditorComponent(JTable table, Object value,
|
||
boolean isSelected, int row, int column) {
|
||
DetailsButton button = new DetailsButton(Integer.parseInt((String) (table.getValueAt(row, 0))),
|
||
(String) table.getValueAt(row, 1));
|
||
button.setIcon(new ImageIcon("resources/pics/play.png"));
|
||
button.addActionListener(this);
|
||
button.setBorderPainted(false);
|
||
return button;
|
||
}
|
||
}
|
DELTa/src/main/java/fr/unicaen/iota/validator/gui/ChartDialog.form | ||
---|---|---|
<?xml version="1.0" encoding="UTF-8" ?>
|
||
|
||
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||
<Properties>
|
||
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||
</Properties>
|
||
<SyntheticProperties>
|
||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||
</SyntheticProperties>
|
||
<AuxValues>
|
||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,57,0,0,1,127"/>
|
||
</AuxValues>
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
|
||
<SubComponents>
|
||
<Container class="javax.swing.JPanel" name="jPanel3">
|
||
<Properties>
|
||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
|
||
<EmptyBorder/>
|
||
</Border>
|
||
</Property>
|
||
</Properties>
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||
<BorderConstraints direction="Center"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
|
||
<SubComponents>
|
||
<Container class="javax.swing.JPanel" name="jPanel1">
|
||
<Properties>
|
||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
||
<TitledBorder title="Chart type :"/>
|
||
</Border>
|
||
</Property>
|
||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||
<Dimension value="[400, 60]"/>
|
||
</Property>
|
||
</Properties>
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||
<BorderConstraints direction="First"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
|
||
<SubComponents>
|
||
<Component class="javax.swing.JLabel" name="jLabel1">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value=" Select a chart Type : "/>
|
||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
|
||
<EmptyBorder bottom="5" left="1" right="1" top="1"/>
|
||
</Border>
|
||
</Property>
|
||
</Properties>
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||
<BorderConstraints direction="Before"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
</Component>
|
||
</SubComponents>
|
||
</Container>
|
||
<Container class="javax.swing.JPanel" name="jPanel2">
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||
<BorderConstraints direction="Last"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
|
||
<SubComponents>
|
||
<Component class="javax.swing.JButton" name="jButton2">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="Cancel"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
<Component class="javax.swing.JButton" name="jButton1">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="Ok"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
</SubComponents>
|
||
</Container>
|
||
</SubComponents>
|
||
</Container>
|
||
</SubComponents>
|
||
</Form>
|
DELTa/src/main/java/fr/unicaen/iota/validator/gui/ChartDialog.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.validator.gui;
|
||
|
||
import java.awt.BorderLayout;
|
||
import java.awt.Component;
|
||
import java.awt.FlowLayout;
|
||
import java.awt.event.ActionEvent;
|
||
import java.awt.event.ActionListener;
|
||
import java.awt.event.ItemEvent;
|
||
import java.awt.event.ItemListener;
|
||
import java.util.HashMap;
|
||
import java.util.List;
|
||
import javax.swing.*;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class ChartDialog extends JDialog implements ActionListener {
|
||
|
||
public static final int YES_OPTION = 0;
|
||
public static final int CANCEL_OPTION = 1;
|
||
private int responseCode = ChartDialog.CANCEL_OPTION;
|
||
private JComboBox jComboBox;
|
||
private int width = 420;
|
||
private int xyHight = 200;
|
||
private int bawHight = 200;
|
||
private Component configPanel = null;
|
||
private List<String> values;
|
||
private ChartType chartType = ChartType.XY_CHART;
|
||
|
||
/** Creates new form ChartDialog */
|
||
public ChartDialog(java.awt.Frame parent, boolean modal, List<String> values) {
|
||
super(parent, modal);
|
||
initComponents();
|
||
this.values = values;
|
||
initChartTypes();
|
||
this.setTitle("Chart configuration");
|
||
this.setSize(width, xyHight);
|
||
}
|
||
|
||
/** This method is called from within the constructor to
|
||
* initialize the form.
|
||
* WARNING: Do NOT modify this code. The content of this method is
|
||
* always regenerated by the Form Editor.
|
||
*/
|
||
@SuppressWarnings("unchecked")
|
||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||
private void initComponents() {
|
||
|
||
jPanel3 = new javax.swing.JPanel();
|
||
jPanel1 = new javax.swing.JPanel();
|
||
jLabel1 = new javax.swing.JLabel();
|
||
jPanel2 = new javax.swing.JPanel();
|
||
jButton2 = new javax.swing.JButton();
|
||
jButton1 = new javax.swing.JButton();
|
||
|
||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||
|
||
jPanel3.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
|
||
jPanel3.setLayout(new java.awt.BorderLayout());
|
||
|
||
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Chart type:"));
|
||
jPanel1.setPreferredSize(new java.awt.Dimension(400, 60));
|
||
jPanel1.setLayout(new java.awt.BorderLayout());
|
||
|
||
jLabel1.setText(" Select a chart Type: ");
|
||
jLabel1.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 5, 1));
|
||
jPanel1.add(jLabel1, java.awt.BorderLayout.LINE_START);
|
||
|
||
jPanel3.add(jPanel1, java.awt.BorderLayout.PAGE_START);
|
||
|
||
jButton2.setText("Cancel");
|
||
jButton2.addActionListener(new java.awt.event.ActionListener() {
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jButton2ActionPerformed(evt);
|
||
}
|
||
});
|
||
jPanel2.add(jButton2);
|
||
|
||
jButton1.setText("Ok");
|
||
jButton1.addActionListener(new java.awt.event.ActionListener() {
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jButton1ActionPerformed(evt);
|
||
}
|
||
});
|
||
jPanel2.add(jButton1);
|
||
|
||
jPanel3.add(jPanel2, java.awt.BorderLayout.PAGE_END);
|
||
|
||
getContentPane().add(jPanel3, java.awt.BorderLayout.CENTER);
|
||
|
||
pack();
|
||
}// </editor-fold>//GEN-END:initComponents
|
||
|
||
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
|
||
this.responseCode = ChartDialog.YES_OPTION;
|
||
dispose();
|
||
}//GEN-LAST:event_jButton1ActionPerformed
|
||
|
||
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
|
||
this.responseCode = ChartDialog.CANCEL_OPTION;
|
||
dispose();
|
||
}//GEN-LAST:event_jButton2ActionPerformed
|
||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||
private javax.swing.JButton jButton1;
|
||
private javax.swing.JButton jButton2;
|
||
private javax.swing.JLabel jLabel1;
|
||
private javax.swing.JPanel jPanel1;
|
||
private javax.swing.JPanel jPanel2;
|
||
private javax.swing.JPanel jPanel3;
|
||
// End of variables declaration//GEN-END:variables
|
||
|
||
/**
|
||
* @return the responseCode
|
||
*/
|
||
public int getResponseCode() {
|
||
return responseCode;
|
||
}
|
||
|
||
private void initChartTypes() {
|
||
jComboBox = new JComboBox(new String[]{"XY chart", "Bar Chart", "Box and Whisker"});
|
||
jComboBox.addActionListener(this);
|
||
jComboBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 5, 5));
|
||
jPanel1.add(jComboBox, BorderLayout.CENTER);
|
||
configPanel = new XYChartPanel(this, values.size());
|
||
jPanel3.add(configPanel, BorderLayout.CENTER);
|
||
}
|
||
|
||
@Override
|
||
public void actionPerformed(ActionEvent e) {
|
||
if (e.getSource().equals(jComboBox)) {
|
||
jPanel3.remove(configPanel);
|
||
switch (((JComboBox) (e.getSource())).getSelectedIndex()) {
|
||
case 0:
|
||
configPanel = new XYChartPanel(this, values.size());
|
||
jPanel3.add(configPanel, BorderLayout.CENTER);
|
||
this.setSize(width, xyHight);
|
||
chartType = ChartType.XY_CHART;
|
||
break;
|
||
case 1:
|
||
configPanel = new BarChartPanel(this);
|
||
jPanel3.add(configPanel, BorderLayout.CENTER);
|
||
this.setSize(width, bawHight);
|
||
chartType = ChartType.BAR_CHART;
|
||
break;
|
||
case 2:
|
||
this.setSize(width, bawHight);
|
||
chartType = ChartType.BOX_AND_WISKER;
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
jPanel3.updateUI();
|
||
|
||
}
|
||
}
|
||
|
||
/**
|
||
* @return the chartType
|
||
*/
|
||
public ChartType getChartType() {
|
||
return chartType;
|
||
}
|
||
|
||
public int getXYThreshold() {
|
||
if (!(configPanel instanceof XYChartPanel)) {
|
||
return -1;
|
||
}
|
||
return ((XYChartPanel) configPanel).getValue();
|
||
}
|
||
|
||
public String getXYParam() {
|
||
if (!(configPanel instanceof XYChartPanel)) {
|
||
return null;
|
||
}
|
||
return ((XYChartPanel) configPanel).getParam();
|
||
}
|
||
|
||
public String getIntervals() {
|
||
if (!(configPanel instanceof BarChartPanel)) {
|
||
return null;
|
||
}
|
||
return ((BarChartPanel) configPanel).getValue();
|
||
}
|
||
|
||
class XYChartPanel extends JPanel implements ActionListener, ItemListener {
|
||
|
||
private JRadioButton rb1;
|
||
private JRadioButton rb2;
|
||
private JComboBox jComboBox1;
|
||
private JPanel confPanel;
|
||
private HashMap<String, JPanel> typePans = new HashMap<String, JPanel>();
|
||
private JPanel linearPanel;
|
||
private JPanel adaptivePanel;
|
||
private JDialog parent;
|
||
private JSpinner threshold;
|
||
private JSpinner nbPoints;
|
||
|
||
public String getParam() {
|
||
return (String) (jComboBox1.getSelectedItem());
|
||
}
|
||
|
||
public int getValue() {
|
||
return (Integer) ("linear".equals(jComboBox1.getSelectedItem()) ? nbPoints.getValue() : threshold.getValue());
|
||
}
|
||
|
||
public XYChartPanel(JDialog parent, int nbPoints) {
|
||
this.setBorder(javax.swing.BorderFactory.createTitledBorder("Chart configuration:"));
|
||
this.parent = parent;
|
||
this.setLayout(new BorderLayout());
|
||
rb1 = new JRadioButton(": print all points");
|
||
rb1.setSelected(true);
|
||
rb2 = new JRadioButton(": custom points ");
|
||
ButtonGroup group = new ButtonGroup();
|
||
group.add(rb1);
|
||
group.add(rb2);
|
||
rb1.addActionListener(this);
|
||
rb2.addActionListener(this);
|
||
JPanel pan = new JPanel();
|
||
pan.setLayout(new FlowLayout());
|
||
pan.add(rb1);
|
||
pan.add(rb2);
|
||
jComboBox1 = new JComboBox(new String[]{"linear", "adaptive"});
|
||
jComboBox1.setEnabled(false);
|
||
jComboBox1.addItemListener(this);
|
||
pan.add(jComboBox1);
|
||
|
||
SpinnerModel model = new SpinnerNumberModel(nbPoints, 1, nbPoints, 1);
|
||
this.nbPoints = new JSpinner(model);
|
||
this.nbPoints.setSize(50, 20);
|
||
JLabel label1 = new JLabel("number of points: ");
|
||
linearPanel = new JPanel(new FlowLayout());
|
||
linearPanel.add(label1);
|
||
linearPanel.add(this.nbPoints);
|
||
confPanel = new JPanel(new BorderLayout());
|
||
confPanel.add(linearPanel, BorderLayout.CENTER);
|
||
this.add(pan, BorderLayout.NORTH);
|
||
|
||
adaptivePanel = new JPanel(new FlowLayout());
|
||
SpinnerModel model2 = new SpinnerNumberModel(1, 0, 1000, 1);
|
||
threshold = new JSpinner(model2);
|
||
threshold.setSize(50, 20);
|
||
JLabel label2 = new JLabel("Threshold (ms): ");
|
||
adaptivePanel.add(label2);
|
||
adaptivePanel.add(threshold);
|
||
typePans.put("linear", linearPanel);
|
||
typePans.put("adaptive", adaptivePanel);
|
||
}
|
||
JComponent chk = rb1;
|
||
|
||
@Override
|
||
public void actionPerformed(ActionEvent e) {
|
||
if (e.getSource() == rb1) {
|
||
if (chk == rb1) {
|
||
return;
|
||
}
|
||
jComboBox1.setEnabled(false);
|
||
this.remove(confPanel);
|
||
parent.setSize(parent.getWidth(), parent.getHeight() - 32);
|
||
this.updateUI();
|
||
chk = rb1;
|
||
} else if (e.getSource() == rb2) {
|
||
if (chk == rb2) {
|
||
return;
|
||
}
|
||
jComboBox1.setEnabled(true);
|
||
this.add(confPanel, BorderLayout.CENTER);
|
||
parent.setSize(parent.getWidth(), parent.getHeight() + 32);
|
||
this.updateUI();
|
||
chk = rb2;
|
||
}
|
||
}
|
||
|
||
String currentItem = "linear";
|
||
|
||
@Override
|
||
public void itemStateChanged(ItemEvent e) {
|
||
if (e.getSource() == jComboBox1) {
|
||
if (e.getItem().equals(currentItem)) {
|
||
return;
|
||
}
|
||
currentItem = (String) e.getItem();
|
||
confPanel.removeAll();
|
||
confPanel.add(typePans.get(currentItem), BorderLayout.CENTER);
|
||
confPanel.updateUI();
|
||
}
|
||
}
|
||
}
|
||
|
||
class BarChartPanel extends JPanel {
|
||
|
||
private JDialog parent;
|
||
private JTextField intervals;
|
||
|
||
public String getValue() {
|
||
return intervals.getText();
|
||
}
|
||
|
||
public BarChartPanel(JDialog parent) {
|
||
this.setBorder(javax.swing.BorderFactory.createTitledBorder("Chart configuration:"));
|
||
this.parent = parent;
|
||
this.setLayout(new BorderLayout());
|
||
JPanel panel = new JPanel(new BorderLayout());
|
||
panel.add(new JLabel("intervals: "), BorderLayout.WEST);
|
||
intervals = new JTextField();
|
||
panel.add(intervals, BorderLayout.CENTER);
|
||
panel.add(new JLabel("*"), BorderLayout.EAST);
|
||
panel.add(new JLabel("*: values separated with \",\""), BorderLayout.SOUTH);
|
||
this.add(panel);
|
||
}
|
||
}
|
||
}
|
DELTa/src/main/java/fr/unicaen/iota/validator/gui/ChartType.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.validator.gui;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public enum ChartType {
|
||
|
||
XY_CHART,
|
||
BAR_CHART,
|
||
BOX_AND_WISKER
|
||
}
|
DELTa/src/main/java/fr/unicaen/iota/validator/gui/ContextualMenu.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.validator.gui;
|
||
|
||
import java.awt.event.ActionEvent;
|
||
import java.awt.event.ActionListener;
|
||
import java.io.File;
|
||
import javax.swing.JMenuItem;
|
||
import javax.swing.JOptionPane;
|
||
import javax.swing.JPopupMenu;
|
||
import javax.swing.JTree;
|
||
import javax.swing.tree.DefaultMutableTreeNode;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class ContextualMenu extends JPopupMenu implements ActionListener {
|
||
|
||
private JMenuItem itemSpr;
|
||
private File file;
|
||
private JTree parent;
|
||
private DefaultMutableTreeNode node;
|
||
|
||
public ContextualMenu(File f, JTree parent, DefaultMutableTreeNode node) {
|
||
super();
|
||
this.file = f;
|
||
this.node = node;
|
||
this.parent = parent;
|
||
itemSpr = new JMenuItem("supprimer");
|
||
itemSpr.addActionListener(this);
|
||
this.add(itemSpr);
|
||
}
|
||
|
||
private boolean deleteDir(File dir) {
|
||
if (dir.isDirectory()) {
|
||
String[] children = dir.list();
|
||
for (int i = 0; i < children.length; i++) {
|
||
boolean success = deleteDir(new File(dir, children[i]));
|
||
if (!success) {
|
||
return false;
|
||
}
|
||
}
|
||
}
|
||
|
||
// The directory is now empty so delete it
|
||
return dir.delete();
|
||
}
|
||
|
||
@Override
|
||
public void actionPerformed(ActionEvent e) {
|
||
if (e.getSource() == itemSpr) {
|
||
if (JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(parent, "Are you sure you want to delete the file \"" + file.getName() + "\"?")) {
|
||
if (!file.isDirectory()) {
|
||
file.delete();
|
||
} else {
|
||
if (JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(parent, "You are trying to delete a directory, all files under this directory will be deleted to.\nDo you wan't to continue?")) {
|
||
deleteDir(file);
|
||
} else {
|
||
return;
|
||
}
|
||
}
|
||
node.removeFromParent();
|
||
parent.updateUI();
|
||
}
|
||
}
|
||
}
|
||
}
|
DELTa/src/main/java/fr/unicaen/iota/validator/gui/DetailsButton.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.validator.gui;
|
||
|
||
import javax.swing.JButton;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class DetailsButton extends JButton {
|
||
|
||
private int rawId;
|
||
private String epc;
|
||
|
||
public DetailsButton(int rowId, String epc) {
|
||
this.rawId = rowId;
|
||
this.epc = epc;
|
||
}
|
||
|
||
/**
|
||
* @return the raw
|
||
*/
|
||
public int getRaw() {
|
||
return rawId;
|
||
}
|
||
|
||
/**
|
||
* @param raw the raw to set
|
||
*/
|
||
public void setRaw(int raw) {
|
||
this.rawId = raw;
|
||
}
|
||
|
||
/**
|
||
* @return the epc
|
||
*/
|
||
public String getEpc() {
|
||
return epc;
|
||
}
|
||
|
||
/**
|
||
* @param epc the epc to set
|
||
*/
|
||
public void setEpc(String epc) {
|
||
this.epc = epc;
|
||
}
|
||
}
|
DELTa/src/main/java/fr/unicaen/iota/validator/gui/DetailsCellRenderer.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.validator.gui;
|
||
|
||
import java.awt.Component;
|
||
import java.awt.Cursor;
|
||
import javax.swing.ImageIcon;
|
||
import javax.swing.JButton;
|
||
import javax.swing.JTable;
|
||
import javax.swing.table.TableCellRenderer;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class DetailsCellRenderer extends JButton implements TableCellRenderer {
|
||
|
||
public DetailsCellRenderer(String iconPath) {
|
||
setIcon(new ImageIcon(iconPath));
|
||
setBorderPainted(false);
|
||
setCursor(new Cursor(Cursor.HAND_CURSOR));
|
||
}
|
||
|
||
@Override
|
||
public Component getTableCellRendererComponent(JTable table, Object color,
|
||
boolean isSelected, boolean hasFocus, int row, int column) {
|
||
return this;
|
||
}
|
||
}
|
DELTa/src/main/java/fr/unicaen/iota/validator/gui/DetailsDialog.form | ||
---|---|---|
<?xml version="1.0" encoding="UTF-8" ?>
|
||
|
||
<Form version="1.2" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||
<Properties>
|
||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||
<Color blue="e7" green="eb" red="ef" type="rgb"/>
|
||
</Property>
|
||
</Properties>
|
||
<SyntheticProperties>
|
||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||
</SyntheticProperties>
|
||
<Events>
|
||
<EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="closeDialog"/>
|
||
</Events>
|
||
<AuxValues>
|
||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-25,0,0,2,-90"/>
|
||
</AuxValues>
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
|
||
<SubComponents>
|
||
<Container class="javax.swing.JPanel" name="jPanel1">
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||
<BorderConstraints direction="North"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout>
|
||
<DimensionLayout dim="0">
|
||
<Group type="103" groupAlignment="0" attributes="0">
|
||
<Component id="jPanel4" alignment="1" max="32767" attributes="0"/>
|
||
</Group>
|
||
</DimensionLayout>
|
||
<DimensionLayout dim="1">
|
||
<Group type="103" groupAlignment="0" attributes="0">
|
||
<Group type="102" alignment="0" attributes="0">
|
||
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
|
||
<Component id="jPanel4" min="-2" max="-2" attributes="0"/>
|
||
<EmptySpace pref="14" max="32767" attributes="0"/>
|
||
</Group>
|
||
</Group>
|
||
</DimensionLayout>
|
||
</Layout>
|
||
<SubComponents>
|
||
<Container class="javax.swing.JPanel" name="jPanel4">
|
||
<Properties>
|
||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
||
<TitledBorder title="Results of the analyse "/>
|
||
</Border>
|
||
</Property>
|
||
</Properties>
|
||
|
||
<Layout>
|
||
<DimensionLayout dim="0">
|
||
<Group type="103" groupAlignment="0" attributes="0">
|
||
<Group type="102" alignment="0" attributes="0">
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
<Group type="103" groupAlignment="0" attributes="0">
|
||
<Group type="102" alignment="0" attributes="0">
|
||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
|
||
</Group>
|
||
<Group type="102" alignment="0" attributes="0">
|
||
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
|
||
<EmptySpace pref="353" max="32767" attributes="0"/>
|
||
<Component id="jButton6" min="-2" max="-2" attributes="0"/>
|
||
</Group>
|
||
</Group>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
</Group>
|
||
</Group>
|
||
</DimensionLayout>
|
||
<DimensionLayout dim="1">
|
||
<Group type="103" groupAlignment="0" attributes="0">
|
||
<Group type="102" alignment="0" attributes="0">
|
||
<Group type="103" groupAlignment="3" attributes="0">
|
||
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
</Group>
|
||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||
<Group type="103" groupAlignment="3" attributes="0">
|
||
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
<Component id="jButton6" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
</Group>
|
||
<EmptySpace max="32767" attributes="0"/>
|
||
</Group>
|
||
</Group>
|
||
</DimensionLayout>
|
||
</Layout>
|
||
<SubComponents>
|
||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="Electronic Product Code :"/>
|
||
</Properties>
|
||
</Component>
|
||
<Component class="javax.swing.JLabel" name="jLabel3">
|
||
<Properties>
|
||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||
<Color blue="ff" green="0" red="3" type="rgb"/>
|
||
</Property>
|
||
<Property name="text" type="java.lang.String" value="urn:epc:id:sgtin:x.y.id"/>
|
||
</Properties>
|
||
</Component>
|
||
<Component class="javax.swing.JLabel" name="jLabel4">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="missing events :"/>
|
||
</Properties>
|
||
</Component>
|
||
<Component class="javax.swing.JLabel" name="jLabel5">
|
||
<Properties>
|
||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||
<Color blue="3" green="0" red="ff" type="rgb"/>
|
||
</Property>
|
||
<Property name="text" type="java.lang.String" value="0"/>
|
||
</Properties>
|
||
</Component>
|
||
<Component class="javax.swing.JButton" name="jButton6">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="Actualize analysis"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton6ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
</SubComponents>
|
||
</Container>
|
||
</SubComponents>
|
||
</Container>
|
||
<Container class="javax.swing.JPanel" name="jPanel2">
|
||
<Properties>
|
||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||
<Dimension value="[678, 56]"/>
|
||
</Property>
|
||
</Properties>
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||
<BorderConstraints direction="South"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout>
|
||
<DimensionLayout dim="0">
|
||
<Group type="103" groupAlignment="0" attributes="0">
|
||
<Group type="102" attributes="0">
|
||
<EmptySpace min="-2" pref="40" max="-2" attributes="0"/>
|
||
<Component id="jLabel6" min="-2" pref="13" max="-2" attributes="0"/>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
|
||
<EmptySpace min="-2" pref="63" max="-2" attributes="0"/>
|
||
<Component id="jLabel8" min="-2" pref="13" max="-2" attributes="0"/>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
<Component id="jLabel9" min="-2" max="-2" attributes="0"/>
|
||
<EmptySpace max="32767" attributes="0"/>
|
||
<Component id="jButton5" min="-2" max="-2" attributes="0"/>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
</Group>
|
||
</Group>
|
||
</DimensionLayout>
|
||
<DimensionLayout dim="1">
|
||
<Group type="103" groupAlignment="0" attributes="0">
|
||
<Group type="102" alignment="1" attributes="0">
|
||
<EmptySpace pref="19" max="32767" attributes="0"/>
|
||
<Group type="103" groupAlignment="3" attributes="0">
|
||
<Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
<Component id="jButton5" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
<Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
<Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
</Group>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
</Group>
|
||
</Group>
|
||
</DimensionLayout>
|
||
</Layout>
|
||
<SubComponents>
|
||
<Component class="javax.swing.JLabel" name="jLabel6">
|
||
<Properties>
|
||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||
<Color blue="a" green="a5" red="0" type="rgb"/>
|
||
</Property>
|
||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||
<Font name="DejaVu Sans" size="10" style="0"/>
|
||
</Property>
|
||
<Property name="text" type="java.lang.String" value=" "/>
|
||
<Property name="opaque" type="boolean" value="true"/>
|
||
</Properties>
|
||
</Component>
|
||
<Component class="javax.swing.JLabel" name="jLabel7">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="events found"/>
|
||
</Properties>
|
||
</Component>
|
||
<Component class="javax.swing.JLabel" name="jLabel8">
|
||
<Properties>
|
||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||
<Color blue="3" green="0" red="ff" type="rgb"/>
|
||
</Property>
|
||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||
<Font name="DejaVu Sans" size="10" style="0"/>
|
||
</Property>
|
||
<Property name="text" type="java.lang.String" value=" "/>
|
||
<Property name="opaque" type="boolean" value="true"/>
|
||
</Properties>
|
||
</Component>
|
||
<Component class="javax.swing.JLabel" name="jLabel9">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="missing events"/>
|
||
</Properties>
|
||
</Component>
|
||
<Component class="javax.swing.JButton" name="jButton5">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="Start new complete evaluation"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton5ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
<Component class="javax.swing.JButton" name="jButton1">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="Close"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
</SubComponents>
|
||
</Container>
|
||
<Container class="javax.swing.JPanel" name="jPanel3">
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||
<BorderConstraints direction="Center"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout>
|
||
<DimensionLayout dim="0">
|
||
<Group type="103" groupAlignment="0" attributes="0">
|
||
<Component id="jTabbedPane1" alignment="1" max="32767" attributes="0"/>
|
||
</Group>
|
||
</DimensionLayout>
|
||
<DimensionLayout dim="1">
|
||
<Group type="103" groupAlignment="0" attributes="0">
|
||
<Component id="jTabbedPane1" alignment="0" max="32767" attributes="0"/>
|
||
</Group>
|
||
</DimensionLayout>
|
||
</Layout>
|
||
<SubComponents>
|
||
<Container class="javax.swing.JTabbedPane" name="jTabbedPane1">
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
|
||
<SubComponents>
|
||
<Container class="javax.swing.JPanel" name="jPanel5">
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
||
<JTabbedPaneConstraints tabName="EPCIS events ">
|
||
<Property name="tabTitle" type="java.lang.String" value="EPCIS events "/>
|
||
</JTabbedPaneConstraints>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout>
|
||
<DimensionLayout dim="0">
|
||
<Group type="103" groupAlignment="0" attributes="0">
|
||
<Group type="102" alignment="1" attributes="0">
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
<Group type="103" groupAlignment="1" attributes="0">
|
||
<Component id="jScrollPane1" alignment="0" pref="649" max="32767" attributes="0"/>
|
||
<Group type="102" alignment="1" attributes="0">
|
||
<Component id="jButton9" min="-2" max="-2" attributes="0"/>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
<Component id="jButton2" min="-2" max="-2" attributes="0"/>
|
||
</Group>
|
||
</Group>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
</Group>
|
||
</Group>
|
||
</DimensionLayout>
|
||
<DimensionLayout dim="1">
|
||
<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"/>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
<Group type="103" groupAlignment="3" attributes="0">
|
||
<Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
<Component id="jButton9" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
</Group>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
</Group>
|
||
</Group>
|
||
</DimensionLayout>
|
||
</Layout>
|
||
<SubComponents>
|
||
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||
<SubComponents>
|
||
<Component class="javax.swing.JTable" name="jTable1">
|
||
<Properties>
|
||
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
|
||
<Table columnCount="4" rowCount="4">
|
||
<Column editable="true" title="Title 1" type="java.lang.Object"/>
|
||
<Column editable="true" title="Title 2" type="java.lang.Object"/>
|
||
<Column editable="true" title="Title 3" type="java.lang.Object"/>
|
||
<Column editable="true" title="Title 4" type="java.lang.Object"/>
|
||
</Table>
|
||
</Property>
|
||
</Properties>
|
||
</Component>
|
||
</SubComponents>
|
||
</Container>
|
||
<Component class="javax.swing.JButton" name="jButton2">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="Start new EPCIS evaluation"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
<Component class="javax.swing.JButton" name="jButton9">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="clear"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton9ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
</SubComponents>
|
||
</Container>
|
||
<Container class="javax.swing.JPanel" name="jPanel6">
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
||
<JTabbedPaneConstraints tabName="DS events indexing EPCIS ">
|
||
<Property name="tabTitle" type="java.lang.String" value="DS events indexing EPCIS "/>
|
||
</JTabbedPaneConstraints>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout>
|
||
<DimensionLayout dim="0">
|
||
<Group type="103" groupAlignment="0" attributes="0">
|
||
<Group type="102" alignment="0" attributes="0">
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
<Group type="103" groupAlignment="0" attributes="0">
|
||
<Component id="jScrollPane2" alignment="0" pref="649" max="32767" attributes="0"/>
|
||
<Group type="102" alignment="1" attributes="0">
|
||
<Component id="jButton8" min="-2" max="-2" attributes="0"/>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
<Component id="jButton3" min="-2" max="-2" attributes="0"/>
|
||
</Group>
|
||
</Group>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
</Group>
|
||
</Group>
|
||
</DimensionLayout>
|
||
<DimensionLayout dim="1">
|
||
<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"/>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
<Group type="103" groupAlignment="3" attributes="0">
|
||
<Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
<Component id="jButton8" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
</Group>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
</Group>
|
||
</Group>
|
||
</DimensionLayout>
|
||
</Layout>
|
||
<SubComponents>
|
||
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||
<SubComponents>
|
||
<Component class="javax.swing.JTable" name="jTable2">
|
||
<Properties>
|
||
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
|
||
<Table columnCount="4" rowCount="4">
|
||
<Column editable="true" title="Title 1" type="java.lang.Object"/>
|
||
<Column editable="true" title="Title 2" type="java.lang.Object"/>
|
||
<Column editable="true" title="Title 3" type="java.lang.Object"/>
|
||
<Column editable="true" title="Title 4" type="java.lang.Object"/>
|
||
</Table>
|
||
</Property>
|
||
</Properties>
|
||
</Component>
|
||
</SubComponents>
|
||
</Container>
|
||
<Component class="javax.swing.JButton" name="jButton3">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="Start new DS to EPCIS evaluation"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
<Component class="javax.swing.JButton" name="jButton8">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="clear"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton8ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
</SubComponents>
|
||
</Container>
|
||
<Container class="javax.swing.JPanel" name="jPanel7">
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
||
<JTabbedPaneConstraints tabName="DS events indexing DS ">
|
||
<Property name="tabTitle" type="java.lang.String" value="DS events indexing DS "/>
|
||
</JTabbedPaneConstraints>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout>
|
||
<DimensionLayout dim="0">
|
||
<Group type="103" groupAlignment="0" attributes="0">
|
||
<Group type="102" alignment="1" attributes="0">
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
<Group type="103" groupAlignment="1" attributes="0">
|
||
<Component id="jScrollPane3" alignment="0" pref="649" max="32767" attributes="0"/>
|
||
<Group type="102" alignment="1" attributes="0">
|
||
<Component id="jButton7" min="-2" max="-2" attributes="0"/>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
<Component id="jButton4" min="-2" max="-2" attributes="0"/>
|
||
</Group>
|
||
</Group>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
</Group>
|
||
</Group>
|
||
</DimensionLayout>
|
||
<DimensionLayout dim="1">
|
||
<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"/>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
<Group type="103" groupAlignment="3" attributes="0">
|
||
<Component id="jButton4" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
<Component id="jButton7" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
</Group>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
</Group>
|
||
</Group>
|
||
</DimensionLayout>
|
||
</Layout>
|
||
<SubComponents>
|
||
<Component class="javax.swing.JButton" name="jButton4">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="Start new DS to DS evaluation"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton4ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
<Container class="javax.swing.JScrollPane" name="jScrollPane3">
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||
<SubComponents>
|
||
<Component class="javax.swing.JTable" name="jTable3">
|
||
<Properties>
|
||
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
|
||
<Table columnCount="4" rowCount="4">
|
||
<Column editable="true" title="Title 1" type="java.lang.Object"/>
|
||
<Column editable="true" title="Title 2" type="java.lang.Object"/>
|
||
<Column editable="true" title="Title 3" type="java.lang.Object"/>
|
||
<Column editable="true" title="Title 4" type="java.lang.Object"/>
|
||
</Table>
|
||
</Property>
|
||
</Properties>
|
||
</Component>
|
||
</SubComponents>
|
||
</Container>
|
||
<Component class="javax.swing.JButton" name="jButton7">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="clear"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton7ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
</SubComponents>
|
||
</Container>
|
||
</SubComponents>
|
||
</Container>
|
||
</SubComponents>
|
||
</Container>
|
||
</SubComponents>
|
||
</Form>
|
DELTa/src/main/java/fr/unicaen/iota/validator/gui/DetailsDialog.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.validator.gui;
|
||
|
||
import fr.unicaen.iota.application.model.DSEvent;
|
||
import fr.unicaen.iota.application.rmi.AccessInterface;
|
||
import fr.unicaen.iota.validator.AnalyserResult;
|
||
import fr.unicaen.iota.validator.Configuration;
|
||
import fr.unicaen.iota.validator.IOTA;
|
||
import fr.unicaen.iota.validator.ResultRaw;
|
||
import fr.unicaen.iota.validator.model.AggregationEvent;
|
||
import fr.unicaen.iota.validator.model.BaseEvent;
|
||
import fr.unicaen.iota.validator.model.EPC;
|
||
import fr.unicaen.iota.validator.model.ObjectEvent;
|
||
import fr.unicaen.iota.validator.operations.DSEntryComparator;
|
||
import fr.unicaen.iota.validator.operations.EPCISEntryComparator;
|
||
import java.net.MalformedURLException;
|
||
import java.rmi.Naming;
|
||
import java.rmi.NotBoundException;
|
||
import java.rmi.RemoteException;
|
||
import java.util.ArrayList;
|
||
import java.util.List;
|
||
import java.util.Map;
|
||
import javax.swing.JDialog;
|
||
import javax.swing.table.DefaultTableModel;
|
||
import javax.swing.table.TableColumn;
|
||
import org.apache.commons.logging.Log;
|
||
import org.apache.commons.logging.LogFactory;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class DetailsDialog extends JDialog {
|
||
|
||
private static final Log log = LogFactory.getLog(DetailsDialog.class);
|
||
private EPC container;
|
||
private GUI gui;
|
||
private boolean showEPCISResults = Configuration.ANALYSE_EPCIS_EVENTS;
|
||
private boolean showDStoEPCISResults = Configuration.ANALYSE_EPCIS_TO_DS_EVENTS;
|
||
private boolean showDStoDSResults = Configuration.ANALYSE_DS_TO_DS_EVENTS;
|
||
private int rowId;
|
||
private IOTA iota;
|
||
|
||
/**
|
||
* Creates new form DetailsDialog1
|
||
*/
|
||
public DetailsDialog(java.awt.Frame parent, boolean modal, String epc, int rowId, IOTA iota) {
|
||
super(parent, modal);
|
||
this.setTitle("Details of the corresponding object");
|
||
initComponents();
|
||
this.gui = (GUI) parent;
|
||
this.iota = iota;
|
||
this.rowId = rowId;
|
||
this.container = gui.getAnalyserResult().get(epc).getContainer(epc);
|
||
jLabel3.setText(container.getEpc());
|
||
jLabel5.setText(Integer.toString(gui.getAnalyserResult().getErrorCount(epc)));
|
||
createTables();
|
||
this.setLocationRelativeTo(parent);
|
||
try {
|
||
createReport(gui.getAnalyserResult());
|
||
} catch (Exception ex) {
|
||
log.error(null, ex);
|
||
}
|
||
}
|
||
|
||
private void createReport(AnalyserResult analyserResult) throws Exception {
|
||
ResultRaw resultRaw = analyserResult.get(container.getEpc());
|
||
if (showEPCISResults) {
|
||
((DefaultTableModel) (jTable1.getModel())).getDataVector().clear();
|
||
int i = 0;
|
||
List<BaseEvent> eventNotFound = resultRaw.getEpcisEvents();
|
||
for (BaseEvent baseEvent : container.getEventList()) {
|
||
i++;
|
||
DefaultTableModel model = (DefaultTableModel) (jTable1.getModel());
|
||
if (baseEvent instanceof ObjectEvent) {
|
||
ObjectEvent objectEvent = (ObjectEvent) baseEvent;
|
||
model.addRow(new String[]{i + "", objectEvent.getBizStep(), objectEvent.getDisposition(), objectEvent.getReadPoint(), objectEvent.getAction().name(), "x", eventNotFound.contains(baseEvent) ? "MISSING" : "FOUND"});
|
||
}
|
||
if (baseEvent instanceof AggregationEvent) {
|
||
AggregationEvent aggregationEvent = (AggregationEvent) baseEvent;
|
||
model.addRow(new String[]{i + "", aggregationEvent.getBizStep(), aggregationEvent.getDisposition(), aggregationEvent.getReadPoint(), aggregationEvent.getAction().name(), aggregationEvent.getParentId(), eventNotFound.contains(baseEvent) ? "MISSING" : "FOUND"});
|
||
}
|
||
}
|
||
}
|
||
if (showDStoEPCISResults) {
|
||
((DefaultTableModel) (jTable2.getModel())).getDataVector().clear();
|
||
int i = 0;
|
||
List<DSEvent> eventNotFound = resultRaw.getDsEvents();
|
||
for (DSEvent dsEvent : container.getDsToEPCISReferentList(resultRaw.getContainerList())) {
|
||
i++;
|
||
DefaultTableModel model = (DefaultTableModel) (jTable2.getModel());
|
||
model.addRow(new String[]{i + "", dsEvent.getBizStep(), dsEvent.getReferenceAddress(), eventNotFound.contains(dsEvent) ? "MISSING" : "FOUND"});
|
||
}
|
||
}
|
||
if (showDStoDSResults) {
|
||
((DefaultTableModel) (jTable3.getModel())).getDataVector().clear();
|
||
int i = 0;
|
||
List<DSEvent> eventNotFound = resultRaw.getDsToDsEvents();
|
||
for (DSEvent dsEvent : container.getDsToDsReferentList()) {
|
||
i++;
|
||
DefaultTableModel model = (DefaultTableModel) (jTable3.getModel());
|
||
model.addRow(new String[]{i + "", dsEvent.getBizStep(), dsEvent.getReferenceAddress(), eventNotFound.contains(dsEvent) ? "MISSING" : "FOUND"});
|
||
}
|
||
}
|
||
}
|
||
|
||
private void createTables() {
|
||
jTable1.setModel(new javax.swing.table.DefaultTableModel(
|
||
new Object[][]{},
|
||
new String[]{
|
||
"ID", "BIZ-STEP", "DISPOSITION", "READ-POINT", "ACTION", "PARENT-ID", "REPORT"}));
|
||
jTable1.getColumnModel().getColumn(0).setCellRenderer(new EPCISEventCellRenderer());
|
||
jTable1.getColumnModel().getColumn(1).setCellRenderer(new EPCISEventCellRenderer());
|
||
jTable1.getColumnModel().getColumn(2).setCellRenderer(new EPCISEventCellRenderer());
|
||
jTable1.getColumnModel().getColumn(3).setCellRenderer(new EPCISEventCellRenderer());
|
||
jTable1.getColumnModel().getColumn(4).setCellRenderer(new EPCISEventCellRenderer());
|
||
jTable1.getColumnModel().getColumn(5).setCellRenderer(new EPCISEventCellRenderer());
|
||
jTable1.getColumnModel().getColumn(6).setCellRenderer(new EPCISEventCellRenderer());
|
||
|
||
jTable2.setModel(new javax.swing.table.DefaultTableModel(
|
||
new Object[][]{},
|
||
new String[]{
|
||
"ID", "BIZ-STEP", "REFERENCE-ADDRESS", "REPORT"}));
|
||
jTable2.getColumnModel().getColumn(0).setCellRenderer(new DsEventCellRenderer());
|
||
jTable2.getColumnModel().getColumn(1).setCellRenderer(new DsEventCellRenderer());
|
||
jTable2.getColumnModel().getColumn(2).setCellRenderer(new DsEventCellRenderer());
|
||
jTable2.getColumnModel().getColumn(3).setCellRenderer(new DsEventCellRenderer());
|
||
|
||
jTable3.setModel(new javax.swing.table.DefaultTableModel(
|
||
new Object[][]{},
|
||
new String[]{
|
||
"ID", "BIZ-STEP", "REFERENCE-ADDRESS", "REPORT"}));
|
||
jTable3.getColumnModel().getColumn(0).setCellRenderer(new DsEventCellRenderer());
|
||
jTable3.getColumnModel().getColumn(1).setCellRenderer(new DsEventCellRenderer());
|
||
jTable3.getColumnModel().getColumn(2).setCellRenderer(new DsEventCellRenderer());
|
||
jTable3.getColumnModel().getColumn(3).setCellRenderer(new DsEventCellRenderer());
|
||
|
||
TableColumn column1 = jTable1.getColumnModel().getColumn(0);
|
||
column1.setPreferredWidth(30);
|
||
column1.setMaxWidth(30);
|
||
|
||
TableColumn column2 = jTable2.getColumnModel().getColumn(0);
|
||
column2.setPreferredWidth(30);
|
||
column2.setMaxWidth(30);
|
||
|
||
TableColumn column3 = jTable3.getColumnModel().getColumn(0);
|
||
column3.setPreferredWidth(30);
|
||
column3.setMaxWidth(30);
|
||
|
||
|
||
TableColumn column4 = jTable1.getColumnModel().getColumn(6);
|
||
column4.setPreferredWidth(70);
|
||
column4.setMaxWidth(70);
|
||
|
||
TableColumn column5 = jTable2.getColumnModel().getColumn(3);
|
||
column5.setPreferredWidth(70);
|
||
column5.setMaxWidth(70);
|
||
|
||
TableColumn column6 = jTable3.getColumnModel().getColumn(3);
|
||
column6.setPreferredWidth(70);
|
||
column6.setMaxWidth(70);
|
||
|
||
TableColumn column7 = jTable3.getColumnModel().getColumn(1);
|
||
column7.setPreferredWidth(100);
|
||
column7.setMaxWidth(400);
|
||
|
||
TableColumn column8 = jTable2.getColumnModel().getColumn(1);
|
||
column8.setPreferredWidth(130);
|
||
column8.setMaxWidth(400);
|
||
}
|
||
|
||
/**
|
||
* This method is called from within the constructor to initialize the form.
|
||
* WARNING: Do NOT modify this code. The content of this method is always
|
||
* regenerated by the Form Editor.
|
||
*/
|
||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||
private void initComponents() {
|
||
|
||
jPanel1 = new javax.swing.JPanel();
|
||
jPanel4 = new javax.swing.JPanel();
|
||
jLabel2 = new javax.swing.JLabel();
|
||
jLabel3 = new javax.swing.JLabel();
|
||
jLabel4 = new javax.swing.JLabel();
|
||
jLabel5 = new javax.swing.JLabel();
|
||
jButton6 = new javax.swing.JButton();
|
||
jPanel2 = new javax.swing.JPanel();
|
||
jLabel6 = new javax.swing.JLabel();
|
||
jLabel7 = new javax.swing.JLabel();
|
||
jLabel8 = new javax.swing.JLabel();
|
||
jLabel9 = new javax.swing.JLabel();
|
||
jButton5 = new javax.swing.JButton();
|
||
jButton1 = new javax.swing.JButton();
|
||
jPanel3 = new javax.swing.JPanel();
|
||
jTabbedPane1 = new javax.swing.JTabbedPane();
|
||
jPanel5 = new javax.swing.JPanel();
|
||
jScrollPane1 = new javax.swing.JScrollPane();
|
||
jTable1 = new javax.swing.JTable();
|
||
jButton2 = new javax.swing.JButton();
|
||
jButton9 = new javax.swing.JButton();
|
||
jPanel6 = new javax.swing.JPanel();
|
||
jScrollPane2 = new javax.swing.JScrollPane();
|
||
jTable2 = new javax.swing.JTable();
|
||
jButton3 = new javax.swing.JButton();
|
||
jButton8 = new javax.swing.JButton();
|
||
jPanel7 = new javax.swing.JPanel();
|
||
jButton4 = new javax.swing.JButton();
|
||
jScrollPane3 = new javax.swing.JScrollPane();
|
||
jTable3 = new javax.swing.JTable();
|
||
jButton7 = new javax.swing.JButton();
|
||
|
||
setBackground(new java.awt.Color(239, 235, 231));
|
||
addWindowListener(new java.awt.event.WindowAdapter() {
|
||
public void windowClosing(java.awt.event.WindowEvent evt) {
|
||
closeDialog(evt);
|
||
}
|
||
});
|
||
|
||
jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Results of the analyse "));
|
||
|
||
jLabel2.setText("Electronic Product Code:");
|
||
|
||
jLabel3.setForeground(new java.awt.Color(3, 0, 255));
|
||
jLabel3.setText("urn:epc:id:sgtin:x.y.id");
|
||
|
||
jLabel4.setText("missing events:");
|
||
|
||
jLabel5.setForeground(new java.awt.Color(255, 0, 3));
|
||
jLabel5.setText("0");
|
||
|
||
jButton6.setText("Actualize analysis");
|
||
jButton6.addActionListener(new java.awt.event.ActionListener() {
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jButton6ActionPerformed(evt);
|
||
}
|
||
});
|
||
|
||
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
|
||
jPanel4.setLayout(jPanel4Layout);
|
||
jPanel4Layout.setHorizontalGroup(
|
||
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||
.addGroup(jPanel4Layout.createSequentialGroup()
|
||
.addContainerGap()
|
||
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||
.addGroup(jPanel4Layout.createSequentialGroup()
|
||
.addComponent(jLabel2)
|
||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||
.addComponent(jLabel3))
|
||
.addGroup(jPanel4Layout.createSequentialGroup()
|
||
.addComponent(jLabel4)
|
||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||
.addComponent(jLabel5)
|
||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 399, Short.MAX_VALUE)
|
||
.addComponent(jButton6)))
|
||
.addContainerGap())
|
||
);
|
||
jPanel4Layout.setVerticalGroup(
|
||
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||
.addGroup(jPanel4Layout.createSequentialGroup()
|
||
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||
.addComponent(jLabel2)
|
||
.addComponent(jLabel3))
|
||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||
.addComponent(jLabel4)
|
||
.addComponent(jLabel5)
|
||
.addComponent(jButton6))
|
||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||
);
|
||
|
||
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
||
jPanel1.setLayout(jPanel1Layout);
|
||
jPanel1Layout.setHorizontalGroup(
|
||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||
.addComponent(jPanel4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||
);
|
||
jPanel1Layout.setVerticalGroup(
|
||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||
.addGap(5, 5, 5)
|
||
.addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||
.addContainerGap(14, Short.MAX_VALUE))
|
||
);
|
||
|
||
add(jPanel1, java.awt.BorderLayout.NORTH);
|
||
|
||
jPanel2.setPreferredSize(new java.awt.Dimension(678, 56));
|
||
|
||
jLabel6.setBackground(new java.awt.Color(0, 165, 10));
|
||
jLabel6.setFont(new java.awt.Font("DejaVu Sans", 0, 10)); // NOI18N
|
||
jLabel6.setText(" ");
|
||
jLabel6.setOpaque(true);
|
||
|
||
jLabel7.setText("events found");
|
||
|
||
jLabel8.setBackground(new java.awt.Color(255, 0, 3));
|
||
jLabel8.setFont(new java.awt.Font("DejaVu Sans", 0, 10)); // NOI18N
|
||
jLabel8.setText(" ");
|
||
jLabel8.setOpaque(true);
|
||
|
||
jLabel9.setText("missing events");
|
||
|
||
jButton5.setText("Start new complete evaluation");
|
||
jButton5.addActionListener(new java.awt.event.ActionListener() {
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jButton5ActionPerformed(evt);
|
||
}
|
||
});
|
||
|
||
jButton1.setText("Close");
|
||
jButton1.addActionListener(new java.awt.event.ActionListener() {
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jButton1ActionPerformed(evt);
|
||
}
|
||
});
|
||
|
||
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
|
||
jPanel2.setLayout(jPanel2Layout);
|
||
jPanel2Layout.setHorizontalGroup(
|
||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||
.addGap(40, 40, 40)
|
||
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 13, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||
.addComponent(jLabel7)
|
||
.addGap(63, 63, 63)
|
||
.addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 13, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||
.addComponent(jLabel9)
|
||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 86, Short.MAX_VALUE)
|
||
.addComponent(jButton5)
|
||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||
.addComponent(jButton1)
|
||
.addContainerGap())
|
||
);
|
||
jPanel2Layout.setVerticalGroup(
|
||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
|
||
.addContainerGap(15, Short.MAX_VALUE)
|
||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||
.addComponent(jButton1)
|
||
.addComponent(jButton5)
|
||
.addComponent(jLabel6)
|
||
.addComponent(jLabel7)
|
||
.addComponent(jLabel9)
|
||
.addComponent(jLabel8))
|
||
.addContainerGap())
|
||
);
|
||
|
||
add(jPanel2, java.awt.BorderLayout.SOUTH);
|
||
|
||
jTable1.setModel(new javax.swing.table.DefaultTableModel(
|
||
new Object [][] {
|
||
{null, null, null, null},
|
||
{null, null, null, null},
|
||
{null, null, null, null},
|
||
{null, null, null, null}
|
||
},
|
||
new String [] {
|
||
"Title 1", "Title 2", "Title 3", "Title 4"
|
||
}
|
||
));
|
||
jScrollPane1.setViewportView(jTable1);
|
||
|
||
jButton2.setText("Start new EPCIS evaluation");
|
||
jButton2.addActionListener(new java.awt.event.ActionListener() {
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jButton2ActionPerformed(evt);
|
||
}
|
||
});
|
||
|
||
jButton9.setText("clear");
|
||
jButton9.addActionListener(new java.awt.event.ActionListener() {
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jButton9ActionPerformed(evt);
|
||
}
|
||
});
|
||
|
||
javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
|
||
jPanel5.setLayout(jPanel5Layout);
|
||
jPanel5Layout.setHorizontalGroup(
|
||
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
|
||
.addContainerGap()
|
||
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 646, Short.MAX_VALUE)
|
||
.addGroup(jPanel5Layout.createSequentialGroup()
|
||
.addComponent(jButton9)
|
||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||
.addComponent(jButton2)))
|
||
.addContainerGap())
|
||
);
|
||
jPanel5Layout.setVerticalGroup(
|
||
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
|
||
.addContainerGap()
|
||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 219, Short.MAX_VALUE)
|
||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||
.addComponent(jButton2)
|
||
.addComponent(jButton9))
|
||
.addContainerGap())
|
||
);
|
||
|
||
jTabbedPane1.addTab("EPCIS events ", jPanel5);
|
||
|
||
jTable2.setModel(new javax.swing.table.DefaultTableModel(
|
||
new Object [][] {
|
||
{null, null, null, null},
|
||
{null, null, null, null},
|
||
{null, null, null, null},
|
||
{null, null, null, null}
|
||
},
|
||
new String [] {
|
||
"Title 1", "Title 2", "Title 3", "Title 4"
|
||
}
|
||
));
|
||
jScrollPane2.setViewportView(jTable2);
|
||
|
||
jButton3.setText("Start new DS to EPCIS evaluation");
|
||
jButton3.addActionListener(new java.awt.event.ActionListener() {
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jButton3ActionPerformed(evt);
|
||
}
|
||
});
|
||
|
||
jButton8.setText("clear");
|
||
jButton8.addActionListener(new java.awt.event.ActionListener() {
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jButton8ActionPerformed(evt);
|
||
}
|
||
});
|
||
|
||
javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
|
||
jPanel6.setLayout(jPanel6Layout);
|
||
jPanel6Layout.setHorizontalGroup(
|
||
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||
.addGroup(jPanel6Layout.createSequentialGroup()
|
||
.addContainerGap()
|
||
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 646, Short.MAX_VALUE)
|
||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
|
||
.addComponent(jButton8)
|
||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||
.addComponent(jButton3)))
|
||
.addContainerGap())
|
||
);
|
||
jPanel6Layout.setVerticalGroup(
|
||
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
|
||
.addContainerGap()
|
||
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 219, Short.MAX_VALUE)
|
||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||
.addComponent(jButton3)
|
||
.addComponent(jButton8))
|
||
.addContainerGap())
|
||
);
|
||
|
||
jTabbedPane1.addTab("DS events indexing EPCIS ", jPanel6);
|
||
|
||
jButton4.setText("Start new DS to DS evaluation");
|
||
jButton4.addActionListener(new java.awt.event.ActionListener() {
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jButton4ActionPerformed(evt);
|
||
}
|
||
});
|
||
|
||
jTable3.setModel(new javax.swing.table.DefaultTableModel(
|
||
new Object [][] {
|
||
{null, null, null, null},
|
||
{null, null, null, null},
|
||
{null, null, null, null},
|
||
{null, null, null, null}
|
||
},
|
||
new String [] {
|
||
"Title 1", "Title 2", "Title 3", "Title 4"
|
||
}
|
||
));
|
||
jScrollPane3.setViewportView(jTable3);
|
||
|
||
jButton7.setText("clear");
|
||
jButton7.addActionListener(new java.awt.event.ActionListener() {
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jButton7ActionPerformed(evt);
|
||
}
|
||
});
|
||
|
||
javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
|
||
jPanel7.setLayout(jPanel7Layout);
|
||
jPanel7Layout.setHorizontalGroup(
|
||
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
|
||
.addContainerGap()
|
||
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||
.addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 646, Short.MAX_VALUE)
|
||
.addGroup(jPanel7Layout.createSequentialGroup()
|
||
.addComponent(jButton7)
|
||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||
.addComponent(jButton4)))
|
||
.addContainerGap())
|
||
);
|
||
jPanel7Layout.setVerticalGroup(
|
||
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
|
||
.addContainerGap()
|
||
.addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 219, Short.MAX_VALUE)
|
||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||
.addComponent(jButton4)
|
||
.addComponent(jButton7))
|
||
.addContainerGap())
|
||
);
|
||
|
||
jTabbedPane1.addTab("DS events indexing DS ", jPanel7);
|
||
|
||
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
|
||
jPanel3.setLayout(jPanel3Layout);
|
||
jPanel3Layout.setHorizontalGroup(
|
||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||
.addComponent(jTabbedPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 678, Short.MAX_VALUE)
|
||
);
|
||
jPanel3Layout.setVerticalGroup(
|
||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||
.addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 315, Short.MAX_VALUE)
|
||
);
|
||
|
||
add(jPanel3, java.awt.BorderLayout.CENTER);
|
||
|
||
pack();
|
||
}// </editor-fold>//GEN-END:initComponents
|
||
|
||
/**
|
||
* Closes the dialog
|
||
*/
|
||
private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
|
||
setVisible(false);
|
||
dispose();
|
||
}//GEN-LAST:event_closeDialog
|
||
|
||
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
|
||
closeDialog(null);
|
||
}//GEN-LAST:event_jButton1ActionPerformed
|
||
|
||
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);
|
||
List<EPC> list = new ArrayList<EPC>();
|
||
list.add(container);
|
||
Map<EPC, List<BaseEvent>> result = epcisComparator.getEventNotVerified(list);
|
||
AnalyserResult analyserResult = gui.getAnalyserResult();
|
||
|
||
int lastResult = analyserResult.get(container.getEpc()).getDsToDsEvents().size();
|
||
int newResult = 0;
|
||
|
||
for (EPC cont : result.keySet()) {
|
||
analyserResult.updateRawForEPCIS(cont, result.get(cont));
|
||
newResult += result.get(cont).size();
|
||
}
|
||
showEPCISResults = true;
|
||
createReport(analyserResult);
|
||
|
||
jLabel5.setText((Integer.parseInt(jLabel5.getText()) - (lastResult - newResult)) + "");
|
||
} catch (NotBoundException ex) {
|
||
log.fatal(null, ex);
|
||
} catch (MalformedURLException ex) {
|
||
log.fatal(null, ex);
|
||
} catch (RemoteException ex) {
|
||
log.fatal(null, ex);
|
||
} catch (Exception ex) {
|
||
log.fatal(null, ex);
|
||
}
|
||
}//GEN-LAST:event_jButton2ActionPerformed
|
||
|
||
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());
|
||
Map<EPC, List<DSEvent>> result = dSEntryComparator.getEventNotVerified(container, gui.getAnalyserResult().get(container.getEpc()).getContainerList());
|
||
AnalyserResult analyserResult = gui.getAnalyserResult();
|
||
|
||
int lastResult = analyserResult.get(container.getEpc()).getDsToDsEvents().size();
|
||
int newResult = 0;
|
||
|
||
for (EPC cont : result.keySet()) {
|
||
analyserResult.updateRawForDStoEPCIS(cont, result.get(cont));
|
||
newResult += result.get(cont).size();
|
||
}
|
||
showDStoEPCISResults = true;
|
||
createReport(analyserResult);
|
||
|
||
jLabel5.setText((Integer.parseInt(jLabel5.getText()) - (lastResult - newResult)) + "");
|
||
} catch (NotBoundException ex) {
|
||
log.fatal(null, ex);
|
||
} catch (MalformedURLException ex) {
|
||
log.fatal(null, ex);
|
||
} catch (RemoteException ex) {
|
||
log.fatal(null, ex);
|
||
} catch (Exception ex) {
|
||
log.fatal(null, ex);
|
||
}
|
||
}//GEN-LAST:event_jButton3ActionPerformed
|
||
|
||
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());
|
||
List<EPC> list = new ArrayList<EPC>();
|
||
list.add(container);
|
||
Map<EPC, List<DSEvent>> result = dSEntryComparator.verifyDSToDSReferences(list);
|
||
AnalyserResult analyserResult = gui.getAnalyserResult();
|
||
|
||
int lastResult = analyserResult.get(container.getEpc()).getDsToDsEvents().size();
|
||
int newResult = 0;
|
||
|
||
for (EPC cont : result.keySet()) {
|
||
analyserResult.updateRawForDStoDS(cont, result.get(cont));
|
||
newResult += result.get(cont).size();
|
||
}
|
||
showDStoDSResults = true;
|
||
createReport(analyserResult);
|
||
|
||
jLabel5.setText((Integer.parseInt(jLabel5.getText()) - (lastResult - newResult)) + "");
|
||
} catch (NotBoundException ex) {
|
||
log.fatal(null, ex);
|
||
} catch (MalformedURLException ex) {
|
||
log.fatal(null, ex);
|
||
} catch (RemoteException ex) {
|
||
log.fatal(null, ex);
|
||
} catch (Exception ex) {
|
||
log.fatal(null, ex);
|
||
}
|
||
}//GEN-LAST:event_jButton4ActionPerformed
|
||
|
||
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
|
||
jButton2ActionPerformed(evt);
|
||
jButton3ActionPerformed(evt);
|
||
jButton4ActionPerformed(evt);
|
||
}//GEN-LAST:event_jButton5ActionPerformed
|
||
|
||
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
|
||
gui.updateRow(rowId, gui.getAnalyserResult().get(container.getEpc()));
|
||
}//GEN-LAST:event_jButton6ActionPerformed
|
||
|
||
private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
|
||
((DefaultTableModel) (jTable3.getModel())).getDataVector().clear();
|
||
jTable3.updateUI();
|
||
}//GEN-LAST:event_jButton7ActionPerformed
|
||
|
||
private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed
|
||
((DefaultTableModel) (jTable1.getModel())).getDataVector().clear();
|
||
jTable3.updateUI();
|
||
}//GEN-LAST:event_jButton9ActionPerformed
|
||
|
||
private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
|
||
((DefaultTableModel) (jTable1.getModel())).getDataVector().clear();
|
||
jTable2.updateUI();
|
||
}//GEN-LAST:event_jButton8ActionPerformed
|
||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||
private javax.swing.JButton jButton1;
|
||
private javax.swing.JButton jButton2;
|
||
private javax.swing.JButton jButton3;
|
||
private javax.swing.JButton jButton4;
|
||
private javax.swing.JButton jButton5;
|
||
private javax.swing.JButton jButton6;
|
||
private javax.swing.JButton jButton7;
|
||
private javax.swing.JButton jButton8;
|
||
private javax.swing.JButton jButton9;
|
||
private javax.swing.JLabel jLabel2;
|
||
private javax.swing.JLabel jLabel3;
|
||
private javax.swing.JLabel jLabel4;
|
||
private javax.swing.JLabel jLabel5;
|
||
private javax.swing.JLabel jLabel6;
|
||
private javax.swing.JLabel jLabel7;
|
||
private javax.swing.JLabel jLabel8;
|
||
private javax.swing.JLabel jLabel9;
|
||
private javax.swing.JPanel jPanel1;
|
||
private javax.swing.JPanel jPanel2;
|
||
private javax.swing.JPanel jPanel3;
|
||
private javax.swing.JPanel jPanel4;
|
||
private javax.swing.JPanel jPanel5;
|
||
private javax.swing.JPanel jPanel6;
|
||
private javax.swing.JPanel jPanel7;
|
||
private javax.swing.JScrollPane jScrollPane1;
|
||
private javax.swing.JScrollPane jScrollPane2;
|
||
private javax.swing.JScrollPane jScrollPane3;
|
||
private javax.swing.JTabbedPane jTabbedPane1;
|
||
private javax.swing.JTable jTable1;
|
||
private javax.swing.JTable jTable2;
|
||
private javax.swing.JTable jTable3;
|
||
// End of variables declaration//GEN-END:variables
|
||
}
|
DELTa/src/main/java/fr/unicaen/iota/validator/gui/DsEventCellRenderer.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.validator.gui;
|
||
|
||
import java.awt.Color;
|
||
import java.awt.Component;
|
||
import javax.swing.JLabel;
|
||
import javax.swing.JTable;
|
||
import javax.swing.table.TableCellRenderer;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class DsEventCellRenderer implements TableCellRenderer {
|
||
|
||
public DsEventCellRenderer() {
|
||
}
|
||
|
||
@Override
|
||
public Component getTableCellRendererComponent(JTable table, Object value,
|
||
boolean isSelected, boolean hasFocus, int row, int column) {
|
||
String report = (String) value;
|
||
JLabel component = new JLabel(report);
|
||
component.setHorizontalAlignment(JLabel.CENTER);
|
||
component.setOpaque(true);
|
||
component.setBackground("FOUND".equals(table.getValueAt(row, 3)) ? Color.GREEN : Color.RED);
|
||
return component;
|
||
}
|
||
}
|
DELTa/src/main/java/fr/unicaen/iota/validator/gui/EPCISEventCellRenderer.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.validator.gui;
|
||
|
||
import java.awt.Color;
|
||
import java.awt.Component;
|
||
import javax.swing.JLabel;
|
||
import javax.swing.JTable;
|
||
import javax.swing.table.TableCellRenderer;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class EPCISEventCellRenderer implements TableCellRenderer {
|
||
|
||
public EPCISEventCellRenderer() {
|
||
}
|
||
|
||
@Override
|
||
public Component getTableCellRendererComponent(JTable table, Object value,
|
||
boolean isSelected, boolean hasFocus, int row, int column) {
|
||
String report = (String) value;
|
||
JLabel component = new JLabel(report);
|
||
component.setHorizontalAlignment(JLabel.CENTER);
|
||
component.setOpaque(true);
|
||
component.setBackground("FOUND".equals(table.getValueAt(row, 6)) ? Color.GREEN : Color.RED);
|
||
return component;
|
||
}
|
||
}
|
DELTa/src/main/java/fr/unicaen/iota/validator/gui/FileTree.java | ||
---|---|---|
/* @SLS Vérifier origine / modifications et copyright
|
||
*
|
||
* 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.validator.gui;
|
||
|
||
import java.awt.BorderLayout;
|
||
import java.awt.Dimension;
|
||
import java.awt.event.MouseEvent;
|
||
import java.awt.event.MouseListener;
|
||
import java.io.File;
|
||
import java.util.*;
|
||
import javax.swing.*;
|
||
import javax.swing.event.TreeSelectionEvent;
|
||
import javax.swing.event.TreeSelectionListener;
|
||
import javax.swing.tree.DefaultMutableTreeNode;
|
||
import javax.swing.tree.MutableTreeNode;
|
||
import javax.swing.tree.TreeNode;
|
||
|
||
/**
|
||
* Display a file system in a JTree view
|
||
*
|
||
* @version $Id: FileTree.java,v 1.9 2004/02/23 03:39:22 ian Exp $
|
||
* @author Ian Darwin
|
||
*/
|
||
public class FileTree extends JPanel implements MouseListener {
|
||
|
||
/** Construct a FileTree */
|
||
private JTabbedPane panelStats;
|
||
private JTree tree;
|
||
private HashMap<String, Integer> tabs = new HashMap<String, Integer>();
|
||
private JFrame parent;
|
||
|
||
public FileTree(File dir, JTabbedPane statsContainer, JFrame parent) {
|
||
panelStats = statsContainer;
|
||
setLayout(new BorderLayout());
|
||
|
||
// Make a tree list with all the nodes, and make it a JTree
|
||
tree = new JTree(addNodes(null, dir));
|
||
tree.addMouseListener(this);
|
||
// Add a listener
|
||
tree.addTreeSelectionListener(new TreeSelectionListener() {
|
||
|
||
@Override
|
||
public void valueChanged(TreeSelectionEvent e) {
|
||
}
|
||
});
|
||
|
||
// Lastly, put the JTree into a JScrollPane.
|
||
JScrollPane scrollpane = new JScrollPane();
|
||
scrollpane.getViewport().add(tree);
|
||
add(BorderLayout.CENTER, scrollpane);
|
||
tree.setRootVisible(false);
|
||
sortTree(tree);
|
||
tree.setCellRenderer(new StatTreeRenderer());
|
||
this.parent = parent;
|
||
|
||
}
|
||
|
||
/** Add nodes from under "dir" into curTop. Highly recursive. */
|
||
DefaultMutableTreeNode addNodes(DefaultMutableTreeNode curTop, File dir) {
|
||
String curPath = dir.getPath();
|
||
File tmpFile = new File(curPath);
|
||
DefaultMutableTreeNode curDir = new AnalyseTreeNode(tmpFile.getName(), tmpFile, createImageIcon("resources/pics/folderstat2.png", ""), AnalyseTreeNode.NODE_TYPE);
|
||
if (curTop != null) { // should only be null at root
|
||
curTop.add(curDir);
|
||
}
|
||
Vector ol = new Vector();
|
||
String[] tmp = dir.list();
|
||
for (int i = 0; i < tmp.length; i++) {
|
||
ol.addElement(tmp[i]);
|
||
}
|
||
Collections.sort(ol, String.CASE_INSENSITIVE_ORDER);
|
||
File f;
|
||
Vector files = new Vector();
|
||
// Make two passes, one for Dirs and one for Files. This is #1.
|
||
for (int i = 0; i < ol.size(); i++) {
|
||
String thisObject = (String) ol.elementAt(i);
|
||
String newPath;
|
||
if (curPath.equals(".")) {
|
||
newPath = thisObject;
|
||
} else {
|
||
newPath = curPath + File.separator + thisObject;
|
||
}
|
||
if ((f = new File(newPath)).isDirectory()) {
|
||
addNodes(curDir, f);
|
||
} else {
|
||
files.addElement(newPath);
|
||
}
|
||
}
|
||
// Pass two: for files.
|
||
for (int fnum = 0; fnum < files.size(); fnum++) {
|
||
File f1 = new File((String) files.elementAt(fnum));
|
||
curDir.add(new AnalyseTreeNode(f1.getName(), f1, createImageIcon("resources/pics/stats.png", ""), AnalyseTreeNode.LEAF_TYPE));
|
||
}
|
||
return curDir;
|
||
}
|
||
|
||
@Override
|
||
public Dimension getMinimumSize() {
|
||
return new Dimension(200, 400);
|
||
}
|
||
|
||
@Override
|
||
public Dimension getPreferredSize() {
|
||
return new Dimension(200, 400);
|
||
}
|
||
|
||
private void sortTree(JTree tree) {
|
||
DefaultMutableTreeNode root = (DefaultMutableTreeNode) tree.getModel().getRoot();
|
||
List<AnalyseTreeNode> list = new ArrayList<AnalyseTreeNode>();
|
||
for (int i = 0; i < root.getChildCount(); i++) {
|
||
list.add((AnalyseTreeNode) root.getChildAt(i));
|
||
}
|
||
Collections.sort(list);
|
||
root.removeAllChildren();
|
||
for (TreeNode tn : list) {
|
||
root.add((MutableTreeNode) tn);
|
||
}
|
||
tree.updateUI();
|
||
}
|
||
|
||
protected ImageIcon createImageIcon(String img, String description) {
|
||
return new ImageIcon(img, description);
|
||
}
|
||
|
||
@Override
|
||
public void mousePressed(MouseEvent evt) {
|
||
if (SwingUtilities.isRightMouseButton(evt)) {
|
||
int selRow = tree.getRowForLocation(evt.getX(), evt.getY());
|
||
if (tree.getSelectionCount() > 0) {
|
||
for (int i : tree.getSelectionRows()) {
|
||
tree.removeSelectionRow(i);
|
||
}
|
||
}
|
||
tree.addSelectionRow(selRow);
|
||
AnalyseTreeNode node = (AnalyseTreeNode) tree.getLastSelectedPathComponent();
|
||
ContextualMenu menu = new ContextualMenu(node.getFile(), tree, node);
|
||
menu.show(tree, evt.getX(), evt.getY());
|
||
}
|
||
}
|
||
|
||
@Override
|
||
public void mouseClicked(MouseEvent e) {
|
||
if (e.getClickCount() == 2) {
|
||
AnalyseTreeNode node = (AnalyseTreeNode) tree.getLastSelectedPathComponent();
|
||
if (node.getType() != AnalyseTreeNode.LEAF_TYPE) {
|
||
return;
|
||
}
|
||
if (tabs.containsKey(node.getFile().getAbsolutePath())) {
|
||
int index = tabs.get(node.getFile().getAbsolutePath());
|
||
panelStats.setSelectedIndex(index);
|
||
return;
|
||
}
|
||
JScrollPane sp = new JScrollPane();
|
||
JPanel pan = new JPanel();
|
||
pan.setLayout(new BorderLayout());
|
||
pan.add(new StatPanel(node.getFile(), parent), BorderLayout.CENTER);
|
||
panelStats.addTab(node.getFile().getName(), pan);
|
||
panelStats.updateUI();
|
||
panelStats.setSelectedIndex(panelStats.getTabCount() - 1);
|
||
tabs.put(node.getFile().getAbsolutePath(), panelStats.getTabCount() - 1);
|
||
}
|
||
}
|
||
|
||
@Override
|
||
public void mouseReleased(MouseEvent e) {
|
||
}
|
||
|
||
@Override
|
||
public void mouseEntered(MouseEvent e) {
|
||
}
|
||
|
||
@Override
|
||
public void mouseExited(MouseEvent e) {
|
||
}
|
||
}
|
DELTa/src/main/java/fr/unicaen/iota/validator/gui/GUI.form | ||
---|---|---|
<?xml version="1.0" encoding="UTF-8" ?>
|
||
|
||
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||
<NonVisualComponents>
|
||
<Menu class="javax.swing.JMenuBar" name="jMenuBar1">
|
||
<SubComponents>
|
||
<Menu class="javax.swing.JMenu" name="jMenu1">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="File"/>
|
||
</Properties>
|
||
<SubComponents>
|
||
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem2">
|
||
<Properties>
|
||
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
|
||
<KeyStroke key="Ctrl+D"/>
|
||
</Property>
|
||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||
<Image iconType="3" name="/resources/pics/Chart.png"/>
|
||
</Property>
|
||
<Property name="text" type="java.lang.String" value="Servers Stats"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem2ActionPerformed"/>
|
||
</Events>
|
||
</MenuItem>
|
||
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem1">
|
||
<Properties>
|
||
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
|
||
<KeyStroke key="Ctrl+P"/>
|
||
</Property>
|
||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||
<Image iconType="3" name="/resources/pics/preferences.png"/>
|
||
</Property>
|
||
<Property name="text" type="java.lang.String" value="Network preferences"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem1ActionPerformed"/>
|
||
</Events>
|
||
</MenuItem>
|
||
</SubComponents>
|
||
</Menu>
|
||
<Menu class="javax.swing.JMenu" name="jMenu2">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="Edit"/>
|
||
</Properties>
|
||
</Menu>
|
||
</SubComponents>
|
||
</Menu>
|
||
</NonVisualComponents>
|
||
<Properties>
|
||
<Property name="defaultCloseOperation" type="int" value="3"/>
|
||
</Properties>
|
||
<SyntheticProperties>
|
||
<SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/>
|
||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||
</SyntheticProperties>
|
||
<AuxValues>
|
||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,75,0,0,3,-29"/>
|
||
</AuxValues>
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
|
||
<SubComponents>
|
||
<Container class="javax.swing.JSplitPane" name="jSplitPane3">
|
||
<Properties>
|
||
<Property name="orientation" type="int" value="0"/>
|
||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||
<Dimension value="[112, 140]"/>
|
||
</Property>
|
||
</Properties>
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||
<BorderConstraints direction="Center"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
|
||
<SubComponents>
|
||
<Container class="javax.swing.JPanel" name="jPanel8">
|
||
<Properties>
|
||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
|
||
<EmptyBorder/>
|
||
</Border>
|
||
</Property>
|
||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||
<Dimension value="[800, 800]"/>
|
||
</Property>
|
||
</Properties>
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
|
||
<JSplitPaneConstraints position="bottom"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
|
||
<SubComponents>
|
||
<Container class="javax.swing.JPanel" name="jPanel4">
|
||
<Properties>
|
||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
|
||
<EmptyBorder bottom="3" left="3" right="3" top="3"/>
|
||
</Border>
|
||
</Property>
|
||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||
<Dimension value="[3120, 26]"/>
|
||
</Property>
|
||
</Properties>
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||
<BorderConstraints direction="First"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
|
||
<SubComponents>
|
||
<Component class="javax.swing.JLabel" name="jLabel1">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="analysis progress : "/>
|
||
</Properties>
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||
<BorderConstraints direction="Before"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
</Component>
|
||
<Component class="javax.swing.JProgressBar" name="jProgressBar1">
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||
<BorderConstraints direction="Center"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
</Component>
|
||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value=" 0%"/>
|
||
</Properties>
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||
<BorderConstraints direction="After"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
</Component>
|
||
</SubComponents>
|
||
</Container>
|
||
<Container class="javax.swing.JPanel" name="jPanel6">
|
||
<Properties>
|
||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
|
||
<EmptyBorder/>
|
||
</Border>
|
||
</Property>
|
||
</Properties>
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||
<BorderConstraints direction="Last"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
|
||
<SubComponents>
|
||
<Container class="javax.swing.JPanel" name="jPanel1">
|
||
<Properties>
|
||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
||
<TitledBorder title="Analyser restrictions"/>
|
||
</Border>
|
||
</Property>
|
||
</Properties>
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||
<BorderConstraints direction="First"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout>
|
||
<DimensionLayout dim="0">
|
||
<Group type="103" groupAlignment="0" attributes="0">
|
||
<Group type="102" alignment="1" attributes="0">
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
<Component id="jCheckBox1" min="-2" max="-2" attributes="0"/>
|
||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||
<Component id="jCheckBox2" min="-2" max="-2" attributes="0"/>
|
||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||
<Component id="jCheckBox3" min="-2" max="-2" attributes="0"/>
|
||
<EmptySpace pref="136" max="32767" attributes="0"/>
|
||
<Group type="103" groupAlignment="0" attributes="0">
|
||
<Group type="102" alignment="0" attributes="0">
|
||
<Component id="jLabel11" min="-2" pref="12" max="-2" attributes="0"/>
|
||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||
<Component id="jLabel12" min="-2" max="-2" attributes="0"/>
|
||
</Group>
|
||
<Group type="102" alignment="0" attributes="0">
|
||
<Component id="jLabel13" min="-2" pref="13" max="-2" attributes="0"/>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
<Component id="jLabel14" min="-2" max="-2" attributes="0"/>
|
||
</Group>
|
||
</Group>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
</Group>
|
||
</Group>
|
||
</DimensionLayout>
|
||
<DimensionLayout dim="1">
|
||
<Group type="103" groupAlignment="0" attributes="0">
|
||
<Group type="102" attributes="0">
|
||
<Group type="103" groupAlignment="0" attributes="0">
|
||
<Group type="102" attributes="0">
|
||
<Group type="103" groupAlignment="3" attributes="0">
|
||
<Component id="jLabel11" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
<Component id="jLabel12" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
</Group>
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
<Group type="103" groupAlignment="3" attributes="0">
|
||
<Component id="jLabel13" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
<Component id="jLabel14" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
</Group>
|
||
</Group>
|
||
<Group type="102" alignment="0" attributes="0">
|
||
<EmptySpace max="-2" attributes="0"/>
|
||
<Group type="103" groupAlignment="3" attributes="0">
|
||
<Component id="jCheckBox1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
<Component id="jCheckBox2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
<Component id="jCheckBox3" alignment="3" min="-2" max="-2" attributes="0"/>
|
||
</Group>
|
||
</Group>
|
||
</Group>
|
||
<EmptySpace max="32767" attributes="0"/>
|
||
</Group>
|
||
</Group>
|
||
</DimensionLayout>
|
||
</Layout>
|
||
<SubComponents>
|
||
<Component class="javax.swing.JCheckBox" name="jCheckBox1">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="Analyse EPCIS events"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jCheckBox1ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
<Component class="javax.swing.JCheckBox" name="jCheckBox2">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="Analyse DS to EPCIS events"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jCheckBox2ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
<Component class="javax.swing.JCheckBox" name="jCheckBox3">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="Analyse DS to DS events"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jCheckBox3ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
<Component class="javax.swing.JLabel" name="jLabel12">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="object correctly tracked"/>
|
||
</Properties>
|
||
</Component>
|
||
<Component class="javax.swing.JLabel" name="jLabel11">
|
||
<Properties>
|
||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||
<Color blue="a" green="a5" red="0" type="rgb"/>
|
||
</Property>
|
||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||
<Font name="DejaVu Sans" size="10" style="0"/>
|
||
</Property>
|
||
<Property name="text" type="java.lang.String" value=" "/>
|
||
<Property name="opaque" type="boolean" value="true"/>
|
||
</Properties>
|
||
</Component>
|
||
<Component class="javax.swing.JLabel" name="jLabel13">
|
||
<Properties>
|
||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||
<Color blue="3" green="0" red="ff" type="rgb"/>
|
||
</Property>
|
||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||
<Font name="DejaVu Sans" size="10" style="0"/>
|
||
</Property>
|
||
<Property name="text" type="java.lang.String" value=" "/>
|
||
<Property name="opaque" type="boolean" value="true"/>
|
||
</Properties>
|
||
</Component>
|
||
<Component class="javax.swing.JLabel" name="jLabel14">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="some events are missing"/>
|
||
</Properties>
|
||
</Component>
|
||
</SubComponents>
|
||
</Container>
|
||
<Container class="javax.swing.JPanel" name="jPanel7">
|
||
<Properties>
|
||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
|
||
<EmptyBorder/>
|
||
</Border>
|
||
</Property>
|
||
</Properties>
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||
<BorderConstraints direction="Last"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
|
||
<SubComponents>
|
||
<Component class="javax.swing.JLabel" name="jLabel5">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="files in queue :"/>
|
||
</Properties>
|
||
</Component>
|
||
<Component class="javax.swing.JLabel" name="jLabel6">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="0"/>
|
||
</Properties>
|
||
</Component>
|
||
<Component class="javax.swing.JLabel" name="jLabel3">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="analysed files : "/>
|
||
</Properties>
|
||
</Component>
|
||
<Component class="javax.swing.JLabel" name="jLabel4">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="0"/>
|
||
</Properties>
|
||
</Component>
|
||
<Component class="javax.swing.JLabel" name="jLabel7">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="errors :"/>
|
||
</Properties>
|
||
</Component>
|
||
<Component class="javax.swing.JLabel" name="jLabel8">
|
||
<Properties>
|
||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||
<Color blue="0" green="0" red="ff" type="rgb"/>
|
||
</Property>
|
||
<Property name="text" type="java.lang.String" value="0"/>
|
||
</Properties>
|
||
</Component>
|
||
<Component class="javax.swing.JLabel" name="jLabel9">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="missing events : "/>
|
||
</Properties>
|
||
</Component>
|
||
<Component class="javax.swing.JLabel" name="jLabel10">
|
||
<Properties>
|
||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||
<Color blue="0" green="0" red="ff" type="rgb"/>
|
||
</Property>
|
||
<Property name="text" type="java.lang.String" value="0"/>
|
||
</Properties>
|
||
</Component>
|
||
<Component class="javax.swing.JButton" name="jButton2">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="Analyse events"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
<Component class="javax.swing.JButton" name="jButton5">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="Suspend Analyse"/>
|
||
<Property name="enabled" type="boolean" value="false"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton5ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
<Component class="javax.swing.JButton" name="jButton3">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="load"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
<Component class="javax.swing.JButton" name="jButton4">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="clear repository"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton4ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
<Component class="javax.swing.JButton" name="jButton1">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="Close"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
</SubComponents>
|
||
</Container>
|
||
</SubComponents>
|
||
</Container>
|
||
<Container class="javax.swing.JPanel" name="jPanel5">
|
||
<Properties>
|
||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
|
||
<EmptyBorder/>
|
||
</Border>
|
||
</Property>
|
||
</Properties>
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||
<BorderConstraints direction="Center"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
|
||
<SubComponents>
|
||
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||
<AuxValues>
|
||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||
</AuxValues>
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||
<BorderConstraints direction="Center"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||
<SubComponents>
|
||
<Component class="javax.swing.JTable" name="jTable1">
|
||
<Properties>
|
||
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
|
||
<Table columnCount="4" rowCount="4">
|
||
<Column editable="true" title="Title 1" type="java.lang.Object"/>
|
||
<Column editable="true" title="Title 2" type="java.lang.Object"/>
|
||
<Column editable="true" title="Title 3" type="java.lang.Object"/>
|
||
<Column editable="true" title="Title 4" type="java.lang.Object"/>
|
||
</Table>
|
||
</Property>
|
||
</Properties>
|
||
</Component>
|
||
</SubComponents>
|
||
</Container>
|
||
</SubComponents>
|
||
</Container>
|
||
</SubComponents>
|
||
</Container>
|
||
<Container class="javax.swing.JPanel" name="jPanel2">
|
||
<Properties>
|
||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||
<Dimension value="[0, 100]"/>
|
||
</Property>
|
||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||
<Dimension value="[956, 200]"/>
|
||
</Property>
|
||
</Properties>
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
|
||
<JSplitPaneConstraints position="left"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
|
||
<SubComponents>
|
||
<Container class="javax.swing.JSplitPane" name="jSplitPane1">
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||
<BorderConstraints direction="Center"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
|
||
</Container>
|
||
</SubComponents>
|
||
</Container>
|
||
</SubComponents>
|
||
</Container>
|
||
</SubComponents>
|
||
</Form>
|
DELTa/src/main/java/fr/unicaen/iota/validator/gui/GUI.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.validator.gui;
|
||
|
||
import fr.unicaen.iota.application.model.DSEvent;
|
||
import fr.unicaen.iota.validator.*;
|
||
import fr.unicaen.iota.validator.listener.AnalyserListener;
|
||
import fr.unicaen.iota.validator.model.BaseEvent;
|
||
import fr.unicaen.iota.validator.model.EPC;
|
||
import fr.unicaen.iota.validator.operations.LogAnalyser;
|
||
import java.awt.event.WindowEvent;
|
||
import java.awt.event.WindowListener;
|
||
import java.io.File;
|
||
import java.io.IOException;
|
||
import java.util.List;
|
||
import java.util.Map;
|
||
import java.util.Vector;
|
||
import javax.swing.JOptionPane;
|
||
import javax.swing.JPanel;
|
||
import javax.swing.JTabbedPane;
|
||
import javax.swing.table.DefaultTableModel;
|
||
import javax.swing.table.TableColumn;
|
||
import org.apache.commons.logging.Log;
|
||
import org.apache.commons.logging.LogFactory;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class GUI extends javax.swing.JFrame implements AnalyserListener, WindowListener {
|
||
|
||
private static final Log log = LogFactory.getLog(GUI.class);
|
||
private int nbFiles;
|
||
private Controler controler;
|
||
private int tableId = 0;
|
||
private IOTA iota;
|
||
private AnalyserResult analyserResult;
|
||
private JPanel tree;
|
||
private JTabbedPane jTabbedPane;
|
||
|
||
/**
|
||
* Creates new form GUI
|
||
*/
|
||
public GUI() {
|
||
initComponents();
|
||
this.setTitle("DELTa");
|
||
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;
|
||
initAnalyserRestricions();
|
||
createTable();
|
||
createTabbedPane();
|
||
createTree();
|
||
this.setSize(1000, 800);
|
||
jSplitPane1.setDividerLocation(280);
|
||
jSplitPane3.setDividerLocation(500);
|
||
this.setLocationRelativeTo(null);
|
||
this.addWindowListener(this);
|
||
|
||
}
|
||
|
||
public void setResults(AnalyserResult analyserResult) {
|
||
this.analyserResult = analyserResult;
|
||
}
|
||
|
||
public void updateRow(int rowId, ResultRaw res) {
|
||
int size = ((DefaultTableModel) jTable1.getModel()).getRowCount();
|
||
Vector vector = ((DefaultTableModel) jTable1.getModel()).getDataVector();
|
||
for (int i = 0; i < size; i++) {
|
||
Vector row = (Vector) vector.get(i);
|
||
if (Integer.parseInt((String) row.get(0)) != rowId) {
|
||
continue;
|
||
}
|
||
|
||
int epcisValue = "unchecked".equals(row.get(2)) ? 0 : Integer.parseInt((String) row.get(2));
|
||
int dsValue = "unchecked".equals(row.get(3)) ? 0 : Integer.parseInt((String) row.get(3));
|
||
int dsToDsValue = "unchecked".equals(row.get(4)) ? 0 : Integer.parseInt((String) row.get(4));
|
||
|
||
int lastErrorCountReport = epcisValue + dsToDsValue + dsValue;
|
||
|
||
int epcisResultSize = 0;
|
||
if (res.getEpcisEvents() != null) {
|
||
epcisResultSize = res.getEpcisEvents().size();
|
||
}
|
||
int dsResultSize = 0;
|
||
if (res.getDsEvents() != null) {
|
||
dsResultSize = res.getDsEvents().size();
|
||
}
|
||
int dsToDsResultSize = 0;
|
||
if (res.getDsToDsEvents() != null) {
|
||
dsToDsResultSize = res.getDsToDsEvents().size();
|
||
}
|
||
row.set(2, res.getEpcisEvents() != null ? epcisResultSize + "" : "unchecked");
|
||
row.set(3, res.getDsEvents() != null ? dsResultSize + "" : "unchecked");
|
||
row.set(4, res.getDsToDsEvents() != null ? dsToDsResultSize + "" : "unchecked");
|
||
row.set(5, epcisResultSize + dsResultSize + dsToDsResultSize == 0 ? "SUCCESS" : "FAIL");
|
||
int uncheckedEvents = epcisResultSize + dsResultSize + dsToDsResultSize;
|
||
int diff = lastErrorCountReport - uncheckedEvents;
|
||
if (diff > 0) {
|
||
jLabel10.setText((Integer.parseInt(jLabel10.getText()) - diff) + "");
|
||
if (uncheckedEvents == 0) {
|
||
jLabel8.setText((Integer.parseInt(jLabel8.getText()) - 1) + "");
|
||
}
|
||
}
|
||
jTable1.updateUI();
|
||
}
|
||
}
|
||
|
||
private void initAnalyserRestricions() {
|
||
jCheckBox1.setSelected(Configuration.ANALYSE_EPCIS_EVENTS);
|
||
jCheckBox2.setSelected(Configuration.ANALYSE_EPCIS_TO_DS_EVENTS);
|
||
jCheckBox3.setSelected(Configuration.ANALYSE_DS_TO_DS_EVENTS);
|
||
}
|
||
|
||
/**
|
||
* This method is called from within the constructor to initialize the form.
|
||
* WARNING: Do NOT modify this code. The content of this method is always
|
||
* regenerated by the Form Editor.
|
||
*/
|
||
@SuppressWarnings("unchecked")
|
||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||
private void initComponents() {
|
||
|
||
jSplitPane3 = new javax.swing.JSplitPane();
|
||
jPanel8 = new javax.swing.JPanel();
|
||
jPanel4 = new javax.swing.JPanel();
|
||
jLabel1 = new javax.swing.JLabel();
|
||
jProgressBar1 = new javax.swing.JProgressBar();
|
||
jLabel2 = new javax.swing.JLabel();
|
||
jPanel6 = new javax.swing.JPanel();
|
||
jPanel1 = new javax.swing.JPanel();
|
||
jCheckBox1 = new javax.swing.JCheckBox();
|
||
jCheckBox2 = new javax.swing.JCheckBox();
|
||
jCheckBox3 = new javax.swing.JCheckBox();
|
||
jLabel12 = new javax.swing.JLabel();
|
||
jLabel11 = new javax.swing.JLabel();
|
||
jLabel13 = new javax.swing.JLabel();
|
||
jLabel14 = new javax.swing.JLabel();
|
||
jPanel7 = new javax.swing.JPanel();
|
||
jLabel5 = new javax.swing.JLabel();
|
||
jLabel6 = new javax.swing.JLabel();
|
||
jLabel3 = new javax.swing.JLabel();
|
||
jLabel4 = new javax.swing.JLabel();
|
||
jLabel7 = new javax.swing.JLabel();
|
||
jLabel8 = new javax.swing.JLabel();
|
||
jLabel9 = new javax.swing.JLabel();
|
||
jLabel10 = new javax.swing.JLabel();
|
||
jButton2 = new javax.swing.JButton();
|
||
jButton5 = new javax.swing.JButton();
|
||
jButton3 = new javax.swing.JButton();
|
||
jButton4 = new javax.swing.JButton();
|
||
jButton1 = new javax.swing.JButton();
|
||
jPanel5 = new javax.swing.JPanel();
|
||
jScrollPane1 = new javax.swing.JScrollPane();
|
||
jTable1 = new javax.swing.JTable();
|
||
jPanel2 = new javax.swing.JPanel();
|
||
jSplitPane1 = new javax.swing.JSplitPane();
|
||
jMenuBar1 = new javax.swing.JMenuBar();
|
||
jMenu1 = new javax.swing.JMenu();
|
||
jMenuItem2 = new javax.swing.JMenuItem();
|
||
jMenuItem1 = new javax.swing.JMenuItem();
|
||
jMenu2 = new javax.swing.JMenu();
|
||
|
||
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
||
|
||
jSplitPane3.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
|
||
jSplitPane3.setPreferredSize(new java.awt.Dimension(112, 140));
|
||
|
||
jPanel8.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
|
||
jPanel8.setMaximumSize(new java.awt.Dimension(800, 800));
|
||
jPanel8.setLayout(new java.awt.BorderLayout());
|
||
|
||
jPanel4.setBorder(javax.swing.BorderFactory.createEmptyBorder(3, 3, 3, 3));
|
||
jPanel4.setPreferredSize(new java.awt.Dimension(3120, 26));
|
||
jPanel4.setLayout(new java.awt.BorderLayout());
|
||
|
||
jLabel1.setText("analysis progress: ");
|
||
jPanel4.add(jLabel1, java.awt.BorderLayout.LINE_START);
|
||
jPanel4.add(jProgressBar1, java.awt.BorderLayout.CENTER);
|
||
|
||
jLabel2.setText(" 0%");
|
||
jPanel4.add(jLabel2, java.awt.BorderLayout.LINE_END);
|
||
|
||
jPanel8.add(jPanel4, java.awt.BorderLayout.PAGE_START);
|
||
|
||
jPanel6.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
|
||
jPanel6.setLayout(new java.awt.BorderLayout());
|
||
|
||
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Analyser restrictions"));
|
||
|
||
jCheckBox1.setText("Analyse EPCIS events");
|
||
jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jCheckBox1ActionPerformed(evt);
|
||
}
|
||
});
|
||
|
||
jCheckBox2.setText("Analyse DS to EPCIS events");
|
||
jCheckBox2.addActionListener(new java.awt.event.ActionListener() {
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jCheckBox2ActionPerformed(evt);
|
||
}
|
||
});
|
||
|
||
jCheckBox3.setText("Analyse DS to DS events");
|
||
jCheckBox3.addActionListener(new java.awt.event.ActionListener() {
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jCheckBox3ActionPerformed(evt);
|
||
}
|
||
});
|
||
|
||
jLabel12.setText("object correctly tracked");
|
||
|
||
jLabel11.setBackground(new java.awt.Color(0, 165, 10));
|
||
jLabel11.setFont(new java.awt.Font("DejaVu Sans", 0, 10));
|
||
jLabel11.setText(" ");
|
||
jLabel11.setOpaque(true);
|
||
|
||
jLabel13.setBackground(new java.awt.Color(255, 0, 3));
|
||
jLabel13.setFont(new java.awt.Font("DejaVu Sans", 0, 10));
|
||
jLabel13.setText(" ");
|
||
jLabel13.setOpaque(true);
|
||
|
||
jLabel14.setText("some events are missing");
|
||
|
||
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
||
jPanel1.setLayout(jPanel1Layout);
|
||
jPanel1Layout.setHorizontalGroup(
|
||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
|
||
.addContainerGap()
|
||
.addComponent(jCheckBox1)
|
||
.addGap(18, 18, 18)
|
||
.addComponent(jCheckBox2)
|
||
.addGap(18, 18, 18)
|
||
.addComponent(jCheckBox3)
|
||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 191, Short.MAX_VALUE)
|
||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||
.addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||
.addComponent(jLabel12))
|
||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||
.addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 13, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||
.addComponent(jLabel14)))
|
||
.addContainerGap())
|
||
);
|
||
jPanel1Layout.setVerticalGroup(
|
||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||
.addComponent(jLabel11)
|
||
.addComponent(jLabel12))
|
||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||
.addComponent(jLabel13)
|
||
.addComponent(jLabel14)))
|
||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||
.addContainerGap()
|
||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||
.addComponent(jCheckBox1)
|
||
.addComponent(jCheckBox2)
|
||
.addComponent(jCheckBox3))))
|
||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||
);
|
||
|
||
jPanel6.add(jPanel1, java.awt.BorderLayout.PAGE_START);
|
||
|
||
jPanel7.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
|
||
|
||
jLabel5.setText("files in queue:");
|
||
jPanel7.add(jLabel5);
|
||
|
||
jLabel6.setText("0");
|
||
jPanel7.add(jLabel6);
|
||
|
||
jLabel3.setText("analysed files: ");
|
||
jPanel7.add(jLabel3);
|
||
|
||
jLabel4.setText("0");
|
||
jPanel7.add(jLabel4);
|
||
|
||
jLabel7.setText("errors:");
|
||
jPanel7.add(jLabel7);
|
||
|
||
jLabel8.setForeground(new java.awt.Color(255, 0, 0));
|
||
jLabel8.setText("0");
|
||
jPanel7.add(jLabel8);
|
||
|
||
jLabel9.setText("missing events: ");
|
||
jPanel7.add(jLabel9);
|
||
|
||
jLabel10.setForeground(new java.awt.Color(255, 0, 0));
|
||
jLabel10.setText("0");
|
||
jPanel7.add(jLabel10);
|
||
|
||
jButton2.setText("Analyse events");
|
||
jButton2.addActionListener(new java.awt.event.ActionListener() {
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jButton2ActionPerformed(evt);
|
||
}
|
||
});
|
||
jPanel7.add(jButton2);
|
||
|
||
jButton5.setText("Suspend Analyse");
|
||
jButton5.setEnabled(false);
|
||
jButton5.addActionListener(new java.awt.event.ActionListener() {
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jButton5ActionPerformed(evt);
|
||
}
|
||
});
|
||
jPanel7.add(jButton5);
|
||
|
||
jButton3.setText("load");
|
||
jButton3.addActionListener(new java.awt.event.ActionListener() {
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jButton3ActionPerformed(evt);
|
||
}
|
||
});
|
||
jPanel7.add(jButton3);
|
||
|
||
jButton4.setText("clear repository");
|
||
jButton4.addActionListener(new java.awt.event.ActionListener() {
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jButton4ActionPerformed(evt);
|
||
}
|
||
});
|
||
jPanel7.add(jButton4);
|
||
|
||
jButton1.setText("Close");
|
||
jButton1.addActionListener(new java.awt.event.ActionListener() {
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jButton1ActionPerformed(evt);
|
||
}
|
||
});
|
||
jPanel7.add(jButton1);
|
||
|
||
jPanel6.add(jPanel7, java.awt.BorderLayout.PAGE_END);
|
||
|
||
jPanel8.add(jPanel6, java.awt.BorderLayout.PAGE_END);
|
||
|
||
jPanel5.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
|
||
jPanel5.setLayout(new java.awt.BorderLayout());
|
||
|
||
jTable1.setModel(new javax.swing.table.DefaultTableModel(
|
||
new Object [][] {
|
||
{null, null, null, null},
|
||
{null, null, null, null},
|
||
{null, null, null, null},
|
||
{null, null, null, null}
|
||
},
|
||
new String [] {
|
||
"Title 1", "Title 2", "Title 3", "Title 4"
|
||
}
|
||
));
|
||
jScrollPane1.setViewportView(jTable1);
|
||
|
||
jPanel5.add(jScrollPane1, java.awt.BorderLayout.CENTER);
|
||
|
||
jPanel8.add(jPanel5, java.awt.BorderLayout.CENTER);
|
||
|
||
jSplitPane3.setBottomComponent(jPanel8);
|
||
|
||
jPanel2.setMinimumSize(new java.awt.Dimension(0, 100));
|
||
jPanel2.setPreferredSize(new java.awt.Dimension(956, 200));
|
||
jPanel2.setLayout(new java.awt.BorderLayout());
|
||
jPanel2.add(jSplitPane1, java.awt.BorderLayout.CENTER);
|
||
|
||
jSplitPane3.setLeftComponent(jPanel2);
|
||
|
||
getContentPane().add(jSplitPane3, java.awt.BorderLayout.CENTER);
|
||
|
||
jMenu1.setText("File");
|
||
|
||
jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_D, java.awt.event.InputEvent.CTRL_MASK));
|
||
jMenuItem2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/pics/Chart.png"))); // NOI18N
|
||
jMenuItem2.setText("Servers Stats");
|
||
jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jMenuItem2ActionPerformed(evt);
|
||
}
|
||
});
|
||
jMenu1.add(jMenuItem2);
|
||
|
||
jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.CTRL_MASK));
|
||
jMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/pics/preferences.png"))); // NOI18N
|
||
jMenuItem1.setText("Network preferences");
|
||
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
|
||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||
jMenuItem1ActionPerformed(evt);
|
||
}
|
||
});
|
||
jMenu1.add(jMenuItem1);
|
||
|
||
jMenuBar1.add(jMenu1);
|
||
|
||
jMenu2.setText("Edit");
|
||
jMenuBar1.add(jMenu2);
|
||
|
||
setJMenuBar(jMenuBar1);
|
||
|
||
pack();
|
||
}// </editor-fold>//GEN-END:initComponents
|
||
|
||
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
|
||
if (controler.isAlive()) {
|
||
controler.resumeAnalyse();
|
||
} else {
|
||
controler.start();
|
||
}
|
||
|
||
jButton2.setEnabled(false);
|
||
jButton5.setEnabled(true);
|
||
jButton4.setEnabled(false);
|
||
jButton3.setEnabled(false);
|
||
jButton1.setEnabled(false);
|
||
|
||
}//GEN-LAST:event_jButton2ActionPerformed
|
||
|
||
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
|
||
System.exit(0);
|
||
}//GEN-LAST:event_jButton1ActionPerformed
|
||
|
||
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
|
||
LogAnalyser logAnalyser = new LogAnalyser(controler.getAnalyserStatus());
|
||
try {
|
||
logAnalyser.load();
|
||
} catch (IOException ex) {
|
||
log.fatal(null, ex);
|
||
}
|
||
}//GEN-LAST:event_jButton3ActionPerformed
|
||
|
||
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
|
||
int i = JOptionPane.showConfirmDialog(this, "You are about to delete all files in the repository.", "Do you want to delete?", JOptionPane.YES_NO_OPTION);
|
||
if (i != JOptionPane.YES_OPTION) {
|
||
log.debug("Deletion aborted.");
|
||
return;
|
||
|
||
}
|
||
for (File f : new File(Configuration.LOG_DIRECTORY).listFiles()) {
|
||
f.delete();
|
||
}
|
||
for (File f : new File(Configuration.UNVERIFIED_DIRECTORY).listFiles()) {
|
||
f.delete();
|
||
}
|
||
for (File f : new File(Configuration.VERIFIED_DIRECTORY).listFiles()) {
|
||
f.delete();
|
||
}
|
||
}//GEN-LAST:event_jButton4ActionPerformed
|
||
|
||
private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed
|
||
Configuration.ANALYSE_EPCIS_EVENTS = !Configuration.ANALYSE_EPCIS_EVENTS;
|
||
}//GEN-LAST:event_jCheckBox1ActionPerformed
|
||
|
||
private void jCheckBox2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox2ActionPerformed
|
||
Configuration.ANALYSE_EPCIS_TO_DS_EVENTS = !Configuration.ANALYSE_EPCIS_TO_DS_EVENTS;
|
||
}//GEN-LAST:event_jCheckBox2ActionPerformed
|
||
|
||
private void jCheckBox3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox3ActionPerformed
|
||
Configuration.ANALYSE_DS_TO_DS_EVENTS = !Configuration.ANALYSE_DS_TO_DS_EVENTS;
|
||
}//GEN-LAST:event_jCheckBox3ActionPerformed
|
||
|
||
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
|
||
controler.suspendAnalyse();
|
||
jButton2.setEnabled(true);
|
||
jButton5.setEnabled(false);
|
||
jButton4.setEnabled(true);
|
||
jButton3.setEnabled(true);
|
||
jButton1.setEnabled(true);
|
||
}//GEN-LAST:event_jButton5ActionPerformed
|
||
|
||
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
|
||
new Preferences(this, true, iota).setVisible(true);
|
||
}//GEN-LAST:event_jMenuItem1ActionPerformed
|
||
|
||
private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
|
||
new Stats(iota, this).setVisible(true);
|
||
}//GEN-LAST:event_jMenuItem2ActionPerformed
|
||
|
||
private void createTable() {
|
||
jTable1.setModel(new javax.swing.table.DefaultTableModel(
|
||
new Object[][]{},
|
||
new String[]{
|
||
"ID", "EPCs", "EPCIS LINK", "EPCIS-DS LINK", "DS-DS LINK", "REPORT", ""
|
||
}));
|
||
jTable1.setAutoCreateRowSorter(true);
|
||
TableColumn column2 = jTable1.getColumnModel().getColumn(1);
|
||
column2.setMaxWidth(400);
|
||
column2.setPreferredWidth(400);
|
||
TableColumn column1 = jTable1.getColumnModel().getColumn(0);
|
||
column1.setPreferredWidth(48);
|
||
column1.setMaxWidth(48);
|
||
TableColumn column3 = jTable1.getColumnModel().getColumn(6);
|
||
column3.setCellEditor(new CellDetailsEditor(this, iota));
|
||
column3.setMaxWidth(20);
|
||
column3.setPreferredWidth(20);
|
||
column3.setCellRenderer(new DetailsCellRenderer("resources/pics/play.png"));
|
||
|
||
jTable1.getColumnModel().getColumn(0).setCellRenderer(new IdCellRenderer());
|
||
jTable1.getColumnModel().getColumn(1).setCellRenderer(new ReportCellRenderer());
|
||
jTable1.getColumnModel().getColumn(2).setCellRenderer(new ReportCellRenderer());
|
||
jTable1.getColumnModel().getColumn(3).setCellRenderer(new ReportCellRenderer());
|
||
jTable1.getColumnModel().getColumn(4).setCellRenderer(new ReportCellRenderer());
|
||
jTable1.getColumnModel().getColumn(5).setCellRenderer(new ReportCellRenderer());
|
||
}
|
||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||
private javax.swing.JButton jButton1;
|
||
private javax.swing.JButton jButton2;
|
||
private javax.swing.JButton jButton3;
|
||
private javax.swing.JButton jButton4;
|
||
private javax.swing.JButton jButton5;
|
||
private javax.swing.JCheckBox jCheckBox1;
|
||
private javax.swing.JCheckBox jCheckBox2;
|
||
private javax.swing.JCheckBox jCheckBox3;
|
||
private javax.swing.JLabel jLabel1;
|
||
private javax.swing.JLabel jLabel10;
|
||
private javax.swing.JLabel jLabel11;
|
||
private javax.swing.JLabel jLabel12;
|
||
private javax.swing.JLabel jLabel13;
|
||
private javax.swing.JLabel jLabel14;
|
||
private javax.swing.JLabel jLabel2;
|
||
private javax.swing.JLabel jLabel3;
|
||
private javax.swing.JLabel jLabel4;
|
||
private javax.swing.JLabel jLabel5;
|
||
private javax.swing.JLabel jLabel6;
|
||
private javax.swing.JLabel jLabel7;
|
||
private javax.swing.JLabel jLabel8;
|
||
private javax.swing.JLabel jLabel9;
|
||
private javax.swing.JMenu jMenu1;
|
||
private javax.swing.JMenu jMenu2;
|
||
private javax.swing.JMenuBar jMenuBar1;
|
||
private javax.swing.JMenuItem jMenuItem1;
|
||
private javax.swing.JMenuItem jMenuItem2;
|
||
private javax.swing.JPanel jPanel1;
|
||
private javax.swing.JPanel jPanel2;
|
||
private javax.swing.JPanel jPanel4;
|
||
private javax.swing.JPanel jPanel5;
|
||
private javax.swing.JPanel jPanel6;
|
||
private javax.swing.JPanel jPanel7;
|
||
private javax.swing.JPanel jPanel8;
|
||
private javax.swing.JProgressBar jProgressBar1;
|
||
private javax.swing.JScrollPane jScrollPane1;
|
||
private javax.swing.JSplitPane jSplitPane1;
|
||
private javax.swing.JSplitPane jSplitPane3;
|
||
private javax.swing.JTable jTable1;
|
||
// End of variables declaration//GEN-END:variables
|
||
|
||
@Override
|
||
public void analysedObject() {
|
||
int nbAnalysedFiles = Integer.parseInt(jLabel4.getText()) + 1;
|
||
jLabel4.setText(nbAnalysedFiles + "");
|
||
int progress = (int) (100 * nbAnalysedFiles / nbFiles);
|
||
jProgressBar1.setValue(progress);
|
||
jLabel2.setText(progress + "%");
|
||
jLabel6.setText(new File(Configuration.XML_EVENT_FOLDER).list().length + "");
|
||
}
|
||
|
||
@Override
|
||
public void errorFound() {
|
||
jLabel8.setText((Integer.parseInt(jLabel8.getText()) + 1) + "");
|
||
}
|
||
|
||
public void missingEvent(int i) {
|
||
jLabel10.setText((Integer.parseInt(jLabel10.getText()) + i) + "");
|
||
}
|
||
|
||
@Override
|
||
public synchronized void publishResults(List<EPC> epcList, Map<EPC, List<BaseEvent>> epcisResults, Map<EPC, List<DSEvent>> dsResults, Map<EPC, List<DSEvent>> dsToDsResults) {
|
||
try {
|
||
for (EPC container : epcList) {
|
||
DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
|
||
int epcisResultSize = 0;
|
||
if (Configuration.ANALYSE_EPCIS_EVENTS) {
|
||
epcisResultSize = epcisResults.get(container).size();
|
||
}
|
||
|
||
int dsResultSize = 0;
|
||
if (Configuration.ANALYSE_EPCIS_TO_DS_EVENTS) {
|
||
dsResultSize = dsResults.get(container).size();
|
||
}
|
||
|
||
int dsToDsResultSize = 0;
|
||
if (Configuration.ANALYSE_DS_TO_DS_EVENTS) {
|
||
dsToDsResultSize = dsToDsResults.get(container).size();
|
||
}
|
||
|
||
tableId++;
|
||
model.insertRow(0, new String[]{tableId + "",
|
||
container.getEpc(),
|
||
Configuration.ANALYSE_EPCIS_EVENTS ? epcisResultSize + "" : "unchecked",
|
||
Configuration.ANALYSE_EPCIS_TO_DS_EVENTS ? dsResultSize + "" : "unchecked",
|
||
Configuration.ANALYSE_DS_TO_DS_EVENTS ? dsToDsResultSize + "" : "unchecked",
|
||
epcisResultSize + dsResultSize + dsToDsResultSize == 0 ? "SUCCESS" : "FAIL"});
|
||
int uncheckedEvents = epcisResultSize + dsResultSize + dsToDsResultSize;
|
||
if (uncheckedEvents > 0) {
|
||
missingEvent(uncheckedEvents);
|
||
}
|
||
|
||
}
|
||
} catch (Exception e) {
|
||
log.error(null, e);
|
||
}
|
||
|
||
}
|
||
|
||
@Override
|
||
public void logFileAnalysed(Map<String, Integer> epcisResults, Map<String, Integer> dsResults, Map<String, Integer> dsToDsResults) {
|
||
for (String container : epcisResults.keySet()) {
|
||
DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
|
||
int epcisResultSize = epcisResults.get(container);
|
||
int dsResultSize = dsResults.get(container);
|
||
int dsToDsResultSize = dsToDsResults.get(container);
|
||
tableId++;
|
||
|
||
model.addRow(new String[]{tableId + "", container, epcisResultSize + "", dsResultSize + "", dsToDsResultSize + "", epcisResultSize + dsResultSize + dsToDsResultSize == 0 ? "SUCCESS" : "FAIL"});
|
||
int uncheckedEvents = epcisResultSize + dsResultSize + dsToDsResultSize;
|
||
if (uncheckedEvents > 0) {
|
||
missingEvent(uncheckedEvents);
|
||
}
|
||
}
|
||
}
|
||
|
||
/**
|
||
* @return the iota
|
||
*/
|
||
public IOTA getIota() {
|
||
return iota;
|
||
}
|
||
|
||
/**
|
||
* @param iota the iota to set
|
||
*/
|
||
public void setIota(IOTA iota) {
|
||
this.iota = iota;
|
||
}
|
||
|
||
/**
|
||
* @return the analyserResult
|
||
*/
|
||
public AnalyserResult getAnalyserResult() {
|
||
return analyserResult;
|
||
}
|
||
|
||
private void createTree() {
|
||
tree = new FileTree(new File(Configuration.STATS_FOLDER), jTabbedPane, this);
|
||
jSplitPane1.setLeftComponent(tree);
|
||
jSplitPane1.setRightComponent(jTabbedPane);
|
||
}
|
||
|
||
private void createTabbedPane() {
|
||
jTabbedPane = new JTabbedPane();
|
||
jTabbedPane.addTab("Home", new JPanel());
|
||
}
|
||
|
||
@Override
|
||
public void windowOpened(WindowEvent e) {
|
||
}
|
||
|
||
@Override
|
||
public void windowClosing(WindowEvent e) {
|
||
if (JOptionPane.YES_OPTION != JOptionPane.showConfirmDialog(this, "Do you want to quit the program?")) {
|
||
return;
|
||
}
|
||
System.exit(0);
|
||
}
|
||
|
||
@Override
|
||
public void windowClosed(WindowEvent e) {
|
||
}
|
||
|
||
@Override
|
||
public void windowIconified(WindowEvent e) {
|
||
}
|
||
|
||
@Override
|
||
public void windowDeiconified(WindowEvent e) {
|
||
}
|
||
|
||
@Override
|
||
public void windowActivated(WindowEvent e) {
|
||
}
|
||
|
||
@Override
|
||
public void windowDeactivated(WindowEvent e) {
|
||
}
|
||
}
|
DELTa/src/main/java/fr/unicaen/iota/validator/gui/IdCellRenderer.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.validator.gui;
|
||
|
||
import java.awt.Color;
|
||
import java.awt.Component;
|
||
import javax.swing.JLabel;
|
||
import javax.swing.JTable;
|
||
import javax.swing.table.TableCellRenderer;
|
||
|
||
/**
|
||
*
|
||
*/
|
||
public class IdCellRenderer implements TableCellRenderer {
|
||
|
||
public IdCellRenderer() {
|
||
}
|
||
|
||
@Override
|
||
public Component getTableCellRendererComponent(JTable table, Object value,
|
||
boolean isSelected, boolean hasFocus, int row, int column) {
|
||
String report = (String) value;
|
||
JLabel component = new JLabel(report);
|
||
component.setHorizontalAlignment(JLabel.RIGHT);
|
||
component.setOpaque(true);
|
||
component.setAlignmentX(10);
|
||
if ("SUCCESS".equals(table.getValueAt(row, 5))) {
|
||
component.setBackground(Color.GREEN);
|
||
} else {
|
||
component.setBackground(Color.RED);
|
||
}
|
||
return component;
|
||
}
|
||
}
|
DELTa/src/main/java/fr/unicaen/iota/validator/gui/Preferences.form | ||
---|---|---|
<?xml version="1.0" encoding="UTF-8" ?>
|
||
|
||
<Form version="1.2" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||
<Properties>
|
||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||
<Color blue="e7" green="eb" red="ef" type="rgb"/>
|
||
</Property>
|
||
</Properties>
|
||
<SyntheticProperties>
|
||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||
</SyntheticProperties>
|
||
<Events>
|
||
<EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="closeDialog"/>
|
||
</Events>
|
||
<AuxValues>
|
||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-93,0,0,2,30"/>
|
||
</AuxValues>
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
|
||
<SubComponents>
|
||
<Container class="javax.swing.JPanel" name="jPanel1">
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||
<BorderConstraints direction="North"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/>
|
||
<SubComponents>
|
||
<Component class="javax.swing.JLabel" name="jLabel1">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value=" add or remove servers during analysis :"/>
|
||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||
<Dimension value="[248, 30]"/>
|
||
</Property>
|
||
</Properties>
|
||
</Component>
|
||
</SubComponents>
|
||
</Container>
|
||
<Container class="javax.swing.JPanel" name="jPanel2">
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||
<BorderConstraints direction="South"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
|
||
<SubComponents>
|
||
<Component class="javax.swing.JButton" name="jButton2">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="Validate"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
<Component class="javax.swing.JButton" name="jButton1">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="load"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
<Component class="javax.swing.JButton" name="jButton3">
|
||
<Properties>
|
||
<Property name="text" type="java.lang.String" value="save"/>
|
||
</Properties>
|
||
<Events>
|
||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/>
|
||
</Events>
|
||
</Component>
|
||
</SubComponents>
|
||
</Container>
|
||
<Container class="javax.swing.JPanel" name="jPanel3">
|
||
<Constraints>
|
||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||
<BorderConstraints direction="Center"/>
|
||
</Constraint>
|
||
</Constraints>
|
||
|
||
<Layout>
|
||
<DimensionLayout dim="0">
|
||
<Group type="103" groupAlignment="0" attributes="0">
|
||
<Component id="jScrollPane1" alignment="0" pref="542" max="32767" attributes="0"/>
|
||
</Group>
|
||
</DimensionLayout>
|
||
<DimensionLayout dim="1">
|
||
<Group type="103" groupAlignment="0" attributes="0">
|
||
<Component id="jScrollPane1" alignment="0" pref="354" max="32767" attributes="0"/>
|
||
</Group>
|
||
</DimensionLayout>
|
||
</Layout>
|
||
<SubComponents>
|
||
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||
<SubComponents>
|
||
<Component class="javax.swing.JTree" name="jTree1">
|
||
</Component>
|
||
</SubComponents>
|
||
</Container>
|
||
</SubComponents>
|
||
</Container>
|
||
</SubComponents>
|
||
</Form>
|
DELTa/src/main/java/fr/unicaen/iota/validator/gui/Preferences.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.validator.gui;
|
||
|
||
import fr.unicaen.iota.validator.Configuration;
|
||
import fr.unicaen.iota.validator.IOTA;
|
||
import fr.unicaen.iota.validator.model.EPCISLink;
|
||
import java.awt.Frame;
|
||
import java.io.File;
|
||
import java.io.FileWriter;
|
||
import java.io.IOException;
|
||
import java.util.ArrayList;
|
||
import java.util.List;
|
||
import javax.swing.JDialog;
|
||
import javax.swing.JFileChooser;
|
||
import javax.swing.JOptionPane;
|
||
import javax.swing.tree.DefaultMutableTreeNode;
|
||
import javax.swing.tree.DefaultTreeModel;
|
||
import org.apache.commons.logging.Log;
|
||
import org.apache.commons.logging.LogFactory;
|
Formats disponibles : Unified diff
Version 1.0