diff --git a/.gitmodules b/.gitmodules
index 98a34651..4e701d07 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,6 @@
[submodule "linphone/oRTP"]
- path = linphone/oRTP
+ path = oRTP
url = git://git.linphone.org/ortp.git
[submodule "linphone/mediastreamer2"]
- path = linphone/mediastreamer2
+ path = mediastreamer2
url = git://git.linphone.org/mediastreamer2.git
diff --git a/linphone/ABOUT-NLS b/ABOUT-NLS
similarity index 100%
rename from linphone/ABOUT-NLS
rename to ABOUT-NLS
diff --git a/linphone/AUTHORS b/AUTHORS
similarity index 100%
rename from linphone/AUTHORS
rename to AUTHORS
diff --git a/linphone/BUGS b/BUGS
similarity index 100%
rename from linphone/BUGS
rename to BUGS
diff --git a/linphone/COPYING b/COPYING
similarity index 100%
rename from linphone/COPYING
rename to COPYING
diff --git a/linphone/ChangeLog b/ChangeLog
similarity index 100%
rename from linphone/ChangeLog
rename to ChangeLog
diff --git a/linphone/Makefile.am b/Makefile.am
similarity index 100%
rename from linphone/Makefile.am
rename to Makefile.am
diff --git a/linphone/NEWS b/NEWS
similarity index 100%
rename from linphone/NEWS
rename to NEWS
diff --git a/linphone/README b/README
similarity index 100%
rename from linphone/README
rename to README
diff --git a/linphone/README.M68k.txt b/README.M68k.txt
similarity index 100%
rename from linphone/README.M68k.txt
rename to README.M68k.txt
diff --git a/linphone/README.arm b/README.arm
similarity index 100%
rename from linphone/README.arm
rename to README.arm
diff --git a/linphone/README.macos b/README.macos
similarity index 100%
rename from linphone/README.macos
rename to README.macos
diff --git a/linphone/README.mingw b/README.mingw
similarity index 100%
rename from linphone/README.mingw
rename to README.mingw
diff --git a/linphone/TODO b/TODO
similarity index 100%
rename from linphone/TODO
rename to TODO
diff --git a/linphone/autogen.sh b/autogen.sh
similarity index 100%
rename from linphone/autogen.sh
rename to autogen.sh
diff --git a/linphone/build/wince/liblinphone.sln b/build/wince/liblinphone.sln
similarity index 100%
rename from linphone/build/wince/liblinphone.sln
rename to build/wince/liblinphone.sln
diff --git a/linphone/build/wince/liblinphone.vcproj b/build/wince/liblinphone.vcproj
similarity index 100%
rename from linphone/build/wince/liblinphone.vcproj
rename to build/wince/liblinphone.vcproj
diff --git a/linphone/build/wince/linphonec/linphonec.vcproj b/build/wince/linphonec/linphonec.vcproj
similarity index 100%
rename from linphone/build/wince/linphonec/linphonec.vcproj
rename to build/wince/linphonec/linphonec.vcproj
diff --git a/linphone/config.rpath b/config.rpath
similarity index 100%
rename from linphone/config.rpath
rename to config.rpath
diff --git a/linphone/configure.in b/configure.in
similarity index 100%
rename from linphone/configure.in
rename to configure.in
diff --git a/linphone/console/.gitignore b/console/.gitignore
similarity index 100%
rename from linphone/console/.gitignore
rename to console/.gitignore
diff --git a/linphone/console/Makefile.am b/console/Makefile.am
similarity index 100%
rename from linphone/console/Makefile.am
rename to console/Makefile.am
diff --git a/linphone/console/TODO b/console/TODO
similarity index 100%
rename from linphone/console/TODO
rename to console/TODO
diff --git a/linphone/console/commands.c b/console/commands.c
similarity index 100%
rename from linphone/console/commands.c
rename to console/commands.c
diff --git a/linphone/console/example/linphonec b/console/example/linphonec
similarity index 100%
rename from linphone/console/example/linphonec
rename to console/example/linphonec
diff --git a/linphone/console/linphonec.c b/console/linphonec.c
similarity index 100%
rename from linphone/console/linphonec.c
rename to console/linphonec.c
diff --git a/linphone/console/linphonec.h b/console/linphonec.h
similarity index 100%
rename from linphone/console/linphonec.h
rename to console/linphonec.h
diff --git a/linphone/console/shell.c b/console/shell.c
similarity index 100%
rename from linphone/console/shell.c
rename to console/shell.c
diff --git a/linphone/console/sipomatic.c b/console/sipomatic.c
similarity index 100%
rename from linphone/console/sipomatic.c
rename to console/sipomatic.c
diff --git a/linphone/console/sipomatic.h b/console/sipomatic.h
similarity index 100%
rename from linphone/console/sipomatic.h
rename to console/sipomatic.h
diff --git a/linphone/console/wav2raw.c b/console/wav2raw.c
similarity index 100%
rename from linphone/console/wav2raw.c
rename to console/wav2raw.c
diff --git a/linphone/coreapi/.gitignore b/coreapi/.gitignore
similarity index 100%
rename from linphone/coreapi/.gitignore
rename to coreapi/.gitignore
diff --git a/linphone/coreapi/Makefile.am b/coreapi/Makefile.am
similarity index 100%
rename from linphone/coreapi/Makefile.am
rename to coreapi/Makefile.am
diff --git a/linphone/coreapi/address.c b/coreapi/address.c
similarity index 100%
rename from linphone/coreapi/address.c
rename to coreapi/address.c
diff --git a/linphone/coreapi/authentication.c b/coreapi/authentication.c
similarity index 100%
rename from linphone/coreapi/authentication.c
rename to coreapi/authentication.c
diff --git a/linphone/coreapi/chat.c b/coreapi/chat.c
similarity index 100%
rename from linphone/coreapi/chat.c
rename to coreapi/chat.c
diff --git a/linphone/coreapi/enum.c b/coreapi/enum.c
similarity index 100%
rename from linphone/coreapi/enum.c
rename to coreapi/enum.c
diff --git a/linphone/coreapi/enum.h b/coreapi/enum.h
similarity index 100%
rename from linphone/coreapi/enum.h
rename to coreapi/enum.h
diff --git a/linphone/coreapi/exevents.c b/coreapi/exevents.c
similarity index 100%
rename from linphone/coreapi/exevents.c
rename to coreapi/exevents.c
diff --git a/linphone/coreapi/exevents.h b/coreapi/exevents.h
similarity index 100%
rename from linphone/coreapi/exevents.h
rename to coreapi/exevents.h
diff --git a/linphone/coreapi/fonis.c b/coreapi/fonis.c
similarity index 100%
rename from linphone/coreapi/fonis.c
rename to coreapi/fonis.c
diff --git a/linphone/coreapi/friend.c b/coreapi/friend.c
similarity index 100%
rename from linphone/coreapi/friend.c
rename to coreapi/friend.c
diff --git a/linphone/coreapi/general_state.c b/coreapi/general_state.c
similarity index 100%
rename from linphone/coreapi/general_state.c
rename to coreapi/general_state.c
diff --git a/linphone/coreapi/help/Doxyfile.in b/coreapi/help/Doxyfile.in
similarity index 100%
rename from linphone/coreapi/help/Doxyfile.in
rename to coreapi/help/Doxyfile.in
diff --git a/linphone/coreapi/help/Makefile.am b/coreapi/help/Makefile.am
similarity index 100%
rename from linphone/coreapi/help/Makefile.am
rename to coreapi/help/Makefile.am
diff --git a/linphone/coreapi/help/doxygen.dox.in b/coreapi/help/doxygen.dox.in
similarity index 100%
rename from linphone/coreapi/help/doxygen.dox.in
rename to coreapi/help/doxygen.dox.in
diff --git a/linphone/coreapi/linphonecore.c b/coreapi/linphonecore.c
similarity index 100%
rename from linphone/coreapi/linphonecore.c
rename to coreapi/linphonecore.c
diff --git a/linphone/coreapi/linphonecore.h b/coreapi/linphonecore.h
similarity index 100%
rename from linphone/coreapi/linphonecore.h
rename to coreapi/linphonecore.h
diff --git a/linphone/coreapi/lpconfig.c b/coreapi/lpconfig.c
similarity index 100%
rename from linphone/coreapi/lpconfig.c
rename to coreapi/lpconfig.c
diff --git a/linphone/coreapi/lpconfig.h b/coreapi/lpconfig.h
similarity index 100%
rename from linphone/coreapi/lpconfig.h
rename to coreapi/lpconfig.h
diff --git a/linphone/coreapi/misc.c b/coreapi/misc.c
similarity index 100%
rename from linphone/coreapi/misc.c
rename to coreapi/misc.c
diff --git a/linphone/coreapi/plugins/buddylookup/AUTHORS b/coreapi/plugins/buddylookup/AUTHORS
similarity index 100%
rename from linphone/coreapi/plugins/buddylookup/AUTHORS
rename to coreapi/plugins/buddylookup/AUTHORS
diff --git a/linphone/coreapi/plugins/buddylookup/COPYING b/coreapi/plugins/buddylookup/COPYING
similarity index 100%
rename from linphone/coreapi/plugins/buddylookup/COPYING
rename to coreapi/plugins/buddylookup/COPYING
diff --git a/linphone/coreapi/plugins/buddylookup/ChangeLog b/coreapi/plugins/buddylookup/ChangeLog
similarity index 100%
rename from linphone/coreapi/plugins/buddylookup/ChangeLog
rename to coreapi/plugins/buddylookup/ChangeLog
diff --git a/linphone/coreapi/plugins/buddylookup/INSTALL b/coreapi/plugins/buddylookup/INSTALL
similarity index 100%
rename from linphone/coreapi/plugins/buddylookup/INSTALL
rename to coreapi/plugins/buddylookup/INSTALL
diff --git a/linphone/coreapi/plugins/buddylookup/Makefile.am b/coreapi/plugins/buddylookup/Makefile.am
similarity index 100%
rename from linphone/coreapi/plugins/buddylookup/Makefile.am
rename to coreapi/plugins/buddylookup/Makefile.am
diff --git a/linphone/coreapi/plugins/buddylookup/NEWS b/coreapi/plugins/buddylookup/NEWS
similarity index 100%
rename from linphone/coreapi/plugins/buddylookup/NEWS
rename to coreapi/plugins/buddylookup/NEWS
diff --git a/linphone/coreapi/plugins/buddylookup/README b/coreapi/plugins/buddylookup/README
similarity index 100%
rename from linphone/coreapi/plugins/buddylookup/README
rename to coreapi/plugins/buddylookup/README
diff --git a/linphone/coreapi/plugins/buddylookup/autogen.sh b/coreapi/plugins/buddylookup/autogen.sh
similarity index 100%
rename from linphone/coreapi/plugins/buddylookup/autogen.sh
rename to coreapi/plugins/buddylookup/autogen.sh
diff --git a/linphone/coreapi/plugins/buddylookup/configure.ac b/coreapi/plugins/buddylookup/configure.ac
similarity index 100%
rename from linphone/coreapi/plugins/buddylookup/configure.ac
rename to coreapi/plugins/buddylookup/configure.ac
diff --git a/linphone/coreapi/plugins/buddylookup/src/Makefile.am b/coreapi/plugins/buddylookup/src/Makefile.am
similarity index 100%
rename from linphone/coreapi/plugins/buddylookup/src/Makefile.am
rename to coreapi/plugins/buddylookup/src/Makefile.am
diff --git a/linphone/coreapi/plugins/buddylookup/src/lookup.c b/coreapi/plugins/buddylookup/src/lookup.c
similarity index 100%
rename from linphone/coreapi/plugins/buddylookup/src/lookup.c
rename to coreapi/plugins/buddylookup/src/lookup.c
diff --git a/linphone/coreapi/presence.c b/coreapi/presence.c
similarity index 100%
rename from linphone/coreapi/presence.c
rename to coreapi/presence.c
diff --git a/linphone/coreapi/private.h b/coreapi/private.h
similarity index 100%
rename from linphone/coreapi/private.h
rename to coreapi/private.h
diff --git a/linphone/coreapi/proxy.c b/coreapi/proxy.c
similarity index 100%
rename from linphone/coreapi/proxy.c
rename to coreapi/proxy.c
diff --git a/linphone/coreapi/sdphandler.c b/coreapi/sdphandler.c
similarity index 100%
rename from linphone/coreapi/sdphandler.c
rename to coreapi/sdphandler.c
diff --git a/linphone/coreapi/sdphandler.h b/coreapi/sdphandler.h
similarity index 100%
rename from linphone/coreapi/sdphandler.h
rename to coreapi/sdphandler.h
diff --git a/linphone/coreapi/siplogin.c b/coreapi/siplogin.c
similarity index 100%
rename from linphone/coreapi/siplogin.c
rename to coreapi/siplogin.c
diff --git a/linphone/coreapi/sipsetup.c b/coreapi/sipsetup.c
similarity index 100%
rename from linphone/coreapi/sipsetup.c
rename to coreapi/sipsetup.c
diff --git a/linphone/coreapi/sipsetup.h b/coreapi/sipsetup.h
similarity index 100%
rename from linphone/coreapi/sipsetup.h
rename to coreapi/sipsetup.h
diff --git a/linphone/gen-gtkfilelist.sh b/gen-gtkfilelist.sh
similarity index 100%
rename from linphone/gen-gtkfilelist.sh
rename to gen-gtkfilelist.sh
diff --git a/linphone/gtk+-2.16.2.filelist b/gtk+-2.16.2.filelist
similarity index 100%
rename from linphone/gtk+-2.16.2.filelist
rename to gtk+-2.16.2.filelist
diff --git a/linphone/gtk+-2.16.6.filelist b/gtk+-2.16.6.filelist
similarity index 100%
rename from linphone/gtk+-2.16.6.filelist
rename to gtk+-2.16.6.filelist
diff --git a/linphone/gtk+-2.18.5.filelist b/gtk+-2.18.5.filelist
similarity index 100%
rename from linphone/gtk+-2.18.5.filelist
rename to gtk+-2.18.5.filelist
diff --git a/linphone/gtk-glade/.gitignore b/gtk-glade/.gitignore
similarity index 100%
rename from linphone/gtk-glade/.gitignore
rename to gtk-glade/.gitignore
diff --git a/linphone/gtk-glade/Makefile.am b/gtk-glade/Makefile.am
similarity index 100%
rename from linphone/gtk-glade/Makefile.am
rename to gtk-glade/Makefile.am
diff --git a/linphone/gtk-glade/about.glade b/gtk-glade/about.glade
similarity index 100%
rename from linphone/gtk-glade/about.glade
rename to gtk-glade/about.glade
diff --git a/linphone/gtk-glade/buddylookup.c b/gtk-glade/buddylookup.c
similarity index 100%
rename from linphone/gtk-glade/buddylookup.c
rename to gtk-glade/buddylookup.c
diff --git a/linphone/gtk-glade/buddylookup.glade b/gtk-glade/buddylookup.glade
similarity index 100%
rename from linphone/gtk-glade/buddylookup.glade
rename to gtk-glade/buddylookup.glade
diff --git a/linphone/gtk-glade/call_logs.glade b/gtk-glade/call_logs.glade
similarity index 100%
rename from linphone/gtk-glade/call_logs.glade
rename to gtk-glade/call_logs.glade
diff --git a/linphone/gtk-glade/calllogs.c b/gtk-glade/calllogs.c
similarity index 100%
rename from linphone/gtk-glade/calllogs.c
rename to gtk-glade/calllogs.c
diff --git a/linphone/gtk-glade/chat.c b/gtk-glade/chat.c
similarity index 100%
rename from linphone/gtk-glade/chat.c
rename to gtk-glade/chat.c
diff --git a/linphone/gtk-glade/chatroom.glade b/gtk-glade/chatroom.glade
similarity index 100%
rename from linphone/gtk-glade/chatroom.glade
rename to gtk-glade/chatroom.glade
diff --git a/linphone/gtk-glade/contact.glade b/gtk-glade/contact.glade
similarity index 100%
rename from linphone/gtk-glade/contact.glade
rename to gtk-glade/contact.glade
diff --git a/linphone/gtk-glade/fonis.c b/gtk-glade/fonis.c
similarity index 100%
rename from linphone/gtk-glade/fonis.c
rename to gtk-glade/fonis.c
diff --git a/linphone/gtk-glade/friendlist.c b/gtk-glade/friendlist.c
similarity index 100%
rename from linphone/gtk-glade/friendlist.c
rename to gtk-glade/friendlist.c
diff --git a/linphone/gtk-glade/gtkrc b/gtk-glade/gtkrc
similarity index 100%
rename from linphone/gtk-glade/gtkrc
rename to gtk-glade/gtkrc
diff --git a/linphone/gtk-glade/incall_view.c b/gtk-glade/incall_view.c
similarity index 100%
rename from linphone/gtk-glade/incall_view.c
rename to gtk-glade/incall_view.c
diff --git a/linphone/gtk-glade/incoming_call.glade b/gtk-glade/incoming_call.glade
similarity index 100%
rename from linphone/gtk-glade/incoming_call.glade
rename to gtk-glade/incoming_call.glade
diff --git a/linphone/gtk-glade/linphone.h b/gtk-glade/linphone.h
similarity index 100%
rename from linphone/gtk-glade/linphone.h
rename to gtk-glade/linphone.h
diff --git a/linphone/gtk-glade/linphone.ico b/gtk-glade/linphone.ico
similarity index 100%
rename from linphone/gtk-glade/linphone.ico
rename to gtk-glade/linphone.ico
diff --git a/linphone/gtk-glade/linphone.iss b/gtk-glade/linphone.iss
similarity index 100%
rename from linphone/gtk-glade/linphone.iss
rename to gtk-glade/linphone.iss
diff --git a/linphone/gtk-glade/linphone.png b/gtk-glade/linphone.png
similarity index 100%
rename from linphone/gtk-glade/linphone.png
rename to gtk-glade/linphone.png
diff --git a/linphone/gtk-glade/linphone.rc b/gtk-glade/linphone.rc
similarity index 100%
rename from linphone/gtk-glade/linphone.rc
rename to gtk-glade/linphone.rc
diff --git a/linphone/gtk-glade/linphone2.png b/gtk-glade/linphone2.png
similarity index 100%
rename from linphone/gtk-glade/linphone2.png
rename to gtk-glade/linphone2.png
diff --git a/linphone/gtk-glade/log.glade b/gtk-glade/log.glade
similarity index 100%
rename from linphone/gtk-glade/log.glade
rename to gtk-glade/log.glade
diff --git a/linphone/gtk-glade/logging.c b/gtk-glade/logging.c
similarity index 100%
rename from linphone/gtk-glade/logging.c
rename to gtk-glade/logging.c
diff --git a/linphone/gtk-glade/loginframe.c b/gtk-glade/loginframe.c
similarity index 100%
rename from linphone/gtk-glade/loginframe.c
rename to gtk-glade/loginframe.c
diff --git a/linphone/gtk-glade/main.c b/gtk-glade/main.c
similarity index 100%
rename from linphone/gtk-glade/main.c
rename to gtk-glade/main.c
diff --git a/linphone/gtk-glade/main.glade b/gtk-glade/main.glade
similarity index 100%
rename from linphone/gtk-glade/main.glade
rename to gtk-glade/main.glade
diff --git a/linphone/gtk-glade/p2pwizard.glade b/gtk-glade/p2pwizard.glade
similarity index 100%
rename from linphone/gtk-glade/p2pwizard.glade
rename to gtk-glade/p2pwizard.glade
diff --git a/linphone/gtk-glade/parameters.glade b/gtk-glade/parameters.glade
similarity index 100%
rename from linphone/gtk-glade/parameters.glade
rename to gtk-glade/parameters.glade
diff --git a/linphone/gtk-glade/password.glade b/gtk-glade/password.glade
similarity index 100%
rename from linphone/gtk-glade/password.glade
rename to gtk-glade/password.glade
diff --git a/linphone/gtk-glade/propertybox.c b/gtk-glade/propertybox.c
similarity index 100%
rename from linphone/gtk-glade/propertybox.c
rename to gtk-glade/propertybox.c
diff --git a/linphone/gtk-glade/setupwizard.c b/gtk-glade/setupwizard.c
similarity index 100%
rename from linphone/gtk-glade/setupwizard.c
rename to gtk-glade/setupwizard.c
diff --git a/linphone/gtk-glade/sip_account.glade b/gtk-glade/sip_account.glade
similarity index 100%
rename from linphone/gtk-glade/sip_account.glade
rename to gtk-glade/sip_account.glade
diff --git a/linphone/gtk-glade/stock_people.png b/gtk-glade/stock_people.png
similarity index 100%
rename from linphone/gtk-glade/stock_people.png
rename to gtk-glade/stock_people.png
diff --git a/linphone/gtk-glade/support.c b/gtk-glade/support.c
similarity index 100%
rename from linphone/gtk-glade/support.c
rename to gtk-glade/support.c
diff --git a/linphone/gtk-glade/update.c b/gtk-glade/update.c
similarity index 100%
rename from linphone/gtk-glade/update.c
rename to gtk-glade/update.c
diff --git a/linphone/gtk-glade/utils.c b/gtk-glade/utils.c
similarity index 100%
rename from linphone/gtk-glade/utils.c
rename to gtk-glade/utils.c
diff --git a/linphone/gtk-glade/waiting.glade b/gtk-glade/waiting.glade
similarity index 100%
rename from linphone/gtk-glade/waiting.glade
rename to gtk-glade/waiting.glade
diff --git a/linphone/intl/ChangeLog b/intl/ChangeLog
similarity index 100%
rename from linphone/intl/ChangeLog
rename to intl/ChangeLog
diff --git a/linphone/intl/Makefile.in b/intl/Makefile.in
similarity index 100%
rename from linphone/intl/Makefile.in
rename to intl/Makefile.in
diff --git a/linphone/intl/VERSION b/intl/VERSION
similarity index 100%
rename from linphone/intl/VERSION
rename to intl/VERSION
diff --git a/linphone/intl/bindtextdom.c b/intl/bindtextdom.c
similarity index 100%
rename from linphone/intl/bindtextdom.c
rename to intl/bindtextdom.c
diff --git a/linphone/intl/cat-compat.c b/intl/cat-compat.c
similarity index 100%
rename from linphone/intl/cat-compat.c
rename to intl/cat-compat.c
diff --git a/linphone/intl/dcgettext.c b/intl/dcgettext.c
similarity index 100%
rename from linphone/intl/dcgettext.c
rename to intl/dcgettext.c
diff --git a/linphone/intl/dgettext.c b/intl/dgettext.c
similarity index 100%
rename from linphone/intl/dgettext.c
rename to intl/dgettext.c
diff --git a/linphone/intl/explodename.c b/intl/explodename.c
similarity index 100%
rename from linphone/intl/explodename.c
rename to intl/explodename.c
diff --git a/linphone/intl/finddomain.c b/intl/finddomain.c
similarity index 100%
rename from linphone/intl/finddomain.c
rename to intl/finddomain.c
diff --git a/linphone/intl/gettext.c b/intl/gettext.c
similarity index 100%
rename from linphone/intl/gettext.c
rename to intl/gettext.c
diff --git a/linphone/intl/gettext.h b/intl/gettext.h
similarity index 100%
rename from linphone/intl/gettext.h
rename to intl/gettext.h
diff --git a/linphone/intl/gettextP.h b/intl/gettextP.h
similarity index 100%
rename from linphone/intl/gettextP.h
rename to intl/gettextP.h
diff --git a/linphone/intl/hash-string.h b/intl/hash-string.h
similarity index 100%
rename from linphone/intl/hash-string.h
rename to intl/hash-string.h
diff --git a/linphone/intl/intl-compat.c b/intl/intl-compat.c
similarity index 100%
rename from linphone/intl/intl-compat.c
rename to intl/intl-compat.c
diff --git a/linphone/intl/l10nflist.c b/intl/l10nflist.c
similarity index 100%
rename from linphone/intl/l10nflist.c
rename to intl/l10nflist.c
diff --git a/linphone/intl/libgettext.h b/intl/libgettext.h
similarity index 100%
rename from linphone/intl/libgettext.h
rename to intl/libgettext.h
diff --git a/linphone/intl/linux-msg.sed b/intl/linux-msg.sed
similarity index 100%
rename from linphone/intl/linux-msg.sed
rename to intl/linux-msg.sed
diff --git a/linphone/intl/loadinfo.h b/intl/loadinfo.h
similarity index 100%
rename from linphone/intl/loadinfo.h
rename to intl/loadinfo.h
diff --git a/linphone/intl/loadmsgcat.c b/intl/loadmsgcat.c
similarity index 100%
rename from linphone/intl/loadmsgcat.c
rename to intl/loadmsgcat.c
diff --git a/linphone/intl/localealias.c b/intl/localealias.c
similarity index 100%
rename from linphone/intl/localealias.c
rename to intl/localealias.c
diff --git a/linphone/intl/po2tbl.sed.in b/intl/po2tbl.sed.in
similarity index 100%
rename from linphone/intl/po2tbl.sed.in
rename to intl/po2tbl.sed.in
diff --git a/linphone/intl/textdomain.c b/intl/textdomain.c
similarity index 100%
rename from linphone/intl/textdomain.c
rename to intl/textdomain.c
diff --git a/linphone/intl/xopen-msg.sed b/intl/xopen-msg.sed
similarity index 100%
rename from linphone/intl/xopen-msg.sed
rename to intl/xopen-msg.sed
diff --git a/linphone/intltool-extract.in b/intltool-extract.in
similarity index 100%
rename from linphone/intltool-extract.in
rename to intltool-extract.in
diff --git a/linphone/intltool-merge.in b/intltool-merge.in
similarity index 100%
rename from linphone/intltool-merge.in
rename to intltool-merge.in
diff --git a/linphone/intltool-update.in b/intltool-update.in
similarity index 100%
rename from linphone/intltool-update.in
rename to intltool-update.in
diff --git a/linphone/linphone-deps.filelist b/linphone-deps.filelist
similarity index 100%
rename from linphone/linphone-deps.filelist
rename to linphone-deps.filelist
diff --git a/linphone/linphone.iss.in b/linphone.iss.in
similarity index 100%
rename from linphone/linphone.iss.in
rename to linphone.iss.in
diff --git a/linphone/linphone.kdevelop b/linphone.kdevelop
similarity index 100%
rename from linphone/linphone.kdevelop
rename to linphone.kdevelop
diff --git a/linphone/linphone.spec.in b/linphone.spec.in
similarity index 100%
rename from linphone/linphone.spec.in
rename to linphone.spec.in
diff --git a/linphone/mingw-envsetup.sh b/linphone/mingw-envsetup.sh
deleted file mode 100644
index 9f79d897..00000000
--- a/linphone/mingw-envsetup.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-export PATH=$PATH:"${PROGRAMFILES}\GnuWin32\bin":"${PROGRAMFILES}\Inno Setup 5"
-export PERL=/c/Perl/bin/perl.exe
-export INTLTOOL_PERL=/c/Perl/bin/perl.exe
-
-
diff --git a/linphone/m4/.gitignore b/m4/.gitignore
similarity index 100%
rename from linphone/m4/.gitignore
rename to m4/.gitignore
diff --git a/linphone/m4/Makefile.am b/m4/Makefile.am
similarity index 100%
rename from linphone/m4/Makefile.am
rename to m4/Makefile.am
diff --git a/linphone/m4/codeset.m4 b/m4/codeset.m4
similarity index 100%
rename from linphone/m4/codeset.m4
rename to m4/codeset.m4
diff --git a/linphone/m4/exosip.m4 b/m4/exosip.m4
similarity index 100%
rename from linphone/m4/exosip.m4
rename to m4/exosip.m4
diff --git a/linphone/m4/gettext.m4 b/m4/gettext.m4
similarity index 100%
rename from linphone/m4/gettext.m4
rename to m4/gettext.m4
diff --git a/linphone/m4/glibc2.m4 b/m4/glibc2.m4
similarity index 100%
rename from linphone/m4/glibc2.m4
rename to m4/glibc2.m4
diff --git a/linphone/m4/glibc21.m4 b/m4/glibc21.m4
similarity index 100%
rename from linphone/m4/glibc21.m4
rename to m4/glibc21.m4
diff --git a/linphone/m4/iconv.m4 b/m4/iconv.m4
similarity index 100%
rename from linphone/m4/iconv.m4
rename to m4/iconv.m4
diff --git a/linphone/m4/ilbc.m4 b/m4/ilbc.m4
similarity index 100%
rename from linphone/m4/ilbc.m4
rename to m4/ilbc.m4
diff --git a/linphone/m4/intdiv0.m4 b/m4/intdiv0.m4
similarity index 100%
rename from linphone/m4/intdiv0.m4
rename to m4/intdiv0.m4
diff --git a/linphone/m4/intl.m4 b/m4/intl.m4
similarity index 100%
rename from linphone/m4/intl.m4
rename to m4/intl.m4
diff --git a/linphone/m4/intldir.m4 b/m4/intldir.m4
similarity index 100%
rename from linphone/m4/intldir.m4
rename to m4/intldir.m4
diff --git a/linphone/m4/intmax.m4 b/m4/intmax.m4
similarity index 100%
rename from linphone/m4/intmax.m4
rename to m4/intmax.m4
diff --git a/linphone/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4
similarity index 100%
rename from linphone/m4/inttypes-pri.m4
rename to m4/inttypes-pri.m4
diff --git a/linphone/m4/inttypes.m4 b/m4/inttypes.m4
similarity index 100%
rename from linphone/m4/inttypes.m4
rename to m4/inttypes.m4
diff --git a/linphone/m4/inttypes_h.m4 b/m4/inttypes_h.m4
similarity index 100%
rename from linphone/m4/inttypes_h.m4
rename to m4/inttypes_h.m4
diff --git a/linphone/m4/isc-posix.m4 b/m4/isc-posix.m4
similarity index 100%
rename from linphone/m4/isc-posix.m4
rename to m4/isc-posix.m4
diff --git a/linphone/m4/lcmessage.m4 b/m4/lcmessage.m4
similarity index 100%
rename from linphone/m4/lcmessage.m4
rename to m4/lcmessage.m4
diff --git a/linphone/m4/lib-ld.m4 b/m4/lib-ld.m4
similarity index 100%
rename from linphone/m4/lib-ld.m4
rename to m4/lib-ld.m4
diff --git a/linphone/m4/lib-link.m4 b/m4/lib-link.m4
similarity index 100%
rename from linphone/m4/lib-link.m4
rename to m4/lib-link.m4
diff --git a/linphone/m4/lib-prefix.m4 b/m4/lib-prefix.m4
similarity index 100%
rename from linphone/m4/lib-prefix.m4
rename to m4/lib-prefix.m4
diff --git a/linphone/m4/lock.m4 b/m4/lock.m4
similarity index 100%
rename from linphone/m4/lock.m4
rename to m4/lock.m4
diff --git a/linphone/m4/longdouble.m4 b/m4/longdouble.m4
similarity index 100%
rename from linphone/m4/longdouble.m4
rename to m4/longdouble.m4
diff --git a/linphone/m4/longlong.m4 b/m4/longlong.m4
similarity index 100%
rename from linphone/m4/longlong.m4
rename to m4/longlong.m4
diff --git a/linphone/m4/nls.m4 b/m4/nls.m4
similarity index 100%
rename from linphone/m4/nls.m4
rename to m4/nls.m4
diff --git a/linphone/m4/ortp.m4 b/m4/ortp.m4
similarity index 100%
rename from linphone/m4/ortp.m4
rename to m4/ortp.m4
diff --git a/linphone/m4/osip.m4 b/m4/osip.m4
similarity index 100%
rename from linphone/m4/osip.m4
rename to m4/osip.m4
diff --git a/linphone/m4/po.m4 b/m4/po.m4
similarity index 100%
rename from linphone/m4/po.m4
rename to m4/po.m4
diff --git a/linphone/m4/printf-posix.m4 b/m4/printf-posix.m4
similarity index 100%
rename from linphone/m4/printf-posix.m4
rename to m4/printf-posix.m4
diff --git a/linphone/m4/progtest.m4 b/m4/progtest.m4
similarity index 100%
rename from linphone/m4/progtest.m4
rename to m4/progtest.m4
diff --git a/linphone/m4/readline.m4 b/m4/readline.m4
similarity index 100%
rename from linphone/m4/readline.m4
rename to m4/readline.m4
diff --git a/linphone/m4/signed.m4 b/m4/signed.m4
similarity index 100%
rename from linphone/m4/signed.m4
rename to m4/signed.m4
diff --git a/linphone/m4/size_max.m4 b/m4/size_max.m4
similarity index 100%
rename from linphone/m4/size_max.m4
rename to m4/size_max.m4
diff --git a/linphone/m4/stdint_h.m4 b/m4/stdint_h.m4
similarity index 100%
rename from linphone/m4/stdint_h.m4
rename to m4/stdint_h.m4
diff --git a/linphone/m4/uintmax_t.m4 b/m4/uintmax_t.m4
similarity index 100%
rename from linphone/m4/uintmax_t.m4
rename to m4/uintmax_t.m4
diff --git a/linphone/m4/ulonglong.m4 b/m4/ulonglong.m4
similarity index 100%
rename from linphone/m4/ulonglong.m4
rename to m4/ulonglong.m4
diff --git a/linphone/m4/video.m4 b/m4/video.m4
similarity index 100%
rename from linphone/m4/video.m4
rename to m4/video.m4
diff --git a/linphone/m4/visibility.m4 b/m4/visibility.m4
similarity index 100%
rename from linphone/m4/visibility.m4
rename to m4/visibility.m4
diff --git a/linphone/m4/wchar_t.m4 b/m4/wchar_t.m4
similarity index 100%
rename from linphone/m4/wchar_t.m4
rename to m4/wchar_t.m4
diff --git a/linphone/m4/wint_t.m4 b/m4/wint_t.m4
similarity index 100%
rename from linphone/m4/wint_t.m4
rename to m4/wint_t.m4
diff --git a/linphone/m4/xsize.m4 b/m4/xsize.m4
similarity index 100%
rename from linphone/m4/xsize.m4
rename to m4/xsize.m4
diff --git a/linphone/media_api/.gitignore b/media_api/.gitignore
similarity index 100%
rename from linphone/media_api/.gitignore
rename to media_api/.gitignore
diff --git a/linphone/media_api/DESIGN.txt b/media_api/DESIGN.txt
similarity index 100%
rename from linphone/media_api/DESIGN.txt
rename to media_api/DESIGN.txt
diff --git a/linphone/media_api/Makefile.am b/media_api/Makefile.am
similarity index 100%
rename from linphone/media_api/Makefile.am
rename to media_api/Makefile.am
diff --git a/linphone/media_api/apitest.c b/media_api/apitest.c
similarity index 100%
rename from linphone/media_api/apitest.c
rename to media_api/apitest.c
diff --git a/linphone/media_api/apitest.h b/media_api/apitest.h
similarity index 100%
rename from linphone/media_api/apitest.h
rename to media_api/apitest.h
diff --git a/linphone/media_api/basiccall.c b/media_api/basiccall.c
similarity index 100%
rename from linphone/media_api/basiccall.c
rename to media_api/basiccall.c
diff --git a/linphone/media_api/basiccall.h b/media_api/basiccall.h
similarity index 100%
rename from linphone/media_api/basiccall.h
rename to media_api/basiccall.h
diff --git a/linphone/media_api/callmember.c b/media_api/callmember.c
similarity index 100%
rename from linphone/media_api/callmember.c
rename to media_api/callmember.c
diff --git a/linphone/media_api/callmember.h b/media_api/callmember.h
similarity index 100%
rename from linphone/media_api/callmember.h
rename to media_api/callmember.h
diff --git a/linphone/media_api/ccl b/media_api/ccl
similarity index 100%
rename from linphone/media_api/ccl
rename to media_api/ccl
diff --git a/linphone/media_api/common.h b/media_api/common.h
similarity index 100%
rename from linphone/media_api/common.h
rename to media_api/common.h
diff --git a/linphone/media_api/media_api.c b/media_api/media_api.c
similarity index 100%
rename from linphone/media_api/media_api.c
rename to media_api/media_api.c
diff --git a/linphone/media_api/media_api.h b/media_api/media_api.h
similarity index 100%
rename from linphone/media_api/media_api.h
rename to media_api/media_api.h
diff --git a/linphone/media_api/mediaflow.c b/media_api/mediaflow.c
similarity index 100%
rename from linphone/media_api/mediaflow.c
rename to media_api/mediaflow.c
diff --git a/linphone/media_api/mediaflow.h b/media_api/mediaflow.h
similarity index 100%
rename from linphone/media_api/mediaflow.h
rename to media_api/mediaflow.h
diff --git a/p2pproxy/.classpath b/p2pproxy/.classpath
deleted file mode 100644
index d4307def..00000000
--- a/p2pproxy/.classpath
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/p2pproxy/.cvsignore b/p2pproxy/.cvsignore
deleted file mode 100644
index da41270a..00000000
--- a/p2pproxy/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-eclipsebuild
-.settings
-antbuild*
-P2pNetwork-*
-sipp2
diff --git a/p2pproxy/.gcjbuilder b/p2pproxy/.gcjbuilder
deleted file mode 100644
index 1084bf2f..00000000
--- a/p2pproxy/.gcjbuilder
+++ /dev/null
@@ -1,21 +0,0 @@
-
- 0
- 0
-
- 0
-
-
-
- 0
-
- 2
-
-
-
-
-
-
- debug
- p2pproxy
- make
-
\ No newline at end of file
diff --git a/p2pproxy/.project b/p2pproxy/.project
deleted file mode 100644
index fbea5077..00000000
--- a/p2pproxy/.project
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
- p2pproxy
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
-
- org.eclipse.jdt.core.javanature
-
-
-
- jni_src
- 2
- jni_src
-
-
-
diff --git a/p2pproxy/AUTHORS b/p2pproxy/AUTHORS
deleted file mode 100644
index e69de29b..00000000
diff --git a/p2pproxy/COPYING b/p2pproxy/COPYING
deleted file mode 100644
index 94a9ed02..00000000
--- a/p2pproxy/COPYING
+++ /dev/null
@@ -1,674 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- 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.
-
-
- Copyright (C)
-
- 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 .
-
-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:
-
- Copyright (C)
- 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
-.
-
- 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
-.
diff --git a/p2pproxy/ChangeLog b/p2pproxy/ChangeLog
deleted file mode 100644
index e69de29b..00000000
diff --git a/p2pproxy/INSTALL b/p2pproxy/INSTALL
deleted file mode 100644
index 8b82ade0..00000000
--- a/p2pproxy/INSTALL
+++ /dev/null
@@ -1,291 +0,0 @@
-Installation Instructions
-*************************
-
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006, 2007, 2008 Free Software Foundation, Inc.
-
- This file is free documentation; the Free Software Foundation gives
-unlimited permission to copy, distribute and modify it.
-
-Basic Installation
-==================
-
- Briefly, the shell commands `./configure; make; make install' should
-configure, build, and install this package. The following
-more-detailed instructions are generic; see the `README' file for
-instructions specific to this package.
-
- The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation. It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions. Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, and a
-file `config.log' containing compiler output (useful mainly for
-debugging `configure').
-
- It can also use an optional file (typically called `config.cache'
-and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring. Caching is
-disabled by default to prevent problems with accidental use of stale
-cache files.
-
- If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
-be considered for the next release. If you are using the cache, and at
-some point `config.cache' contains results you don't want to keep, you
-may remove or edit it.
-
- The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'. You need `configure.ac' if
-you want to change it or regenerate `configure' using a newer version
-of `autoconf'.
-
-The simplest way to compile this package is:
-
- 1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system.
-
- Running `configure' might take a while. While running, it prints
- some messages telling which features it is checking for.
-
- 2. Type `make' to compile the package.
-
- 3. Optionally, type `make check' to run any self-tests that come with
- the package.
-
- 4. Type `make install' to install the programs and any data files and
- documentation.
-
- 5. You can remove the program binaries and object files from the
- source code directory by typing `make clean'. To also remove the
- files that `configure' created (so you can compile the package for
- a different kind of computer), type `make distclean'. There is
- also a `make maintainer-clean' target, but that is intended mainly
- for the package's developers. If you use it, you may have to get
- all sorts of other programs in order to regenerate files that came
- with the distribution.
-
- 6. Often, you can also type `make uninstall' to remove the installed
- files again.
-
-Compilers and Options
-=====================
-
- Some systems require unusual options for compilation or linking that
-the `configure' script does not know about. Run `./configure --help'
-for details on some of the pertinent environment variables.
-
- You can give `configure' initial values for configuration parameters
-by setting variables in the command line or in the environment. Here
-is an example:
-
- ./configure CC=c99 CFLAGS=-g LIBS=-lposix
-
- *Note Defining Variables::, for more details.
-
-Compiling For Multiple Architectures
-====================================
-
- You can compile the package for more than one kind of computer at the
-same time, by placing the object files for each architecture in their
-own directory. To do this, you can use GNU `make'. `cd' to the
-directory where you want the object files and executables to go and run
-the `configure' script. `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
-
- With a non-GNU `make', it is safer to compile the package for one
-architecture at a time in the source code directory. After you have
-installed the package for one architecture, use `make distclean' before
-reconfiguring for another architecture.
-
- On MacOS X 10.5 and later systems, you can create libraries and
-executables that work on multiple system types--known as "fat" or
-"universal" binaries--by specifying multiple `-arch' options to the
-compiler but only a single `-arch' option to the preprocessor. Like
-this:
-
- ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
- CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
- CPP="gcc -E" CXXCPP="g++ -E"
-
- This is not guaranteed to produce working output in all cases, you
-may have to build one architecture at a time and combine the results
-using the `lipo' tool if you have problems.
-
-Installation Names
-==================
-
- By default, `make install' installs the package's commands under
-`/usr/local/bin', include files under `/usr/local/include', etc. You
-can specify an installation prefix other than `/usr/local' by giving
-`configure' the option `--prefix=PREFIX'.
-
- You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files. If you
-pass the option `--exec-prefix=PREFIX' to `configure', the package uses
-PREFIX as the prefix for installing programs and libraries.
-Documentation and other data files still use the regular prefix.
-
- In addition, if you use an unusual directory layout you can give
-options like `--bindir=DIR' to specify different values for particular
-kinds of files. Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
-
- If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
-Optional Features
-=================
-
- Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System). The
-`README' should mention any `--enable-' and `--with-' options that the
-package recognizes.
-
- For packages that use the X Window System, `configure' can usually
-find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
-
-Particular systems
-==================
-
- On HP-UX, the default C compiler is not ANSI C compatible. If GNU
-CC is not installed, it is recommended to use the following options in
-order to use an ANSI C compiler:
-
- ./configure CC="cc -Ae"
-
-and if that doesn't work, install pre-built binaries of GCC for HP-UX.
-
- On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
-parse its `' header file. The option `-nodtk' can be used as
-a workaround. If GNU CC is not installed, it is therefore recommended
-to try
-
- ./configure CC="cc"
-
-and if that doesn't work, try
-
- ./configure CC="cc -nodtk"
-
-Specifying the System Type
-==========================
-
- There may be some features `configure' cannot figure out
-automatically, but needs to determine by the type of machine the package
-will run on. Usually, assuming the package is built to be run on the
-_same_ architectures, `configure' can figure that out, but if it prints
-a message saying it cannot guess the machine type, give it the
-`--build=TYPE' option. TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name which has the form:
-
- CPU-COMPANY-SYSTEM
-
-where SYSTEM can have one of these forms:
-
- OS KERNEL-OS
-
- See the file `config.sub' for the possible values of each field. If
-`config.sub' isn't included in this package, then this package doesn't
-need to know the machine type.
-
- If you are _building_ compiler tools for cross-compiling, you should
-use the option `--target=TYPE' to select the type of system they will
-produce code for.
-
- If you want to _use_ a cross compiler, that generates code for a
-platform different from the build platform, you should specify the
-"host" platform (i.e., that on which the generated programs will
-eventually be run) with `--host=TYPE'.
-
-Sharing Defaults
-================
-
- If you want to set default values for `configure' scripts to share,
-you can create a site shell script called `config.site' that gives
-default values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists. Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
-
-Defining Variables
-==================
-
- Variables not defined in a site shell script can be set in the
-environment passed to `configure'. However, some packages may run
-configure again during the build, and the customized values of these
-variables may be lost. In order to avoid this problem, you should set
-them in the `configure' command line, using `VAR=value'. For example:
-
- ./configure CC=/usr/local2/bin/gcc
-
-causes the specified `gcc' to be used as the C compiler (unless it is
-overridden in the site shell script).
-
-Unfortunately, this technique does not work for `CONFIG_SHELL' due to
-an Autoconf bug. Until the bug is fixed you can use this workaround:
-
- CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
-
-`configure' Invocation
-======================
-
- `configure' recognizes the following options to control how it
-operates.
-
-`--help'
-`-h'
- Print a summary of all of the options to `configure', and exit.
-
-`--help=short'
-`--help=recursive'
- Print a summary of the options unique to this package's
- `configure', and exit. The `short' variant lists options used
- only in the top level, while the `recursive' variant lists options
- also present in any nested packages.
-
-`--version'
-`-V'
- Print the version of Autoconf used to generate the `configure'
- script, and exit.
-
-`--cache-file=FILE'
- Enable the cache: use and save the results of the tests in FILE,
- traditionally `config.cache'. FILE defaults to `/dev/null' to
- disable caching.
-
-`--config-cache'
-`-C'
- Alias for `--cache-file=config.cache'.
-
-`--quiet'
-`--silent'
-`-q'
- Do not print messages saying which checks are being made. To
- suppress all normal output, redirect it to `/dev/null' (any error
- messages will still be shown).
-
-`--srcdir=DIR'
- Look for the package's source code in directory DIR. Usually
- `configure' can determine that directory automatically.
-
-`--prefix=DIR'
- Use DIR as the installation prefix. *Note Installation Names::
- for more details, including other options available for fine-tuning
- the installation locations.
-
-`--no-create'
-`-n'
- Run the configure checks, but stop before creating any output
- files.
-
-`configure' also accepts some other, not widely useful, options. Run
-`configure --help' for more details.
-
diff --git a/p2pproxy/Makefile.am b/p2pproxy/Makefile.am
deleted file mode 100644
index aaa51ae7..00000000
--- a/p2pproxy/Makefile.am
+++ /dev/null
@@ -1,19 +0,0 @@
-EXTRA_DIST=dependencies dependencies-src src test-src
-
-SUBDIRS=launcher plugin-src
-
-ALL_JARS= \
- $(top_builddir)/antbuild/dist/p2pproxy_0.1/bcprov-jdk14.jar $(top_builddir)/antbuild/dist/p2pproxy_0.1/log4j.jar \
- $(top_builddir)/antbuild/dist/p2pproxy_0.1/javax.servlet.jar $(top_builddir)/antbuild/dist/p2pproxy_0.1/org.mortbay.jetty.jar \
- $(top_builddir)/antbuild/dist/p2pproxy_0.1/jstun-0.7.0.jar $(top_builddir)/antbuild/dist/p2pproxy_0.1/p2pproxy.jar \
- $(top_builddir)/antbuild/dist/p2pproxy_0.1/junit-4.3.1.jar $(top_builddir)/antbuild/dist/p2pproxy_0.1/sip.jar
-
-$(ALL_JARS): src/org/linphone/p2pproxy/*/*.java
- $(ANT) dist
-
-jarsdir=$(datadir)/java/fonis
-
-jars_DATA=$(ALL_JARS)
-
-clean-local:
- $(ANT) clean
diff --git a/p2pproxy/NEWS b/p2pproxy/NEWS
deleted file mode 100644
index e69de29b..00000000
diff --git a/p2pproxy/README b/p2pproxy/README
deleted file mode 100644
index e69de29b..00000000
diff --git a/p2pproxy/autogen.sh b/p2pproxy/autogen.sh
deleted file mode 100755
index d342f286..00000000
--- a/p2pproxy/autogen.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-#AM_VERSION=1.10
-#1.9 was the recommended version
-if test -n "$AM_VERSION" ; then
- ACLOCAL=aclocal-${AM_VERSION}
- AUTOMAKE=automake-${AM_VERSION}
-else
- ACLOCAL=aclocal
- AUTOMAKE=automake
-fi
-
-echo "Generating build scripts in this mediastreamer plugin"
-set -x
-libtoolize --copy --force
-$ACLOCAL
-$AUTOMAKE --force-missing --add-missing --copy
-autoconf
-rm -rf config.cache
-
diff --git a/p2pproxy/bin/p2pproxy-cmd.bat b/p2pproxy/bin/p2pproxy-cmd.bat
deleted file mode 100644
index f1fc5f0c..00000000
--- a/p2pproxy/bin/p2pproxy-cmd.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-@echo off
-"%JAVA_HOME%\bin\java.exe" -cp p2pproxy.jar org.linphone.p2pproxy.core.utils.AccountManagerCli %1 %2 %3 %4 %5 %6 %7 %8 %9
\ No newline at end of file
diff --git a/p2pproxy/bin/p2pproxy-cmd.sh b/p2pproxy/bin/p2pproxy-cmd.sh
deleted file mode 100644
index 1598057d..00000000
--- a/p2pproxy/bin/p2pproxy-cmd.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-exec ${JAVA_HOME}/bin/java -cp p2pproxy.jar org.linphone.p2pproxy.core.utils.AccountManagerCli $*
\ No newline at end of file
diff --git a/p2pproxy/bin/p2pproxy.bat b/p2pproxy/bin/p2pproxy.bat
deleted file mode 100644
index 21eaf933..00000000
--- a/p2pproxy/bin/p2pproxy.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-@echo off
-"%JAVA_HOME%\bin\java.exe" -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=6789 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -jar p2pproxy.jar %1 %2 %3 %4 %5 %6 %7 %8 %9
\ No newline at end of file
diff --git a/p2pproxy/bin/p2pproxy.sh b/p2pproxy/bin/p2pproxy.sh
deleted file mode 100644
index 91f31916..00000000
--- a/p2pproxy/bin/p2pproxy.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-if [ -z "$P2P_JMX_PORT"] ; then
- P2P_JMX_PORT=6789
-fi
-exec ${JAVA_HOME}/bin/java -Dcom.sun.management.jmxremote \
- -Dcom.sun.management.jmxremote.port=${P2P_JMX_PORT} \
- -Dcom.sun.management.jmxremote.authenticate=false \
- -Dcom.sun.management.jmxremote.ssl=false \
- -jar p2pproxy.jar $*
\ No newline at end of file
diff --git a/p2pproxy/build.xml b/p2pproxy/build.xml
deleted file mode 100644
index 02d3a759..00000000
--- a/p2pproxy/build.xml
+++ /dev/null
@@ -1,195 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/p2pproxy/configure.ac b/p2pproxy/configure.ac
deleted file mode 100644
index fffaf614..00000000
--- a/p2pproxy/configure.ac
+++ /dev/null
@@ -1,134 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT([p2pproxy],[0.0.1])
-
-AM_INIT_AUTOMAKE([tar-ustar])
-
-AC_CANONICAL_SYSTEM
-
-AC_MSG_CHECKING([warning make an error on compilation])
-AC_ARG_ENABLE(strict,
-[ --enable-strict Enable error on compilation warning [default=no]],
-[wall_werror=$enableval],
-[wall_werror=no]
-)
-
-
-dnl Checks for programs.
-AC_PROG_CC
-AC_PROG_LIBTOOL
-AC_DISABLE_STATIC
-
-
-CFLAGS="$CFLAGS -Wall"
-
-
-dnl Checks for header files.
-AC_HEADER_STDC
-
-dnl Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_C_INLINE
-AC_HEADER_TIME
-AC_WORDS_BIGENDIAN
-if test x$ac_cv_c_bigendian = xyes ; then
- CFLAGS="$CFLAGS -D_BIGENDIAN"
-fi
-
-if test $GCC = yes && test $wall_werror = yes; then
- CFLAGS="$CFLAGS -Werror "
-fi
-
-AC_ARG_WITH(java,
- [ --with-java Sets directory of java home, [default=/usr/lib/jvm/java-6-sun] ],
- [ javadir=${withval}],[javadir=/usr/lib/jvm/java-6-sun/])
-
-AC_SUBST(javadir)
-
-AC_PATH_PROG(ANT,ant,false)
-
-AC_PATH_PROG(SWIG,swig,false)
-
-if test x$ANT = xfalse ; then
- AC_MSG_ERROR([ant not found: you must install ant to build this package.])
-fi
-
-if test x$prefix = xNONE ; then
- jarsdir="/usr/local/share/java/fonis"
-else
- jarsdir="$prefix/share/java/fonis"
-fi
-
-AC_DEFINE_UNQUOTED(P2PPROXY_INSTALLDIR,"$jarsdir",[path of jars])
-
-PKG_CHECK_MODULES(LIBLINPHONE, linphone >= 3.0.0)
-
-LINPHONE_PLUGINS_DIR="\$(libdir)/liblinphone/plugins/"
-AC_SUBST(LINPHONE_PLUGINS_DIR)
-
-dnl ##################################################
-dnl # Check for ESP Packager
-dnl ##################################################
-
-AC_PATH_PROG(EPM,epm,false)
-AC_PATH_PROG(MKEPMLIST,mkepmlist,false)
-AC_PATH_PROG(EPMINSTALL,epminstall,false)
-AM_CONDITIONAL(WITH_EPM,test $EPM != false && test $MKEPMLIST != false && test $EPMINSTALL != false)
-
-
-# Preferred packaging system, as per EPM terminology
-case $target in
-*-*-linux*)
- if test -f /etc/debian_version ; then
- EPM_PKG_EXT=deb
- else
- EPM_PKG_EXT=rpm
- fi
- ;;
-*-hp-hpux*)
- EPM_PKG_EXT=depot.gz;;
-*-dec-osf*)
- EPM_PKG_EXT=setld;;
-esac
-AC_SUBST(EPM_PKG_EXT)
-
-# System software User & Group names
-case $target in
-*-*-linux*)
- SYS_USER=root
- SYS_GROUP=root
- ;;
-*-*-hpux*|*-dec-osf*)
- SYS_USER=bin
- SYS_GROUP=bin
- ;;
-esac
-AC_SUBST(SYS_USER)
-AC_SUBST(SYS_GROUP)
-
-# CPU Architecture
-case $target_cpu in
-i?86) ARCH=i386;;
-*) ARCH=$target_cpu;;
-esac
-AC_SUBST(ARCH)
-
-# Various other packaging variables, that can be over-ridden ad `make
-# package' time
-SUMMARY="A SIP P2P proxy and toolkit"
-AC_SUBST(SUMMARY)
-PACKAGER=anonymous
-AC_SUBST(PACKAGER)
-LICENSE=GPL
-AC_SUBST(LICENSE)
-VENDOR=Linphone
-AC_SUBST(VENDOR)
-RELEASE=1
-AC_SUBST(RELEASE)
-
-
-AC_OUTPUT(
-Makefile
-launcher/Makefile
-launcher/src/Makefile
-plugin-src/Makefile
-)
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ChangeRequest.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ChangeRequest.java
deleted file mode 100644
index bf83df66..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ChangeRequest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.attribute;
-
-import de.javawi.jstun.util.*;
-
-public class ChangeRequest extends MessageAttribute {
- /*
- * 0 1 2 3
- * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A B 0|
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- boolean changeIP = false;
- boolean changePort = false;
-
- public ChangeRequest() {
- super(MessageAttribute.MessageAttributeType.ChangeRequest);
- }
-
- public boolean isChangeIP() {
- return changeIP;
- }
-
- public boolean isChangePort() {
- return changePort;
- }
-
- public void setChangeIP() {
- changeIP = true;
- }
-
- public void setChangePort() {
- changePort = true;
- }
-
- public byte[] getBytes() throws UtilityException {
- byte[] result = new byte[8];
- // message attribute header
- // type
- System.arraycopy(Utility.integerToTwoBytes(typeToInteger(type)), 0, result, 0, 2);
- // length
- System.arraycopy(Utility.integerToTwoBytes(4), 0, result, 2, 2);
-
- // change request header
- if (changeIP) result[7] = Utility.integerToOneByte(4);
- if (changePort) result[7] = Utility.integerToOneByte(2);
- if (changeIP && changePort) result[7] = Utility.integerToOneByte(6);
- return result;
- }
-
- public static ChangeRequest parse(byte[] data) throws MessageAttributeParsingException {
- try {
- if (data.length < 4) {
- throw new MessageAttributeParsingException("Data array too short");
- }
- ChangeRequest cr = new ChangeRequest();
- int status = Utility.oneByteToInteger(data[3]);
- switch (status) {
- case 0: break;
- case 2: cr.setChangePort(); break;
- case 4: cr.setChangeIP(); break;
- case 6: cr.setChangeIP(); cr.setChangePort(); break;
- default: throw new MessageAttributeParsingException("Status parsing error");
- }
- return cr;
- } catch (UtilityException ue) {
- throw new MessageAttributeParsingException("Parsing error");
- }
- }
-}
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ChangedAddress.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ChangedAddress.java
deleted file mode 100644
index ce06b603..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ChangedAddress.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.attribute;
-
-import java.util.logging.Logger;
-
-
-public class ChangedAddress extends MappedResponseChangedSourceAddressReflectedFrom {
- private static Logger logger = Logger.getLogger("de.javawi.stun.attribute.ChangedAddress");
-
- public ChangedAddress() {
- super(MessageAttribute.MessageAttributeType.ChangedAddress);
- }
-
- public static MessageAttribute parse(byte[] data) throws MessageAttributeParsingException {
- ChangedAddress ca = new ChangedAddress();
- MappedResponseChangedSourceAddressReflectedFrom.parse(ca, data);
- logger.finer("Message Attribute: Changed Address parsed: " + ca.toString() + ".");
- return ca;
- }
-}
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Data.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Data.java
deleted file mode 100644
index 71452ad2..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Data.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package de.javawi.jstun.attribute;
-
-import java.util.logging.Logger;
-
-import de.javawi.jstun.util.UtilityException;
-
-public class Data extends MessageAttribute {
- private static Logger logger = Logger.getLogger(Data.class.getName());
- @Override
- public byte[] getBytes() throws UtilityException {
- // TODO Auto-generated method stub
- return null;
- }
- public static MessageAttribute parse(byte[] data) throws MessageAttributeParsingException {
- Data ma = new Data();
-
- logger.finer("Message Attribute: Data Address parsed: " + ma.toString() + ".");
- return ma;
- }
-}
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Dummy.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Dummy.java
deleted file mode 100644
index 8e780dcc..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Dummy.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.attribute;
-
-import de.javawi.jstun.util.Utility;
-import de.javawi.jstun.util.UtilityException;
-
-public class Dummy extends MessageAttribute {
- int lengthValue;
- public Dummy() {
- super(MessageAttributeType.Dummy);
- }
-
- public void setLengthValue(int length) {
- this.lengthValue = length;
- }
-
- public byte[] getBytes() throws UtilityException {
- byte[] result = new byte[lengthValue + 4];
- // message attribute header
- // type
- System.arraycopy(Utility.integerToTwoBytes(typeToInteger(type)), 0, result, 0, 2);
- // length
- System.arraycopy(Utility.integerToTwoBytes(lengthValue), 0, result, 2, 2);
- return result;
- }
-
- public static Dummy parse(byte[] data) {
- Dummy dummy = new Dummy();
- dummy.setLengthValue(data.length);
- return dummy;
- }
-}
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ErrorCode.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ErrorCode.java
deleted file mode 100644
index 04436dd7..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ErrorCode.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.attribute;
-
-import de.javawi.jstun.util.Utility;
-import de.javawi.jstun.util.UtilityException;
-
-public class ErrorCode extends MessageAttribute {
- /*
- * 0 1 2 3
- * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * | 0 |Class| Number |
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * | Reason Phrase (variable) ..
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
-
- int responseCode;
- String reason;
-
- public ErrorCode() {
- super(MessageAttribute.MessageAttributeType.ErrorCode);
- }
-
- public void setResponseCode(int responseCode) throws MessageAttributeException {
- switch (responseCode) {
- case 400: reason = "Bad Request"; break;
- case 401: reason = "Unauthorized"; break;
- case 420: reason = "Unkown Attribute"; break;
- case 430: reason = "Stale Credentials"; break;
- case 431: reason = "Integrity Check Failure"; break;
- case 432: reason = "Missing Username"; break;
- case 433: reason = "Use TLS"; break;
- case 500: reason = "Server Error"; break;
- case 600: reason = "Global Failure"; break;
- default: throw new MessageAttributeException("Response Code is not valid");
- }
- this.responseCode = responseCode;
- }
-
- public int getResponseCode() {
- return responseCode;
- }
-
- public String getReason() {
- return reason;
- }
-
- public byte[] getBytes() throws UtilityException {
- int length = reason.length();
- // length adjustment
- if ((length % 4) != 0) {
- length += 4 - (length % 4);
- }
- // message attribute header
- length += 4;
- byte[] result = new byte[length];
- // message attribute header
- // type
- System.arraycopy(Utility.integerToTwoBytes(typeToInteger(type)), 0, result, 0, 2);
- // length
- System.arraycopy(Utility.integerToTwoBytes(length-4), 0, result, 2, 2);
-
- // error code header
- int classHeader = (int) Math.floor(((double)responseCode)/100);
- result[6] = Utility.integerToOneByte(classHeader);
- result[7] = Utility.integerToOneByte(responseCode%100);
- byte[] reasonArray = reason.getBytes();
- System.arraycopy(reasonArray, 0, result, 8, reasonArray.length);
- return result;
- }
-
- public static ErrorCode parse(byte[] data) throws MessageAttributeParsingException {
- try {
- if (data.length < 4) {
- throw new MessageAttributeParsingException("Data array too short");
- }
- byte classHeaderByte = data[3];
- int classHeader = Utility.oneByteToInteger(classHeaderByte);
- if ((classHeader < 1) || (classHeader > 6)) throw new MessageAttributeParsingException("Class parsing error");
- byte numberByte = data[4];
- int number = Utility.oneByteToInteger(numberByte);
- if ((number < 0) || (number > 99)) throw new MessageAttributeParsingException("Number parsing error");
- int responseCode = (classHeader * 100) + number;
- ErrorCode result = new ErrorCode();
- result.setResponseCode(responseCode);
- return result;
- } catch (UtilityException ue) {
- throw new MessageAttributeParsingException("Parsing error");
- } catch (MessageAttributeException mae) {
- throw new MessageAttributeParsingException("Parsing error");
- }
- }
-}
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MappedAddress.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MappedAddress.java
deleted file mode 100644
index bdb84acf..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MappedAddress.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.attribute;
-
-import java.util.logging.Logger;
-
-
-public class MappedAddress extends MappedResponseChangedSourceAddressReflectedFrom {
- private static Logger logger = Logger.getLogger("de.javawi.stun.attribute.MappedAddress");
- public MappedAddress() {
- super(MessageAttribute.MessageAttributeType.MappedAddress);
- }
-
- public static MessageAttribute parse(byte[] data) throws MessageAttributeParsingException {
- MappedAddress ma = new MappedAddress();
- MappedResponseChangedSourceAddressReflectedFrom.parse(ma, data);
- logger.finer("Message Attribute: Mapped Address parsed: " + ma.toString() + ".");
- return ma;
- }
-}
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MappedResponseChangedSourceAddressReflectedFrom.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MappedResponseChangedSourceAddressReflectedFrom.java
deleted file mode 100644
index 252e9605..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MappedResponseChangedSourceAddressReflectedFrom.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.attribute;
-
-import de.javawi.jstun.util.*;
-
-public class MappedResponseChangedSourceAddressReflectedFrom extends MessageAttribute {
- int port;
- Address address;
-
- /*
- * 0 1 2 3
- * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * |x x x x x x x x| Family | Port |
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * | Address |
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- public MappedResponseChangedSourceAddressReflectedFrom() {
- super();
- try {
- port = 0;
- address = new Address("0.0.0.0");
- } catch (UtilityException ue) {
- ue.getMessage();
- ue.printStackTrace();
- }
- }
-
- public MappedResponseChangedSourceAddressReflectedFrom(MessageAttribute.MessageAttributeType type) {
- super(type);
- }
-
- public int getPort() {
- return port;
- }
-
- public Address getAddress() {
- return address;
- }
-
- public void setPort(int port) throws MessageAttributeException {
- if ((port > 65536) || (port < 0)) {
- throw new MessageAttributeException("Port value " + port + " out of range.");
- }
- this.port = port;
- }
-
- public void setAddress(Address address) {
- this.address = address;
- }
-
- public byte[] getBytes() throws UtilityException {
- byte[] result = new byte[12];
- // message attribute header
- // type
- System.arraycopy(Utility.integerToTwoBytes(typeToInteger(type)), 0, result, 0, 2);
- // length
- System.arraycopy(Utility.integerToTwoBytes(8), 0, result, 2, 2);
-
- // mappedaddress header
- // family
- result[5] = Utility.integerToOneByte(0x01);
- // port
- System.arraycopy(Utility.integerToTwoBytes(port), 0, result, 6, 2);
- // address
- System.arraycopy(address.getBytes(), 0, result, 8, 4);
- return result;
- }
-
- protected static MappedResponseChangedSourceAddressReflectedFrom parse(MappedResponseChangedSourceAddressReflectedFrom ma, byte[] data) throws MessageAttributeParsingException {
- try {
- if (data.length < 8) {
- throw new MessageAttributeParsingException("Data array too short");
- }
- int family = Utility.oneByteToInteger(data[1]);
- if (family != 0x01) throw new MessageAttributeParsingException("Family " + family + " is not supported");
- byte[] portArray = new byte[2];
- System.arraycopy(data, 2, portArray, 0, 2);
- ma.setPort(Utility.twoBytesToInteger(portArray));
- int firstOctet = Utility.oneByteToInteger(data[4]);
- int secondOctet = Utility.oneByteToInteger(data[5]);
- int thirdOctet = Utility.oneByteToInteger(data[6]);
- int fourthOctet = Utility.oneByteToInteger(data[7]);
- ma.setAddress(new Address(firstOctet, secondOctet, thirdOctet, fourthOctet));
- return ma;
- } catch (UtilityException ue) {
- throw new MessageAttributeParsingException("Parsing error");
- } catch (MessageAttributeException mae) {
- throw new MessageAttributeParsingException("Port parsing error");
- }
- }
-
- public String toString() {
- return "Address " +address.toString() + ", Port " + port;
- }
-}
\ No newline at end of file
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttribute.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttribute.java
deleted file mode 100644
index 2c1f1ef7..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttribute.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.attribute;
-
-import java.util.logging.*;
-
-import de.javawi.jstun.util.*;
-
-
-public abstract class MessageAttribute implements MessageAttributeInterface {
- private static Logger logger = Logger.getLogger("de.javawi.stun.util.MessageAttribute");
- MessageAttributeType type;
-
- public MessageAttribute() {
- }
-
- public MessageAttribute(MessageAttributeType type) {
- setType(type);
- }
-
- public void setType(MessageAttributeType type) {
- this.type = type;
- }
-
- public MessageAttribute.MessageAttributeType getType() {
- return type;
- }
-
- public static int typeToInteger(MessageAttributeType type) {
- if (type == MessageAttributeType.MappedAddress) return MAPPEDADDRESS;
- if (type == MessageAttributeType.ResponseAddress) return RESPONSEADDRESS;
- if (type == MessageAttributeType.ChangeRequest) return CHANGEREQUEST;
- if (type == MessageAttributeType.SourceAddress) return SOURCEADDRESS;
- if (type == MessageAttributeType.ChangedAddress) return CHANGEDADDRESS;
- if (type == MessageAttributeType.Username) return USERNAME;
- if (type == MessageAttributeType.Password) return PASSWORD;
- if (type == MessageAttributeType.MessageIntegrity) return MESSAGEINTEGRITY;
- if (type == MessageAttributeType.ErrorCode) return ERRORCODE;
- if (type == MessageAttributeType.UnknownAttribute) return UNKNOWNATTRIBUTE;
- if (type == MessageAttributeType.ReflectedFrom) return REFLECTEDFROM;
- if (type == MessageAttributeType.Dummy) return DUMMY;
- //turn
- if (type == MessageAttributeType.ChannelNumber) return CHANNELNUMBER;
- if (type == MessageAttributeType.LifeTime) return LIFETIME;
- if (type == MessageAttributeType.Bandwidth ) return BANDWIDTH;
- if (type == MessageAttributeType.PeerAddress ) return PEERADDRESS;
- if (type == MessageAttributeType.Data ) return DATA;
- if (type == MessageAttributeType.RelayAddress ) return RELAYADDRESS;
- if (type == MessageAttributeType.RequestedProps ) return REQUESTEDPROPS;
- if (type == MessageAttributeType.RequestedTransport ) return REQUESTEDTRANSPORT;
- if (type == MessageAttributeType.ReservationToken ) return RESERVATIONTOKEN;
- return -1;
- }
-
- public static MessageAttributeType intToType(long type) {
- if (type == MAPPEDADDRESS) return MessageAttributeType.MappedAddress;
- if (type == RESPONSEADDRESS) return MessageAttributeType.ResponseAddress;
- if (type == CHANGEREQUEST) return MessageAttributeType.ChangeRequest;
- if (type == SOURCEADDRESS) return MessageAttributeType.SourceAddress;
- if (type == CHANGEDADDRESS) return MessageAttributeType.ChangedAddress;
- if (type == USERNAME) return MessageAttributeType.Username;
- if (type == PASSWORD) return MessageAttributeType.Password;
- if (type == MESSAGEINTEGRITY) return MessageAttributeType.MessageIntegrity;
- if (type == ERRORCODE) return MessageAttributeType.ErrorCode;
- if (type == UNKNOWNATTRIBUTE) return MessageAttributeType.UnknownAttribute;
- if (type == REFLECTEDFROM) return MessageAttributeType.ReflectedFrom;
- if (type == DUMMY) return MessageAttributeType.Dummy;
- //turn
- if (type == CHANNELNUMBER) return MessageAttributeType.ChannelNumber;
- if (type == LIFETIME) return MessageAttributeType.LifeTime;
- if (type == BANDWIDTH) return MessageAttributeType.Bandwidth;
- if (type == PEERADDRESS) return MessageAttributeType.PeerAddress;
- if (type == DATA) return MessageAttributeType.Data;
- if (type == RELAYADDRESS) return MessageAttributeType.RelayAddress;
- if (type == REQUESTEDPROPS) return MessageAttributeType.RequestedProps;
- if (type == REQUESTEDTRANSPORT) return MessageAttributeType.RequestedTransport;
- if (type == RESERVATIONTOKEN) return MessageAttributeType.ReservationToken;
- return null;
- }
-
- abstract public byte[] getBytes() throws UtilityException;
- //abstract public MessageAttribute parse(byte[] data) throws MessageAttributeParsingException;
-
- public int getLength() throws UtilityException {
- int length = getBytes().length;
- return length;
- }
-
- public static MessageAttribute parseCommonHeader(byte[] data) throws MessageAttributeParsingException {
- try {
- byte[] typeArray = new byte[2];
- System.arraycopy(data, 0, typeArray, 0, 2);
- int type = Utility.twoBytesToInteger(typeArray);
- byte[] lengthArray = new byte[2];
- System.arraycopy(data, 2, lengthArray, 0, 2);
- int lengthValue = Utility.twoBytesToInteger(lengthArray);
- byte[] valueArray = new byte[lengthValue];
- System.arraycopy(data, 4, valueArray, 0, lengthValue);
- MessageAttribute ma;
- switch (type) {
- case MAPPEDADDRESS: ma = MappedAddress.parse(valueArray); break;
- case RESPONSEADDRESS: ma = ResponseAddress.parse(valueArray); break;
- case CHANGEREQUEST: ma = ChangeRequest.parse(valueArray); break;
- case SOURCEADDRESS: ma = SourceAddress.parse(valueArray); break;
- case CHANGEDADDRESS: ma = ChangedAddress.parse(valueArray); break;
- case USERNAME: ma = Username.parse(valueArray); break;
- case PASSWORD: ma = Password.parse(valueArray); break;
- case MESSAGEINTEGRITY: ma = MessageIntegrity.parse(valueArray); break;
- case ERRORCODE: ma = ErrorCode.parse(valueArray); break;
- case UNKNOWNATTRIBUTE: ma = UnknownAttribute.parse(valueArray); break;
- case REFLECTEDFROM: ma = ReflectedFrom.parse(valueArray); break;
- default:
- if (type <= 0x7fff) {
- throw new UnknownMessageAttributeException("Unkown mandatory message attribute", intToType(type));
- } else {
- logger.finer("MessageAttribute with type " + type + " unkown.");
- ma = Dummy.parse(valueArray);
- break;
- }
- }
- return ma;
- } catch (UtilityException ue) {
- throw new MessageAttributeParsingException("Parsing error");
- }
- }
-}
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttributeException.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttributeException.java
deleted file mode 100644
index a8109cfd..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttributeException.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.attribute;
-
-public class MessageAttributeException extends Exception {
- private static final long serialVersionUID = 3258131345099404850L;
-
- public MessageAttributeException(String mesg) {
- super(mesg);
- }
-}
\ No newline at end of file
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttributeInterface.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttributeInterface.java
deleted file mode 100644
index 8c55d780..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttributeInterface.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.attribute;
-
-public interface MessageAttributeInterface {
- public enum MessageAttributeType { MappedAddress
- , ResponseAddress
- , ChangeRequest
- , SourceAddress
- , ChangedAddress
- , Username
- , Password
- , MessageIntegrity
- , ErrorCode
- , UnknownAttribute
- , ReflectedFrom
- , Dummy
- , ChannelNumber
- , LifeTime
- , Bandwidth
- , PeerAddress
- , Data
- , RelayAddress
- , RequestedProps
- , RequestedTransport
- , ReservationToken};
- final static int MAPPEDADDRESS = 0x0001;
- final static int RESPONSEADDRESS = 0x0002;
- final static int CHANGEREQUEST = 0x0003;
- final static int SOURCEADDRESS = 0x0004;
- final static int CHANGEDADDRESS = 0x0005;
- final static int USERNAME = 0x0006;
- final static int PASSWORD = 0x0007;
- final static int MESSAGEINTEGRITY = 0x0008;
- final static int ERRORCODE = 0x0009;
- final static int UNKNOWNATTRIBUTE = 0x000a;
- final static int REFLECTEDFROM = 0x000b;
- final static int DUMMY = 0x0000;
-// turn attributes
-// 0x000C: CHANNEL-NUMBER
-// 0x000D: LIFETIME
-// 0x0010: BANDWIDTH
-// 0x0012: PEER-ADDRESS
-// 0x0013: DATA
-// 0x0016: RELAY-ADDRESS
-// 0x0018: REQUESTED-PROPS
-// 0x0019: REQUESTED-TRANSPORT
-// 0x0022: RESERVATION-TOKEN
- final static int CHANNELNUMBER = 0x000C;
- final static int LIFETIME = 0x000D;
- final static int BANDWIDTH = 0x0010;
- final static int PEERADDRESS = 0x0012;
- final static int DATA = 0x0013;
- final static int RELAYADDRESS = 0x0016;
- final static int REQUESTEDPROPS = 0x0018;
- final static int REQUESTEDTRANSPORT = 0x0019;
- final static int RESERVATIONTOKEN = 0x0022;
-
-}
\ No newline at end of file
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttributeParsingException.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttributeParsingException.java
deleted file mode 100644
index d2027897..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttributeParsingException.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.attribute;
-
-public class MessageAttributeParsingException extends MessageAttributeException {
- private static final long serialVersionUID = 3258409534426263605L;
-
- public MessageAttributeParsingException(String mesg) {
- super(mesg);
- }
-}
\ No newline at end of file
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageIntegrity.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageIntegrity.java
deleted file mode 100644
index 7aa7df3d..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageIntegrity.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.attribute;
-
-public class MessageIntegrity extends MessageAttribute {
- // incomplete message integrity implementation
- public MessageIntegrity() {
- super(MessageAttribute.MessageAttributeType.MessageIntegrity);
- }
-
- public byte[] getBytes() {
- return new byte[0];
- }
-
- public static MessageIntegrity parse(byte[] data) {
- return new MessageIntegrity();
- }
-}
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Password.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Password.java
deleted file mode 100644
index 679a193d..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Password.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.attribute;
-
-import de.javawi.jstun.util.Utility;
-import de.javawi.jstun.util.UtilityException;
-
-public class Password extends MessageAttribute {
- String password;
-
- public Password() {
- super(MessageAttribute.MessageAttributeType.Password);
- }
-
- public Password(String password) {
- super(MessageAttribute.MessageAttributeType.Password);
- setPassword(password);
- }
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public byte[] getBytes() throws UtilityException {
- int length = password.length();
- // password header
- if ((length % 4) != 0) {
- length += 4 - (length % 4);
- }
- // message attribute header
- length += 4;
- byte[] result = new byte[length];
- // message attribute header
- // type
- System.arraycopy(Utility.integerToTwoBytes(typeToInteger(type)), 0, result, 0, 2);
- // length
- System.arraycopy(Utility.integerToTwoBytes(length - 4), 0, result, 2, 2);
-
- // password header
- byte[] temp = password.getBytes();
- System.arraycopy(temp, 0, result, 4, temp.length);
- return result;
- }
-
- public static Password parse(byte[] data) {
- Password result = new Password();
- String password = new String(data);
- result.setPassword(password);
- return result;
- }
-}
\ No newline at end of file
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ReflectedFrom.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ReflectedFrom.java
deleted file mode 100644
index e2983143..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ReflectedFrom.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.attribute;
-
-import java.util.logging.Logger;
-
-public class ReflectedFrom extends MappedResponseChangedSourceAddressReflectedFrom {
- private static Logger logger = Logger.getLogger("de.javawi.stun.attribute.ReflectedFrom");
-
- public ReflectedFrom() {
- super(MessageAttribute.MessageAttributeType.ReflectedFrom);
- }
-
- public static ReflectedFrom parse(byte[] data) throws MessageAttributeParsingException {
- ReflectedFrom result = new ReflectedFrom();
- MappedResponseChangedSourceAddressReflectedFrom.parse(result, data);
- logger.finer("Message Attribute: ReflectedFrom parsed: " + result.toString() + ".");
- return result;
- }
-
-
-}
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ResponseAddress.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ResponseAddress.java
deleted file mode 100644
index 40c73bd0..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ResponseAddress.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.attribute;
-
-import java.util.logging.Logger;
-
-
-public class ResponseAddress extends MappedResponseChangedSourceAddressReflectedFrom {
- private static Logger logger = Logger.getLogger("de.javawi.stun.attribute.ResponseAddress");
- public ResponseAddress() {
- super(MessageAttribute.MessageAttributeType.ResponseAddress);
- }
-
- public static MessageAttribute parse(byte[] data) throws MessageAttributeParsingException {
- ResponseAddress ra = new ResponseAddress();
- MappedResponseChangedSourceAddressReflectedFrom.parse(ra, data);
- logger.finer("Message Attribute: Response Address parsed: " + ra.toString() + ".");
- return ra;
- }
-}
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/SourceAddress.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/SourceAddress.java
deleted file mode 100644
index 070d7d8d..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/SourceAddress.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.attribute;
-
-import java.util.logging.Logger;
-
-
-public class SourceAddress extends MappedResponseChangedSourceAddressReflectedFrom {
- private static Logger logger = Logger.getLogger("de.javawi.stun.attribute.SourceAddress");
- public SourceAddress() {
- super(MessageAttribute.MessageAttributeType.SourceAddress);
- }
-
- public static MessageAttribute parse(byte[] data) throws MessageAttributeParsingException {
- SourceAddress sa = new SourceAddress();
- MappedResponseChangedSourceAddressReflectedFrom.parse(sa, data);
- logger.finer("Message Attribute: Source Address parsed: " + sa.toString() + ".");
- return sa;
- }
-}
\ No newline at end of file
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/UnknownAttribute.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/UnknownAttribute.java
deleted file mode 100644
index 04f1abb8..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/UnknownAttribute.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.attribute;
-
-import java.util.*;
-
-import de.javawi.jstun.util.Utility;
-import de.javawi.jstun.util.UtilityException;
-
-public class UnknownAttribute extends MessageAttribute {
- /*
- * 0 1 2 3
- * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * | Attribute 1 Type | Attribute 2 Type |
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * | Attribute 3 Type | Attribute 4 Type ...
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
-
- Vector unkown = new Vector();
-
- public UnknownAttribute() {
- super(MessageAttribute.MessageAttributeType.UnknownAttribute);
- }
-
- public void addAttribute(MessageAttributeType attribute) {
- unkown.add(attribute);
- }
-
- public byte[] getBytes() throws UtilityException {
- int length = 0;
- if (unkown.size()%2 == 1) {
- length = 2 * (unkown.size() + 1) + 4;
- } else {
- length = 2 * unkown.size() + 4;
- }
- byte[] result = new byte[length];
- // message attribute header
- // type
- System.arraycopy(Utility.integerToTwoBytes(typeToInteger(type)), 0, result, 0, 2);
- // length
- System.arraycopy(Utility.integerToTwoBytes(length - 4), 0, result, 2, 2);
-
- // unkown attribute header
- Iterator it = unkown.iterator();
- while(it.hasNext()) {
- MessageAttributeType attri = it.next();
- System.arraycopy(Utility.integerToTwoBytes(typeToInteger(attri)), 0, result, 4, 2);
- }
- // padding
- if (unkown.size()%2 == 1) {
- System.arraycopy(Utility.integerToTwoBytes(typeToInteger(unkown.elementAt(1))), 0, result, 4, 2);
- }
- return result;
- }
-
- public static UnknownAttribute parse(byte[] data) throws MessageAttributeParsingException {
- try {
- UnknownAttribute result = new UnknownAttribute();
- if (data.length % 4 != 0) throw new MessageAttributeParsingException("Data array too short");
- for (int i = 0; i < data.length; i += 4) {
- byte[] temp = new byte[4];
- System.arraycopy(data, i, temp, 0, 4);
- long attri = Utility.fourBytesToLong(temp);
- result.addAttribute(MessageAttribute.intToType(attri));
- }
- return result;
- } catch (UtilityException ue) {
- throw new MessageAttributeParsingException("Parsing error");
- }
- }
-}
\ No newline at end of file
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/UnknownMessageAttributeException.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/UnknownMessageAttributeException.java
deleted file mode 100644
index 4ddd4922..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/UnknownMessageAttributeException.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package de.javawi.jstun.attribute;
-
-import de.javawi.jstun.attribute.MessageAttributeInterface.MessageAttributeType;
-
-public class UnknownMessageAttributeException extends MessageAttributeParsingException {
- private static final long serialVersionUID = 5375193544145543299L;
-
- private MessageAttributeType type;
-
- public UnknownMessageAttributeException(String mesg, MessageAttributeType type) {
- super(mesg);
- this.type = type;
- }
-
- public MessageAttributeType getType() {
- return type;
- }
-}
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Username.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Username.java
deleted file mode 100644
index 1afaec7b..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Username.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.attribute;
-
-import de.javawi.jstun.util.Utility;
-import de.javawi.jstun.util.UtilityException;
-
-public class Username extends MessageAttribute {
- String username;
-
- public Username() {
- super(MessageAttribute.MessageAttributeType.Username);
- }
-
- public Username(String username) {
- super(MessageAttribute.MessageAttributeType.Username);
- setUsername(username);
- }
-
- public String getUsername() {
- return username;
- }
-
- public void setUsername(String username) {
- this.username = username;
- }
-
- public byte[] getBytes() throws UtilityException {
- int length = username.length();
- // username header
- if ((length % 4) != 0) {
- length += 4 - (length % 4);
- }
- // message attribute header
- length += 4;
- byte[] result = new byte[length];
- // message attribute header
- // type
- System.arraycopy(Utility.integerToTwoBytes(typeToInteger(type)), 0, result, 0, 2);
- // length
- System.arraycopy(Utility.integerToTwoBytes(length-4), 0, result, 2, 2);
-
- // username header
- byte[] temp = username.getBytes();
- System.arraycopy(temp, 0, result, 4, temp.length);
- return result;
- }
-
- public static Username parse(byte[] data) {
- Username result = new Username();
- String username = new String(data);
- result.setUsername(username);
- return result;
- }
-}
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeader.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeader.java
deleted file mode 100644
index 1e6dab58..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeader.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.header;
-
-import de.javawi.jstun.attribute.*;
-import de.javawi.jstun.util.*;
-
-import java.util.*;
-import java.util.logging.*;
-
-public class MessageHeader implements MessageHeaderInterface {
- /*
- * 0 1 2 3
- * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * | STUN Message Type | Message Length |
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * |
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- *
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * Transaction ID
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * |
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- private static Logger logger = Logger.getLogger("de.javawi.stun.header.MessageHeader");
- MessageHeaderType type;
- byte[] id = new byte[16];
-
- TreeMap ma = new TreeMap();
-
- public MessageHeader() {
- super();
- }
-
- public MessageHeader(MessageHeaderType type) {
- super();
- setType(type);
- }
-
- public void setType(MessageHeaderType type) {
- this.type = type;
- }
-
- public MessageHeaderType getType() {
- return type;
- }
-
- public static int typeToInteger(MessageHeaderType type) {
- if (type == MessageHeaderType.BindingRequest) return BINDINGREQUEST;
- if (type == MessageHeaderType.BindingResponse) return BINDINGRESPONSE;
- if (type == MessageHeaderType.BindingErrorResponse) return BINDINGERRORRESPONSE;
- if (type == MessageHeaderType.SharedSecretRequest) return SHAREDSECRETREQUEST;
- if (type == MessageHeaderType.SharedSecretResponse) return SHAREDSECRETRESPONSE;
- if (type == MessageHeaderType.SharedSecretErrorResponse) return SHAREDSECRETERRORRESPONSE;
- //turn headers
- if (type == MessageHeaderType.AllocateRequest) return ALLOCATEREQUEST;
- if (type == MessageHeaderType.AllocateResponse) return ALLOCATERESPONSE;
- if (type == MessageHeaderType.AllocateErrorResponse) return ALLOCATEERRORRESPONSE;
- if (type == MessageHeaderType.RefreshRequest) return REFRESHREQUEST;
- if (type == MessageHeaderType.RefreshResponse) return REFRESHRESPONSE;
- if (type == MessageHeaderType.RefreshErrorResponse) return REFRESHERRORRESPONSE;
- if (type == MessageHeaderType.ChannelBindRequest) return CHANNELBINDREQUEST;
- if (type == MessageHeaderType.ChannelBindResponse) return CHANNELBINDRESPONSE;
- if (type == MessageHeaderType.ChannelBindErrorResponse) return CHANNELBINDERRORRESPONSE;
-
-
- return -1;
- }
-
- public void setTransactionID(byte[] id) {
- System.arraycopy(id, 0, this.id, 0, 16);
- }
-
- public void generateTransactionID() throws UtilityException {
- System.arraycopy(Utility.integerToTwoBytes((int)(Math.random() * 65536)), 0, id, 0, 2);
- System.arraycopy(Utility.integerToTwoBytes((int)(Math.random() * 65536)), 0, id, 2, 2);
- System.arraycopy(Utility.integerToTwoBytes((int)(Math.random() * 65536)), 0, id, 4, 2);
- System.arraycopy(Utility.integerToTwoBytes((int)(Math.random() * 65536)), 0, id, 6, 2);
- System.arraycopy(Utility.integerToTwoBytes((int)(Math.random() * 65536)), 0, id, 8, 2);
- System.arraycopy(Utility.integerToTwoBytes((int)(Math.random() * 65536)), 0, id, 10, 2);
- System.arraycopy(Utility.integerToTwoBytes((int)(Math.random() * 65536)), 0, id, 12, 2);
- System.arraycopy(Utility.integerToTwoBytes((int)(Math.random() * 65536)), 0, id, 14, 2);
- }
-
- public byte[] getTransactionID() {
- byte[] idCopy = new byte[id.length];
- System.arraycopy(id, 0, idCopy, 0, id.length);
- return idCopy;
- }
-
- public boolean equalTransactionID(MessageHeader header) {
- byte[] idHeader = header.getTransactionID();
- if (idHeader.length != 16) return false;
- if ((idHeader[0] == id[0]) && (idHeader[1] == id[1]) && (idHeader[2] == id[2]) && (idHeader[3] == id[3]) &&
- (idHeader[4] == id[4]) && (idHeader[5] == id[5]) && (idHeader[6] == id[6]) && (idHeader[7] == id[7]) &&
- (idHeader[8] == id[8]) && (idHeader[9] == id[9]) && (idHeader[10] == id[10]) && (idHeader[11] == id[11]) &&
- (idHeader[12] == id[12]) && (idHeader[13] == id[13]) && (idHeader[14] == id[14]) && (idHeader[15] == id[15])) {
- return true;
- } else {
- return false;
- }
- }
-
- public void addMessageAttribute(MessageAttribute attri) {
- ma.put(attri.getType(), attri);
- }
-
- public MessageAttribute getMessageAttribute(MessageAttribute.MessageAttributeType type) {
- return ma.get(type);
- }
-
- public byte[] getBytes() throws UtilityException {
- int length = 20;
- Iterator it = ma.keySet().iterator();
- while (it.hasNext()) {
- MessageAttribute attri = ma.get(it.next());
- length += attri.getLength();
- }
- // add attribute size + attributes.getSize();
- byte[] result = new byte[length];
- System.arraycopy(Utility.integerToTwoBytes(typeToInteger(type)), 0, result, 0, 2);
- System.arraycopy(Utility.integerToTwoBytes(length-20), 0, result, 2, 2);
- System.arraycopy(id, 0, result, 4, 16);
-
- // arraycopy of attributes
- int offset = 20;
- it = ma.keySet().iterator();
- while (it.hasNext()) {
- MessageAttribute attri = ma.get(it.next());
- System.arraycopy(attri.getBytes(), 0, result, offset, attri.getLength());
- offset += attri.getLength();
- }
- return result;
- }
-
- public int getLength() throws UtilityException {
- return getBytes().length;
- }
-
- public void parseAttributes(byte[] data) throws MessageAttributeParsingException {
- try {
- byte[] lengthArray = new byte[2];
- System.arraycopy(data, 2, lengthArray, 0, 2);
- int length = Utility.twoBytesToInteger(lengthArray);
- System.arraycopy(data, 4, id, 0, 16);
- byte[] cuttedData;
- int offset = 20;
- while (length > 0) {
- cuttedData = new byte[length];
- System.arraycopy(data, offset, cuttedData, 0, length);
- MessageAttribute ma = MessageAttribute.parseCommonHeader(cuttedData);
- addMessageAttribute(ma);
- length -= ma.getLength();
- offset += ma.getLength();
- }
- } catch (UtilityException ue) {
- throw new MessageAttributeParsingException("Parsing error");
- }
- }
-
- public static MessageHeader parseHeader(byte[] data) throws MessageHeaderParsingException {
- try {
- MessageHeader mh = new MessageHeader();
- byte[] typeArray = new byte[2];
- System.arraycopy(data, 0, typeArray, 0, 2);
- int type = Utility.twoBytesToInteger(typeArray);
- switch (type) {
- case BINDINGREQUEST: mh.setType(MessageHeaderType.BindingRequest); logger.finer("Binding Request received."); break;
- case BINDINGRESPONSE: mh.setType(MessageHeaderType.BindingResponse); logger.finer("Binding Response received."); break;
- case BINDINGERRORRESPONSE: mh.setType(MessageHeaderType.BindingErrorResponse); logger.finer("Binding Error Response received."); break;
- case SHAREDSECRETREQUEST: mh.setType(MessageHeaderType.SharedSecretRequest); logger.finer("Shared Secret Request received."); break;
- case SHAREDSECRETRESPONSE: mh.setType(MessageHeaderType.SharedSecretResponse); logger.finer("Shared Secret Response received."); break;
- case SHAREDSECRETERRORRESPONSE: mh.setType(MessageHeaderType.SharedSecretErrorResponse); logger.finer("Shared Secret Error Response received.");break;
- //turn
- case ALLOCATEREQUEST: mh.setType(MessageHeaderType.AllocateRequest); logger.finer("Allocate Request received."); break;
- case ALLOCATERESPONSE: mh.setType(MessageHeaderType.AllocateResponse); logger.finer("Allocate Response received."); break;
- case ALLOCATEERRORRESPONSE: mh.setType(MessageHeaderType.AllocateErrorResponse); logger.finer("Allocate Errro received."); break;
- case REFRESHREQUEST: mh.setType(MessageHeaderType.RefreshRequest); logger.finer("Refresh Request received."); break;
- case REFRESHRESPONSE: mh.setType(MessageHeaderType.RefreshResponse); logger.finer("Refresh Response received."); break;
- case REFRESHERRORRESPONSE: mh.setType(MessageHeaderType.RefreshErrorResponse); logger.finer("Refresh Error received."); break;
- case CHANNELBINDREQUEST: mh.setType(MessageHeaderType.ChannelBindRequest); logger.finer("ChannelBind Request received."); break;
- case CHANNELBINDRESPONSE: mh.setType(MessageHeaderType.ChannelBindResponse); logger.finer("ChannelBind Response received."); break;
- case CHANNELBINDERRORRESPONSE: mh.setType(MessageHeaderType.ChannelBindErrorResponse); logger.finer("ChannelBind Error received."); break;
- default: throw new MessageHeaderParsingException("Message type " + type + "is not supported");
- }
- return mh;
- } catch (UtilityException ue) {
- throw new MessageHeaderParsingException("Parsing error");
- }
- }
-}
\ No newline at end of file
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeaderException.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeaderException.java
deleted file mode 100644
index f4a9fa49..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeaderException.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.header;
-
-public class MessageHeaderException extends Exception {
- private static final long serialVersionUID = 3689066248944103737L;
-
- public MessageHeaderException(String mesg) {
- super(mesg);
- }
-}
\ No newline at end of file
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeaderInterface.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeaderInterface.java
deleted file mode 100644
index 1b7a2cfe..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeaderInterface.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.header;
-
-public interface MessageHeaderInterface {
- public enum MessageHeaderType { BindingRequest
- , BindingResponse
- , BindingErrorResponse
- , SharedSecretRequest
- , SharedSecretResponse
- , SharedSecretErrorResponse
- , AllocateRequest
- , AllocateResponse
- , AllocateErrorResponse
- , RefreshRequest
- , RefreshResponse
- , RefreshErrorResponse
- , ChannelBindRequest
- , ChannelBindResponse
- , ChannelBindErrorResponse
- ,SendIndication
- ,DataIndication};
- final static int BINDINGREQUEST = 0x0001;
- final static int BINDINGRESPONSE = 0x0101;
- final static int BINDINGERRORRESPONSE = 0x0111;
- final static int SHAREDSECRETREQUEST = 0x0002;
- final static int SHAREDSECRETRESPONSE = 0x0102;
- final static int SHAREDSECRETERRORRESPONSE = 0x0112;
-
-// TURN defines ten new Message Types:
-//Request/Response Transactions
-//0x003 : Allocate
-//0x004 : Refresh
-//0x009 : ChannelBind
-//0x006 : Send
-//0x007 : Data
-
-
- final static int ALLOCATEREQUEST = 0x0003;
- final static int ALLOCATERESPONSE = 0x0103;
- final static int ALLOCATEERRORRESPONSE = 0x0113;
- final static int REFRESHREQUEST = 0x0004;
- final static int REFRESHRESPONSE = 0x0104;
- final static int REFRESHERRORRESPONSE = 0x0114;
- final static int CHANNELBINDREQUEST = 0x0009;
- final static int CHANNELBINDRESPONSE = 0x0109;
- final static int CHANNELBINDERRORRESPONSE = 0x0119;
- final static int SENDINDICATION = 0x0006;
- final static int DATAINDICATION = 0x0007;
-
-
-}
\ No newline at end of file
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeaderParsingException.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeaderParsingException.java
deleted file mode 100644
index d5192ef2..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeaderParsingException.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.header;
-
-public class MessageHeaderParsingException extends MessageHeaderException {
- private static final long serialVersionUID = 3544393617029607478L;
-
- public MessageHeaderParsingException(String mesg) {
- super(mesg);
- }
-}
\ No newline at end of file
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/BindingLifetimeTest.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/BindingLifetimeTest.java
deleted file mode 100644
index 1dca91b4..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/BindingLifetimeTest.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.test;
-
-import java.util.logging.*;
-import java.util.*;
-import java.io.*;
-import java.net.*;
-
-import de.javawi.jstun.attribute.*;
-import de.javawi.jstun.header.*;
-import de.javawi.jstun.util.UtilityException;
-
-public class BindingLifetimeTest {
- private static Logger logger = Logger.getLogger("de.javawi.stun.test.BindingLifetimeTest");
- String stunServer;
- int port;
- int timeout = 300; //ms
- MappedAddress ma;
- Timer timer;
- DatagramSocket initialSocket;
-
- // start value for binary search - should be carefully choosen
- int upperBinarySearchLifetime = 345000; // ms
- int lowerBinarySearchLifetime = 0;
- int binarySearchLifetime = ( upperBinarySearchLifetime + lowerBinarySearchLifetime ) / 2;
-
- // lifetime value
- int lifetime = -1; // -1 means undefined.
- boolean completed = false;
-
- public BindingLifetimeTest(String stunServer, int port) {
- super();
- this.stunServer = stunServer;
- this.port = port;
- timer = new Timer(true);
- }
-
- public void test() throws UtilityException, SocketException, UnknownHostException, IOException, MessageAttributeParsingException, MessageAttributeException, MessageHeaderParsingException {
- initialSocket = new DatagramSocket();
- initialSocket.connect(InetAddress.getByName(stunServer), port);
- initialSocket.setSoTimeout(timeout);
-
- if (bindingCommunicationInitialSocket()) {
- return;
- }
- BindingLifetimeTask task = new BindingLifetimeTask();
- timer.schedule(task, binarySearchLifetime);
- logger.finer("Timer scheduled initially: " + binarySearchLifetime + ".");
- }
-
- private boolean bindingCommunicationInitialSocket() throws UtilityException, IOException, MessageHeaderParsingException, MessageAttributeParsingException {
- MessageHeader sendMH = new MessageHeader(MessageHeader.MessageHeaderType.BindingRequest);
- sendMH.generateTransactionID();
- ChangeRequest changeRequest = new ChangeRequest();
- sendMH.addMessageAttribute(changeRequest);
- byte[] data = sendMH.getBytes();
-
- DatagramPacket send = new DatagramPacket(data, data.length, InetAddress.getByName(stunServer), port);
- initialSocket.send(send);
- logger.finer("Binding Request sent.");
-
- MessageHeader receiveMH = new MessageHeader();
- while (!(receiveMH.equalTransactionID(sendMH))) {
- DatagramPacket receive = new DatagramPacket(new byte[200], 200);
- initialSocket.receive(receive);
- receiveMH = MessageHeader.parseHeader(receive.getData());
- receiveMH.parseAttributes(receive.getData());
- }
- ma = (MappedAddress) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.MappedAddress);
- ErrorCode ec = (ErrorCode) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.ErrorCode);
- if (ec != null) {
- logger.config("Message header contains an Errorcode message attribute.");
- return true;
- }
- if (ma == null) {
- logger.config("Response does not contain a Mapped Address message attribute.");
- return true;
- }
- return false;
- }
-
- public int getLifetime() {
- return lifetime;
- }
-
- public boolean isCompleted() {
- return completed;
- }
-
- public void setUpperBinarySearchLifetime(int upperBinarySearchLifetime) {
- this.upperBinarySearchLifetime = upperBinarySearchLifetime;
- binarySearchLifetime = ( upperBinarySearchLifetime + lowerBinarySearchLifetime ) / 2;
- }
-
- class BindingLifetimeTask extends TimerTask {
-
- public BindingLifetimeTask() {
- super();
- }
-
- public void run() {
- try {
- lifetimeQuery();
- } catch (Exception e) {
- logger.config("Unhandled Exception. BindLifetimeTasks stopped.");
- e.printStackTrace();
- }
- }
-
- public void lifetimeQuery() throws UtilityException, MessageAttributeException, MessageHeaderParsingException, MessageAttributeParsingException, IOException {
- try {
- DatagramSocket socket = new DatagramSocket();
- socket.connect(InetAddress.getByName(stunServer), port);
- socket.setSoTimeout(timeout);
-
- MessageHeader sendMH = new MessageHeader(MessageHeader.MessageHeaderType.BindingRequest);
- sendMH.generateTransactionID();
- ChangeRequest changeRequest = new ChangeRequest();
- ResponseAddress responseAddress = new ResponseAddress();
- responseAddress.setAddress(ma.getAddress());
- responseAddress.setPort(ma.getPort());
- sendMH.addMessageAttribute(changeRequest);
- sendMH.addMessageAttribute(responseAddress);
- byte[] data = sendMH.getBytes();
-
- DatagramPacket send = new DatagramPacket(data, data.length, InetAddress.getByName(stunServer), port);
- socket.send(send);
- logger.finer("Binding Request sent.");
-
- MessageHeader receiveMH = new MessageHeader();
- while (!(receiveMH.equalTransactionID(sendMH))) {
- DatagramPacket receive = new DatagramPacket(new byte[200], 200);
- initialSocket.receive(receive);
- receiveMH = MessageHeader.parseHeader(receive.getData());
- receiveMH.parseAttributes(receive.getData());
- }
- ErrorCode ec = (ErrorCode) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.ErrorCode);
- if (ec != null) {
- logger.config("Message header contains errorcode message attribute.");
- return;
- }
- logger.finer("Binding Response received.");
- if (upperBinarySearchLifetime == (lowerBinarySearchLifetime + 1)) {
- logger.config("BindingLifetimeTest completed. UDP binding lifetime: " + binarySearchLifetime + ".");
- completed = true;
- return;
- }
- lifetime = binarySearchLifetime;
- logger.finer("Lifetime update: " + lifetime + ".");
- lowerBinarySearchLifetime = binarySearchLifetime;
- binarySearchLifetime = ( upperBinarySearchLifetime + lowerBinarySearchLifetime ) / 2;
- if (binarySearchLifetime > 0) {
- BindingLifetimeTask task = new BindingLifetimeTask();
- timer.schedule(task, binarySearchLifetime);
- logger.finer("Timer scheduled: " + binarySearchLifetime + ".");
- } else {
- completed = true;
- }
- } catch (SocketTimeoutException ste) {
- logger.finest("Read operation at query socket timeout.");
- if (upperBinarySearchLifetime == (lowerBinarySearchLifetime + 1)) {
- logger.config("BindingLifetimeTest completed. UDP binding lifetime: " + binarySearchLifetime + ".");
- completed = true;
- return;
- }
- upperBinarySearchLifetime = binarySearchLifetime;
- binarySearchLifetime = ( upperBinarySearchLifetime + lowerBinarySearchLifetime ) / 2;
- if (binarySearchLifetime > 0) {
- if (bindingCommunicationInitialSocket()) {
- return;
- }
- BindingLifetimeTask task = new BindingLifetimeTask();
- timer.schedule(task, binarySearchLifetime);
- logger.finer("Timer scheduled: " + binarySearchLifetime + ".");
- } else {
- completed = true;
- }
- }
- }
- }
-}
-
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/DiscoveryInfo.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/DiscoveryInfo.java
deleted file mode 100644
index abaab15e..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/DiscoveryInfo.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.test;
-
-import java.net.*;
-
-public class DiscoveryInfo {
- private InetAddress testIP;
- private boolean error = false;
- private int errorResponseCode = 0;
- private String errorReason;
- private boolean openAccess = false;
- private boolean blockedUDP = false;
- private boolean fullCone = false;
- private boolean restrictedCone = false;
- private boolean portRestrictedCone = false;
- private boolean symmetric = false;
- private boolean symmetricUDPFirewall = false;
- private InetAddress publicIP;
-
- public DiscoveryInfo(InetAddress testIP) {
- this.testIP = testIP;
- }
-
- public boolean isError() {
- return error;
- }
-
- public void setError(int responseCode, String reason) {
- this.error = true;
- this.errorResponseCode = responseCode;
- this.errorReason = reason;
- }
-
- public boolean isOpenAccess() {
- if (error) return false;
- return openAccess;
- }
-
- public void setOpenAccess() {
- this.openAccess = true;
- }
-
- public boolean isBlockedUDP() {
- if (error) return false;
- return blockedUDP;
- }
-
- public void setBlockedUDP() {
- this.blockedUDP = true;
- }
-
- public boolean isFullCone() {
- if (error) return false;
- return fullCone;
- }
-
- public void setFullCone() {
- this.fullCone = true;
- }
-
- public boolean isPortRestrictedCone() {
- if (error) return false;
- return portRestrictedCone;
- }
-
- public void setPortRestrictedCone() {
- this.portRestrictedCone = true;
- }
-
- public boolean isRestrictedCone() {
- if (error) return false;
- return restrictedCone;
- }
-
- public void setRestrictedCone() {
- this.restrictedCone = true;
- }
-
- public boolean isSymmetric() {
- if (error) return false;
- return symmetric;
- }
-
- public void setSymmetric() {
- this.symmetric = true;
- }
-
- public boolean isSymmetricUDPFirewall() {
- if (error) return false;
- return symmetricUDPFirewall;
- }
-
- public void setSymmetricUDPFirewall() {
- this.symmetricUDPFirewall = true;
- }
-
- public InetAddress getPublicIP() {
- return publicIP;
- }
-
- public InetAddress getLocalIP() {
- return testIP;
- }
-
- public void setPublicIP(InetAddress publicIP) {
- this.publicIP = publicIP;
- }
-
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append("Network interface: ");
- try {
- sb.append(NetworkInterface.getByInetAddress(testIP).getName());
- } catch (SocketException se) {
- sb.append("unknown");
- }
- sb.append("\n");
- sb.append("Local IP address: ");
- sb.append(testIP.getHostAddress());
- sb.append("\n");
- if (error) {
- sb.append(errorReason + " - Responsecode: " + errorResponseCode);
- return sb.toString();
- }
- sb.append("Result: ");
- if (openAccess) sb.append("Open access to the Internet.\n");
- if (blockedUDP) sb.append("Firewall blocks UDP.\n");
- if (fullCone) sb.append("Full Cone NAT handles connections.\n");
- if (restrictedCone) sb.append("Restricted Cone NAT handles connections.\n");
- if (portRestrictedCone) sb.append("Port restricted Cone NAT handles connections.\n");
- if (symmetric) sb.append("Symmetric Cone NAT handles connections.\n");
- if (symmetricUDPFirewall) sb.append ("Symmetric UDP Firewall handles connections.\n");
- if (!openAccess && !blockedUDP && !fullCone && !restrictedCone && !portRestrictedCone && !symmetric && !symmetricUDPFirewall) sb.append("unkown\n");
- sb.append("Public IP address: ");
- if (publicIP != null) {
- sb.append(publicIP.getHostAddress());
- } else {
- sb.append("unknown");
- }
- sb.append("\n");
- return sb.toString();
- }
-}
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/DiscoveryTest.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/DiscoveryTest.java
deleted file mode 100644
index 4f940adf..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/DiscoveryTest.java
+++ /dev/null
@@ -1,351 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.test;
-
-import java.io.IOException;
-import java.net.DatagramPacket;
-import java.net.DatagramSocket;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.SocketException;
-import java.net.SocketTimeoutException;
-import java.net.UnknownHostException;
-import java.util.logging.Logger;
-
-
-
-
-
-import de.javawi.jstun.attribute.ChangeRequest;
-import de.javawi.jstun.attribute.ChangedAddress;
-import de.javawi.jstun.attribute.ErrorCode;
-import de.javawi.jstun.attribute.MappedAddress;
-import de.javawi.jstun.attribute.MessageAttribute;
-import de.javawi.jstun.attribute.MessageAttributeException;
-import de.javawi.jstun.attribute.MessageAttributeParsingException;
-import de.javawi.jstun.header.MessageHeader;
-import de.javawi.jstun.header.MessageHeaderParsingException;
-import de.javawi.jstun.util.UtilityException;
-
-public class DiscoveryTest {
- private static Logger logger = Logger.getLogger("de.javawi.stun.test.DiscoveryTest");
- InetAddress iaddress;
- String stunServer;
- int port;
- int timeoutInitValue = 300; //ms
- MappedAddress ma = null;
- ChangedAddress ca = null;
- boolean nodeNatted = true;
- DatagramSocket socketTest1 = null;
- DiscoveryInfo di = null;
-
- public DiscoveryTest(InetAddress iaddress , String stunServer, int port) {
- super();
- this.iaddress = iaddress;
- this.stunServer = stunServer;
- this.port = port;
- }
-
- public DiscoveryInfo test() throws UtilityException, SocketException, UnknownHostException, IOException, MessageAttributeParsingException, MessageAttributeException, MessageHeaderParsingException{
- ma = null;
- ca = null;
- nodeNatted = true;
- socketTest1 = null;
- di = new DiscoveryInfo(iaddress);
-
- if (test1()) {
- if (test2()) {
- if (test1Redo()) {
- test3();
- }
- }
- }
-
- socketTest1.close();
-
- return di;
- }
-
- private boolean test1() throws UtilityException, SocketException, UnknownHostException, IOException, MessageAttributeParsingException, MessageHeaderParsingException {
- int timeSinceFirstTransmission = 0;
- int timeout = timeoutInitValue;
- while (true) {
- try {
- // Test 1 including response
- socketTest1 = new DatagramSocket(new InetSocketAddress(iaddress, 0));
- socketTest1.setReuseAddress(true);
- socketTest1.connect(InetAddress.getByName(stunServer), port);
- socketTest1.setSoTimeout(timeout);
-
- MessageHeader sendMH = new MessageHeader(MessageHeader.MessageHeaderType.BindingRequest);
- sendMH.generateTransactionID();
-
- ChangeRequest changeRequest = new ChangeRequest();
- sendMH.addMessageAttribute(changeRequest);
-
- byte[] data = sendMH.getBytes();
- DatagramPacket send = new DatagramPacket(data, data.length);
- socketTest1.send(send);
- logger.finer("Test 1: Binding Request sent.");
-
- MessageHeader receiveMH = new MessageHeader();
- while (!(receiveMH.equalTransactionID(sendMH))) {
- DatagramPacket receive = new DatagramPacket(new byte[200], 200);
- socketTest1.receive(receive);
- receiveMH = MessageHeader.parseHeader(receive.getData());
- receiveMH.parseAttributes(receive.getData());
- }
-
- ma = (MappedAddress) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.MappedAddress);
- ca = (ChangedAddress) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.ChangedAddress);
- ErrorCode ec = (ErrorCode) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.ErrorCode);
- if (ec != null) {
- di.setError(ec.getResponseCode(), ec.getReason());
- logger.config("Message header contains an Errorcode message attribute.");
- return false;
- }
- if ((ma == null) || (ca == null)) {
- di.setError(700, "The server is sending an incomplete response (Mapped Address and Changed Address message attributes are missing). The client should not retry.");
- logger.config("Response does not contain a Mapped Address or Changed Address message attribute.");
- return false;
- } else {
- di.setPublicIP(ma.getAddress().getInetAddress());
- if ((ma.getPort() == socketTest1.getLocalPort()) && (ma.getAddress().getInetAddress().equals(socketTest1.getLocalAddress()))) {
- logger.fine("Node is not natted.");
- nodeNatted = false;
- } else {
- logger.fine("Node is natted.");
- }
- return true;
- }
- } catch (SocketTimeoutException ste) {
- if (timeSinceFirstTransmission < 7900) {
- logger.finer("Test 1: Socket timeout while receiving the response.");
- timeSinceFirstTransmission += timeout;
- int timeoutAddValue = (timeSinceFirstTransmission * 2);
- if (timeoutAddValue > 1600) timeoutAddValue = 1600;
- timeout = timeoutAddValue;
- } else {
- // node is not capable of udp communication
- logger.finer("Test 1: Socket timeout while receiving the response. Maximum retry limit exceed. Give up.");
- di.setBlockedUDP();
- logger.fine("Node is not capable of UDP communication.");
- return false;
- }
- }
- }
- }
-
- private boolean test2() throws UtilityException, SocketException, UnknownHostException, IOException, MessageAttributeParsingException, MessageAttributeException, MessageHeaderParsingException {
- int timeSinceFirstTransmission = 0;
- int timeout = timeoutInitValue;
- while (true) {
- try {
- // Test 2 including response
- DatagramSocket sendSocket = new DatagramSocket(new InetSocketAddress(iaddress, 0));
- sendSocket.connect(InetAddress.getByName(stunServer), port);
- sendSocket.setSoTimeout(timeout);
-
- MessageHeader sendMH = new MessageHeader(MessageHeader.MessageHeaderType.BindingRequest);
- sendMH.generateTransactionID();
-
- ChangeRequest changeRequest = new ChangeRequest();
- changeRequest.setChangeIP();
- changeRequest.setChangePort();
- sendMH.addMessageAttribute(changeRequest);
-
- byte[] data = sendMH.getBytes();
- DatagramPacket send = new DatagramPacket(data, data.length);
- sendSocket.send(send);
- logger.finer("Test 2: Binding Request sent.");
-
- int localPort = sendSocket.getLocalPort();
- InetAddress localAddress = sendSocket.getLocalAddress();
-
- sendSocket.close();
-
- DatagramSocket receiveSocket = new DatagramSocket(localPort, localAddress);
- receiveSocket.connect(ca.getAddress().getInetAddress(), ca.getPort());
- receiveSocket.setSoTimeout(timeout);
-
- MessageHeader receiveMH = new MessageHeader();
- while(!(receiveMH.equalTransactionID(sendMH))) {
- DatagramPacket receive = new DatagramPacket(new byte[200], 200);
- receiveSocket.receive(receive);
- receiveMH = MessageHeader.parseHeader(receive.getData());
- receiveMH.parseAttributes(receive.getData());
- }
- ErrorCode ec = (ErrorCode) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.ErrorCode);
- if (ec != null) {
- di.setError(ec.getResponseCode(), ec.getReason());
- logger.config("Message header contains an Errorcode message attribute.");
- return false;
- }
- if (!nodeNatted) {
- di.setOpenAccess();
- logger.fine("Node has open access to the Internet (or, at least the node is behind a full-cone NAT without translation).");
- } else {
- di.setFullCone();
- logger.fine("Node is behind a full-cone NAT.");
- }
- return false;
- } catch (SocketTimeoutException ste) {
- if (timeSinceFirstTransmission < 7900) {
- logger.finer("Test 2: Socket timeout while receiving the response.");
- timeSinceFirstTransmission += timeout;
- int timeoutAddValue = (timeSinceFirstTransmission * 2);
- if (timeoutAddValue > 1600) timeoutAddValue = 1600;
- timeout = timeoutAddValue;
- } else {
- logger.finer("Test 2: Socket timeout while receiving the response. Maximum retry limit exceed. Give up.");
- if (!nodeNatted) {
- di.setSymmetricUDPFirewall();
- logger.fine("Node is behind a symmetric UDP firewall.");
- return false;
- } else {
- // not is natted
- // redo test 1 with address and port as offered in the changed-address message attribute
- return true;
- }
- }
- }
- }
- }
-
- private boolean test1Redo() throws UtilityException, SocketException, UnknownHostException, IOException, MessageAttributeParsingException, MessageHeaderParsingException{
- int timeSinceFirstTransmission = 0;
- int timeout = timeoutInitValue;
- while (true) {
- // redo test 1 with address and port as offered in the changed-address message attribute
- try {
- // Test 1 with changed port and address values
- socketTest1.connect(ca.getAddress().getInetAddress(), ca.getPort());
- socketTest1.setSoTimeout(timeout);
-
- MessageHeader sendMH = new MessageHeader(MessageHeader.MessageHeaderType.BindingRequest);
- sendMH.generateTransactionID();
-
- ChangeRequest changeRequest = new ChangeRequest();
- sendMH.addMessageAttribute(changeRequest);
-
- byte[] data = sendMH.getBytes();
- DatagramPacket send = new DatagramPacket(data, data.length);
- socketTest1.send(send);
- logger.finer("Test 1 redo with changed address: Binding Request sent.");
-
- MessageHeader receiveMH = new MessageHeader();
- while (!(receiveMH.equalTransactionID(sendMH))) {
- DatagramPacket receive = new DatagramPacket(new byte[200], 200);
- socketTest1.receive(receive);
- receiveMH = MessageHeader.parseHeader(receive.getData());
- receiveMH.parseAttributes(receive.getData());
- }
- MappedAddress ma2 = (MappedAddress) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.MappedAddress);
- ErrorCode ec = (ErrorCode) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.ErrorCode);
- if (ec != null) {
- di.setError(ec.getResponseCode(), ec.getReason());
- logger.config("Message header contains an Errorcode message attribute.");
- return false;
- }
- if (ma2 == null) {
- di.setError(700, "The server is sending an incomplete response (Mapped Address message attribute is missing). The client should not retry.");
- logger.config("Response does not contain a Mapped Address message attribute.");
- return false;
- } else {
- if ((ma.getPort() != ma2.getPort()) || (!(ma.getAddress().getInetAddress().equals(ma2.getAddress().getInetAddress())))) {
- di.setSymmetric();
- logger.fine("Node is behind a symmetric NAT.");
- return false;
- }
- }
- return true;
- } catch (SocketTimeoutException ste2) {
- if (timeSinceFirstTransmission < 7900) {
- logger.config("Test 1 redo with changed address: Socket timeout while receiving the response.");
- timeSinceFirstTransmission += timeout;
- int timeoutAddValue = (timeSinceFirstTransmission * 2);
- if (timeoutAddValue > 1600) timeoutAddValue = 1600;
- timeout = timeoutAddValue;
- } else {
- logger.config("Test 1 redo with changed address: Socket timeout while receiving the response. Maximum retry limit exceed. Give up.");
- return false;
- }
- }
- }
- }
-
- private void test3() throws UtilityException, SocketException, UnknownHostException, IOException, MessageAttributeParsingException, MessageAttributeException, MessageHeaderParsingException {
- int timeSinceFirstTransmission = 0;
- int timeout = timeoutInitValue;
- while (true) {
- try {
- // Test 3 including response
- DatagramSocket sendSocket = new DatagramSocket(new InetSocketAddress(iaddress, 0));
- sendSocket.connect(InetAddress.getByName(stunServer), port);
- sendSocket.setSoTimeout(timeout);
-
- MessageHeader sendMH = new MessageHeader(MessageHeader.MessageHeaderType.BindingRequest);
- sendMH.generateTransactionID();
-
- ChangeRequest changeRequest = new ChangeRequest();
- changeRequest.setChangePort();
- sendMH.addMessageAttribute(changeRequest);
-
- byte[] data = sendMH.getBytes();
- DatagramPacket send = new DatagramPacket(data, data.length);
- sendSocket.send(send);
- logger.finer("Test 3: Binding Request sent.");
-
- int localPort = sendSocket.getLocalPort();
- InetAddress localAddress = sendSocket.getLocalAddress();
-
- sendSocket.close();
-
- DatagramSocket receiveSocket = new DatagramSocket(localPort, localAddress);
- receiveSocket.connect(InetAddress.getByName(stunServer), ca.getPort());
- receiveSocket.setSoTimeout(timeout);
-
- MessageHeader receiveMH = new MessageHeader();
- while (!(receiveMH.equalTransactionID(sendMH))) {
- DatagramPacket receive = new DatagramPacket(new byte[200], 200);
- receiveSocket.receive(receive);
- receiveMH = MessageHeader.parseHeader(receive.getData());
- receiveMH.parseAttributes(receive.getData());
- }
- ErrorCode ec = (ErrorCode) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.ErrorCode);
- if (ec != null) {
- di.setError(ec.getResponseCode(), ec.getReason());
- logger.config("Message header contains an Errorcode message attribute.");
- return;
- }
- if (nodeNatted) {
- di.setRestrictedCone();
- logger.fine("Node is behind a restricted NAT.");
- return;
- }
- } catch (SocketTimeoutException ste) {
- if (timeSinceFirstTransmission < 7900) {
- logger.finer("Test 3: Socket timeout while receiving the response.");
- timeSinceFirstTransmission += timeout;
- int timeoutAddValue = (timeSinceFirstTransmission * 2);
- if (timeoutAddValue > 1600) timeoutAddValue = 1600;
- timeout = timeoutAddValue;
- } else {
- logger.finer("Test 3: Socket timeout while receiving the response. Maximum retry limit exceed. Give up.");
- di.setPortRestrictedCone();
- logger.fine("Node is behind a port restricted NAT.");
- return;
- }
- }
- }
- }
-}
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/BindingLifetimeTestDemo.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/BindingLifetimeTestDemo.java
deleted file mode 100644
index 37e20f84..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/BindingLifetimeTestDemo.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.test.demo;
-
-import java.util.logging.FileHandler;
-import java.util.logging.Handler;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import java.util.logging.SimpleFormatter;
-
-import de.javawi.jstun.test.BindingLifetimeTest;
-
-public class BindingLifetimeTestDemo {
- public static void main(String args[]) {
- try {
- Handler fh = new FileHandler("logging.txt");
- fh.setFormatter(new SimpleFormatter());
- Logger.getLogger("de.javawi.stun").addHandler(fh);
- Logger.getLogger("de.javawi.stun").setLevel(Level.ALL);
- BindingLifetimeTest test = new BindingLifetimeTest("iphone-stun.freenet.de", 3478);
- // iphone-stun.freenet.de:3478
- // larry.gloo.net:3478
- // stun.xten.net:3478
- test.test();
- boolean continueWhile = true;
- while(continueWhile) {
- Thread.sleep(5000);
- if (test.getLifetime() != -1) {
- System.out.println("Lifetime: " + test.getLifetime() + " Finished: " + test.isCompleted());
- if (test.isCompleted()) continueWhile = false;
- }
- }
- } catch (Exception e) {
- System.out.println(e.getMessage());
- e.printStackTrace();
- }
- }
-}
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/DiscoveryTestDemo.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/DiscoveryTestDemo.java
deleted file mode 100644
index 76a6c17e..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/DiscoveryTestDemo.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.test.demo;
-
-import java.net.BindException;
-import java.net.InetAddress;
-import java.net.NetworkInterface;
-import java.util.Enumeration;
-import java.util.logging.FileHandler;
-import java.util.logging.Handler;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import java.util.logging.SimpleFormatter;
-
-import de.javawi.jstun.test.DiscoveryTest;
-
-public class DiscoveryTestDemo implements Runnable {
- InetAddress iaddress;
-
- public DiscoveryTestDemo(InetAddress iaddress) {
- this.iaddress = iaddress;
- }
-
- public void run() {
- try {
- DiscoveryTest test = new DiscoveryTest(iaddress, "jstun.javawi.de", 3478);
- //DiscoveryTest test = new DiscoveryTest(iaddress, "stun.sipgate.net", 10000);
- // iphone-stun.freenet.de:3478
- // larry.gloo.net:3478
- // stun.xten.net:3478
- // stun.sipgate.net:10000
- System.out.println(test.test());
- } catch (BindException be) {
- System.out.println(iaddress.toString() + ": " + be.getMessage());
- } catch (Exception e) {
- System.out.println(e.getMessage());
- e.printStackTrace();
- }
- }
-
- public static void main(String args[]) {
- try {
- Handler fh = new FileHandler("logging.txt");
- fh.setFormatter(new SimpleFormatter());
- Logger.getLogger("de.javawi.stun").addHandler(fh);
- Logger.getLogger("de.javawi.stun").setLevel(Level.ALL);
-
- Enumeration ifaces = NetworkInterface.getNetworkInterfaces();
- while (ifaces.hasMoreElements()) {
- NetworkInterface iface = ifaces.nextElement();
- Enumeration iaddresses = iface.getInetAddresses();
- while (iaddresses.hasMoreElements()) {
- InetAddress iaddress = iaddresses.nextElement();
- if (Class.forName("java.net.Inet4Address").isInstance(iaddress)) {
- if ((!iaddress.isLoopbackAddress()) && (!iaddress.isLinkLocalAddress())) {
- Thread thread = new Thread(new DiscoveryTestDemo(iaddress));
- thread.start();
- }
- }
- }
- }
- } catch (Exception e) {
- System.out.println(e.getMessage());
- }
- }
-}
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/StunServer.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/StunServer.java
deleted file mode 100644
index b72ffe7c..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/StunServer.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.test.demo;
-
-import java.io.IOException;
-import java.net.DatagramPacket;
-import java.net.DatagramSocket;
-import java.net.InetAddress;
-import java.net.SocketException;
-import java.net.UnknownHostException;
-import java.util.Vector;
-import java.util.logging.FileHandler;
-import java.util.logging.Handler;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import java.util.logging.SimpleFormatter;
-
-import de.javawi.jstun.attribute.ChangeRequest;
-import de.javawi.jstun.attribute.ChangedAddress;
-import de.javawi.jstun.attribute.MappedAddress;
-import de.javawi.jstun.attribute.MessageAttributeException;
-import de.javawi.jstun.attribute.MessageAttributeParsingException;
-import de.javawi.jstun.attribute.ResponseAddress;
-import de.javawi.jstun.attribute.SourceAddress;
-import de.javawi.jstun.attribute.UnknownAttribute;
-import de.javawi.jstun.attribute.UnknownMessageAttributeException;
-import de.javawi.jstun.attribute.MessageAttributeInterface.MessageAttributeType;
-import de.javawi.jstun.header.MessageHeader;
-import de.javawi.jstun.header.MessageHeaderParsingException;
-import de.javawi.jstun.header.MessageHeaderInterface.MessageHeaderType;
-import de.javawi.jstun.util.Address;
-import de.javawi.jstun.util.UtilityException;
-
-/*
- * This class implements a STUN server as described in RFC 3489.
- * The server requires a machine that is dual-homed to be functional.
- */
-public class StunServer {
- private static Logger logger = Logger.getLogger("de.javawi.stun.test.StunServer");
- Vector sockets;
-
- public StunServer(int primaryPort, InetAddress primary, int secondaryPort, InetAddress secondary) throws SocketException {
- sockets = new Vector();
- sockets.add(new DatagramSocket(primaryPort, primary));
- sockets.add(new DatagramSocket(secondaryPort, primary));
- sockets.add(new DatagramSocket(primaryPort, secondary));
- sockets.add(new DatagramSocket(secondaryPort, secondary));
- }
-
- public void start() throws SocketException {
- for (DatagramSocket socket : sockets) {
- socket.setReceiveBufferSize(2000);
- StunServerReceiverThread ssrt = new StunServerReceiverThread(socket);
- ssrt.start();
- }
- }
-
- /*
- * Inner class to handle incoming packets and react accordingly.
- * I decided not to start a thread for every received Binding Request, because the time
- * required to receive a Binding Request, parse it, generate a Binding Response and send
- * it varies only between 2 and 4 milliseconds. This amount of time is small enough so
- * that no extra thread is needed for incoming Binding Request.
- */
- class StunServerReceiverThread extends Thread {
- private DatagramSocket receiverSocket;
- private DatagramSocket changedPort;
- private DatagramSocket changedIP;
- private DatagramSocket changedPortIP;
-
- StunServerReceiverThread(DatagramSocket datagramSocket) {
- this.receiverSocket = datagramSocket;
- for (DatagramSocket socket : sockets) {
- if ((socket.getLocalPort() != receiverSocket.getLocalPort()) &&
- (socket.getLocalAddress().equals(receiverSocket.getLocalAddress())))
- changedPort = socket;
- if ((socket.getLocalPort() == receiverSocket.getLocalPort()) &&
- (!socket.getLocalAddress().equals(receiverSocket.getLocalAddress())))
- changedIP = socket;
- if ((socket.getLocalPort() != receiverSocket.getLocalPort()) &&
- (!socket.getLocalAddress().equals(receiverSocket.getLocalAddress())))
- changedPortIP = socket;
- }
- }
-
- public void run() {
- while (true) {
- try {
- DatagramPacket receive = new DatagramPacket(new byte[200], 200);
- receiverSocket.receive(receive);
- logger.finest(receiverSocket.getLocalAddress().getHostAddress() + ":" + receiverSocket.getLocalPort() + " datagram received from " + receive.getAddress().getHostAddress() + ":" + receive.getPort());
- MessageHeader receiveMH = MessageHeader.parseHeader(receive.getData());
- try {
- receiveMH.parseAttributes(receive.getData());
- if (receiveMH.getType() == MessageHeaderType.BindingRequest) {
- logger.config(receiverSocket.getLocalAddress().getHostAddress() + ":" + receiverSocket.getLocalPort() + " Binding Request received from " + receive.getAddress().getHostAddress() + ":" + receive.getPort());
- ChangeRequest cr = (ChangeRequest) receiveMH.getMessageAttribute(MessageAttributeType.ChangeRequest);
- if (cr == null) throw new MessageAttributeException("Message attribute change request is not set.");
- ResponseAddress ra = (ResponseAddress) receiveMH.getMessageAttribute(MessageAttributeType.ResponseAddress);
-
- MessageHeader sendMH = new MessageHeader(MessageHeaderType.BindingResponse);
- sendMH.setTransactionID(receiveMH.getTransactionID());
-
- // Mapped address attribute
- MappedAddress ma = new MappedAddress();
- ma.setAddress(new Address(receive.getAddress().getAddress()));
- ma.setPort(receive.getPort());
- sendMH.addMessageAttribute(ma);
- // Changed address attribute
- ChangedAddress ca = new ChangedAddress();
- ca.setAddress(new Address(changedPortIP.getLocalAddress().getAddress()));
- ca.setPort(changedPortIP.getLocalPort());
- sendMH.addMessageAttribute(ca);
- if (cr.isChangePort() && (!cr.isChangeIP())) {
- logger.finer("Change port received in Change Request attribute");
- // Source address attribute
- SourceAddress sa = new SourceAddress();
- sa.setAddress(new Address(changedPort.getLocalAddress().getAddress()));
- sa.setPort(changedPort.getLocalPort());
- sendMH.addMessageAttribute(sa);
- byte[] data = sendMH.getBytes();
- DatagramPacket send = new DatagramPacket(data, data.length);
- if (ra != null) {
- send.setPort(ra.getPort());
- send.setAddress(ra.getAddress().getInetAddress());
- } else {
- send.setPort(receive.getPort());
- send.setAddress(receive.getAddress());
- }
- changedPort.send(send);
- logger.config(changedPort.getLocalAddress().getHostAddress() + ":" + changedPort.getLocalPort() + " send Binding Response to " + send.getAddress().getHostAddress() + ":" + send.getPort());
- } else if ((!cr.isChangePort()) && cr.isChangeIP()) {
- logger.finer("Change ip received in Change Request attribute");
- // Source address attribute
- SourceAddress sa = new SourceAddress();
- sa.setAddress(new Address(changedIP.getLocalAddress().getAddress()));
- sa.setPort(changedIP.getLocalPort());
- sendMH.addMessageAttribute(sa);
- byte[] data = sendMH.getBytes();
- DatagramPacket send = new DatagramPacket(data, data.length);
- if (ra != null) {
- send.setPort(ra.getPort());
- send.setAddress(ra.getAddress().getInetAddress());
- } else {
- send.setPort(receive.getPort());
- send.setAddress(receive.getAddress());
- }
- changedIP.send(send);
- logger.config(changedIP.getLocalAddress().getHostAddress() + ":" + changedIP.getLocalPort() + " send Binding Response to " + send.getAddress().getHostAddress() + ":" + send.getPort());
- } else if ((!cr.isChangePort()) && (!cr.isChangeIP())) {
- logger.finer("Nothing received in Change Request attribute");
- // Source address attribute
- SourceAddress sa = new SourceAddress();
- sa.setAddress(new Address(receiverSocket.getLocalAddress().getAddress()));
- sa.setPort(receiverSocket.getLocalPort());
- sendMH.addMessageAttribute(sa);
- byte[] data = sendMH.getBytes();
- DatagramPacket send = new DatagramPacket(data, data.length);
- if (ra != null) {
- send.setPort(ra.getPort());
- send.setAddress(ra.getAddress().getInetAddress());
- } else {
- send.setPort(receive.getPort());
- send.setAddress(receive.getAddress());
- }
- receiverSocket.send(send);
- logger.config(receiverSocket.getLocalAddress().getHostAddress() + ":" + receiverSocket.getLocalPort() + " send Binding Response to " + send.getAddress().getHostAddress() + ":" + send.getPort());
- } else if (cr.isChangePort() && cr.isChangeIP()) {
- logger.finer("Change port and ip received in Change Request attribute");
- // Source address attribute
- SourceAddress sa = new SourceAddress();
- sa.setAddress(new Address(changedPortIP.getLocalAddress().getAddress()));
- sa.setPort(changedPortIP.getLocalPort());
- sendMH.addMessageAttribute(sa);
- byte[] data = sendMH.getBytes();
- DatagramPacket send = new DatagramPacket(data, data.length);
- if (ra != null) {
- send.setPort(ra.getPort());
- send.setAddress(ra.getAddress().getInetAddress());
- } else {
- send.setPort(receive.getPort());
- send.setAddress(receive.getAddress());
- }
- changedPortIP.send(send);
- logger.config(changedPortIP.getLocalAddress().getHostAddress() + ":" + changedPortIP.getLocalPort() + " send Binding Response to " + send.getAddress().getHostAddress() + ":" + send.getPort());
- }
- }
- } catch (UnknownMessageAttributeException umae) {
- umae.printStackTrace();
- // Generate Binding error response
- MessageHeader sendMH = new MessageHeader(MessageHeaderType.BindingErrorResponse);
- sendMH.setTransactionID(receiveMH.getTransactionID());
-
- // Unknown attributes
- UnknownAttribute ua = new UnknownAttribute();
- ua.addAttribute(umae.getType());
- sendMH.addMessageAttribute(ua);
-
- byte[] data = sendMH.getBytes();
- DatagramPacket send = new DatagramPacket(data, data.length);
- send.setPort(receive.getPort());
- send.setAddress(receive.getAddress());
- receiverSocket.send(send);
- logger.config(changedPortIP.getLocalAddress().getHostAddress() + ":" + changedPortIP.getLocalPort() + " send Binding Error Response to " + send.getAddress().getHostAddress() + ":" + send.getPort());
- }
- } catch (IOException ioe) {
- ioe.printStackTrace();
- } catch (MessageAttributeParsingException mape) {
- mape.printStackTrace();
- } catch (MessageAttributeException mae) {
- mae.printStackTrace();
- } catch (MessageHeaderParsingException mhpe) {
- mhpe.printStackTrace();
- } catch (UtilityException ue) {
- ue.printStackTrace();
- } catch (ArrayIndexOutOfBoundsException aioobe) {
- aioobe.printStackTrace();
- }
- }
- }
- }
-
- /*
- * To invoke the STUN server two IP addresses and two ports are required.
- */
- public static void main(String args[]) {
- try {
- if (args.length != 4) {
- System.out.println("usage: java de.javawi.jstun.test.demo.StunServer PORT1 IP1 PORT2 IP2");
- System.out.println();
- System.out.println(" PORT1 - the first port that should be used by the server");
- System.out.println(" IP1 - the first ip address that should be used by the server");
- System.out.println(" PORT2 - the second port that should be used by the server");
- System.out.println(" IP2 - the second ip address that should be used by the server");
- System.exit(0);
- }
- Handler fh = new FileHandler("logging_server.txt");
- fh.setFormatter(new SimpleFormatter());
- Logger.getLogger("de.javawi.stun").addHandler(fh);
- Logger.getLogger("de.javawi.stun").setLevel(Level.ALL);
- StunServer ss = new StunServer(Integer.parseInt(args[0]),
- InetAddress.getByName(args[1]),
- Integer.parseInt(args[2]),
- InetAddress.getByName(args[3]));
- ss.start();
- } catch (SocketException se) {
- se.printStackTrace();
- } catch (UnknownHostException uhe) {
- uhe.printStackTrace();
- } catch (IOException ioe) {
- ioe.printStackTrace();
- }
- }
-}
\ No newline at end of file
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/ice/Candidate.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/ice/Candidate.java
deleted file mode 100644
index 22dd58fb..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/ice/Candidate.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.test.demo.ice;
-
-import java.net.DatagramSocket;
-import java.net.SocketException;
-import java.net.UnknownHostException;
-
-import de.javawi.jstun.util.Address;
-import de.javawi.jstun.util.UtilityException;
-
-public class Candidate implements Comparable {
- // The ieft-mmusic-ice-12 draft is not non-ambigious about the number of types.
- // Chapter 5.1 defines 3 and 4 types on page 16 and page 17, respectively.
- public enum CandidateType { Local, ServerReflexive, PeerReflexive, Relayed };
-
- private DatagramSocket socket;
- private CandidateType type;
- private short componentId;
- private int priority;
- private int foundationId;
- private Candidate base;
- private boolean isInUse;
-
- public Candidate(Address address, short componentId) throws SocketException, UnknownHostException, UtilityException {
- this.socket = new DatagramSocket(0, address.getInetAddress());
- this.type = CandidateType.Local;
- this.componentId = componentId;
- this.priority = 0;
- this.base = this;
- this.isInUse = false;
- }
-
- public Candidate(Address address, CandidateType type, short componentId, Candidate base) throws SocketException, UnknownHostException, UtilityException {
- this.socket = new DatagramSocket(0, address.getInetAddress());
- this.type = type;
- setComponentId(componentId);
- this.priority = 0;
- this.base = base;
- this.isInUse = false;
- }
-
- public void setBase(Candidate base) {
- this.base = base;
- }
-
- public Candidate getBase() {
- return base;
- }
-
- public CandidateType getCandidateType() {
- return type;
- }
-
- public void setComponentId(short componentId) {
- if ((componentId < 1) || (componentId > 256)) throw new IllegalArgumentException(componentId + " is not between 1 and 256 inclusive.");
- this.componentId = componentId;
- }
-
- public short getComponentId() {
- return componentId;
- }
-
- public void setFoundationId(int foundationId) {
- this.foundationId = foundationId;
- }
-
- public int getFoundationId() {
- return foundationId;
- }
-
- public void setPriority(int priority) {
- this.priority = priority;
- }
-
- public int getPriority() {
- return priority;
- }
-
- public Address getAddress() throws UtilityException {
- return new Address(socket.getLocalAddress().getAddress());
- }
-
- public int getPort() {
- return socket.getLocalPort();
- }
-
- public void setInUse(boolean isInUse) {
- this.isInUse = isInUse;
- }
-
- public boolean getInUse() {
- return isInUse;
- }
-
- public int compareTo(Object arg0) {
- Candidate cand = (Candidate) arg0;
- return cand.getPriority() - getPriority();
- }
-
- public boolean equals(Object o) {
- if (o == null) return false;
- if ((((Candidate) o).socket.equals(socket)) && (((Candidate) o).base.equals(base))) return true;
- return false;
- }
-}
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/ice/ICENegociator.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/ice/ICENegociator.java
deleted file mode 100644
index 502528c5..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/ice/ICENegociator.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.test.demo.ice;
-
-import java.net.InetAddress;
-import java.net.NetworkInterface;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import de.javawi.jstun.test.DiscoveryInfo;
-import de.javawi.jstun.test.DiscoveryTest;
-import de.javawi.jstun.test.demo.ice.Candidate.CandidateType;
-import de.javawi.jstun.util.Address;
-
-public class ICENegociator {
- // type preference must be an integere from 0 (=lowest) to 126 (=highest) (inclusive)
- private final static int LOCAL_PREFERENCE = 0;
- private final static int SERVER_REFLEXIVE_PREFERENCE = 42;
- private final static int PEER_REFLEXIVE_PREFERENCE = 84;
- private final static int RELAYED_PREFERENCE = 126;
-
- // component id
- private short componentId;
-
- // candidates
- HashSet candidates;
-
- public ICENegociator(short componentId) {
- this.componentId = componentId;
- candidates = new HashSet();
- }
-
- /*
- * This method gathers candidate addresses as described in draft-ietf-mmusic-ice-12.txt Chapter 2.1
- * Unfortunately, only the candidates of the direct attached network interfaces and server reflexive
- * addreses are gathered. So far, no support for relayed candidates is available (because I am not
- * aware of any STUN relay server).
- */
- public void gatherCandidateAddresses() {
- candidates = new HashSet();
- try {
- Enumeration ifaces = NetworkInterface.getNetworkInterfaces();
- while (ifaces.hasMoreElements()) {
- NetworkInterface iface = ifaces.nextElement();
- Enumeration iaddresses = iface.getInetAddresses();
- while (iaddresses.hasMoreElements()) {
- InetAddress iaddress = iaddresses.nextElement();
- if (!iaddress.isLoopbackAddress() && !iaddress.isLinkLocalAddress()) {
- // add host candidate
- Candidate local = new Candidate(new Address(iaddress.getAddress()), componentId);
- candidates.add(local);
- // add server reflexive address
- DiscoveryTest test = new DiscoveryTest(iaddress, "iphone-stun.freenet.de", 3478);
- DiscoveryInfo di = test.test();
- if (di.getPublicIP() != null) {
- Candidate cand = new Candidate(new Address(di.getPublicIP().getAddress()), CandidateType.ServerReflexive, componentId, local);
- cand.setComponentId(componentId);
- candidates.add(cand);
- }
- }
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- public void prioritizeCandidates() {
- // count number of candidate types
- int numberLocal = 0;
- int numberServerReflexive = 0;
- int numberPeerReflexive = 0;
- int numberRelayed = 0;
- // count number of candidates of a particular type
- Iterator iterCandidates = candidates.iterator();
- while (iterCandidates.hasNext()) {
- Candidate cand = iterCandidates.next();
- CandidateType type = cand.getCandidateType();
- if (type == CandidateType.Local) numberLocal++;
- else if (type == CandidateType.ServerReflexive) numberServerReflexive++;
- else if (type == CandidateType.PeerReflexive) numberPeerReflexive++;
- else if (type == CandidateType.Relayed) numberRelayed++;
- }
- // assign priorities
- iterCandidates = candidates.iterator();
- while (iterCandidates.hasNext()) {
- int typeValue = 0;
- int localValue = 0;
- int componentValue = 0;
- Candidate cand = iterCandidates.next();
- CandidateType type = cand.getCandidateType();
- if (type == CandidateType.Local) {
- typeValue = LOCAL_PREFERENCE;
- localValue = numberLocal--;
- }
- else if (type == CandidateType.ServerReflexive) {
- typeValue = SERVER_REFLEXIVE_PREFERENCE;
- localValue = numberServerReflexive--;
- }
- else if (type == CandidateType.PeerReflexive) {
- typeValue = PEER_REFLEXIVE_PREFERENCE;
- localValue = numberPeerReflexive--;
- }
- else if (type == CandidateType.Relayed) {
- typeValue = RELAYED_PREFERENCE;
- localValue = numberRelayed--;
- }
- componentValue = cand.getComponentId();
- int priority = ((2 ^ 24) * typeValue) + ((2 ^ 8) * localValue) + componentValue;
- cand.setPriority(priority);
- }
- }
-
- public List getSortedCandidates() {
- Vector sortedCandidates = new Vector(candidates);
- Collections.sort(sortedCandidates);
- return sortedCandidates;
- }
-
- public static void main(String args[]) {
- ICENegociator cc = new ICENegociator((short) 1);
- // gather candidates
- cc.gatherCandidateAddresses();
- // priorize candidates
- cc.prioritizeCandidates();
- // get SortedCandidates
- List sortedCandidates = cc.getSortedCandidates();
-
- // sent sorted candidate addresses to peer over SDP
- // received sorted candidate addresses of peer over SDP
-
- }
-}
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/util/Address.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/util/Address.java
deleted file mode 100644
index 46ad1a0e..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/util/Address.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.util;
-
-import java.util.*;
-import java.net.*;
-
-public class Address {
- int firstOctet;
- int secondOctet;
- int thirdOctet;
- int fourthOctet;
-
- public Address(int firstOctet, int secondOctet, int thirdOctet, int fourthOctet) throws UtilityException {
- if ((firstOctet < 0) || (firstOctet > 255) || (secondOctet < 0) || (secondOctet > 255) || (thirdOctet < 0) || (thirdOctet > 255) || (fourthOctet < 0) || (fourthOctet > 255)) {
- throw new UtilityException("Address is malformed.");
- }
- this.firstOctet = firstOctet;
- this.secondOctet = secondOctet;
- this.thirdOctet = thirdOctet;
- this.fourthOctet = fourthOctet;
- }
-
- public Address(String address) throws UtilityException {
- StringTokenizer st = new StringTokenizer(address, ".");
- if (st.countTokens() != 4) {
- throw new UtilityException("4 octets in address string are required.");
- }
- int i = 0;
- while (st.hasMoreTokens()) {
- int temp = Integer.parseInt(st.nextToken());
- if ((temp < 0) || (temp > 255)) {
- throw new UtilityException("Address is in incorrect format.");
- }
- switch (i) {
- case 0: firstOctet = temp; ++i; break;
- case 1: secondOctet = temp; ++i; break;
- case 2: thirdOctet = temp; ++i; break;
- case 3: fourthOctet = temp; ++i; break;
- }
- }
- }
-
- public Address(byte[] address) throws UtilityException {
- if (address.length < 4) {
- throw new UtilityException("4 bytes are required.");
- }
- firstOctet = Utility.oneByteToInteger(address[0]);
- secondOctet = Utility.oneByteToInteger(address[1]);
- thirdOctet = Utility.oneByteToInteger(address[2]);
- fourthOctet = Utility.oneByteToInteger(address[3]);
- }
-
- public String toString() {
- return firstOctet + "." + secondOctet + "." + thirdOctet + "." + fourthOctet;
- }
-
- public byte[] getBytes() throws UtilityException {
- byte[] result = new byte[4];
- result[0] = Utility.integerToOneByte(firstOctet);
- result[1] = Utility.integerToOneByte(secondOctet);
- result[2] = Utility.integerToOneByte(thirdOctet);
- result[3] = Utility.integerToOneByte(fourthOctet);
- return result;
- }
-
- public InetAddress getInetAddress() throws UtilityException, UnknownHostException {
- byte[] address = new byte[4];
- address[0] = Utility.integerToOneByte(firstOctet);
- address[1] = Utility.integerToOneByte(secondOctet);
- address[2] = Utility.integerToOneByte(thirdOctet);
- address[3] = Utility.integerToOneByte(fourthOctet);
- return InetAddress.getByAddress(address);
- }
-
- public boolean equals(Object obj) {
- if (obj == null) return false;
- try {
- byte[] data1 = this.getBytes();
- byte[] data2 = ((Address) obj).getBytes();
- if ((data1[0] == data2[0]) && (data1[1] == data2[1]) &&
- (data1[2] == data2[2]) && (data1[3] == data2[3])) return true;
- return false;
- } catch (UtilityException ue) {
- return false;
- }
- }
-
- public int hashCode() {
- return (firstOctet << 24) + (secondOctet << 16) + (thirdOctet << 8) + fourthOctet;
- }
-
-}
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/util/Utility.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/util/Utility.java
deleted file mode 100644
index 91c2d88e..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/util/Utility.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.util;
-
-public class Utility {
-
- public static final byte integerToOneByte(int value) throws UtilityException {
- if ((value > Math.pow(2,15)) || (value < 0)) {
- throw new UtilityException("Integer value " + value + " is larger than 2^15");
- }
- return (byte)(value & 0xFF);
- }
-
- public static final byte[] integerToTwoBytes(int value) throws UtilityException {
- byte[] result = new byte[2];
- if ((value > Math.pow(2,31)) || (value < 0)) {
- throw new UtilityException("Integer value " + value + " is larger than 2^31");
- }
- result[0] = (byte)((value >>> 8) & 0xFF);
- result[1] = (byte)(value & 0xFF);
- return result;
- }
-
- public static final byte[] integerToFourBytes(int value) throws UtilityException {
- byte[] result = new byte[4];
- if ((value > Math.pow(2,63)) || (value < 0)) {
- throw new UtilityException("Integer value " + value + " is larger than 2^63");
- }
- result[0] = (byte)((value >>> 24) & 0xFF);
- result[1] = (byte)((value >>> 16) & 0xFF);
- result[2] = (byte)((value >>> 8) & 0xFF);
- result[3] = (byte)(value & 0xFF);
- return result;
- }
-
- public static final int oneByteToInteger(byte value) throws UtilityException {
- return (int)value & 0xFF;
- }
-
- public static final int twoBytesToInteger(byte[] value) throws UtilityException {
- if (value.length < 2) {
- throw new UtilityException("Byte array too short!");
- }
- int temp0 = value[0] & 0xFF;
- int temp1 = value[1] & 0xFF;
- return ((temp0 << 8) + temp1);
- }
-
- public static final long fourBytesToLong(byte[] value) throws UtilityException {
- if (value.length < 4) {
- throw new UtilityException("Byte array too short!");
- }
- int temp0 = value[0] & 0xFF;
- int temp1 = value[1] & 0xFF;
- int temp2 = value[2] & 0xFF;
- int temp3 = value[3] & 0xFF;
- return (((long)temp0 << 24) + (temp1 << 16) + (temp2 << 8) + temp3);
- }
-}
diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/util/UtilityException.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/util/UtilityException.java
deleted file mode 100644
index d6f65fa7..00000000
--- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/util/UtilityException.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * This file is part of JSTUN.
- *
- * Copyright (c) 2005 Thomas King - All rights
- * reserved.
- *
- * This software is licensed under either the GNU Public License (GPL),
- * or the Apache 2.0 license. Copies of both license agreements are
- * included in this distribution.
- */
-
-package de.javawi.jstun.util;
-
-public class UtilityException extends Exception {
- private static final long serialVersionUID = 3545800974716581680L;
-
- UtilityException(String mesg) {
- super(mesg);
- }
-
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/pom.xml b/p2pproxy/dependencies-src/jxse-src-2.5/api/pom.xml
deleted file mode 100644
index 4f467d1c..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/pom.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
- net.jxta.platform
- jxta
- 1.0
- ../pom.xml
-
- 4.0.0
- jxta-api
- net.jxta.platform
- jxta-api
- jar
- 1.0
-
-
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/Version.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/Version.java
deleted file mode 100644
index f6604de0..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/Version.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- *
- * ====================================================================
- *
- * Copyright (c) 2001 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta;
-
-import java.lang.Package;
-
-/**
- * Provides easy access to Java Package information for the JXSE API.
- */
-public final class Version {
-
- /**
- * Returns the package.
- *
- * @return The specification title.
- */
- public static Package getPackage() {
- return Version.class.getPackage();
- }
-
- /**
- * Returns the specification title.
- *
- * @return The specification title.
- */
- public static String getSpecTitle() {
- Package versionPackage = Version.class.getPackage();
-
- return versionPackage.getSpecificationTitle();
- }
-
- /**
- * Returns the specification vendor.
- *
- * @return The specification vendor.
- */
- public static String getSpecVendor() {
- Package versionPackage = Version.class.getPackage();
-
- return versionPackage.getSpecificationVendor();
- }
-
- /**
- * Returns the specification version.
- *
- * @return The specification version.
- */
- public static String getSpecVersion() {
- Package versionPackage = Version.class.getPackage();
-
- return versionPackage.getSpecificationVersion();
- }
-
- /**
- * Returns the specification title.
- *
- * @return The specification title.
- */
- public static String getImplTitle() {
- Package versionPackage = Version.class.getPackage();
-
- return versionPackage.getImplementationTitle();
- }
-
- /**
- * Returns the specification vendor.
- *
- * @return The specification vendor.
- */
- public static String getImplVendor() {
- Package versionPackage = Version.class.getPackage();
-
- return versionPackage.getImplementationVendor();
- }
-
- /**
- * Returns the specification version.
- *
- * @return The specification version.
- */
- public static String getImplVersion() {
- Package versionPackage = Version.class.getPackage();
-
- return versionPackage.getImplementationVersion();
- }
-
- /**
- * This class is a singleton.
- */
- private Version() {
- }
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/access/AccessService.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/access/AccessService.java
deleted file mode 100644
index e5183e82..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/access/AccessService.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- *
- * ====================================================================
- *
- * Copyright (c) 2001 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.access;
-
-
-import net.jxta.credential.Credential;
-import net.jxta.credential.PrivilegedOperation;
-import net.jxta.document.Element;
-import net.jxta.service.Service;
-
-
-/**
- * The Access Service is used by JXTA Applications and Services to determine if
- specific operations are permitted for a particular identity.
- *
- * Each Access Service implementation provides a mechanism for determining
- * if, for a given operation and identity, the operation is permitted.
- **/
-public interface AccessService extends Service {
-
- /**
- * The result of an access check.
- **/
- public enum AccessResult {
-
- /**
- * State is unknown or could not be established.
- *
- * The operation should not be performed.
- *
- * This result may not be used by all Access Service
- * implementations.
- **/
- UNDETERMINED, /**
- * Operation is disallowed.
- *
- * The operation should not be performed.
- *
- **/ DISALLOWED, /**
- * Operation is permitted.
- *
- * The operation should be performed.
- *
- **/ PERMITTED, /**
- * Operation would be permitted, but one (or more) of the provided
- * credentials was expired.
- *
- * The operation should not be performed.
- *
- * This result may not be used by all Access Service
- * implementations.
- **/ PERMITTED_EXPIRED
- }
-
- /**
- * Determine if a privileged operation is permitted for a given identity.
- *
- * @param operation The operation which is being requested or {@code null}.
- * {@code null} signifies that the operation is unimportant though the
- * credential must be valid.
- * @param credential The identity which is requesting or {@code null}. A
- * {@code null} value indicates that no credential is available.
- * @return the result of the access check.
- **/
- public AccessResult doAccessCheck(PrivilegedOperation operation, Credential credential);
-
- /**
- * Create a new privileged operation with the specified subject. Each
- * operation is also associated with an identity, the offerer. Generally
- * the privileged operation is cryptographically signed by the offerer.
- *
- * @see net.jxta.credential.Credential
- *
- * @param subject The subject of the operation. This usually identifies
- * what operation is being requested.
- * @param offerer The identity which is offering the operation.
- * @return The privileged operation object
- **/
- public PrivilegedOperation newPrivilegedOperation(Object subject, Credential offerer);
-
- /**
- * Read a privileged operation from a portion of a structured document.
- *
- * @param source The root of the document portion containing the serialized
- * representation of the privileged operation.
- * @return The privileged operation object.
- **/
- public PrivilegedOperation newPrivilegedOperation(Element source);
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/access/package.html b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/access/package.html
deleted file mode 100644
index e9f7516f..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/access/package.html
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
- The Access Service provides a framework for using the identities created
- with the Membership Service to control whether specific operations are
- permitted.
-
- The Access Service, like the Membership Service, is not associated with
- a particular JXTA protocol. Each Access Service implementation is
- responsible for its own protocol definition (if any). This approach is used
- primarily so that JXTA bridges well to existing common Membership and Access
- technologies. For example; PKI, LDAP Kerberos, NTLM and API based interfaces
- such as PAM and JAAS.
-
- @see net.jxta.credential.Credential
- @see net.jxta.credential.PrivilegedOperation
- @see net.jxta.membership.MembershipService
- @see JXTA Protocols Specification : Protocols
-
-
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/Codat.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/Codat.java
deleted file mode 100644
index 75a45844..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/Codat.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.codat;
-
-
-import net.jxta.document.Document;
-import net.jxta.id.ID;
-import net.jxta.id.IDFactory;
-import net.jxta.peergroup.PeerGroupID;
-
-import java.io.IOException;
-
-
-/**
- * The common container for managing content within JXTA. A Codat consists of:
- *
- *
Content data for the Codat in the form of a JXTA
- * {@link net.jxta.document.Document}.
- *
A persistent canonical identifier for the Codat in the form of a
- * {@link net.jxta.codat.CodatID}.
- *
An optional CodatID for an associated Codat for which this Codat is
- * metadata.
- *
- *
- * @see net.jxta.codat.CodatID
- * @see net.jxta.document.Document
- */
-public class Codat {
-
- /**
- * CodatID of this Codat. A persistent canonical identifier for this Codat.
- */
- private final CodatID id;
-
- /**
- * CodatID for an associated Codat for which this Codat is metadata. This
- * may be the CodatId of another Codat in the same Peer Group or
- * null.
- */
- private final CodatID metaId;
-
- /**
- * Contains the data of this Codat.
- */
- private final Document doc;
-
- /**
- * Constructs a Codat instance with a new CodatId given a PeerGroupID and
- * a Document.
- *
- * @param groupID The peer group to which this Codat will belong.
- * @param about The CodatID of an associated Codat for which this Codat is
- * metadata or null if there is no associated Codat.
- * @param document Document which contains the content data for this Codat.
- * @throws IOException if there is an error accessing the document.
- */
- public Codat(PeerGroupID groupID, CodatID about, Document document) throws IOException {
- this(IDFactory.newCodatID(groupID, document.getStream()), about, document);
- }
-
- /**
- * Constructs a Codat instance for an existing Codat given it's
- * CodatID and a document.
- *
- * This implementation does not verify that the CodatID matches the
- * provided Document.
- *
- * @param id CodatId of the new Codat.
- * @param about CodatID of an associated Codat for which this Codat is metadata.
- * @param document Document which contains the content data for this Codat.
- */
- public Codat(CodatID id, CodatID about, Document document) {
- if (null == id) {
- throw new IllegalArgumentException("CodatID may not be null.");
- }
-
- if (null == document) {
- throw new IllegalArgumentException("Document may not be null.");
- }
-
- this.id = id;
- this.metaId = about;
- this.doc = document;
- }
-
- /**
- * Returns the CodatID of this Codat.
- *
- * @return The CodatID of this Codat.
- */
- public ID getCodatID() {
- return id;
- }
-
- /**
- * Returns the CodatID of an associated Codat for which this Codat is
- * metadata or null if there is no associated Codat.
- *
- * @return CodatID The CodatID of an associated Codat for which this Codat
- * is metadata or null if there is no associated Codat.
- */
- public ID getMetaID() {
- return metaId;
- }
-
- /**
- * Returns a Document containing the data of this Codat.
- *
- * @return A Document containing the data of this Codat.
- */
- public Document getDocument() {
- return doc;
- }
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/CodatID.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/CodatID.java
deleted file mode 100644
index 5e7c94d7..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/CodatID.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.codat;
-
-
-import java.net.URI;
-import net.jxta.id.ID;
-
-
-/**
- * An identifier that enables canonical references to be made to a Codat within
- * the context of a specific peer group.
- *
- * A CodatID is formed by the conjuction of:
- *
a PeerGroupID
- *
a randomly chosen value that has a high probability of being unique
- *
an optional SHA1 cryptographic hash of the Codat contents
- *
- * Codats which contain static content will normally include the hash value
- * as part of their CodatID.
- *
- * @see net.jxta.codat.Codat
- * @see net.jxta.peergroup.PeerGroupID
- */
-public abstract class CodatID extends ID {
-
- /**
- * Creates an ID by parsing the given URI.
- *
- *
This convenience factory method works as if by invoking the
- * {@link net.jxta.id.IDFactory#fromURI(URI)} method; any
- * {@link java.net.URISyntaxException} thrown is caught and wrapped in a
- * new {@link IllegalArgumentException} object, which is then thrown.
- *
- *
This method is provided for use in situations where it is known that
- * the given string is a legal ID, for example for ID constants declared
- * within in a program, and so it would be considered a programming error
- * for the URI not to parse as such. The {@link net.jxta.id.IDFactory},
- * which throws {@link java.net.URISyntaxException} directly, should be used
- * situations where a ID is being constructed from user input or from some
- * other source that may be prone to errors.
- *
- * @param fromURI The URI to be parsed into an ID
- * @return The new ID
- *
- * @throws NullPointerException If {@code fromURI} is {@code null}.
- * @throws IllegalArgumentException If the given URI is not a valid ID.
- */
- public static CodatID create(URI fromURI) {
- return (CodatID) ID.create(fromURI);
- }
-
- /**
- * {@inheritDoc}
- */
- public CodatID intern() {
- return (CodatID) super.intern();
- }
-
- /**
- * Returns PeerGroupID of the Peer Group to which this Codat ID belongs.
- *
- * @return PeerGroupID of the Peer Group which this ID is part of.
- */
- public abstract ID getPeerGroupID();
-
- /**
- * Returns true if this CodatID is associated with a static Codat.
- *
- * @return true if the codatId is for a Codat with static content
- * otherwise false.
- */
- public abstract boolean isStatic();
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/Metadata.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/Metadata.java
deleted file mode 100644
index 1d1f7bbd..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/Metadata.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-package net.jxta.codat;
-
-
-import net.jxta.document.Document;
-import net.jxta.peergroup.PeerGroupID;
-
-import java.io.IOException;
-
-
-/**
- * Medata Codats are special codats that contain information about another
- * Codat. Multiple medata Codats can refer to the same Codat. Medata codats can
- * hold any kind of information about a codat, such as a symbolic name,
- * description, index and searching information, etc.
- *
- * @see net.jxta.codat.Codat
- * @see net.jxta.codat.CodatID
- * @see net.jxta.document.Document
- */
-public class Metadata extends Codat {
-
- /**
- * Constructs a Metadata instance with a new CodatId given a PeerGroupID,
- * the CodatID of the associated Codat and a Document.
- *
- * @param groupID The peer group to which this Codat will belong.
- * @param about The CodatID of an associated Codat for which this Codat is
- * metadata or null if there is no associated Codat.
- * @param document Document which contains the content data for this Codat.
- * @throws IOException if there is an error accessing the document.
- */
- public Metadata(PeerGroupID groupID, CodatID about, Document document) throws IOException {
- super(groupID, about, document);
- }
-
- /**
- * Constructs a Metadata instance for an existing Codat given it's
- * CodatID, the CodatID of the associated Codat and a Document.
- *
- * This implementation does not verify that the CodatID matches the
- * provided Document.
- *
- * @param id CodatId of the new Codat.
- * @param about CodatID of an associated Codat for which this Codat is metadata.
- * @param document Document which contains the content data for this Codat.
- */
- public Metadata(CodatID id, CodatID about, Document document) {
- super(id, about, document);
- }
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/package.html b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/package.html
deleted file mode 100644
index 7b4aa9a5..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/package.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-Codats are container objects that can hold both data or code and are
-associated with a JXTA ID.
-
-@see net.jxta.id
-@see JXTA Protocols
- Specification : Protocols
-
-
-file:///home/mike/code/jxta/spec/www/v1.0/docbook/JXTAProtocols.html#overview-codats
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/AuthenticationCredential.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/AuthenticationCredential.java
deleted file mode 100644
index 081e8364..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/AuthenticationCredential.java
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.credential;
-
-import net.jxta.document.*;
-import net.jxta.id.ID;
-import net.jxta.id.IDFactory;
-import net.jxta.peergroup.PeerGroup;
-import net.jxta.service.Service;
-
-import java.util.logging.Level;
-
-import net.jxta.logging.Logging;
-
-import java.util.logging.Logger;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Enumeration;
-
-/**
- * Authenication credentials are used by JXTA Membership Services as the
- * basis for applications for peergroup membership. The AuthenticationCredential
- * provides two important pieces of inforamtion:
- *
- *
the authetication method being requested
- *
identity information which will be provided to that authentication
- * method.
- *
- *
- * Not all authentication methods use the identity nformation.
- *
- * @see net.jxta.credential.Credential
- * @see net.jxta.membership.MembershipService
- * @see net.jxta.membership.Authenticator
- */
-public final class AuthenticationCredential implements Credential {
-
- /**
- * Logger
- */
- private final static transient Logger LOG = Logger.getLogger(AuthenticationCredential.class.getName());
-
- /**
- * the authentication method which will be requested when this credential is
- * provided during "apply" to a peergroup membership service.
- */
- private String authenticationMethod = null;
-
- /**
- * Any optional information which is required by the requested authentication method.
- */
- private Element identityInfo = null;
-
- /**
- * The peergroup of this AuthenticationCredential
- */
- private final PeerGroup peergroup;
-
- /**
- * Creates new AuthenticationCredential
- *
- * @param peergroup The peergroup context in which this
- * AuthenticationCredential is created.
- * @param method The authentication method which will be requested when the
- * AuthentiationCredential is provided to the peergroup Membership Service.
- * Authentication methods are specific to Membership services. Consult the
- * Documentation for the Membership service you will be authenticating
- * against in order to determine the valid method values. Every
- * Membership service should support a default authentication method which
- * can be specified as null.
- * @param indentityInfo Optional additional information which is used by the
- * authentication method or null. This information is passed to the
- * authentication method during the apply operation of the Membership
- * Service. Consult the documentation for the specific Membership Service
- * you are using for details on how this information is used (if at all).
- */
- public AuthenticationCredential(PeerGroup peergroup, String method, Element indentityInfo) {
- this.peergroup = peergroup;
-
- authenticationMethod = method;
-
- if (null != indentityInfo) {
- this.identityInfo = StructuredDocumentUtils.copyAsDocument(indentityInfo);
- }
- }
-
- /**
- * Creates new AuthenticationCredential
- *
- * @param peergroup The peergroup context in which this
- * AuthenticationCredential is created.
- * @param root the document containing the serialized representation of the
- * AuthenticationCredential.
- */
- public AuthenticationCredential(PeerGroup peergroup, Element root) {
-
- this.peergroup = peergroup;
-
- initialize(root);
- }
-
- /**
- * {@inheritDoc}
- *
- * AuthenticationCredentials are created in the context of a PeerGroup
- * though they are generally independant of peergroups. The intent is that
- * the AuthenticationCredential will be passed to the MembershipService
- * service of the same peergroup as the AuthenticationCredenitals.
- *
- * @return PeerGroupID associated with this AuthenticationCredential.
- */
- public ID getPeerGroupID() {
- return peergroup.getPeerGroupID();
- }
-
- /**
- * {@inheritDoc}
- */
- public ID getPeerID() {
- return peergroup.getPeerID();
- }
-
- /**
- * {@inheritDoc}
- */
- public Service getSourceService() {
- return null;
- }
-
- /**
- * {@inheritDoc}
- *
- * AuthenticationCredential are never expired. The Authenticator will
- * determine the true validity from the included identity info.
- */
- public boolean isExpired() {
- return false;
- }
-
- /**
- * {@inheritDoc}
- *
- * AuthenticationCredential are always valid, the Authenticator will
- * determine the true validity from the included identity info.
- */
- public boolean isValid() {
- return true;
- }
-
- /**
- * {@inheritDoc}
- *
- * There is no straightforward mechansim for identifying the subject
- * unfortunately.
- */
- public Object getSubject() {
- return null;
- }
-
- /**
- * Write credential into a document. as is a mime media-type
- * specification and provides the form of the document which is being
- * requested. Two standard document forms are defined. "text/text" encodes
- * the document in a form nice for printing out and "text/xml" which
- * provides an XML format.
- *
- * @param as The mime media type of the encoding format being requested.
- * @return the StructuredDocument which represents this credential.
- * @throws Exception When errors occur.
- */
- public StructuredDocument getDocument(MimeMediaType as) throws Exception {
-
- StructuredDocument doc = StructuredDocumentFactory.newStructuredDocument(as, "jxta:Cred");
-
- if (doc instanceof Attributable) {
- ((Attributable) doc).addAttribute("xmlns:jxta", "http://jxta.org");
- ((Attributable) doc).addAttribute("xml:space", "preserve");
- ((Attributable) doc).addAttribute("type", "AuthenticationCredential");
- }
-
- Element e = doc.createElement("Method", getMethod());
-
- doc.appendChild(e);
-
- e = doc.createElement("PeerGroupID", getPeerGroupID().toString());
- doc.appendChild(e);
-
- e = doc.createElement("PeerID", getPeerID().toString());
- doc.appendChild(e);
-
- if (null != identityInfo) {
- e = doc.createElement("IdentityInfo");
- doc.appendChild(e);
-
- StructuredDocumentUtils.copyElements(doc, e, identityInfo);
- }
-
- return doc;
- }
-
- /**
- * Returns the authentication method which this AuthenticationCredential
- * will be requesting when it is provided to a Membership Service during the
- * "Apply" operation.
- *
- * @return String containing the authentication method being requested.
- */
- public String getMethod() {
- return authenticationMethod;
- }
-
- protected void setMethod(String authenticationMethod) {
- this.authenticationMethod = authenticationMethod;
- }
-
- /**
- * Returns the StructuredDocument Element containing the identity information which was
- * originally provided when this AuthenticationCredential was created.
- *
- * @return StructuredDocument Element containing the identity information which was
- * originally provided when this AuthenticationCredential was created.
- */
- public Element getIdentityInfo() {
- return (null == identityInfo) ? null : StructuredDocumentUtils.copyAsDocument(identityInfo);
- }
-
- /**
- * Process an individual element from the document.
- *
- * @param elem the element to be processed.
- * @return true if the element was recognized, otherwise false.
- */
- protected boolean handleElement(TextElement elem) {
- if (elem.getName().equals("PeerGroupID")) {
- try {
- URI gID = new URI(elem.getTextValue());
- ID pgid = IDFactory.fromURI(gID);
-
- if (!pgid.equals(getPeerGroupID())) {
- throw new IllegalArgumentException("Operation is from a different group. " + pgid + " != " + getPeerGroupID());
- }
- } catch (URISyntaxException badID) {
- throw new IllegalArgumentException("Unusable ID in advertisement: " + elem.getTextValue());
- }
- return true;
- }
-
- if (elem.getName().equals("PeerID")) {
- try {
- URI pID = new URI(elem.getTextValue());
- ID pid = IDFactory.fromURI(pID);
-
- if (!pid.equals(getPeerID())) {
- throw new IllegalArgumentException("Operation is from a different group. " + pid + " != " + getPeerID());
- }
- } catch (URISyntaxException badID) {
- throw new IllegalArgumentException("Bad Peer ID in advertisement: " + elem.getTextValue());
- } catch (ClassCastException badID) {
- throw new IllegalArgumentException("Id is not a peer id: " + elem.getTextValue());
- }
- return true;
- }
-
- if (elem.getName().equals("Method")) {
- setMethod(elem.getTextValue());
- return true;
- }
-
- if (elem.getName().equals("IdentityInfo")) {
- Enumeration firstChild = elem.getChildren();
-
- if (!firstChild.hasMoreElements()) {
- throw new IllegalArgumentException("Missing identity info");
- }
-
- identityInfo = StructuredDocumentUtils.copyAsDocument((Element) firstChild.nextElement());
-
- return true;
- }
-
- // element was not handled
- return false;
- }
-
- /**
- * Intialize from a portion of a structured document.
- *
- * @param root the element
- */
- protected void initialize(Element root) {
-
- if (!TextElement.class.isInstance(root)) {
- throw new IllegalArgumentException(getClass().getName() + " only supports TextElement");
- }
-
- TextElement doc = (TextElement) root;
-
- String typedoctype = "";
-
- if (root instanceof Attributable) {
- Attribute itsType = ((Attributable) root).getAttribute("type");
-
- if (null != itsType) {
- typedoctype = itsType.getValue();
- }
- }
-
- String doctype = doc.getName();
-
- if (!"jxta:AuthenticationCredential".equals(doctype) && !"jxta:AuthenticationCredential".equals(typedoctype)) {
- throw new IllegalArgumentException(
- "Could not construct : " + getClass().getName() + "from doc containing a " + doctype);
- }
-
- Enumeration elements = doc.getChildren();
-
- while (elements.hasMoreElements()) {
- TextElement elem = (TextElement) elements.nextElement();
-
- if (!handleElement(elem)) {
- if (Logging.SHOW_WARNING && LOG.isLoggable(Level.WARNING)) {
- LOG.warning("Unhandleded element \'" + elem.getName() + "\' in " + doc.getName());
- }
- }
- }
-
- // sanity check time!
-
- // FIXME bondolo@jxta.org 20030409 check things
- }
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/Credential.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/Credential.java
deleted file mode 100644
index 9a42252b..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/Credential.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.credential;
-
-
-import net.jxta.document.MimeMediaType;
-import net.jxta.document.StructuredDocument;
-import net.jxta.id.ID;
-import net.jxta.service.Service;
-
-
-/**
- * Credentials provide the basic mechanisms for securely establishing and
- * communicating identity within JXTA. Credentials have three different roles
- * within JXTA:
- *
- *
- *
Authentication credentials are associated with authentication methods
- * and are used to provide information required for authentication. Each
- * {@link net.jxta.credential.AuthenticationCredential AuthenticationCredential}
- * implementation is specific to its associated
- * {@link net.jxta.membership.Authenticator Authenticator}. Authentication
- * Credentials are normally created by constructing a document which follows
- * a schema provided by the authentication method.
- *
- *
Identity credentials associate an identity with a peer. The peer may
- * request operations to be performed using that identity. Identity Credentials
- * are created by successfully completing authentication with a Membership
- * Service.
- *
- *
Privileged operations associate an operation with an identity. To
- * request a remote peer to perform some operation an application or service
- * provides a {@link net.jxta.credential.PrivilegedOperation} and an
- * identity credential along with the request. The remote peer determines if
- * the operation is permitted for the specified identity and if it is permitted,
- * completes the operation.
- *
- *
- * The XML representation of a Credential uses the following very simple
- * schema. Credential implementations extend this schema as needed.
- *
- *
- */
-public interface Credential {
-
- /**
- * Returns the peerGroupID associated with this credential.
- *
- * @return The peerGroupID associated with this credential.
- */
- public ID getPeerGroupID();
-
- /**
- * Returns the peerID associated with this credential.
- *
- * @return The peerID associated with this credential.
- */
- public ID getPeerID();
-
- /**
- * Returns the service which generated this credential.
- *
- * @return The service which generated this credential.
- */
- public Service getSourceService();
-
- /**
- * Returns {@code true} if this credential is expired. Some credential
- * implementations may never expire.
- *
- * @return {@code true} if this credential is expired, otherwise
- * {@code false}.
- */
- public boolean isExpired();
-
- /**
- * Returns {@code true} if this credential is currently valid.
- *
- * @return {@code true} if the credential is currently valid, otherwise
- * {@code false}.
- */
- public boolean isValid();
-
- /**
- * Returns the subject of this credential. The Objects returned must
- * support {@link Object#equals(Object)} and {@link Object#hashCode()}.
- *
- * @return The subject of the credential as an abstract object.
- */
- public Object getSubject();
-
- /**
- * Write credential into a document. asMimeType is a mime
- * media-type specification and provides the form of the document which is
- * being requested. Two standard document forms are defined.
- * "{@code text/plain}" encodes the document in a "pretty-print" format
- * for human viewing and "{@code text/xml}" which provides an XML format.
- *
- * Depending on the credential format this document may be
- * cryptographically signed to prevent alteration.
- *
- * @param asMimeType MimeMediaType format representation requested
- * @return The credential serialized to a Document.
- * @throws Exception if an error occurs
- */
- public StructuredDocument getDocument(MimeMediaType asMimeType) throws Exception;
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/CredentialPCLSupport.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/CredentialPCLSupport.java
deleted file mode 100644
index 16bc378d..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/CredentialPCLSupport.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.credential;
-
-
-import java.beans.PropertyChangeListener;
-
-
-/**
- * Provides Property Change Listener support for Credentials.
- */
-public interface CredentialPCLSupport {
-
- /**
- * Property name for the expired bound property.
- */
- public final static String EXPIRED_CREDENTIAL_PROPERTY = "expired";
-
- /**
- * Property name for valid bound property.
- */
- public final static String VALID_CREDENTIAL_PROPERTY = "valid";
-
- /**
- * Add a listener
- *
- * @param listener the listener
- */
- public void addPropertyChangeListener(PropertyChangeListener listener);
-
- /**
- * Add a listener. Available properties from all Credentials are :
- *
- *
- *
expired
- *
valid
- *
- *
- * @param propertyName the property to watch
- * @param listener the listener
- */
- public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener);
-
- /**
- * Remove a listener
- *
- * @param listener the listener
- */
- public void removePropertyChangeListener(PropertyChangeListener listener);
-
- /**
- * Remove a listener
- *
- * @param propertyName the property which was watched
- * @param listener the listener
- */
- public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener);
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/CredentialValidator.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/CredentialValidator.java
deleted file mode 100644
index 8e57de9a..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/CredentialValidator.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
-Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-package net.jxta.credential;
-
-
-/**
- * CredentialValidator defines the interface for allowing external validation of a credential
- *
- */
-public interface CredentialValidator {
-
- /**
- * Called when a credential verfication is needed.
- * @param cred the credential to verify, Credential can be null.
- * @return true if verified
- */
- public boolean checkCred(Credential cred);
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/PrivilegedOperation.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/PrivilegedOperation.java
deleted file mode 100644
index e8c83c96..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/PrivilegedOperation.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-
- *
- * ====================================================================
- *
- * Copyright (c) 2001 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.credential;
-
-
-/**
- * A Privileged Operation is an identifier for an operation whose usage is
- * restricted. It is represented as a credential so that users and providers
- * can prevent the unauthorized creation of privledges.
- *
- * Each operation is associated with an offerer. The offerer is the
- * identity which created the operation.
- */
-public interface PrivilegedOperation extends Credential {
-
- /**
- * Returns the offerer of this operation. The offerer is the identity which
- * created the operation.
- *
- * @return the offerer of the operation.
- */
- public Credential getOfferer();
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/package.html b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/package.html
deleted file mode 100644
index 4c201736..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/package.html
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-Credentials provide the basic mechanisms for securly establishing and
-communicating identity within JXTA.
-
-@see JXTA Protocols
- Specification : Protocols
-
-
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/discovery/DiscoveryEvent.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/discovery/DiscoveryEvent.java
deleted file mode 100644
index 0c6cdabf..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/discovery/DiscoveryEvent.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.discovery;
-
-
-import java.util.Enumeration;
-import java.util.EventObject;
-import net.jxta.document.Advertisement;
-import net.jxta.protocol.DiscoveryResponseMsg;
-
-
-/**
- * Container for DiscoveryService events. The source of the event is the Endpoint
- * address of the responding peer
- */
-public class DiscoveryEvent extends EventObject {
-
- private final DiscoveryResponseMsg response;
- private final int queryID;
-
- /**
- * Creates a new event
- *
- * @see net.jxta.protocol.DiscoveryResponseMsg
- * @see net.jxta.protocol.ResolverResponseMsg
- *
- * @param source The source of the event is the Endpoint address of the responding peer
- * @param response The response message for which this event is being generated.
- * @param queryid The query id associated with the response returned in this event
- */
- public DiscoveryEvent(Object source, DiscoveryResponseMsg response, int queryid) {
- super(source);
- this.response = response;
- this.queryID = queryid;
- }
-
- /**
- * Returns the response associated with the event
- *
- * @return DiscoveryResponseMsg
- *
- * @see net.jxta.protocol.DiscoveryResponseMsg
- */
- public DiscoveryResponseMsg getResponse() {
-
- return response;
- }
-
- /**
- * Returns the query id associated with the response returned in this event
- *
- * @return query id associated with the response
- */
- public int getQueryID() {
-
- return queryID;
- }
-
- /**
- * Returns an array of advertisements contained in the DiscoveryResponse
- * for this event.
- *
- * @return Enumeration of Advertisements
- */
- public Enumeration getSearchResults() {
-
- return response.getAdvertisements();
- }
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/discovery/DiscoveryListener.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/discovery/DiscoveryListener.java
deleted file mode 100644
index f3d47e7d..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/discovery/DiscoveryListener.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.discovery;
-
-
-import java.util.EventListener;
-
-
-/**
- * The listener interface for receiving {@link DiscoveryEvent}s from the
- * Discovery Service.
- *
- * The following 2 examples illustrate how to implement a
- * DiscoverListener:
- *
- * Example 1:
- *
- * public class JxtaAppDemo implements Runnable, DiscoveryListener {
- * ..
- * ..
- * public void discoveryEvent(DiscoveryEvent ev) {
- *
- * DiscoveryResponseMsg res = ev.getResponse();
- * ..
- * ..
- * // see tutorial example 2 for full source
- * // JXTA Tutorials
- * }
- * }
- *
- *
- * @see net.jxta.discovery.DiscoveryService
- * @see net.jxta.discovery.DiscoveryEvent
- **/
-public interface DiscoveryListener extends EventListener {
-
- /**
- * Called to handle an event from the Discovery Service.
- *
- * @param event the discovery event
- */
- void discoveryEvent(DiscoveryEvent event);
-}
-
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/discovery/DiscoveryService.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/discovery/DiscoveryService.java
deleted file mode 100644
index 62ce541f..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/discovery/DiscoveryService.java
+++ /dev/null
@@ -1,506 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.discovery;
-
-
-import java.io.IOException;
-import java.util.Enumeration;
-
-import net.jxta.document.Advertisement;
-import net.jxta.id.ID;
-import net.jxta.service.Service;
-
-
-/**
- * Provides an asynchronous mechanism for discovering Advertisement (Peers,
- * Groups, Pipes, Modules, etc.). The scope of discovery queries can be
- * controlled by specifying a name and attribute pair, and/or a threshold.
- * The threshold is an upper limit the requesting peer specifies for
- * responding peers not to exceed. Each JXTA Peer Group has an instance of
- * a DiscoveryService. The scope of discovery is limited to the group. For
- * example :
- *
- * A peer in the soccer group invokes the soccer group's DiscoveryService
- * to discover pipe advertisements for the Score tracker service in the group,
- * and is interested in a maximum of 10 Advertisements from each peer:
- *
- *
- * In the above example, peers that are part of the soccer group would
- * respond. After a getRemoteAdvertisements call is made and the peers respond,
- * a call to getLocalAdvertisements can be made to retrieve results that have
- * been found and added to the local group cache. Alternately, a call to
- * addDiscoveryListener() will provide asynchronous notification of discovered
- * advertisements.
- *
- * When an Advertisement is published, it is stored, and indexed in the
- * peer's local cache. The Advertisement indexes are also shared with
- * Rendezvous peers. Advertisement indexes may not be shared with other
- * peers immediately, but may be updated as part of a periodic process. The
- * Discovery Service currently updates remote indexes every 30 seconds.
- *
- * It is important to note that what is shared with the rendezvous peer is
- * the index and expiration of the advertisement, not the advertisement. The
- * indexes are republished whenever the peer establishes a new connection with
- * a different rendezvous peer.
- *
- * Distributed index garbage collection. A rendezvous peer will GC indexes for
- * a specific peer when it receive a disconnect message, or it has determined
- * that a peer is no longer reachable, the latter action is a lazy GC and is
- * triggered by messenger creation failures which results in a mark and sweep at
- * a future point in time.
- *
- * DiscoveryService also provides a mechanism for publishing advertisements,
- * so that they may be discovered. The rules to follow when publishing are:
- *
- *
- *
- * Use the current discovery service to publish advertisements private to the
- * group.
- *
discovery.publish(adv);
- *
- *
- *
Use the parent's discovery to publish advertisements that public outside
- * of the group. Example : a peer would like publish the "soccer" group in the
- * NetPeerGroup
- *
- *
- * The threshold can be utilized in peer discovery in situations where a peer
- * is only interested in other peers, and not about additional peers they may
- * know about. To achieve this effect for peer discovery set the Threshold to
- * 0 (zero).
- *
- * Advertisements are often stored in a persistent local cache. This cache
- * can improve performance and responsiveness by retaining advertisements
- * between restarts.
- *
- *@see net.jxta.service.Service
- *@see net.jxta.resolver.ResolverService
- *@see net.jxta.protocol.DiscoveryQueryMsg
- *@see net.jxta.protocol.DiscoveryResponseMsg
- *@see net.jxta.protocol.ResolverQueryMsg
- *@see net.jxta.protocol.ResolverResponseMsg
- */
-public interface DiscoveryService extends Service {
-
- /**
- * Discovery type Peer
- */
- public final static int PEER = 0;
-
- /**
- * Discovery type Group
- */
- public final static int GROUP = 1;
-
- /**
- * Discovery type Advertisement
- */
- public final static int ADV = 2;
-
- /**
- * Default lifetime time for advertisements. This is the maximum
- * amount of time which the advertisement will remain valid. If the
- * advertisement remains valid after this time, then the creator will
- * need to republish the advertisement.
- */
- public final static long DEFAULT_LIFETIME = 1000L * 60L * 60L * 24L * 365L;
-
- /**
- * Default expiration time for advertisements. This is the amount of
- * time which advertisements will live in caches. After this time, the
- * advertisement should be refreshed from the source.
- */
- public final static long DEFAULT_EXPIRATION = 1000L * 60L * 60L * 2L;
-
- /**
- * Infinite lifetime for advertisements. The advertisement is valid
- * forever. (well maybe it will expire when the sun burns out, but not
- * before then).
- */
- public final static long INFINITE_LIFETIME = Long.MAX_VALUE;
-
- /**
- * Specifies that the advertisement will have no expiration and will be
- * kept indefinitely.
- */
- public final static long NO_EXPIRATION = Long.MAX_VALUE;
-
- /**
- * Discover advertisements from remote peers. This does not normally
- * provide an exhaustive search. Instead it provides a "best efforts"
- * search which will provide a selection of advertisements of matching the
- * search criteria. The selection of advertisements returned may be random
- * or predictable depending upon the network configuration and no
- * particular behaviour should be assumed. In general the narrower the
- * query specified the more exhaustive the responses will be.
- *
- * Discovery can be performed in two ways :
- *
With a null peerid - The discovery query is
- * propagated on via the Rendezvous Service and via local sub-net
- * utilizing IP multicast.
- *
With a provided peerid - The discovery query is forwarded to the
- * specified peer.
- *
- *
- * The scope of advertisements returned can be narrowed by specifying
- * an {@code attribute} and {@code value} pair. The {@code attribute} is
- * a case-sensitive string matching the name of an Advertisement XML tag
- * who's values will be matched by the {@code value}. Only a limited number
- * of Advertisement XML fields are indexed. {@link
- * net.jxta.document.Advertisement#getIndexFields()} will return the
- * fields on which you may query for a particular Advertisement type.
- *
- * The {@code value} is a case-insensitive string who's value is
- * matched against the values of {@code attribute} fields of Advertisements.
- * The {@code} value may be of several forms :
- *
- *
{@code null} - Don't care. All advertisements with the matching
- * {@code attribute} will be returned.
- *
exact value - Only advertisements with an {@code attribute}
- * field who's value exactly matches the string {@code value} will be
- * returned.
- *
wild card - Only advertisements with an {@code attribute}
- * field who's value matches the wild card expression {@code value}
- * will be returned. eg. The following expressions all match against
- * "FooBar":
- *
- *
{@code foO*}
- *
{@code *Bar}
- *
{@code *oBA*}
- *
- *
- *
- * @param peerid If provided the query will be forwarded to the specified
- * peer. If {@code null} then the query will be propagated through the
- * network to peers with matching Advertisements.
- * @param type Discovery type; PEER, GROUP or ADV.
- * @param attribute indexed element name (see advertisement(s) for a
- * list of indexed fields. A null attribute indicates any advertisement
- * of specified type
- * @param value value of attribute to narrow discovery to. Valid values for
- * this parameter are null (don't care), Exact value, or use of wild
- * card(s) (e.g. if a Advertisement defines FooBar , a value
- * of "*bar", "foo*", or "*ooB*", will return the Advertisement
- * @param threshold The maximum number of matching advertisements which
- * be returned by each responding peer. A {@code threshold} of 0, and
- * {@code type} of {@code PEER} has a special behaviour.
- * @return query ID for this discovery query.
- */
- public int getRemoteAdvertisements(String peerid, int type, String attribute, String value, int threshold);
-
- /**
- * Discover advertisements from remote peers. This does not normally
- * provide an exhaustive search. Instead it provides a "best efforts"
- * search which will provide a selection of advertisements of matching the
- * search criteria. The selection of advertisements returned may be random
- * or predictable depending upon the network configuration and no
- * particular behaviour should be assumed. In general the narrower the
- * query specified the more exhaustive the responses will be.
- *
- * Discovery can be performed in two ways :
- *
With a {@code null} peerid - The discovery query is
- * propagated on via the Rendezvous Service and via local sub-net
- * utilizing IP multicast.
- *
With a provided peerid - The discovery query is forwarded to the
- * specified peer.
- *
- *
- * The scope of advertisements returned can be narrowed by specifying
- * an {@code attribute} and {@code value} pair. The {@code attribute} is
- * a case-sensitive string matching the name of an Advertisement XML tag
- * who's values will be matched by the {@code value}. Only a limited number
- * of Advertisement XML fields are indexed. {@link
- * net.jxta.document.Advertisement#getIndexFields()} will return the
- * fields on which you may query for a particular Advertisement type.
- *
- * The {@code value} is a case-insensitive string who's value is
- * matched against the values of {@code attribute} fields of Advertisements.
- * The {@code} value may be of several forms :
- *
- *
{@code null} - Don't care. All advertisements with the matching
- * {@code attribute} will be returned.
- *
exact value - Only advertisements with an {@code attribute}
- * field who's value exactly matches the string {@code value} will be
- * returned.
- *
wild card - Only advertisements with an {@code attribute}
- * field who's value matches the wild card expression {@code value}
- * will be returned. eg. The following expressions all match against
- * "FooBar":
- *
- *
{@code fOo*}
- *
{@code *bAr}
- *
{@code *OBa*}
- *
- *
- *
- * @param peerid If provided the query will be forwarded to the specified
- * peer. If {@code null} then the query will be propagated through the
- * network to peers with matching Advertisements.
- * @param type Discovery type; PEER, GROUP or ADV.
- * @param attribute indexed element name (see Advertisement(s) for a
- * list of indexed fields. A null attribute indicates any advertisement
- * of specified type
- * @param value value of attribute to narrow discovery to. Valid values
- * for this parameter or {@code null} (don't care), Exact value, or use
- * of wild card(s) (e.g. if a Advertisement defines FooBar,
- * a value of "*bar", "foo*", or "*ooB*", will return the Advertisement
- * @param threshold The maximum number of matching advertisements which
- * be returned by each responding peer. A {@code threshold} of 0, and
- * {@code type} of {@code PEER} has a special behaviour.
- * @param listener The listener which will be called when advertisement
- * which match this query are discovered or {@code null} if no
- * callback is desired.
- * @return query ID for this discovery query.
- */
- public int getRemoteAdvertisements(String peerid, int type, String attribute, String value, int threshold, DiscoveryListener listener);
-
- /**
- * Retrieve locally stored Advertisements. This is an exhaustive search of
- * the locally cached results. All valid known matching results will be
- * returned.
- *
- * @param type Discovery type; PEER, GROUP or ADV.
- * @param attribute indexed element name (see Advertisement(s) for a
- * list of indexed fields. {@code null} indicates any advertisement
- * of specified type
- * @param value value of attribute to narrow discovery to valid
- * values for this parameter are {@code null} (don't care), Exact
- * value, or use of wild card(s) (e.g. if a Advertisement defines
- * FooBar , a value of "*bar", "foo*", or "*ooB*", will
- * return the Advertisement
- * @return Enumeration of stored advertisements.
- * @throws IOException Thrown if an error occurs during retrieval.
- */
- public Enumeration getLocalAdvertisements(int type, String attribute, String value) throws IOException;
-
- /**
- * Publish an Advertisement. The Advertisement will expire automatically
- * on the local peer after DEFAULT_LIFETIME and will expire on
- * other peers after DEFAULT_EXPIRATION.
- *
- * When an Advertisement is published, it is stored, and indexed in the
- * peer's local cache. The Advertisement indexes are also shared with
- * Rendezvous peers. Advertisement indexes may not be shared with other
- * peers immediately, but may be updated as part of a periodic process. The
- * Discovery Service currently publishes index updates every 30 seconds.
- *
- * @param adv The Advertisement to publish.
- * @throws IOException When an error occurs during Advertisement publication.
- */
- public void publish(Advertisement adv) throws IOException;
-
- /**
- * Publish an Advertisement. The Advertisement will expire automatically
- * after the specified time. A peer that discovers this advertisement will
- * hold it for about expiration or lifetime milliseconds,
- * whichever is smaller.
- *
- * When an Advertisement is published, it is stored, and indexed in the
- * peer's local cache. The Advertisement indexes are also shared with
- * Rendezvous peers. Advertisement indexes may not be shared with other
- * peers immediately, but may be updated as part of a periodic process. The
- * Discovery Service currently publishes index updates every 30 seconds.
- *
- * @param adv The Advertisement to publish.
- * @param lifetime Duration in relative milliseconds that this advertisement will exist.
- * @param expiration Duration in relative milliseconds that this advertisement will be cached by other peers.
- * @throws IOException When an error occurs during Advertisement publication.
- */
- public void publish(Advertisement adv, long lifetime, long expiration) throws IOException;
-
- /**
- * Publish an Advertisement via propagation to other peers on the network.
- * This does not result in the advertisement being stored locally. The
- * Advertisement will be published with an expiration time of
- * DEFAULT_EXPIRATION.
- *
- * @param adv Advertisement to publish.
- */
- public void remotePublish(Advertisement adv);
-
- /**
- * Publish an Advertisement via propagation to other peers on the network.
- * This does not result in the advertisement being stored locally.
- *
- * @param adv The Advertisement to publish.
- * @param expiration Duration in relative milliseconds that this
- * Advertisement will be cached by other peers.
- */
- public void remotePublish(Advertisement adv, long expiration);
-
- /**
- * Publish an Advertisement to another peer on the network.
- * This does not result in the advertisement being stored locally. The
- * Advertisement will be published with an expiration time of
- * DEFAULT_EXPIRATION.
- *
- *@param peerid The ID of a peer, specifying null results in
- * propagation within the group.
- *@param adv The Advertisement to publish.
- */
- public void remotePublish(String peerid, Advertisement adv);
-
- /**
- * Publish an Advertisement to another peer on the network. This does not
- * result in the advertisement being stored locally.
- *
- * @param peerid id of a peer, specifying null results in a propagate
- * within the group
- * @param adv The Advertisement to publish.
- * @param expiration Duration in relative milliseconds that this
- * Advertisement will be cached by other peers.
- */
- public void remotePublish(String peerid, Advertisement adv, long expiration);
-
- /**
- * Removes the specified Advertisement from the cache of locally stored
- * Advertisements.
- *
- * @param adv Advertisement to remove.
- * @throws IOException If there is a problem removing the advertisement.
- */
- public void flushAdvertisement(Advertisement adv) throws IOException;
-
- /**
- * Removes the specified Advertisement from the cache of locally stored
- * Advertisements.
- *
- * @param id The {@link Advertisement#getID()} value of the
- * Advertisement to be removed.
- * @param type Discovery type PEER, GROUP, ADV.
- * @throws IOException If there is a problem removing the advertisement.
- */
- public void flushAdvertisements(String id, int type) throws IOException;
-
- /**
- * Returns the maximum duration in milliseconds for which this document
- * will be cached by peers other than the publisher. This value is either
- * the stored lifetime or the remaining lifetime of the document, whichever
- * is less.
- *
- * @param id Document ID, Peer ID, or PeerGroup ID
- * @param type Discovery type PEER, GROUP, ADV
- * @return The number of milliseconds that other peers will be told to
- * retain this Advertisement in their local caches. -1 is returned if
- * the Advertisement is not known or already expired.
- */
- public long getAdvExpirationTime(ID id, int type);
-
- /**
- * Returns the maximum duration in milliseconds for which this document
- * should be kept in local cache.
- *
- * @param id Document ID, Peer ID, or PeerGroup ID
- * @param type Discovery type PEER, GROUP, ADV
- * @return The number of milliseconds this Advertisement will remain in the
- * local cache unless refreshed before that time. -1 is returned if the
- * Advertisement is not known or already expired.
- */
- public long getAdvLifeTime(ID id, int type);
-
- /**
- * Returns the maximum duration in milliseconds for which this document
- * will be cached by peers other than the publisher. This value is either
- * the stored lifetime or the remaining lifetime of the document, whichever
- * is less.
- *
- * @param adv Advertisement
- * @return The number of milliseconds that other peers will be told to
- * retain this Advertisement in their local caches. -1 is returned if
- * the Advertisement is not known or already expired.
- */
- public long getAdvExpirationTime(Advertisement adv);
-
- /**
- * Returns the maximum duration in milliseconds for which this document
- * should be kept in local cache.
- *
- * @param adv Advertisement
- * @return The number of milliseconds this Advertisement will remain in the
- * local cache unless refreshed before that time. -1 is returned if the
- * Advertisement is not known or already expired.
- */
- public long getAdvLifeTime(Advertisement adv);
-
- /**
- * Register a Discovery listener. The Discovery listener will be called
- * whenever Advertisement responses are received from remote peers by the
- * Discovery Service.
- *
- * @param listener the DiscoveryListener
- */
- public void addDiscoveryListener(DiscoveryListener listener);
-
- /**
- * Remove a Discovery listener which was previously registered with
- * {@link #getRemoteAdvertisements(String,int,String,String,int,DiscoveryListener) getRemoteAdvertisements()}
- * or {@link #addDiscoveryListener(DiscoveryListener) addDiscoveryListener()}.
- *
- * @param listener The listener to be removed.
- * @return true if the listener was successfully removed, false otherwise
- */
- public boolean removeDiscoveryListener(DiscoveryListener listener);
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/discovery/package.html b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/discovery/package.html
deleted file mode 100644
index c304dd16..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/discovery/package.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
- The JXTA Discovery Service provides an asynchronous mechanism for
- discovering Peer Advertisements, Group Advertisements, and other general
- JXTA Advertisements (pipes, services, etc.).
-
- @see net.jxta.resolver
- @see net.jxta.document.Advertisement
- @see JXTA Protocols Specification : Peer Discovery Protocol
-
-
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/Advertisement.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/Advertisement.java
deleted file mode 100644
index 88b88c8e..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/Advertisement.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.UndeclaredThrowableException;
-import java.lang.reflect.Method;
-
-import net.jxta.id.ID;
-
-
-/**
- * Advertisements are core JXTA objects that are used to advertise Peers,
- * PeerGroups, Services, Pipes or other JXTA resources. Advertisements provide
- * a platform independent representation of core platform objects that can be
- * exchanged between different platform implementations (Java, C, etc.).
- *
- *
Each Advertisement holds a document that represents the advertisement.
- * Advertisements are typically represented as a text document (XML). The
- * {@link Advertisement#getDocument(MimeMediaType) getDocument(mimetype)}
- * method is used to generate representations of the advertisement. Different
- * representations are available via mime type selection. Typical mime types
- * are "text/xml" or "text/plain" that generate textual representations for the
- * Advertisements.
- *
- *
Advertisements are created via {@link AdvertisementFactory} rather than
- * through use of constructors. This is done because public the Advertisement
- * sub-classes are typically abstract. The actual implementations are provided
- * by private sub-classes.
- *
- * @see net.jxta.document.AdvertisementFactory
- * @see net.jxta.document.ExtendableAdvertisement
- * @see net.jxta.id.ID
- * @see net.jxta.document.Document
- * @see net.jxta.document.MimeMediaType
- */
-public abstract class Advertisement {
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Advertisement clone() throws CloneNotSupportedException {
- return (Advertisement) super.clone();
- }
-
- /**
- * Return a string representation of this advertisement. The string will
- * contain the advertisement pretty-print formatted as a UTF-8 encoded XML
- * Document.
- *
- * @return A String containing the advertisement.
- */
- @Override
- public String toString() {
- XMLDocument doc = (XMLDocument) getDocument(MimeMediaType.XMLUTF8);
-
- // Force pretty printing
- doc.addAttribute("xml:space", "default");
-
- return doc.toString();
- }
-
- /**
- * Returns the identifying type of this Advertisement.
- *
- *
Note: This is a static method. It cannot be used to determine
- * the runtime type of an advertisement. ie.
- *
- *
- * This is wrong and does not work the way you might expect.
- * This call is not polymorphic and calls
- * {@code Advertisement.getAdvertisementType()} no matter what the real
- * type of the advertisement.
- *
- * @return The type of advertisement.
- */
- public static String getAdvertisementType() {
- throw new UnsupportedOperationException(
- "Advertisement : sub-class failed to override getAdvertisementType. getAdvertisementType() is static and is *not* polymorphic.");
- }
-
- /**
- * Returns the identifying type of this Advertisement. Unlike
- * {@link #getAdvertisementType()} this method will return the correct
- * runtime type of an Advertisement object.
- *
- * This implementation is provided for existing advertisements which do not
- * provide their own implementation. In most cases you should provide your
- * own implementation for efficiency reasons.
- *
- * @since JXSE 2.1.1
- * @return The identifying type of this Advertisement.
- */
- public String getAdvType() {
- try {
- Method getAdvertisementTypeMethod = this.getClass().getMethod("getAdvertisementType", (Class[]) null);
- String result = (String) getAdvertisementTypeMethod.invoke(null, (Object[]) null);
-
- return result;
- } catch (NoSuchMethodException failed) {
- UnsupportedOperationException failure = new UnsupportedOperationException("Could not get Advertisement type.");
-
- failure.initCause(failed);
- throw failure;
- } catch (IllegalAccessException failed) {
- SecurityException failure = new SecurityException("Could not get Advertisement type.");
-
- failure.initCause(failed);
- throw failure;
- } catch (InvocationTargetException failed) {
- UndeclaredThrowableException failure = new UndeclaredThrowableException(failed, "Failed getting Advertisement type.");
-
- failure.initCause(failed.getCause());
- throw failure;
- }
- }
-
- /**
- * Write this advertisement into a document of the requested type. Two
- * standard document forms are defined. "text/plain" encodes
- * the document in a "pretty-print" format for human viewing and
- * "text/xml" which provides an XML format.
- *
- * @param asMimeType MimeMediaType format representation requested.
- * @return The {@code Advertisement} represented as a {@code Document} of
- * the requested MIME Media Type.
- */
- public abstract Document getDocument(MimeMediaType asMimeType);
-
- /**
- * Returns an ID which identifies this {@code Advertisement} as uniquely as
- * possible. This ID is typically used as the primary key for indexing of
- * the Advertisement within databases.
- *
- * Each advertisement sub-class must choose an appropriate implementation
- * which returns canonical and relatively unique ID values for it's
- * instances. Since this ID is commonly used for indexing, the IDs returned
- * must be as unique as possible to avoid collisions. The value for the ID
- * returned can either be:
- *
- *
- *
An ID which is already part of the advertisement definition
- * and is relatively unique between advertisements instances. For
- * example, the Peer Advertisement returns the Peer ID.
- *
- *
A static CodatID which is generated via some canonical process
- * which will produce the same value each time and different values for
- * different advertisements of the same type.
- *
- *
ID.nullID for advertisement types which are not readily indexed.
- *
- *
- *
- * For Advertisement types which normally return non-ID.nullID values
- * no ID should be returned when asked to generate an ID while the
- * Advertisement is an inconsistent state (example: uninitialized index
- * fields). Instead {@link java.lang.IllegalStateException} should be
- * thrown.
- *
- * @return An ID that relatively uniquely identifies this advertisement
- * or {@code ID.nullID} if this advertisement is of a type that is not
- * normally indexed.
- */
- public abstract ID getID();
-
- /**
- * Returns the element names on which this advertisement should be indexed.
- *
- * @return The element names on which this advertisement should be indexed.
- */
- public abstract String[] getIndexFields();
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/AdvertisementFactory.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/AdvertisementFactory.java
deleted file mode 100644
index aa870cdf..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/AdvertisementFactory.java
+++ /dev/null
@@ -1,401 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-import java.io.InputStream;
-import java.io.Reader;
-import java.util.HashMap;
-import java.util.Map;
-
-import java.io.IOException;
-import java.util.NoSuchElementException;
-import java.util.MissingResourceException;
-
-import java.util.logging.Logger;
-import java.util.logging.Level;
-import net.jxta.logging.Logging;
-
-import net.jxta.util.ClassFactory;
-
-
-/**
- * A Factory class for constructing Advertisements. This class abstracts the
- * the implementations used to represent and create advertisements.
- *
- * Advertisements are core objects that are used to advertise a Peer, a
- * PeerGroup, a Service, a Pipe, etc. The Advertisement class provides a
- * platform independent representation of core objects that can be exchanged
- * between different implementations (Java, C).
- *
- * The AdvertisementFactory extends the ClassFactory to register the various
- * types of advertisements into an internal table. The factory is called with
- * the Advertisement type requested to create the corresponding advertisement
- * type.
- *
- * The set of Advertisements types supported is loaded from the JXTA
- * classpath via the service provider interface.
- *
- * @see net.jxta.document.Advertisement
- * @see net.jxta.document.Document
- * @see net.jxta.document.MimeMediaType
- * @see net.jxta.peergroup.PeerGroup
- * @see net.jxta.protocol.PeerAdvertisement
- * @see net.jxta.protocol.PeerGroupAdvertisement
- * @see net.jxta.protocol.PipeAdvertisement
- */
-public class AdvertisementFactory extends ClassFactory {
-
- /**
- * Logger
- */
- private static final Logger LOG = Logger.getLogger(AdvertisementFactory.class.getName());
-
- /**
- * Interface for instantiators of Advertisements
- */
- public interface Instantiator {
-
- /**
- * Returns the identifying type of this Advertisement.
- *
- * @return String the type of advertisement
- */
- String getAdvertisementType();
-
- /**
- * Constructs an instance of {@link Advertisement} matching the type
- * specified by the advertisementType parameter.
- *
- *
- * @return The instance of {@link Advertisement}.
- */
- Advertisement newInstance();
-
- /**
- * Constructs an instance of {@link Advertisement} matching the type
- * specified by the advertisementType parameter.
- *
- * @param root Specifies a portion of a @link StructuredDocument} which
- * will be converted into an Advertisement.
- * @return The instance of {@link Advertisement}.
- */
- Advertisement newInstance(net.jxta.document.Element root);
- }
-
- /**
- * This class is a singleton. This is the instance that backs the
- * static methods.
- */
- private final static AdvertisementFactory factory = new AdvertisementFactory();
-
- /**
- * This is the map of mime-types and constructors used by
- * {@code newAdvertisement}.
- */
- private final Map encodings = new HashMap();
-
- /**
- * If true then the pre-defined set of StructuredDocument sub-classes has
- * been registered from the property containing them.
- */
- private boolean loadedProperty = false;
-
- /**
- * Private constructor. This class is not meant to be instantiated except
- * by itself.
- *
- */
- private AdvertisementFactory() {}
-
- /**
- * Registers the pre-defined set of Advertisement sub-classes so that
- * this factory can construct them.
- *
- * @return true if at least one of the Advertisement sub-classes could
- * be registered otherwise false.
- */
- private synchronized boolean loadProviders() {
- if (!factory.loadedProperty) {
- factory.loadedProperty = registerProviders(Advertisement.class.getName());
- }
-
- return factory.loadedProperty;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Map getAssocTable() {
- return encodings;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Class getClassOfInstantiators() {
- // our key is the doctype names.
- return Instantiator.class;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Class getClassForKey() {
- // our key is the doctype names.
- return java.lang.String.class;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected boolean registerAssoc(String className) {
- boolean registeredSomething = false;
-
- try {
- Class advClass = Class.forName(className + "$Instantiator");
-
- Instantiator instantiator = (Instantiator) advClass.newInstance();
-
- String advType = instantiator.getAdvertisementType();
-
- registeredSomething = registerAdvertisementInstance(advType, instantiator);
- } catch (Exception all) {
- if (Logging.SHOW_FINE && LOG.isLoggable(Level.FINE)) {
- LOG.log(Level.FINE, "Failed to register \'" + className + "\'", all);
- }
- }
-
- return registeredSomething;
- }
-
- /**
- * Register an instantiator for and advertisement type to allow instances
- * of that type to be created.
- *
- * @param rootType the identifying value for this advertisement instance
- * type.
- * @param instantiator the instantiator to use in constructing objects
- * of this rootType.
- * @return boolean true if the rootType type is registered. If there is
- * already a constructor for this type then false will be returned.
- */
- public static boolean registerAdvertisementInstance(String rootType, Instantiator instantiator) {
- boolean result = factory.registerAssoc(rootType, instantiator);
-
- return result;
- }
-
- /**
- * Constructs a new instance of {@link Advertisement} matching the type
- * specified by the {@code advertisementType} parameter.
- *
- * @param advertisementType Specifies the type of advertisement to create.
- * @return The instance of {@link Advertisement}.
- * @throws NoSuchElementException if there is no matching advertisement type.
- */
- public static Advertisement newAdvertisement(String advertisementType) {
- factory.loadProviders();
-
- Instantiator instantiator = factory.getInstantiator(advertisementType);
-
- Advertisement a = instantiator.newInstance();
-
- return a;
- }
-
- /**
- * Constructs an instance of {@link Advertisement} from the provided
- * InputStream. The content type of the stream is declared via
- * the mimetype parameter.
- *
- * @deprecated Please convert your code to construct an {@code XMLDocument}
- * using {@code StructuredDocumentFactory} and then call
- * {@link AdvertisementFactory#newAdvertisement(XMLElement)}. For example :
- *
- * XMLDocument xml = (XMLDocument) StructuredDocumentFactory.newStructuredDocument( MimeMediaType.XMLUTF8, is );
- *
- *
- * @param mimetype Specifies the mime media type of the stream being read.
- * @param stream input stream used to read data to construct the advertisement
- * @return The instance of {@link Advertisement}
- * @throws IOException error reading message from input stream
- * @throws NoSuchElementException if there is no matching advertisement type
- * for the type of document read in.
- */
- @Deprecated
- public static Advertisement newAdvertisement(MimeMediaType mimetype, InputStream stream) throws IOException {
- StructuredDocument doc = StructuredDocumentFactory.newStructuredDocument(mimetype, stream);
-
- if (!(doc instanceof XMLDocument)) {
- throw new IllegalArgumentException("Advertisements must be XML");
- }
-
- return newAdvertisement((XMLDocument) doc);
- }
-
- /**
- * Reconstructs an instance of {@link Advertisement} from the provided
- * Reader. The content type of the reader is declared via the
- * mimetype parameter.
- *
- * @deprecated Please convert your code to construct an {@code XMLDocument}
- * using {@code StructuredDocumentFactory} and then call
- * {@link AdvertisementFactory#newAdvertisement(XMLElement)}. For example :
- *
- *
- * @param mimetype Specifies the mime media type of the stream being read.
- * @param source used to read data to construct the advertisement.
- * @return The instance of {@link Advertisement}
- * @throws IOException error reading message from input stream
- * @throws NoSuchElementException if there is no matching advertisement type
- * for the type of document read in.
- * @throws UnsupportedOperationException if the specified mime type is not
- * associated with a text oriented document type.
- */
- @Deprecated
- public static Advertisement newAdvertisement(MimeMediaType mimetype, Reader source) throws IOException {
- StructuredTextDocument doc = (StructuredTextDocument) StructuredDocumentFactory.newStructuredDocument(mimetype, source);
-
- return newAdvertisement(doc);
- }
-
- /**
- * Reconstructs an instance of {@link Advertisement} matching the type
- * specified by the {@code root} parameter.
- *
- * @deprecated Advertisements must be encoded in XML. This is a legacy
- * static constructor. You should convert your code to use the
- * {@link AdvertisementFactory#newAdvertisement(XMLElement) XMLElement}
- * version.
- *
- * @param root Specifies a portion of a StructuredDocument which will be
- * converted into an Advertisement.
- * @return The instance of {@link Advertisement}.
- * @throws NoSuchElementException if there is no advertisement type
- * matching the type of the root node.
- */
- @Deprecated
- public static Advertisement newAdvertisement(TextElement root) {
- if (!(root instanceof XMLElement)) {
- throw new IllegalArgumentException("Advertisements must be XML");
- }
-
- return newAdvertisement((XMLElement) root);
- }
-
- /**
- * Reconstructs an instance of {@link Advertisement} matching the type
- * specified by the {@code root} parameter.
- *
- * @param root Specifies a portion of an XMLElement which will be
- * converted into an Advertisement.
- * @return The instance of {@link Advertisement}.
- * @throws NoSuchElementException if there is no advertisement type
- * matching the type of the root node.
- */
- public static Advertisement newAdvertisement(XMLElement root) {
- factory.loadProviders();
-
- Instantiator instantiator = null;
-
- // The base type of the advertisement may be overridden by a type
- // declaration. If this is the case, then we try to use that as the
- // key rather than the root name.
- Attribute type = root.getAttribute("type");
-
- if (null != type) {
- try {
- instantiator = factory.getInstantiator(type.getValue());
- } catch (NoSuchElementException notThere) {
- // do nothing, its not fatal
- ;
- }
- }
-
- // Don't have an instantiator for the type attribute, try the root name
- if (null == instantiator) {
- instantiator = factory.getInstantiator(root.getName());
- }
-
- Advertisement a = instantiator.newInstance(root);
-
- return a;
- }
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/Attributable.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/Attributable.java
deleted file mode 100644
index eee48900..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/Attributable.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-import java.util.Enumeration;
-
-
-/**
- * Interface for name value pairs to be associated with some base object.
- *
- * @see net.jxta.document.Attribute
- * @see net.jxta.document.StructuredDocument
- * @see net.jxta.document.Element
- */
-public interface Attributable {
-
- /**
- * Adds an attribute with the given name and value. Some implementations
- * may support only a single value for each distinct name. Others may
- * support multiple values for each name. If the value being provided
- * replaces some other value then that value is returned otherwise null
- * is returned.
- *
- * @param name name of the attribute.
- * @param value value for the attribute.
- * @return String containing previous value for this name if the value
- * is being replaced otherwise null.
- */
- String addAttribute(String name, String value);
-
- /**
- * Adds an attribute with the given name and value. Some implementations
- * may support only a single value for each distinct name. Others may
- * support multiple values for each name. If the value being provided
- * replaces some other value then that value is returned otherwise null
- * is returned.
- *
- * @param newAttrib new attribute.
- * @return String containing previous value for this name if the value
- * is being replaced otherwise null.
- */
- String addAttribute(Attribute newAttrib);
-
- /**
- * Returns an enumerations of the attributes associated with this object.
- * Each element is of type Attribute.
- *
- * @return Enumeration the attributes associated with this object.
- */
- Enumeration getAttributes();
-
- /**
- * Returns a single attribute which matches the name provided. If no such
- * named attribute exists then null is returned. For implementations of
- * this interface which support multiple values for each name only the
- * first value will be returned. To access all values for a name you must
- * use getAttributes.
- *
- * @param name the attribute name
- * @return Attribute the attributes matching the given name.
- */
- Attribute getAttribute(String name);
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/Attribute.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/Attribute.java
deleted file mode 100644
index 1d746627..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/Attribute.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-/**
- * A name value pair which is associated with some base object.
- *
- * @see net.jxta.document.Attributable
- * @see net.jxta.document.StructuredDocument
- * @see net.jxta.document.Element
- *
- **/
-public class Attribute {
-
- /**
- * The object which this attribute extends.
- **/
- private Attributable owner;
-
- /**
- * Our name
- **/
- private String name;
-
- /**
- * Our value
- **/
- private String value;
-
- /**
- * Constructor for a new attribute which can be added to an
- * {@link Attributable}.
- *
- * @param name Name for this attribute.
- * @param value Value for this attribute.
- **/
- public Attribute(String name, String value) {
- this(null, name, value);
- }
-
- /**
- * Constructor for a new attribute which is associated with an
- * @link Attributable} object.
- *
- * @param owner The Atrributable owner of this attribute or null.
- * @param name Name for this attribute.
- * @param value Value for this attribute.
- **/
- public Attribute(Attributable owner, String name, String value) {
- this.owner = owner;
- this.name = name;
- this.value = value;
- }
-
- /**
- * {@inheritDoc}
- **/
- @Override
- protected Object clone() {
- return this; // immutable so we can return self.
- }
-
- /**
- * {@inheritDoc}
-
- * The two attributes are the same if they have
- * the same owner, name and value.
- *
- * @param target Attribute to be checked with
- * @return boolean if the attributes are equal otherwise false.
- **/
- @Override
- public boolean equals(Object target) {
- if (this == target) {
- return true;
- }
-
- if (target instanceof Attribute) {
- Attribute targAttrib = (Attribute) target;
-
- boolean result = ((owner.equals(targAttrib.owner)) && name.equals(targAttrib.name) && value.equals(targAttrib.name));
-
- return result;
- } else {
- return false;
- }
- }
-
- /**
- * {@inheritDoc}
- **/
- @Override
- public int hashCode() {
- int result = name.hashCode() ^ value.hashCode();
-
- result ^= (null != owner) ? owner.hashCode() : 0;
- return result;
- }
-
- /**
- * {@inheritDoc}
- **/
- @Override
- public String toString() {
- return "<" + name + " = \"" + value + "\">";
- }
-
- /**
- * Return name of this attribute
- *
- * @return String containing the attribute's name.
- **/
- public String getName() {
- return name;
- }
-
- /**
- * Return the {@link Attributable} which is the owner of this attribute.
- *
- * @return Attributable object which owns this attribute.
- **/
- public Attributable getOwner() {
- return owner;
- }
-
- /**
- * Return value of this attribute
- *
- * @return String containing the attribute's value.
- **/
- public String getValue() {
- return value;
- }
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/BinaryDocument.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/BinaryDocument.java
deleted file mode 100644
index 04b6c919..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/BinaryDocument.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.IOException;
-
-
-/**
- * This class is an implementation of the Document interface. It is perhaps the
- * simplest implementation of the Document interface possible.
- */
-public class BinaryDocument implements Document {
-
- /**
- * Our Mime Media Types
- */
- private static final MimeMediaType[] myTypes = {
- MimeMediaType.AOS
- };
-
- /**
- * Storage for our bytes.
- */
- private final byte[] ourBytes;
-
- /**
- * The MIME type of this document.
- */
- private final MimeMediaType ourType;
-
- /**
- * Returns the MIME Media types supported by this this Document per
- * {@link IETF RFC 2046 MIME : Media Types}.
- *
- * Jxta does not currently support the 'Multipart' or 'Message' media types.
- *
- * @return An array of MimeMediaType objects containing the MIME Media Type
- * for this Document.
- */
- public static MimeMediaType[] getSupportedMimeTypes() {
- return (myTypes.clone());
- }
-
- /**
- * Creates new BinaryDocument from a byte array. The data in the array is
- * not copied. If you intend to modify the array after creating a document
- * then you should pass a copy of the data instead.
- *
- * @param someBytes Contains a byte array which will serve as our data.
- */
- public BinaryDocument(byte[] someBytes) {
- this(someBytes, myTypes[0]);
- }
-
- /**
- * Creates new BinaryDocument from a byte array. The data in the array is
- * not copied. If you intend to modify the array after creating a document
- * then you should pass a copy of the data instead.
- *
- * @param someBytes Contains a byte array which will serve as our data.
- * @param type The MIME media type for this document.
- */
- public BinaryDocument(byte[] someBytes, MimeMediaType type) {
- ourBytes = someBytes;
- ourType = type;
- }
-
- /**
- * {@inheritDoc}
- */
- public MimeMediaType getMimeType() {
- return ourType;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getFileExtension() {
- return StructuredDocumentFactory.getFileExtensionForMimeType(ourType);
- }
-
- /**
- * {@inheritDoc}
- */
- public InputStream getStream() throws IOException {
- return (new ByteArrayInputStream(ourBytes));
- }
-
- /**
- * {@inheritDoc}
- */
- public void sendToStream(OutputStream stream) throws IOException {
- stream.write(ourBytes);
- }
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/Document.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/Document.java
deleted file mode 100644
index 016d8f1b..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/Document.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import java.io.IOException;
-
-
-/**
- * A simple typed container for data. A {@code Document} is presented as a
- * byte stream with an associated type. The data type is specified using a
- * MIME Media Type (as defined by
- * {@link IETF RFC 2046 MIME : Media Types}).
- *
- * @see net.jxta.document.MimeMediaType
- * @see net.jxta.document.StructuredDocument
- * @see net.jxta.document.StructuredDocumentFactory
- */
-public interface Document extends DocumentStreamIO {
-
- /**
- * Returns the MIME Media type of this {@code Document} per
- * {@link IETF RFC 2046 MIME : Media Types}.
- *
- * JXTA does not currently support the 'Multipart' or
- * 'Message' media types.
- *
- * @return The MIME Media Type for this {@code Document}.
- */
- MimeMediaType getMimeType();
-
- /**
- * Returns the file extension type used by this {@code Document}. This
- * value is usually chosen based upon the MIME Media Type.
- *
- * @return An appropriate file extension for this {@code Document}.
- */
- String getFileExtension();
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/DocumentByteArrayIO.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/DocumentByteArrayIO.java
deleted file mode 100644
index dba00eee..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/DocumentByteArrayIO.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-import java.nio.ByteBuffer;
-
-
-/**
- * Provides {@code byte} array based interfaces for manipulating
- * {@code Document} contents.
- *
- * @see net.jxta.document.Document
- */
-public interface DocumentByteArrayIO {
-
- /**
- * Returns the {@code Document} as a sequence of bytes.
- */
- byte[] getBytes();
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/DocumentByteBufferIO.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/DocumentByteBufferIO.java
deleted file mode 100644
index 2131e16d..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/DocumentByteBufferIO.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-import java.nio.ByteBuffer;
-
-
-/**
- * Provides {@code ByteBuffer} based interfaces for manipulating
- * {@code Document} contents.
- *
- * @see java.nio.ByteBuffer
- * @see net.jxta.document.Document
- */
-public interface DocumentByteBufferIO {
-
- /**
- * Returns the {@code Document} as a sequence of ByteBuffers
- */
- ByteBuffer[] getByteBuffers();
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/DocumentStreamIO.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/DocumentStreamIO.java
deleted file mode 100644
index c3e9734f..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/DocumentStreamIO.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import java.io.IOException;
-
-
-/**
- * Provides stream based interfaces for manipulating {@code Document} contents.
- *
- * @see net.jxta.document.Document
- */
-public interface DocumentStreamIO {
-
- /**
- * Returns the stream of bytes which represents the content of this
- * {@code Document}.
- *
- * @return An {@link java.io.InputStream} containing the bytes
- * of this {@code Document}.
- * @throws IOException For errors while writing the {@code Document}.
- */
- InputStream getStream() throws IOException;
-
- /**
- * Send the contents of this {@code Document} to the specified stream.
- *
- * @param stream The OutputStream to which the {@code Document} will
- * be written.
- * @throws IOException For errors while writing the {@code Document}.
- */
- void sendToStream(OutputStream stream) throws IOException;
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/Element.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/Element.java
deleted file mode 100644
index b73bd8d7..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/Element.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-package net.jxta.document;
-
-
-import java.util.Enumeration;
-
-
-/**
- * An element represents a portion of a {@link StructuredDocument}. An element
- * is identifiable by a key and may also optionally have a
- * value. Each Element also maintains a collection of references
- * to other elements, its children. Elements can be
- * composed into arbitrary hierarchical structures forming complex data
- * structures.
- *
- * Element instances are always associated with a
- * {@link StructuredDocument}. A {@link StructuredDocument} is a specialized
- * form of Element with additional features that make it appropriate for
- * acting as the root of a hierarchy of elements.
- *
- * @see net.jxta.document.Document
- * @see net.jxta.document.StructuredDocument
- * @see net.jxta.document.StructuredDocumentFactory
- * @see net.jxta.document.StructuredTextDocument
- * @see net.jxta.document.TextElement
- */
-public interface Element> {
-
- /**
- * Get the key associated with this Element.
- *
- * @return The key of this Element.
- */
- Object getKey();
-
- /**
- * Get the value (if any) associated with this Element.
- *
- * @return The value of this element, if any, otherwise null.
- */
- Object getValue();
-
- /**
- * Get the root document element of the hierarchy this element belongs to.
- *
- * @return The root document element of this element's hierarchy.
- */
- StructuredDocument getRoot();
-
- /**
- * Get the parent element of this element. If this Element has not been
- * inserted into the Document then null is returned. If this
- * element is the root element of the Document then it returns itself. ie.,
- * this == this.getParent().
- *
- * @return The parent of this element. If the element has no parent
- * then null will be returned. If the element is the root Element of the
- * hierarchy then it will return itself.
- */
- E getParent();
-
- /**
- * Add a child element to this element. The child element must be from the
- * document as the element it is to be added to. Elements are created using
- * either {@link StructuredDocument#createElement(Object)} or
- * {@link StructuredDocument#createElement(Object, Object)}.
- *
- * @param element The element to be added as a child.
- */
- void appendChild(E element);
-
- /**
- * Returns an enumeration of the immediate children of this element.
- *
- * @return Enumeration containing all of the children of this element.
- */
- Enumeration getChildren();
-
- /**
- * Returns an enumeration of the immediate children of this element who
- * match the specified key.
- *
- * @param key The key which will be matched against.
- * @return Enumeration containing all of the matching children of this
- * element.
- */
- Enumeration getChildren(Object key);
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/ExtendableAdvertisement.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/ExtendableAdvertisement.java
deleted file mode 100644
index 70e71ab7..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/ExtendableAdvertisement.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-/**
- * Extendable advertisements provide features for allowing inheritance of
- * advertisement types. The core and standard JXTA advertisements all allow
- * extension by extending this class.
- *
- * @see net.jxta.document.Advertisement
- * @see net.jxta.document.AdvertisementFactory
- * @see net.jxta.document.Document
- * @see net.jxta.document.MimeMediaType
- */
-public abstract class ExtendableAdvertisement extends Advertisement {
-
- /**
- * If {@code true} then the advertisement will be pretty print formatted
- * when it is output as XML. Currently this must be specified at
- * construction time as it is normally a preference per advertisement type.
- */
- private transient boolean formatted;
-
- /**
- * Default constructor. The advertisement will *not* be pretty-printed when
- * it is output as XML.
- */
- protected ExtendableAdvertisement() {
- this(false);
- }
-
- /**
- * @param formatted If {@code true} then the advertisement will be pretty
- * print formatted when it is output as XML.
- */
- protected ExtendableAdvertisement(boolean formatted) {
- this.formatted = formatted;
- }
-
- /**
- * Returns the base type of this advertisement hierarchy. Typically, only
- * the most basic advertisement of a type will implement this method and
- * declare it as final.
- *
- * @return String the base type of advertisements in this hierarchy.
- */
- public abstract String getBaseAdvType();
-
- /**
- * Process an individual element from the document during parse. Normally,
- * implementations will allow the base advertisements a chance to handle
- * the element before attempting to handle the element themselves. ie.
- *
- *
- * protected boolean handleElement(Element elem) {
- *
- * if (super.handleElement()) {
- * // it's been handled.
- * return true;
- * }
- * ... handle elements here ...
- *
- * // we don't know how to handle the element
- * return false;
- * }
- *
- *
- * @param elem The element to be processed.
- * @return {@code true} if the element was recognized, otherwise false.
- */
- protected boolean handleElement(Element elem) {
- // we don't handle any elements.
- return false;
- }
-
- /**
- * Process an individual attribute from the document root node. Normally,
- * implementations will allow the base advertisements a chance to handle
- * the attribute before attempting to handle the element themselves. ie.
- *
- *
- * protected boolean handleAttribute( Attribute elem ) {
- *
- * if (super.handleAttribute()) {
- * // it's been handled.
- * return true;
- * }
- *
- * ... handle attributes here ...
- *
- * // we don't know how to handle the attribute
- * return false;
- * }
- *
- *
- * @param attrib The attribute to be processed.
- * @return {@code true} if the attribute was recognized, otherwise false.
- */
- protected boolean handleAttribute(Attribute attrib) {
-
- // "handle" the attributes that we choose to ignore.
- if ("xmlns:jxta".equals(attrib.getName())) {
- return true;
- } else if ("xml:space".equals(attrib.getName())) {
- return true;
- } else if ("type".equals(attrib.getName())) {
- return true;
- }
-
- return false;
- }
-
- /**
- * {@inheritDoc}
- *
- * We don't have any content to add, just build the document instance and
- * return it to implementations that actually do something with it.
- */
- @Override
- public Document getDocument(MimeMediaType encodeAs) {
- Document adv = StructuredDocumentFactory.newStructuredDocument(encodeAs, getBaseAdvType());
-
- if (!(adv instanceof Attributable)) {
- throw new IllegalArgumentException("Advertisements require document type with attribute support.");
- }
-
- if (adv instanceof XMLDocument) {
- XMLDocument xmlAdv = (XMLDocument) adv;
-
- xmlAdv.addAttribute("xmlns:jxta", "http://jxta.org");
- if (!formatted) {
- xmlAdv.addAttribute("xml:space", "preserve");
- }
- }
-
- if (!getBaseAdvType().equals(getAdvType())) {
- ((Attributable) adv).addAttribute("type", getAdvType());
- }
-
- return adv;
- }
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/FileDocument.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/FileDocument.java
deleted file mode 100644
index bcee2c9f..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/FileDocument.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import java.io.IOException;
-
-
-/**
- * This class presents a Document interface for a specific file on disk.
- */
-public class FileDocument implements Document {
-
- private final static int BUFFER_SIZE = 4096;
-
- /**
- * File which backs this document.
- */
- private final File file;
-
- /**
- * MIME media type of this document.
- **/
- private final MimeMediaType type;
-
- /**
- * Create a new File Document.
- **/
- public FileDocument(File file) {
- this(file, StructuredDocumentFactory.getMimeTypeForFileExtension(getFileExtension(file)));
- }
-
- /**
- * Create a new File Document.
- */
- public FileDocument(File file, MimeMediaType type) {
- if (file.isDirectory()) {
- throw(new IllegalArgumentException("File cannot be a directory"));
- }
-
- if (!file.exists()) {
- throw(new IllegalArgumentException("File must exist"));
- }
-
- this.file = file;
- this.type = type.intern();
- }
-
- /**
- * {@inheritDoc}
- *
- * Returns everything after the last '.' in the filename, or the
- * empty string if the file name does not contain a '.'.
- **/
- public String getFileExtension() {
- return getFileExtension(file);
- }
-
- /**
- * Returns everything after the last '.' in the filename, or the
- * empty string if the file name does not contain a '.'.
- **/
- private static String getFileExtension(File file) {
-
- String fileName = file.getName();
- int idx = fileName.lastIndexOf('.');
-
- if (idx < 0 || idx == fileName.length()) {
- return "";
- } else {
- return fileName.substring(idx + 1);
- }
- }
-
- /**
- * {@inheritDoc}
- **/
- public MimeMediaType getMimeType() {
- return type;
- }
-
- /**
- * {@inheritDoc}
- **/
- public InputStream getStream() throws IOException {
- return new FileInputStream(file);
- }
-
- /**
- * {@inheritDoc}
- **/
- public void sendToStream(OutputStream sink) throws IOException {
- InputStream source = getStream();
- int c;
- byte[] buf = new byte[BUFFER_SIZE];
-
- do {
- c = source.read(buf);
-
- if (-1 == c) {
- break;
- }
-
- sink.write(buf, 0, c);
- } while (true);
- }
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/MimeMediaType.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/MimeMediaType.java
deleted file mode 100644
index c044aacb..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/MimeMediaType.java
+++ /dev/null
@@ -1,835 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-import java.io.*;
-import java.lang.ref.Reference;
-import java.lang.ref.WeakReference;
-import java.util.*;
-
-
-/**
- * MIME Media Types are used to describe the format of data streams. MIME
- * Media Types are defined by
- * {@link IETF RFC 2046 MIME : Media Types}.
- * This class manages parsing of Mime Media Types from strings and piecemeal
- * construction of Mime Media Type descriptors.
- *
- * Note : This implementation does not include support for the character
- * encoding techniques described by :
- * {@link IETF RFC 2046 MIME : Media Types}.
- *
- * @see net.jxta.document.Document
- * @see net.jxta.document.StructuredDocument
- * @see net.jxta.document.StructuredDocumentFactory
- * @see net.jxta.document.StructuredTextDocument
- */
-public class MimeMediaType implements Serializable {
-
- /**
- * Magic value for this format of serialization version.
- */
- private final static long serialVersionUID = 7546247036878523161L;
-
- private final static String CTL = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007"
- + "\u0008\u0009\n\u000b\u000c\r\u000e\u000f" + "\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017"
- + "\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f" + "\u007f";
-
- private final static String space = "\u0020";
- private final static String LWSP_char = space + "\u0009";
- private final static String param_sep = LWSP_char + ";";
- private final static String tspecials = "()<>@,;:\\\"/[]?=";
- private final static String terminator = CTL + space + tspecials;
-
- /**
- * A canonical map of Mime Media Types.
- */
- private static final Map> interned = new WeakHashMap>();
-
- /**
- * Common Mime Media Type for arbitrary unparsed binary data.
- */
- public static final MimeMediaType AOS = new MimeMediaType("application", "octet-stream").intern();
-
- /**
- * Common Mime Media Type for text encoded using the default character
- * encoding for this JVM. The default character encoding is specified by
- * the JDK System property "file.encoding".
- *
- * The default encoding varies with host platform and locale. This
- * media type must not be used for any documents which
- * will be exchanged with other peers (as they may be using different
- * default character encodings).
- */
- public static final MimeMediaType TEXT_DEFAULTENCODING = new MimeMediaType("text", "plain").intern();
-
- /**
- * Common Mime Media Type for plain text encoded as UTF-8 characters. This
- * type is used by JXTA for all strings.
- */
- public static final MimeMediaType TEXTUTF8 = new MimeMediaType("text", "plain", "charset=\"UTF-8\"").intern();
-
- /**
- * Common Mime Media Type for XML encoded using the default character
- * encoding for this JVM. The default character encoding is specified by
- * the JDK System property "file.encoding".
- *
- * The default encoding varies with host platform and locale. This
- * media type must not be used for any documents which
- * will be exchanged with other peers (as they may be using different
- * default character encodings).
- */
- public static final MimeMediaType XML_DEFAULTENCODING = new MimeMediaType("text", "xml").intern();
-
- /**
- * Common Mime Media Type for XML encoded using the default character
- * encoding for this JVM. The default character encoding is specified by
- * the JDK System property "file.encoding".
- *
- * The default encoding varies with host platform and locale. This
- * media type must not be used for any documents which
- * will be exchanged with other peers (as they may be using different
- * default character encodings).
- */
- public static final MimeMediaType APPLICATION_XML_DEFAULTENCODING = new MimeMediaType("application", "xml").intern();
-
- /**
- * Common Mime Media Type for XML encoded as UTF-8 characters. This type is
- * used by JXTA for all protocol messages and metadata.
- */
- public static final MimeMediaType XMLUTF8 = new MimeMediaType("text", "xml", "charset=\"UTF-8\"").intern();
-
- /**
- * The primary media type
- */
- private transient String type = null;
-
- /**
- * The specific media sub-type
- */
- private transient String subtype = null;
-
- /**
- * The parameters for this media type
- */
- private transient List parameters = new ArrayList();
-
- /**
- * The hashcode value for this mime media type.
- */
- private transient int cachedHashCode = 0;
-
- /**
- * manages a media type parameter.
- */
- private static class parameter implements Comparable {
-
- /**
- * Attribute name.
- */
- final String attribute;
-
- /**
- * Value for the attribute. Includes quoting characters if they are
- * needed for outputting this value.
- */
- final String value;
-
- parameter(String attr, String val) {
- attribute = attr;
- value = val;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (!(obj instanceof parameter)) {
- return false;
- }
-
- parameter asParameter = (parameter) obj;
-
- return attribute.equalsIgnoreCase(asParameter.attribute) && asParameter.value.equals(value);
-
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int hashCode() {
- return attribute.toLowerCase().hashCode() * 6037 + value.hashCode();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String toString() {
- return attribute + "=" + outputForm(value);
- }
-
- /**
- * {@inheritDoc}
- */
- public int compareTo(parameter asParameter) {
- if (this == asParameter) {
- return 0;
- }
-
- int result = attribute.compareToIgnoreCase(asParameter.attribute);
-
- if (0 != result) {
- return result;
- }
-
- return value.compareTo(asParameter.value);
- }
-
- private static String outputForm(String val) {
- StringBuilder result = new StringBuilder();
-
- if (-1 == findNextSeperator(val)) {
- result.append(val);
- } else {
- // needs quoting
- result.append('\"');
- for (int eachChar = 0; eachChar < val.length(); eachChar++) {
- char aChar = val.charAt(eachChar);
-
- if (('\\' == aChar) || ('\"' == aChar) || ('\r' == aChar)) {
- // needs escaping.
- result.append('\\');
- }
- result.append(aChar);
- }
- result.append('\"');
- }
- return result.toString();
- }
- }
-
- /**
- * Creates a new MimeMediaType
- *
- * @param mimetype string representing a mime-type
- */
- public MimeMediaType(String mimetype) {
-
- String cleaned = mimetype.trim();
-
- if (0 == cleaned.length()) {
- throw new IllegalArgumentException("input cannot be empty");
- }
-
- // determine the type
- int typeSepAt = findNextSeperator(cleaned);
-
- if ((-1 == typeSepAt) || (0 == typeSepAt) || ('/' != cleaned.charAt(typeSepAt))) {
- throw new IllegalArgumentException("expected seperator or seperator in unexpected location");
- }
-
- setType(cleaned.substring(0, typeSepAt));
-
- // determine the sub-type
- int subtypeSepAt = findNextSeperator(cleaned, typeSepAt + 1);
-
- String itsParams = "";
-
- if (-1 == subtypeSepAt) {
- setSubtype(cleaned.substring(typeSepAt + 1));
- } else {
- setSubtype(cleaned.substring(typeSepAt + 1, subtypeSepAt));
- itsParams = cleaned.substring(subtypeSepAt);
- // include the seperator, its significant
- }
-
- parseParams(itsParams, false);
- }
-
- /**
- * Creates a new type/subtype MimeMediaType
- *
- * @param type string representing a mime type
- * @param subtype string representing a mime subtype
- */
- public MimeMediaType(String type, String subtype) {
- this(type, subtype, null);
- }
-
- /**
- * Creates a new type/subtype MimeMediaType
- *
- * @param type string representing a mime type
- * @param subtype string representing a mime subtype
- * @param parameters parameters to the mime-type constructor
- */
- public MimeMediaType(String type, String subtype, String parameters) {
- setType(type);
- setSubtype(subtype);
- if (null != parameters) {
- parseParams(parameters, false);
- }
- }
-
- /**
- * Creates a new type/subtype MimeMediaType with the specified parameters.
- * The parameters are copied from the source mime type and additional params
- * are added. If replace is true, then the provided params will overwrite
- * the params from the source mime type.
- *
- * @param type the source mime type
- * @param params parameters to the mime-type constructor
- * @param replace parameters if true then provided params should replace
- * existing params else they are accumulated.
- */
- public MimeMediaType(MimeMediaType type, String params, boolean replace) {
- setType(type.getType());
- setSubtype(type.getSubtype());
- parameters.addAll(type.parameters);
-
- parseParams(params, replace);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (!(obj instanceof MimeMediaType)) {
- return false;
- }
-
- MimeMediaType asMMT = (MimeMediaType) obj;
-
- if (!type.equalsIgnoreCase(asMMT.type)) {
- return false;
- }
-
- if (!subtype.equalsIgnoreCase(asMMT.subtype)) {
- return false;
- }
-
- List myParams = new ArrayList(parameters);
- List itsParams = new ArrayList(asMMT.parameters);
-
- Collections.sort(myParams);
- Collections.sort(itsParams);
-
- return myParams.equals(itsParams);
- }
-
- /**
- * Similar to {@link #equals(Object)}, but ignores any parameters. Compares
- * only the type and sub-type.
- *
- * @param obj the object to compare
- * @return true if equal
- */
- public boolean equalsIngoringParams(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (!(obj instanceof MimeMediaType)) {
- return false;
- }
-
- MimeMediaType likeMe = (MimeMediaType) obj;
-
- boolean retValue = getType().equalsIgnoreCase(likeMe.getType()) && getSubtype().equalsIgnoreCase(likeMe.getSubtype());
-
- return retValue;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int hashCode() {
- if (0 == cachedHashCode) {
- List myParams = new ArrayList(parameters);
-
- Collections.sort(myParams);
-
- int calcedHash = type.hashCode() * 2467 + subtype.hashCode() * 3943 + myParams.hashCode();
-
- cachedHashCode = (0 != calcedHash) ? calcedHash : 1;
- }
-
- return cachedHashCode;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String toString() {
- StringBuilder retValue = new StringBuilder(getMimeMediaType());
-
- for (parameter parameter : parameters) {
- retValue.append(';');
- parameter aParam = parameter;
-
- retValue.append(aParam.toString());
- }
- return retValue.toString();
- }
-
- /**
- * Returns the "base" MIME media type of this type. ie. with no parameters.
- *
- * @return The "base" MIME media type of this MimeMediaType.
- */
- public MimeMediaType getBaseMimeMediaType() {
- return new MimeMediaType(type, subtype).intern();
- }
-
- /**
- * Returns the "base" MIME media type of this type. ie. with no parameters.
- *
- * @return The "base" MIME media type of this type. ie. with no parameters.
- */
- public String getMimeMediaType() {
- StringBuilder retValue = new StringBuilder(type.length() + 1 + subtype.length());
-
- retValue.append(type);
- retValue.append('/');
- retValue.append(subtype);
-
- return retValue.toString();
- }
-
- /**
- * Get type of the mime-type
- *
- * @return type of the mime-type
- */
- public String getType() {
- return type;
- }
-
- /**
- * Check if the mime-type is for provisional. See Section 2.1 of
- * {@link IETF RFC 2048 MIME : Registration Procedures}
- *
- * @return boolean true if it is a provisional type
- */
- public boolean isExperimentalType() {
- if ((null == type) || (type.length() < 2)) {
- return false;
- }
-
- if (type.startsWith("x-") || type.startsWith("x.")) {
- return true;
- }
-
- return null != subtype && subtype.length() >= 2 && (subtype.startsWith("x-") || subtype.startsWith("x."));
-
- }
-
- /**
- * Set the type of MimeMediaType
- *
- * @param type type value
- */
- private void setType(String type) {
- if (null == type) {
- throw new IllegalArgumentException("type cannot be null");
- }
-
- String cleaned = type.trim().toLowerCase(Locale.US);
-
- if (0 == cleaned.length()) {
- throw new IllegalArgumentException("type cannot be null");
- }
-
- if (-1 != findNextSeperator(cleaned)) {
- throw new IllegalArgumentException("type cannot contain a seperator");
- }
-
- this.type = cleaned;
- }
-
- /**
- * Get the Subtype of the mime-type
- *
- * @return subtype of the mime-type
- */
- public String getSubtype() {
- return subtype;
- }
-
- /**
- * Check if the mime-type is for debugging. This method will be
- * removed
- *
- * @return boolean true if it is a debugging type
- */
- public boolean isExperimentalSubtype() {
- if ((null == subtype) || (subtype.length() < 2)) {
- return false;
- }
-
- return (('x' == subtype.charAt(0)) && ('-' == subtype.charAt(1)));
- }
-
- /**
- * Set the subtype of MimeMediaType
- *
- * @param subtype subtype value
- */
- private void setSubtype(String subtype) {
- if (null == subtype) {
- throw new IllegalArgumentException("subtype cannot be null");
- }
-
- String cleaned = subtype.trim().toLowerCase(Locale.US);
-
- if (0 == cleaned.length()) {
- throw new IllegalArgumentException("subtype cannot be null");
- }
-
- if (-1 != findNextSeperator(cleaned)) {
- throw new IllegalArgumentException("subtype cannot contain a seperator");
- }
-
- this.subtype = cleaned;
- }
-
- /**
- * Get the value of the first occurance of the specified parameter from the
- * parameter list.
- *
- * @param param the parameter to retrieve.
- * @return the value of the specifid parameter or null if the parameter was
- * not found.
- */
- public String getParameter(String param) {
- for (parameter parameter : parameters) {
- parameter aParam = parameter;
-
- if (aParam.attribute.equalsIgnoreCase(param)) {
- return aParam.value;
- }
- }
- return null;
- }
-
- /**
- * Parses the parametes portion of a MIME Media Type specification.
- *
- * @param itsParams parse a string for mime parameters.
- * @param replace parameters if true then provided params should replace
- * existing params else they are accumulated.
- */
- private void parseParams(String itsParams, boolean replace) {
- int currentCharIdx = 0;
- String currentAttribute = null;
- boolean inSeperator = true;
- boolean inComment = false;
- boolean inAttribute = false;
- StringBuffer currentValue = null;
- boolean inValue = false;
- boolean inQuoted = false;
- boolean nextEscaped = false;
-
- while (currentCharIdx < itsParams.length()) {
- char currentChar = itsParams.charAt(currentCharIdx);
-
- if (inSeperator) {
- if ('(' == currentChar) {
- inSeperator = false;
- inComment = true;
- } else if (-1 == param_sep.indexOf(currentChar)) {
- inSeperator = false;
- inAttribute = true;
- currentCharIdx--; // unget
- }
- } else if (inComment) {
- if (nextEscaped) {
- nextEscaped = false;
- } else {
- if ('\\' == currentChar) {
- nextEscaped = true;
- } else if (')' == currentChar) {
- inComment = false;
- inSeperator = true;
- } else if ('\r' == currentChar) {
- throw new IllegalArgumentException("malformed mime parameter at idx = " + currentCharIdx);
- }
- }
- } else if (inAttribute) {
- int endAttr = findNextSeperator(itsParams, currentCharIdx);
-
- if ((-1 == endAttr) || ('=' != itsParams.charAt(endAttr)) || (0 == (endAttr - currentCharIdx))) {
- throw new IllegalArgumentException("malformed mime parameter at idx = " + currentCharIdx);
- }
-
- currentAttribute = itsParams.substring(currentCharIdx, endAttr).toLowerCase(Locale.US);
-
- currentCharIdx = endAttr; // skip the equals.
- inAttribute = false;
- inValue = true;
- inQuoted = false;
- nextEscaped = false;
- currentValue = new StringBuffer();
- } else if (inValue) {
- if (inQuoted) {
- if (nextEscaped) {
- currentValue.append(currentChar);
- nextEscaped = false;
- } else {
- if ('\\' == currentChar) {
- nextEscaped = true;
- } else if ('"' == currentChar) {
- inQuoted = false;
- } else if ('\r' == currentChar) {
- throw new IllegalArgumentException("malformed mime parameter at idx = " + currentCharIdx);
- } else {
- currentValue.append(currentChar);
- }
- }
- } else if (-1 == terminator.indexOf(currentChar)) {
- currentValue.append(currentChar);
- } else {
- if ('"' == currentChar) {
- inQuoted = true;
- } else {
- parameter newparam = new parameter(currentAttribute, currentValue.toString());
-
- if (replace) {
- while (parameters.remove(newparam)) {}
- }
-
- parameters.add(newparam);
-
- inValue = false;
- inSeperator = true;
- currentCharIdx--; // unget
- }
- }
- } else {
- throw new IllegalArgumentException("malformed mime parameter at idx = " + currentCharIdx);
- }
-
- currentCharIdx++;
- }
-
- // finish off the last value.
- if (inValue) {
- if (nextEscaped || inQuoted) {
- throw new IllegalArgumentException("malformed mime parameter at idx = " + currentCharIdx);
- }
-
- parameter newparam = new parameter(currentAttribute, currentValue.toString());
-
- if (replace) {
- while (parameters.remove(newparam)) {}
- }
-
- parameters.add(newparam);
-
- inValue = false;
- inSeperator = true;
- }
-
- if (!inSeperator) {
- throw new IllegalArgumentException("malformed mime parameter at idx = " + currentCharIdx);
- }
- }
-
- /**
- * Find next separator position in mime-type
- *
- * @param source source location
- * @return int separator location
- */
- private static int findNextSeperator(String source) {
- return findNextSeperator(source, 0);
- }
-
- /**
- * Find next separator position in mime-type
- *
- * @param source source location
- * @param from from location
- * @return int separator location
- */
- private static int findNextSeperator(String source, int from) {
-
- int seperator = -1;
-
- // find a seperator
- for (int eachChar = from; eachChar < source.length(); eachChar++) {
- if (-1 != terminator.indexOf(source.charAt(eachChar))) {
- seperator = eachChar;
- break;
- }
- }
-
- return seperator;
- }
-
- /**
- * Returns a MimeMediaType with a value represented by the specified String.
- *
- * This method may produce better results than using the constructor
- * the same parameter set in that:
- *
- *
- * new MimeMediaType( string ) != new MimeMediaType( string )
- *
- *
- * while for common types:
- *
- *
- * MimeMediaType.valueOf( string ) == MimeMediaType.valueOf( string )
- *
- */
- public static MimeMediaType valueOf(String mimetype) {
- return new MimeMediaType(mimetype).intern();
- }
-
- /**
- * Read this Object in for Java Serialization
- *
- * @param s The stream from which the Object will be read.
- * @throws IOException for errors reading from the input stream.
- * @throws ClassNotFoundException if the serialized representation contains
- * references to classes which cannot be found.
- */
- private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
- s.defaultReadObject();
-
- MimeMediaType readType = MimeMediaType.valueOf(s.readUTF());
-
- type = readType.type;
- subtype = readType.subtype;
- parameters = readType.parameters;
- }
-
- /**
- * Return the interned form of the ID.
- */
- private Object readResolve() throws ObjectStreamException {
- return intern();
- }
-
- /**
- * Write this Object out for Java Serialization
- *
- * @param s The stream to which the Object will be written.
- * @throws IOException for errors writing to the output stream.
- */
- private void writeObject(ObjectOutputStream s) throws IOException {
- s.defaultWriteObject();
-
- s.writeUTF(toString());
- }
-
- /**
- * Returns a canonical representation for the MimeMediaType object.
- *
- * A pool of MimeMediaType, is maintained privately by the class.
- *
- * When the intern method is invoked, if the pool already contains a
- * MimeMediaType equal to this MimeMediaType object as determined by the
- * equals(Object) method, then the MimeMediaType from the pool is returned.
- * Otherwise, this MimeMediaType object is added to the pool and a reference
- * to this MimeMediaType object is returned.
- *
- * It follows that for any two MimeMediaType s and t,
- * s.intern() == t.intern() is true if and only if s.equals(t)
- * is true.
- *
- * @return a MimeMediaType that has the same value as this type, but is
- * guaranteed to be from a pool of unique types.
- */
- public MimeMediaType intern() {
- synchronized (MimeMediaType.class) {
- Reference common = interned.get(this);
-
- MimeMediaType result;
-
- if (null == common) {
- common = new WeakReference(this);
- interned.put(this, common);
- result = this;
- } else {
- result = common.get();
- if (null == result) {
- interned.put(this, new WeakReference(this));
- result = this;
- }
- }
-
- return result;
- }
- }
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/StructuredDocument.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/StructuredDocument.java
deleted file mode 100644
index 73e19ddd..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/StructuredDocument.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-/**
- * An extension of {@link Document} which allows the content of a document to be
- * specified by a hierarchy of elements. This allows the content of many
- * document types to be manipulated in an abstract way without regard to the
- * physical representation of the documents.
- *
- * StructuredDocuments are one of the elementary components that is
- * manipulated by the JXTA core. StructuredDocuments are used to represent most
- * core objects such as peer, peergroup or pipe advertisements.
- *
- * @see net.jxta.document.Document
- * @see net.jxta.document.StructuredTextDocument
- * @see net.jxta.document.StructuredDocumentFactory
- **/
-public interface StructuredDocument> extends Document, Element {
-
- /**
- * Create a new element without value.
- *
- * @param key The key of the element to be created.
- * @return The new element.
- **/
- E createElement(Object key);
-
- /**
- * Create a new element with value.
- *
- * @param key The name of the element to be created.
- * @param value The value of the element to be created or
- * null if no value is desired.
- * @return The new element.
- **/
- E createElement(Object key, Object value);
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/StructuredDocumentFactory.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/StructuredDocumentFactory.java
deleted file mode 100644
index 74154edd..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/StructuredDocumentFactory.java
+++ /dev/null
@@ -1,582 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-import java.io.InputStream;
-import java.io.Reader;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
-
-import java.io.IOException;
-import java.util.MissingResourceException;
-
-import java.util.logging.Logger;
-import java.util.logging.Level;
-import net.jxta.logging.Logging;
-
-import net.jxta.util.ClassFactory;
-import net.jxta.endpoint.MessageElement;
-import net.jxta.endpoint.TextMessageElement;
-
-
-/**
- * A factory for constructing instances of {@link StructuredDocument}.
- * Behind the scenes, it also provides for the registration of the mime-types
- * and constructors needed to accomplish the construction. All supported
- * mime-types will need to register their implementation in this factory.
- *
- * @see net.jxta.document.Document
- * @see net.jxta.document.StructuredTextDocument
- * @see net.jxta.document.StructuredDocument
- * @see net.jxta.document.MimeMediaType
- */
-public final class StructuredDocumentFactory extends ClassFactory {
-
- /**
- * Log4J Logger
- */
- private static final Logger LOG = Logger.getLogger(StructuredDocumentFactory.class.getName());
-
- /**
- * Interface for instantiators of StructuredDocuments
- */
- public interface Instantiator {
-
- /**
- * For mapping between extensions and MIME types.
- */
- class ExtensionMapping extends Object {
-
- /**
- * The extension
- */
- private final String extension;
-
- /**
- * MIME type it maps to
- */
- private final MimeMediaType mimetype;
-
- /**
- * default constructor
- */
- public ExtensionMapping(String extension, MimeMediaType mimetype) {
- this.extension = extension;
- this.mimetype = (null != mimetype) ? mimetype.intern() : null;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean equals(Object target) {
- if (this == target) {
- return true;
- }
-
- if (target instanceof ExtensionMapping) {
- ExtensionMapping likeMe = (ExtensionMapping) target;
-
- if (!extension.equals(likeMe.extension)) {
- return false;
- }
-
- if ((null == mimetype) && (null == likeMe.mimetype)) {
- return true;
- }
-
- if ((null == mimetype) || (null == likeMe.mimetype)) {
- return false;
- }
-
- return mimetype.equals(likeMe.mimetype);
- } else {
- return false;
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int hashCode() {
- int hash = extension.hashCode();
-
- if (null != mimetype) {
- hash ^= mimetype.hashCode();
- }
-
- return hash;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String toString() {
- return extension + " -> " + ((null != mimetype) ? mimetype.toString() : "");
- }
-
- /**
- * Returns the extension which is part of this mapping.
- *
- * @return the extension which is part of this mapping.
- */
- public String getExtension() {
- return extension;
- }
-
- /**
- * Returns the MIME Media Type which is part of this mapping.
- *
- * @return the MIME Media Type which is part of this mapping.
- */
- public MimeMediaType getMimeMediaType() {
- return mimetype;
- }
- }
-
- /**
- * Returns the MIME Media types supported by this this Document per
- * {@link IETF RFC 2046 MIME : Media Types}.
- *
- * JXTA does not currently support the 'Multipart' or 'Message'
- * media types.
- *
- * @return An array of MimeMediaType objects containing the MIME Media Type
- * for this Document.
- */
- MimeMediaType[] getSupportedMimeTypes();
-
- /**
- * Returns the mapping of file extension and mime-types for this type
- * of document. The default extension is mapped to the 'null' mime-type
- * and should only be used if no other mapping matches.
- *
- * @return An array of objects containing file extensions
- */
- ExtensionMapping[] getSupportedFileExtensions();
-
- /**
- * Create a new structured document of the type specified by doctype.
- *
- * @param mimeType The MIME type to be associated with this instance.
- * the base type must be one of the types returned by
- * getSupportedMimeTypes. Some implementations may accept
- * parameters in the params section of the MIME type.
- * @param doctype Type for the base node of the document.
- * @return StructuredDocument instance.
- */
- StructuredDocument newInstance(MimeMediaType mimeType, String doctype);
-
- /**
- * Create a new structured document of the type specified by doctype.
- *
- * @param mimeType The MIME type to be associated with this instance.
- * The base type must be one of the types returned by
- * getSupportedMimeTypes. Some implementations may accept
- * parameters in the params section of the MIME type.
- * @param doctype Type for the base node of the document.
- * @param value Value for the base node of the document.
- * @return {@link StructuredDocument} instance.
- */
- StructuredDocument newInstance(MimeMediaType mimeType, String doctype, String value);
-
- /**
- * Create a structured document from a stream containing an appropriately serialized
- * instance of the same document.
- *
- * @param mimeType The MIME type to be associated with this instance.
- * The base type must be one of the types returned by
- * getSupportedMimeTypes. Some implementations may accept
- * parameters in the params section of the MIME type.
- * @param source The {@code Inputstream} from which to read the
- * document.
- * @return {@link StructuredDocument} instance.
- * @throws IOException Thrown for problems reading from the source.
- */
- StructuredDocument newInstance(MimeMediaType mimeType, InputStream source) throws IOException;
- }
-
-
- /**
- * Interface for instantiators of StructuredTextDocuments
- */
- public interface TextInstantiator extends Instantiator {
-
- /**
- * Create a structured document from a Reader containing an appropriately serialized
- * instance of the same document.
- *
- * @param mimeType The MIME type to be associated with this instance.
- * The base type must be one of the types returned by
- * getSupportedMimeTypes. Some implementations may accept
- * parameters in the params section of the MIME type.
- * @param source {@code Reader} from which to read the instance.
- * @return {@link StructuredDocument} instance.
- * @throws IOException Thrown for problems reading from the source.
- */
- StructuredDocument newInstance(MimeMediaType mimeType, Reader source) throws IOException;
- }
-
- /**
- * This class is a singleton. This is the instance that backs the
- * static methods.
- */
- private static final StructuredDocumentFactory factory = new StructuredDocumentFactory();
-
- /**
- * This is the map of mime-types and instantiators used by
- * newStructuredDocument.
- */
- private final Map encodings = new HashMap();
-
- /**
- * This is the map of extensions to mime-types used by
- * {@link #getMimeTypeForFileExtension(String) }
- */
- private final Map extToMime = new HashMap();
-
- /**
- * This is the map of mime-types to extensions used by
- * {@link #getFileExtensionForMimeType(MimeMediaType mimetype) }
- */
- private final Map mimeToExt = new HashMap();
-
- /**
- * If true then the pre-defined set of StructuredDocument sub-classes has
- * been registered from the property containing them.
- */
- private boolean loadedProperty = false;
-
- /**
- * Private constructor. This class is not meant to be instantiated except
- * by itself.
- *
- */
- private StructuredDocumentFactory() {}
-
- /**
- * Registers the pre-defined set of StructuredDocument sub-classes so that
- * this factory can construct them.
- *
- * @return true if at least one of the StructuredDocument sub-classes could
- * be registered otherwise false.
- */
- private synchronized boolean loadProviders() {
- if (factory.loadedProperty) {
- return true;
- }
-
- factory.loadedProperty = registerProviders(StructuredDocument.class.getName());
-
- return factory.loadedProperty;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Map getAssocTable() {
- return encodings;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Class getClassForKey() {
- return MimeMediaType.class;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Class getClassOfInstantiators() {
- // our key is the doctype names.
- return Instantiator.class;
- }
-
- /**
- * {@inheritDoc}
- *
- * We override the standard implementation to get the MIME type from
- * the class and use that as the key to register the class with the factory.
- *
- * @param className The class name which will be registered.
- * @return boolean true if the class was registered otherwise false.
- */
- @Override
- protected boolean registerAssoc(String className) {
- boolean registeredSomething = false;
-
- LOG.finer("Registering : " + className);
-
- try {
- Class docClass = Class.forName(className);
-
- Instantiator instantiator = (Instantiator) docClass.getField("INSTANTIATOR").get(null);
-
- MimeMediaType[] mimeTypes = instantiator.getSupportedMimeTypes();
-
- for (int eachType = 0; eachType < mimeTypes.length; eachType++) {
- LOG.finer(" Registering Type : " + mimeTypes[eachType].getMimeMediaType());
- registeredSomething |= registerInstantiator(mimeTypes[eachType], instantiator);
- }
- } catch (Exception all) {
- if (Logging.SHOW_WARNING && LOG.isLoggable(Level.WARNING)) {
- LOG.log(Level.WARNING, "Failed to register \'" + className + "\'", all);
- }
- }
-
- return registeredSomething;
- }
-
- /**
- * Returns the preferred extension for a given mime-type. If there is no
- * mapping or no preferred extension for this MIME type then null is
- * returned.
- *
- * @param mimetype the MimeMediaType we wish to know the file extension for.
- * @return String containing the extension or null for mime-types with no
- * known association.
- */
- public static String getFileExtensionForMimeType(MimeMediaType mimetype) {
- factory.loadProviders();
-
- return factory.mimeToExt.get(mimetype.getBaseMimeMediaType());
- }
-
- /**
- * Returns the preferred mime-type for a given file extension. If there is
- * no mapping then null is returned.
- *
- * @param extension The extension we wish to know the mime-type for.
- * @return MimeMediaType associated with this file extension.
- */
- public static MimeMediaType getMimeTypeForFileExtension(String extension) {
- factory.loadProviders();
-
- MimeMediaType result = factory.extToMime.get(extension);
-
- return result;
- }
-
- /**
- * Register an instantiator object a mime-type of documents to be
- * constructed.
- *
- * @param mimetype the mime-type associated.
- * @param instantiator the instantiator that wants to be registered..
- * @return boolean true if the instantiator for this mime-type is now
- * registered. If there was already an instantiator this mime-type then
- * false will be returned.
- * @throws SecurityException there were permission problems registering
- * the instantiator.
- */
- public static boolean registerInstantiator(MimeMediaType mimetype, Instantiator instantiator) {
- boolean registered = factory.registerAssoc(mimetype.getBaseMimeMediaType(), instantiator);
-
- if (registered) {
- Instantiator.ExtensionMapping[] extensions = instantiator.getSupportedFileExtensions();
-
- for (int eachExt = 0; eachExt < extensions.length; eachExt++) {
- if (null != extensions[eachExt].getMimeMediaType()) {
- factory.extToMime.put(extensions[eachExt].getExtension(), extensions[eachExt].getMimeMediaType().intern());
-
- factory.mimeToExt.put(extensions[eachExt].getMimeMediaType(), extensions[eachExt].getExtension());
-
- // And the base version.
- factory.mimeToExt.put(extensions[eachExt].getMimeMediaType().getBaseMimeMediaType(), extensions[eachExt].getExtension());
- }
- }
- }
-
- return registered;
- }
-
- /**
- * Constructs an instance of {@link StructuredDocument} matching
- * the mime-type specified by the mimetype parameter. The
- * doctype parameter identifies the base type of the
- * {@link StructuredDocument}.
- *
- * @param mimetype Specifies the mime media type to be associated with
- * the {@link StructuredDocument} to be created.
- * @param doctype Specifies the root type of the {@link StructuredDocument}
- * to be created.
- * @return StructuredDocument The instance of {@link StructuredDocument}
- * or null if it could not be created.
- * @throws NoSuchElementException invalid mime-media-type
- */
- public static StructuredDocument newStructuredDocument(MimeMediaType mimetype, String doctype) {
- factory.loadProviders();
-
- Instantiator instantiator = factory.getInstantiator(mimetype.getBaseMimeMediaType());
-
- return instantiator.newInstance(mimetype, doctype);
- }
-
- /**
- * Constructs an instance of {@link StructuredDocument} matching
- * the mime-type specified by the mimetype parameter. The
- * doctype parameter identifies the base type of the
- * {@link StructuredDocument}. Value supplies a value for the root
- * element.
- *
- * @param mimetype Specifies the mime media type to be associated with
- * the {@link StructuredDocument} to be created.
- * @param doctype Specifies the root type of the {@link StructuredDocument}
- * to be created.
- * @param value Specifies a value for the root element.
- * @return StructuredDocument The instance of {@link StructuredDocument}
- * or null if it could not be created.
- * @throws NoSuchElementException if the mime-type has not been registered.
- */
- public static StructuredDocument newStructuredDocument(MimeMediaType mimetype, String doctype, String value) {
- factory.loadProviders();
-
- Instantiator instantiator = factory.getInstantiator(mimetype.getBaseMimeMediaType());
-
- return instantiator.newInstance(mimetype, doctype, value);
- }
-
- /**
- * Constructs an instance of {@link StructuredDocument} matching
- * the mime-type specified by the mimetype parameter. The
- * doctype parameter identifies the base type of the
- * {@link StructuredDocument}.
- *
- * @param mimetype Specifies the mime media type to be associated with the
- * {@link StructuredDocument} to be created.
- * @param stream Contains an InputStream from which the document will be
- * constructed.
- * @return StructuredDocument The instance of {@link StructuredDocument}
- * or null if it could not be created.
- * @throws IOException If there is a problem reading from the stream.
- * @throws NoSuchElementException if the mime-type has not been registered.
- */
- public static StructuredDocument newStructuredDocument(MimeMediaType mimetype, InputStream stream) throws IOException {
- factory.loadProviders();
-
- Instantiator instantiator = factory.getInstantiator(mimetype.getBaseMimeMediaType());
-
- return instantiator.newInstance(mimetype, stream);
- }
-
- /**
- * Constructs an instance of {@link StructuredDocument} matching
- * the mime-type specified by the mimetype parameter. The
- * doctype parameter identifies the base type of the
- * {@link StructuredDocument}.
- *
- * @param mimetype Specifies the mime media type to be associated with the
- * {@link StructuredDocument} to be created.
- * @param reader A Reader from which the document will be constructed.
- * @return StructuredDocument The instance of {@link StructuredDocument}
- * or {@code null} if it could not be created.
- * @throws IOException If there is a problem reading from the stream.
- * @throws NoSuchElementException if the mime-type has not been registered.
- * @throws UnsupportedOperationException if the mime-type provided is not
- * a text oriented MIME type.
- */
- public static StructuredDocument newStructuredDocument(MimeMediaType mimetype, Reader reader) throws IOException {
- factory.loadProviders();
-
- Instantiator instantiator = factory.getInstantiator(mimetype.getBaseMimeMediaType());
-
- if (!(instantiator instanceof TextInstantiator)) {
- // XXX 20020502 bondolo@jxta.org we could probably do something
- // really inefficient that would allow it to work, but better not to.
- // if ReaderInputStream existed, it would be easy to do.
- if (Logging.SHOW_WARNING && LOG.isLoggable(Level.WARNING)) {
- LOG.warning( "Document Class \'" + instantiator.getClass().getName() + "\' associated with \'" + mimetype
- + "\' is not a text oriented document");
- }
-
- throw new UnsupportedOperationException( "Document Class '" + instantiator.getClass().getName()
- + "' associated with '" + mimetype + "' is not a text oriented document");
- }
-
- return ((TextInstantiator) instantiator).newInstance(mimetype, reader);
- }
-
- /**
- * Constructs an instance of {@link StructuredDocument} based upon the
- * content of the provided message element.
- *
- * @param element The message element from which to create the document.
- * @return StructuredDocument The instance of {@link StructuredDocument}
- * or null if it could not be created.
- * @throws IOException If there is a problem reading from the stream.
- * @throws NoSuchElementException if the mime-type has not been registered.
- */
- public static StructuredDocument newStructuredDocument(MessageElement element) throws IOException {
- factory.loadProviders();
-
- Instantiator instantiator = factory.getInstantiator(element.getMimeType().getBaseMimeMediaType());
-
- if ((instantiator instanceof TextInstantiator) && (element instanceof TextMessageElement)) {
- return ((TextInstantiator) instantiator).newInstance(element.getMimeType(), ((TextMessageElement) element).getReader());
- } else {
- return instantiator.newInstance(element.getMimeType(), element.getStream());
- }
- }
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/StructuredDocumentUtils.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/StructuredDocumentUtils.java
deleted file mode 100644
index 0a3b07da..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/StructuredDocumentUtils.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-import java.util.Enumeration;
-
-
-/**
- * Provides a number of static utility members which are helpful in
- * manipluating StructuredDocuments.
- *
- **/
-public final class StructuredDocumentUtils {
-
- /**
- * A singleton class, not meant to be constructed
- **/
- private StructuredDocumentUtils() {
- ;
- }
-
- /**
- * Recursively copy children elements of from into the
- * the element intoElement of document intoDoc.
- *
- * BEWARE that this does NOT copy the TEXTVALUE (if any) of the
- * fromParent element, ONLY CHILDREN. All other elements
- * are fully copied, including their textValue.
- *
- * It is not possible to copy a textValue in an existing element.
- *
- * @param intoDoc the document into which the elements will be
- * copied.
- * @param intoElement the element which will serve as the parent for
- * the elements being copied.
- * @param from the parent element of the elements which will be copied.
- **/
- public static void copyChildren(StructuredDocument intoDoc, Element intoElement, Element from) {
-
- for (Enumeration eachChild = from.getChildren(); eachChild.hasMoreElements();) {
-
- Element aChild = (Element) eachChild.nextElement();
- Element newElement = intoDoc.createElement(aChild.getKey(), aChild.getValue());
-
- intoElement.appendChild(newElement);
-
- // copy attributes if any
- if ((aChild instanceof Attributable) && (newElement instanceof Attributable)) {
- Enumeration eachAttrib = ((Attributable) aChild).getAttributes();
-
- while (eachAttrib.hasMoreElements()) {
- Attribute anAttrib = (Attribute) eachAttrib.nextElement();
-
- ((Attributable) newElement).addAttribute(anAttrib.getName(), anAttrib.getValue());
- }
- }
-
- // recurse to add the children.
- copyChildren(intoDoc, newElement, aChild);
- }
- }
-
- /**
- * Recursively copy elements beginnging with from into the
- * document identified by intoDoc.
- *
- * @param intoDoc the document into which the elements which will be
- * copied.
- * @param intoElement the element which will serve as the parent for
- * the elements being copied.
- * @param from the root element of the hierarchy which will be copied.
- * @param newName the root element being copied is renamed
- * newName.
- * @return The added element.
- *
- **/
- public static Element copyElements(StructuredDocument intoDoc, Element intoElement, Element from, Object newName) {
-
- Element newElement = intoDoc.createElement(newName, from.getValue());
-
- intoElement.appendChild(newElement);
-
- boolean hasType = false;
-
- // copy attributes if any
- if (newElement instanceof Attributable) {
-
- if (from instanceof Attributable) {
- Enumeration eachAttrib = ((Attributable) from).getAttributes();
-
- while (eachAttrib.hasMoreElements()) {
- Attribute anAttrib = (Attribute) eachAttrib.nextElement();
- String attribName = anAttrib.getName();
-
- if (attribName.equals("type")) {
- hasType = true;
- }
- ((Attributable) newElement).addAttribute(attribName, anAttrib.getValue());
- }
- }
-
- // If "from" happens to be a document, and if it happens to be renamed, and if it does not have an explicit type
- // attribute, then preserve the document type, which we assume is the original name, converted to string, as a type
- // attribute. It is an XMLism. It may be wrong or at least ineffective for other kinds of structured documents. If
- // it one day becomes an issue, it will have to be resolved by having a method specific to each kind of structured
- // document and dedicated to correcting type loss.
-
- Object origName = from.getKey().toString();
-
- if ((!hasType) && (!newName.equals(origName)) && (from instanceof Document)) {
- ((Attributable) newElement).addAttribute("type", origName.toString());
- }
- }
-
- StructuredDocumentUtils.copyChildren(intoDoc, newElement, from);
-
- return newElement;
- }
-
- /**
- * Recursively copy elements beginnging with from into the
- * document identified by intoDoc.
- *
- * @param intoDoc the document into which the elements which will be
- * copied.
- * @param intoElement the element which will serve as the parent for
- * the elements being copied.
- * @param from the root element of the hierarchy which will be copied.
- * @return The added element.
- **/
- public static Element copyElements(StructuredDocument intoDoc, Element intoElement, Element from) {
-
- return copyElements(intoDoc, intoElement, from, from.getKey());
- }
-
- /**
- * Copies the specified element or document into a standalone document of
- * same type. The from for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-/**
- * Extends {@link StructuredDocument} to provide accessors appropriate for text
- * based documents.
- *
- * @see net.jxta.document.Document
- * @see net.jxta.document.StructuredDocument
- * @see net.jxta.document.TextDocument
- * @see net.jxta.document.Element
- * @see net.jxta.document.TextElement
- * @see net.jxta.document.StructuredDocumentFactory
- */
-public interface StructuredTextDocument> extends TextDocument, StructuredDocument, TextElement {
-
- /**
- * Create a new element without value.
- *
- * @param name The name of the element to be created.
- * @return The new element.
- */
- T createElement(String name);
-
- /**
- * Create a new element with value.
- *
- * @param name The name of the element to be created.
- * @param value The value of the element to be created.
- * @return The new element.
- */
- T createElement(String name, String value);
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextDocument.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextDocument.java
deleted file mode 100644
index 701a5b18..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextDocument.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-import java.io.Writer;
-import java.io.Reader;
-
-import java.io.IOException;
-
-
-/**
- * Extends {@link net.jxta.document.Document} for text documents.
- *
- * @see net.jxta.document.Document
- */
-public interface TextDocument extends Document, TextDocumentReaderIO {}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextDocumentCharArrayIO.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextDocumentCharArrayIO.java
deleted file mode 100644
index 9ad6c2c6..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextDocumentCharArrayIO.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-import java.io.Writer;
-import java.io.Reader;
-
-import java.io.IOException;
-
-
-/**
- * Provides {@code char} array based interfaces for manipulating
- * {@code TextDocument}s.
- */
-public interface TextDocumentCharArrayIO {
-
- /**
- * Returns the sequence of characters which represents the content of the
- * {@code TextDocument}.
- *
- * @return A character array containing the characters of the
- * {@code TextDocument}.
- */
- char[] getChars();
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextDocumentCharBufferIO.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextDocumentCharBufferIO.java
deleted file mode 100644
index 304602cc..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextDocumentCharBufferIO.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-import java.io.Writer;
-import java.io.Reader;
-
-import java.io.IOException;
-
-
-/**
- * Provides {@code Reader}/{@code Writer} based interfaces for manipulating
- * {@code TextDocument}s.
- */
-public interface TextDocumentCharBufferIO {
-
- /**
- * Returns the sequence of characters which represents the content of the
- * {@code TextDocument}.
- *
- * @return A character array containing the characters of the
- * {@code TextDocument}.
- */
- CharSequence getCharSequence();
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextDocumentCharSequenceIO.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextDocumentCharSequenceIO.java
deleted file mode 100644
index fda5b275..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextDocumentCharSequenceIO.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-import java.nio.CharBuffer;
-
-
-/**
- * Provides {@code Reader}/{@code Writer} based interfaces for manipulating
- * {@code TextDocument}s.
- */
-public interface TextDocumentCharSequenceIO {
-
- /**
- * Returns the sequence of characters which represents the content of the
- * {@code TextDocument}.
- *
- * @return A sequence of {@code CharBuffer}s containing the characters of
- * the {@code TextDocument}.
- */
- CharBuffer getCharBuffers();
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextDocumentReaderIO.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextDocumentReaderIO.java
deleted file mode 100644
index a1742ab6..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextDocumentReaderIO.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-import java.io.Writer;
-import java.io.Reader;
-
-import java.io.IOException;
-
-
-/**
- * Provides {@code Reader}/{@code Writer} based interfaces for manipulating
- * {@code TextDocument}s.
- */
-public interface TextDocumentReaderIO {
-
- /**
- * Returns the sequence of characters which represents the content of the
- * {@code TextDocument}.
- *
- * @return An {@link java.io.Reader} containing the characters of the
- * {@code TextDocument}.
- * @throws IOException If an I/O error occurs.
- */
- Reader getReader() throws IOException;
-
- /**
- * Send the contents of this {@code TextDocument} to the specified
- * Writer.
- *
- * @param writer The {@link java.io.Writer} to which the characters of the
- * {@code TextDocument} will be written.
- * @throws IOException If an I/O error occurs.
- */
- void sendToWriter(Writer writer) throws IOException;
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextElement.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextElement.java
deleted file mode 100644
index c816cee9..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextElement.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-import java.util.Enumeration;
-
-
-/**
- * Extends {@link Element} to provide {@link java.lang.String} oriented
- * accessors for instances of {@link StructuredTextDocument}
- *
- * @see net.jxta.document.Document
- * @see net.jxta.document.Element
- * @see net.jxta.document.StructuredDocument
- * @see net.jxta.document.StructuredTextDocument
- */
-public interface TextElement> extends Element {
-
- /**
- * {@inheritDoc}
- */
- String getKey();
-
- /**
- * {@inheritDoc}
- */
- String getValue();
-
- /**
- * {@inheritDoc}
- */
- StructuredTextDocument getRoot();
-
- /**
- * Get the name associated with an element.
- *
- * @return A string containing the name of this element.
- */
- String getName();
-
- /**
- * Get the value (if any) associated with an element.
- *
- * @return A string containing the value of this element, if any, otherwise null.
- */
- String getTextValue();
-
- /**
- * Returns an enumeration of the immediate children of this element whose
- * name match the specified string.
- *
- * @param name The name which will be matched against.
- * @return An enumeration containing all of the children of this element.
- */
- Enumeration getChildren(String name);
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/XMLDocument.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/XMLDocument.java
deleted file mode 100644
index 1424da1e..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/XMLDocument.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-/**
- * Common interfaces for all {@link net.jxta.document.StructuredTextDocument}
- * which are implemented by XML Documents. Appropriate for advertisements and
- * messages.
- */
-public interface XMLDocument> extends XMLElement, StructuredTextDocument {
-
- /**
- * {@inheritDoc}
- */
- X createElement(String name);
-
- /**
- * {@inheritDoc}
- */
- X createElement(String name, String value);
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/XMLElement.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/XMLElement.java
deleted file mode 100644
index 091ffc8e..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/XMLElement.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.document;
-
-
-import java.util.Enumeration;
-
-
-/**
- * Common definition of XML Elements. Appropriate for advertisements and
- * messages.
- */
-public interface XMLElement> extends TextElement, Attributable {
-
- /**
- * {@inheritDoc}
- */
- XMLDocument getRoot();
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/package.html b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/package.html
deleted file mode 100644
index e579d09e..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/package.html
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
- JXTA Documents are containers for both structured and unstructured data.
- Advertisements are used to describe JXTA resources such as peers, groups,
- services, and codats.
-
- @see JXTA Protocols Specification : Advertisementss
-
-
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/AbstractMessenger.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/AbstractMessenger.java
deleted file mode 100644
index d81cba5e..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/AbstractMessenger.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * Copyright (c) 2004-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.endpoint;
-
-
-import net.jxta.util.AbstractSimpleSelectable;
-import net.jxta.util.SimpleSelectable;
-
-import java.io.IOException;
-import java.io.InterruptedIOException;
-
-
-/**
- * An AbstractMessenger is used to implement messengers (for example, by transport modules).
- * It supplies the convenience, bw compatible, obvious, or otherwise rarely changed methods.
- * Many method cannot be overloaded in order to ensure standard behaviour.
- * The rest is left to implementations.
- *
- * @see net.jxta.endpoint.EndpointService
- * @see net.jxta.endpoint.EndpointAddress
- * @see net.jxta.endpoint.Message
- */
-public abstract class AbstractMessenger extends AbstractSimpleSelectable implements Messenger {
-
- /**
- * The default Maximum Transmission Unit.
- */
- protected static final long DEFAULT_MTU = Long.parseLong(System.getProperty("net.jxta.MTU", "65536"));
-
- /**
- * The destination address of messages sent on this messenger.
- */
- protected final EndpointAddress dstAddress;
-
- /**
- * The stateLock that we share with the implementation.
- * This permits to implement waitState in a totally generic way: waitState depends only on the lock
- * (provided at construction), and on getState(), supplied by the implementation.
- */
- private Object stateLock;
-
- /**
- * Create a new abstract messenger.
- *
- * Warning: This class needs to know the object on which to waitState must synchronize. It is generally impossible
- * to pass it at construction because it is not yet constructed. Instead implementations MUST call {@link #setStateLock}
- * from their constructor.
- *
- * @param dest who messages should be addressed to
- */
- public AbstractMessenger(EndpointAddress dest) {
- dstAddress = dest;
- }
-
- /**
- * {@inheritDoc}
- *
- * A simple implementation for debugging. Do not depend upon the format.
- */
- @Override
- public String toString() {
- return super.toString() + " {" + dstAddress + "}";
- }
-
- /**
- * Specifies the object on which waitState must synchronize.
- *
- * @param stateLock The object on which waitState must synchronize. This has to be the object that gets notified when the
- * implementation changes its state. Changing state is defined as "any operation that causes the result of the
- * getState method to change". Implementations that use the MessengerState state machine should typically use the
- * MessengerState object as their state lock, but it is not assumed.
- */
- protected void setStateLock(Object stateLock) {
- this.stateLock = stateLock;
- }
-
- /*
- * Messenger methods implementations.
- */
-
- /**
- * {@inheritDoc}
- *
- * This is here for backward compatibility reasons. The notion of long term unemployment still exists, but is no-longer part
- * of the API. Self closing for unemployment is now a built-in feature of messengers.
- */
- @Deprecated
- public final boolean isIdle() {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Deprecated
- public final boolean isSynchronous() {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public final EndpointAddress getDestinationAddress() {
- return dstAddress;
- }
-
- /**
- * {@inheritDoc}
- */
- @Deprecated
- public final EndpointAddress getDestinationAddressObject() {
- return dstAddress;
- }
-
- /**
- * {@inheritDoc}
- * It is not always enforced. At least this much can always be sent.
- */
- public long getMTU() {
- return DEFAULT_MTU;
- }
-
- /**
- * {@inheritDoc}
- *
- * This is a minimal implementation. It may not detect closure
- * initiated by the other side unless the messenger was actually used
- * since. A more accurate (but not mandatory implementation) would
- * actually go and check the underlying connection, if relevant...unless
- * breakage initiated by the other side is actually reported asynchronously
- * when it happens. Breakage detection from the other side need not
- * be reported atomically with its occurrence. This not very important
- * since we canonicalize transport messengers and so do not need to
- * aggressively collect closed ones. When not used, messengers die by themselves.
- */
- public boolean isClosed() {
- return (getState() & USABLE) == 0;
- }
-
- /**
- * {@inheritDoc}
- */
- public final void flush() throws IOException {
- int currentState = 0;
-
- try {
- currentState = waitState(IDLE, 0);
- } catch (InterruptedException ie) {
- InterruptedIOException iio = new InterruptedIOException("flush() interrupted");
-
- iio.initCause(ie);
- throw iio;
- }
-
- if ((currentState & (CLOSED | USABLE)) != 0) {
- return;
- }
-
- throw new IOException("Messenger was unexpectedly closed.");
- }
-
- /**
- * {@inheritDoc}
- */
- public final boolean sendMessage(Message msg) throws IOException {
- return sendMessage(msg, null, null);
- }
-
- /**
- * {@inheritDoc}
- *
- */
- public void sendMessage(Message msg, String service, String serviceParam, OutgoingMessageEventListener listener) {
- throw new UnsupportedOperationException("This legacy method is not supported by this messenger.");
- }
-
- /**
- * {@inheritDoc}
- */
- public final boolean sendMessage(Message msg, String rService, String rServiceParam) throws IOException {
-
- // We have to retrieve the failure from the message and throw it if its an IOException, this is what the API
- // says that this method does.
-
- if (sendMessageN(msg, rService, rServiceParam)) {
- return true;
- }
-
- Object failed = msg.getMessageProperty(Messenger.class);
-
- if ((failed == null) || !(failed instanceof OutgoingMessageEvent)) {
- // huh ?
- return false;
- }
-
- Throwable t = ((OutgoingMessageEvent) failed).getFailure();
-
- if (t == null) {
- // Must be saturation, then. (No throw for that).
- return false;
- }
-
- // Now see how we can manage to throw it.
- if (t instanceof IOException) {
- throw (IOException) t;
- } else if (t instanceof RuntimeException) {
- throw (RuntimeException) t;
- } else if (t instanceof Error) {
- throw (Error) t;
- }
-
- IOException failure = new IOException("Failure sending message");
-
- failure.initCause(t);
-
- throw failure;
- }
-
- /**
- * {@inheritDoc}
- *
- * This method synchronizes on the lock object supplied at construction.
- */
- public final int waitState(int wantedStates, long timeout) throws InterruptedException {
- synchronized (stateLock) {
- if (timeout == 0) {
- while ((wantedStates & getState()) == 0) {
- stateLock.wait();
- }
- return getState();
- }
-
- if (timeout < 0) {
- stateLock.wait(timeout); // let it throw the appropriate error.
- }
-
- long start = System.currentTimeMillis();
- long end = start + timeout;
-
- if (end < start) {
- end = Long.MAX_VALUE;
- }
- long left = end - start;
-
- while ((left > 0) && (wantedStates & getState()) == 0) {
-
- stateLock.wait(left);
-
- left = end - System.currentTimeMillis();
- }
-
- return getState();
- }
- }
-
- /*
- * SimpleSelectable implementation.
- */
-
- /**
- * Implements a default for all AbstractMessengers: mirror the event to our selectors. This is what is needed by all the
- * known AbstractMessengers that register themselves somewhere. (That is ChannelMessengers).
- * FIXME - jice@jxta.org 20040413: Not sure that this is the best default.
- *
- * @param changedObject Ignored.
- */
- public void itemChanged(SimpleSelectable changedObject) {
- notifyChange();
- }
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/AsyncChannelMessenger.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/AsyncChannelMessenger.java
deleted file mode 100644
index ff8607eb..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/AsyncChannelMessenger.java
+++ /dev/null
@@ -1,665 +0,0 @@
-/*
- * Copyright (c) 2004-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-package net.jxta.endpoint;
-
-import net.jxta.peergroup.PeerGroupID;
-
-import java.io.IOException;
-import java.io.InterruptedIOException;
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.BlockingQueue;
-
-/**
- * Extends Channel Messenger behaviour to provide asynchronous message sending
- * via queuing.
- */
-public abstract class AsyncChannelMessenger extends ChannelMessenger {
-
- /*
- * Logger
- * private final static transient Logger LOG = Logger.getLogger(AsyncChannelMessenger.class.getName());
- */
-
- /**
- * {@code true} if we have deliberately closed our one message input queue.
- */
- private boolean inputClosed = false;
-
- /**
- * {@code true} if we have deliberately stopped sending.
- */
- private boolean outputClosed = false;
-
- /**
- * Actions that we defer to after returning from event methods. In other
- * words, they cannot be done with the lock held, or they require calling
- * more event methods.
- */
- private enum DeferredAction {
-
- /**
- * No action deferred.
- */
- ACTION_NONE,
- /**
- * Must send the current message.
- */
- ACTION_SEND,
- /**
- * Must report failure to connect.
- */
- ACTION_CONNECT
- }
-
- /**
- * The current deferred action.
- */
- private DeferredAction deferredAction = DeferredAction.ACTION_NONE;
-
- /**
- * The messages queue.
- */
- private final BlockingQueue queue;
-
- /**
- * State lock and engine.
- */
- private final AsyncChannelMessengerState stateMachine;
-
- /**
- * Our statemachine implementation; just connects the standard MessengerState action methods to
- * this object.
- */
- private class AsyncChannelMessengerState extends MessengerState {
-
- protected AsyncChannelMessengerState(boolean connected) {
- super(connected);
- }
-
- /*
- * The required action methods.
- */
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void connectAction() {
- deferredAction = DeferredAction.ACTION_CONNECT;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void startAction() {
- deferredAction = DeferredAction.ACTION_SEND;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void closeInputAction() {
- // We're synchronized here. (invoked from stateMachine)
- inputClosed = true;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void closeOutputAction() {
- // We're synchronized here. (invoked from stateMachine)
- outputClosed = true;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void failAllAction() {
-
- // The queue is now closed, so we can rest assured that the last
- // message is really the last one. This is a synchronous action. The
- // state machine assumes that it is done when we return. There is no
- // need to signal completion with an idleEvent.
- PendingMessage theMsg;
-
- while (true) {
- theMsg = null;
-
- synchronized (stateMachine) {
- theMsg = queue.poll();
- }
-
- if (theMsg == null) {
- return;
- }
-
- Message currentMsg = theMsg.msg;
- Throwable currentFailure = theMsg.failure;
-
- if (currentFailure == null) {
- currentFailure = new IOException("Messenger unexpectedly closed");
- }
-
- OutgoingMessageEvent event = new OutgoingMessageEvent(currentMsg, currentFailure);
-
- currentMsg.setMessageProperty(Messenger.class, event);
- }
- }
- }
-
-
- /**
- * The representation of a queued message. It is shared between this
- * abstract class and any implementation.
- */
- protected static class PendingMessage {
- final Message msg;
- final String service;
- final String param;
- Throwable failure;
-
- PendingMessage(Message msg, String service, String param) {
- this.msg = msg;
- this.service = service;
- this.param = param;
- this.failure = null;
- }
- }
-
- /**
- * Create a new AsyncChannelMessenger.
- *
- * @param baseAddress The network address messages go to; regardless of
- * service, param, or group.
- * @param redirection Group to which the messages must be redirected. This
- * is used to implement the automatic group segregation which has become a
- * de-facto standard. If not null, the unique portion of the specified
- * groupID is prepended with {@link #InsertedServicePrefix} and inserted in
- * every message's destination address in place of the the original service
- * name, which gets shifted into the beginning of the service parameter. The
- * opposite is done on arrival to restore the original destination address
- * before the message is delivered to the listener in the the specified
- * group. Messages that already bear a group redirection are not affected.
- * @param origService The default destination service for messages sent
- * without specifying a different service.
- * @param origServiceParam The default destination service parameter for
- * messages sent without specifying a different service parameter.
- * @param queueSize the queue size that channels should have.
- * @param connected true if the channel is created in the connected state.
- */
- public AsyncChannelMessenger(EndpointAddress baseAddress, PeerGroupID redirection, String origService, String origServiceParam, int queueSize, boolean connected) {
-
- super(baseAddress, redirection, origService, origServiceParam);
-
- stateMachine = new AsyncChannelMessengerState(connected);
-
- queue = new ArrayBlockingQueue(queueSize);
-
- // We synchronize our state with the sharedMessenger's stateMachine.
- // Logic would dictate that we pass it to super(), but it is not itself
- // constructed until super() returns. No way around it.
-
- setStateLock(stateMachine);
- }
-
- /**
- * {@inheritDoc}
- */
- public final void close() {
- DeferredAction action;
-
- synchronized (stateMachine) {
- stateMachine.closeEvent();
- action = eventCalled(true);
- }
-
- // We called an event. State may have changed.
- notifyChange();
-
- performDeferredAction(action);
- }
-
- /**
- * This internal method does the common part of sending the message on
- * behalf of both sendMessageN and sendMessageB.
- * It is not quite possible to implement sendMessageB as a wrapper
- * around sendMessageN without some internal cooperation. At least not in
- * an efficient manner. sendMessageB must not set the message property:
- * either it fails and throws, or it returns successfully and the property
- * is set later. This is required so that messages can be retried when
- * failing synchronously (through a blocking messenger typically, but the
- * semantic has to be uniform).
- * Each of sendMessageB and sendMessageN takes care of status reporting
- * on its own terms.
- *
- * @param msg the message to send
- * @param rService destination service
- * @param rServiceParam destination param
- * @return The outcome from that one attempt. {@code true} means done.
- * {@code false} means saturated. When {@code true} is returned, it means
- * that the fate of the message will be decided asynchronously, so we do
- * not have any details, yet.
- * @throws IOException is thrown if this messenger is closed.
- * @throws InterruptedException if interrupted
- */
- private boolean sendMessageCommon(Message msg, String rService, String rServiceParam) throws IOException, InterruptedException {
-
- String service = effectiveService(rService);
- String serviceParam = effectiveParam(rService, rServiceParam);
- boolean queued = true;
- boolean change = false;
- DeferredAction action = DeferredAction.ACTION_NONE;
-
- synchronized (stateMachine) {
- if (inputClosed) {
- throw new IOException("This messenger is closed. It cannot be used to send messages.");
- }
-
- boolean wasEmpty = queue.isEmpty();
-
- if (queue.remainingCapacity() > 1) {
- queue.put(new PendingMessage(msg, service, serviceParam));
-
- // Still not saturated. If we weren't idle either, then nothing worth mentionning.
- if (wasEmpty) {
- change = true;
- stateMachine.msgsEvent();
- action = eventCalled(false);
- }
- } else if (1 == queue.remainingCapacity()) {
- queue.put(new PendingMessage(msg, service, serviceParam));
-
- // Now saturated.
- stateMachine.saturatedEvent();
- action = eventCalled(false);
- change = true;
- } else {
- // Was already saturated.
- queued = false;
- }
- }
-
- if (queued && change) {
- // If not queued, there was no change of condition as far as
- // outsiders are concerned. (redundant saturatedEvent, only
- // defensive; to guarantee statemachine in sync). else, if the
- // saturation state did not change, we have no state change to
- // notify.
- notifyChange();
- }
-
- performDeferredAction(action);
-
- // Before we return, make sure that this channel remains referenced if
- // it has messages. It could become unreferenced if it is not yet
- // resolved and the application lets go of it after sending messages.
- // This means that we may need to do something only in the resolpending
- // and resolsaturated cases. The way we do this test, there can be false
- // positives. They're dealt with as part of the action that is carried
- // out.
- if ((stateMachine.getState() & (Messenger.RESOLPENDING | Messenger.RESOLSATURATED)) != 0) {
- resolPendingImpl();
- }
-
- return queued;
- }
-
- /**
- * {@inheritDoc}
- */
- public final boolean sendMessageN(Message msg, String rService, String rServiceParam) {
-
- try {
- if (sendMessageCommon(msg, rService, rServiceParam)) {
- // If it worked the message is queued; the outcome will be notified later.
- return true;
- }
- // Non-blocking and queue full: report overflow.
- msg.setMessageProperty(Messenger.class, OutgoingMessageEvent.OVERFLOW);
- } catch (IOException oie) {
- msg.setMessageProperty(Messenger.class, new OutgoingMessageEvent(msg, oie));
- } catch (InterruptedException interrupted) {
- msg.setMessageProperty(Messenger.class, new OutgoingMessageEvent(msg, interrupted));
- }
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public final void sendMessageB(Message msg, String rService, String rServiceParam) throws IOException {
-
- try {
- while (true) {
- // if sendMessageCommon says "true" it worked.
- if (sendMessageCommon(msg, rService, rServiceParam)) {
- return;
- }
- // Do a shallow check on the queue. If it seems empty (without getting into a critical section to
- // verify it), then yielding is good bet. It is a lot cheaper and smoother than waiting.
- // Note the message should be enqueued now. yielding makes sense now if the queue is empty
- if (queue.isEmpty()) {
- Thread.yield();
- }
-
- // If we reached this far, it is neither closed, nor ok. So it was saturated.
- synchronized (stateMachine) {
- // Cheaper than waitState. sendMessageCommon already does the relevant state checks.
- stateMachine.wait();
- }
- }
- } catch (InterruptedException ie) {
- InterruptedIOException iie = new InterruptedIOException("Message send interrupted");
-
- iie.initCause(ie);
- throw iie;
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public final void resolve() {
- DeferredAction action;
-
- synchronized (stateMachine) {
- stateMachine.resolveEvent();
- action = eventCalled(true);
- }
- notifyChange();
- performDeferredAction(action); // we expect connect but let the state machine decide.
- }
-
- /**
- * {@inheritDoc}
- */
- public final int getState() {
- return stateMachine.getState();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public final Messenger getChannelMessenger(PeerGroupID redirection, String service, String serviceParam) {
- // Channels don't make channels.
- return null;
- }
-
- /**
- * Three exposed methods may need to inject new events in the system:
- * sendMessageN, close, and shutdown.
- * Since they can all cause actions, and since connectAction and
- * startAction are deferred, it seems possible that one of the actions
- * caused by send, close, or shutdown be called while connectAction or
- * startAction are in progress.
- * However, the state machine gives us a few guarantees: connectAction
- * and startAction can never nest. We will not be asked to perform one while
- * still performing the other. Only the synchronous actions closeInput,
- * closeOutput, or failAll can possibly be requested in the interval. We
- * could make more assumptions and simplify the code, but rather keep at
- * least some flexibility.
- *
- * DEAD LOCK WARNING: the implementor's method invoke some of our call backs
- * while synchronized. Then our call backs synchronize on the state machine
- * in here. This nesting order must always be respected. As a result, we can
- * never invoke implementors methods while synchronized. Hence the
- * deferredAction processing.
- *
- * @param action the action
- */
- private void performDeferredAction(DeferredAction action) {
- switch (action) {
- case ACTION_SEND:
- startImpl();
- break;
-
- case ACTION_CONNECT:
- connectImpl();
- break;
- }
- }
-
- /**
- * A shortHand for a frequently used sequence. MUST be called while
- * synchronized on stateMachine.
- *
- * @param notifyAll If {@code true} then this is a life-cycle event and all
- * waiters on the stateMachine should be notified. If {@code false} then
- * only a single waiter will be notified for simple activity events.
- * @return the deferred action.
- */
- private DeferredAction eventCalled(boolean notifyAll) {
- DeferredAction action = deferredAction;
-
- deferredAction = DeferredAction.ACTION_NONE;
- if (notifyAll) {
- stateMachine.notifyAll();
- } else {
- stateMachine.notify();
- }
- return action;
- }
-
- /*
- * Implement the methods that our shared messenger will use to report progress.
- */
-
- /**
- * The implementation will invoke this method when it becomes resolved,
- * after connectImpl was invoked.
- */
- protected void up() {
- DeferredAction action;
-
- synchronized (stateMachine) {
- stateMachine.upEvent();
- action = eventCalled(true);
- }
- notifyChange();
- performDeferredAction(action); // we expect start but let the state machine decide.
- }
-
- /**
- * The implementation invokes this method when it becomes broken.
- */
- protected void down() {
- DeferredAction action;
-
- synchronized (stateMachine) {
- stateMachine.downEvent();
- action = eventCalled(true);
- }
- notifyChange();
- performDeferredAction(action); // we expect connect but let the state machine decide.
- }
-
- /**
- * Here, we behave like a queue to the shared messenger. When we report
- * being empty, though, we're automatically removed from the active queues
- * list. We'll go back there the next time we have something to send by
- * calling startImpl.
- *
- * @return pending message
- */
- protected PendingMessage peek() {
-
- PendingMessage theMsg;
- DeferredAction action = DeferredAction.ACTION_NONE;
-
- synchronized (stateMachine) {
- // We like the msg to keep occupying space in the queue until it's
- // out the door. That way, idleness (that is, not currently working
- // on a message), is always consistent with queue emptyness.
-
- theMsg = queue.peek();
- if (theMsg == null) {
- stateMachine.idleEvent();
- action = eventCalled(false);
-
- // We do not notifyChange, here, because, if the queue is empty,
- // it was already notified when the last message was popped. The
- // call to idleEvent is only defensive programming to make extra
- // sure the state machine is in sync.
-
- return null;
- }
-
- if (outputClosed) {
- // We've been asked to stop sending. Which, if we were sending,
- // must be notified by either an idle event or a down
- // event. Nothing needs to happen to the shared messenger. We're
- // just a channel.
- stateMachine.downEvent();
- action = eventCalled(true);
- theMsg = null;
- }
- }
-
- notifyChange();
- performDeferredAction(action); // we expect none but let the state machine decide.
- return theMsg;
- }
-
- /**
- * Returns the number of elements in this collection. If this collection
- * contains more than Integer.MAX_VALUE elements, returns
- * Integer.MAX_VALUE.
- *
- * @return the number of elements in this collection
- */
- protected int size() {
- return queue.size();
- }
-
- /**
- * One message done. Update the saturated/etc state accordingly.
- *
- * @return true if there are more messages after the one we removed.
- */
- protected boolean poll() {
-
- boolean result;
- DeferredAction action;
-
- synchronized (stateMachine) {
- queue.poll();
-
- if (queue.peek() == null) {
- stateMachine.idleEvent();
- action = eventCalled(false);
- result = false;
- } else {
- stateMachine.msgsEvent();
- action = eventCalled(false);
- result = true;
- }
- }
-
- notifyChange();
- performDeferredAction(action); // we expect none but let the state machine decide.
-
- return result;
- }
-
- /**
- * We invoke this method to be placed on the list of channels that have
- * message to send.
- *
- * NOTE that it is the shared messenger responsibility to synchronize so
- * that we cannot be added to the active list just before we get removed
- * due to reporting an empty queue in parallel. So, if we report an empty
- * queue and have a new message to send before the shared messenger removes
- * us form the active list, startImpl will block until the removal is done.
- * Then we'll be added back.
- *
- * If it cannot be done, it means that the shared messenger is no longer
- * usable. It may call down() in sequence. Out of defensiveness, it should
- * do so without holding its lock.
- */
- protected abstract void startImpl();
-
- /**
- * We invoke this method to be placed on the list of channels that are
- * waiting for resolution.
- *
- * If it cannot be done, it means that the shared messenger is no longer
- * usable. It may call down() in sequence. Out of defensiveness, it should
- * do so without holding its lock. If the messenger is already resolved it
- * may call up() in sequence. Same wisdom applies. It is a good idea to
- * create channels in the resolved state if the shared messenger is already
- * resolved. That avoids this extra contortion.
- */
- protected abstract void connectImpl();
-
- /**
- * This is invoked to inform the implementation that this channel is now in
- * the resolPending or resolSaturated state. This is specific to this type
- * of channels. The shared messenger must make sure that this channel
- * remains strongly referenced, even though it is not resolved, because
- * there are messages in it. It is valid for an application to let go of a
- * channel after sending a message, even if the channel is not yet
- * resolved. The message will go if/when the channel resolves. This method
- * may be invoked redundantly and even once the channel is no longer among
- * the one awaiting resolution. The implementation must be careful to
- * ignore such calls.
- */
- protected abstract void resolPendingImpl();
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/ByteArrayMessageElement.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/ByteArrayMessageElement.java
deleted file mode 100644
index f2892b7e..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/ByteArrayMessageElement.java
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.endpoint;
-
-
-import net.jxta.document.MimeMediaType;
-import java.util.logging.Level;
-import net.jxta.logging.Logging;
-import java.util.logging.Logger;
-
-import java.io.*;
-import java.lang.ref.SoftReference;
-import java.util.zip.CRC32;
-import java.util.zip.Checksum;
-
-
-/**
- * A Message Element using byte arrays for the element data.
- *
- * This implementation does not copy the byte array provided and assumes
- * that the contents of the byte array will not change through out the lifetime
- * of the MessageElement.
- *
- * some synchronization is due to optimization in {@link #getBytes(boolean)}
- * which replaces value of internal member {@link #b}.
- */
-public class ByteArrayMessageElement extends MessageElement {
-
- /**
- * Logger
- */
- private static transient final Logger LOG = Logger.getLogger(ByteArrayMessageElement.class.getName());
-
- /**
- * The bytes of this element.
- */
- protected byte[] b;
-
- /**
- * This is the offset of our data within the array
- */
- protected int offset;
-
- /**
- * length of the element data. sometimes the same as b.length, but may be
- * lesser.
- */
- protected int len;
-
- /**
- * Create a new Message Element. The contents of the provided byte array
- * are not copied during construction.
- *
- * @param name Name of the MessageElement. May be the empty string ("") if
- * the MessageElement is not named.
- * @param type Type of the MessageElement. null is the same as specifying
- * the type "Application/Octet-stream".
- * @param b A byte array containing the contents of this element.
- * @param sig optional message digest/digital signature element or null if
- * no signature is desired.
- */
- public ByteArrayMessageElement(String name, MimeMediaType type, byte[] b, MessageElement sig) {
- this(name, type, b, 0, b.length, sig);
- }
-
- /**
- * Create a new MessageElement, The contents of the provided byte array are
- * not copied during construction.
- *
- * @param name Name of the MessageElement. May be the empty string ("") if
- * the MessageElement is not named.
- * @param type Type of the MessageElement. null is the same as specifying
- * the type "Application/Octet-stream".
- * @param b A byte array containing the contents of this element.
- * @param offset all bytes before this location in b
- * will be ignored.
- * @param sig optional message digest/digital signature elemnent or null if
- * no signature is desired.
- */
- public ByteArrayMessageElement(String name, MimeMediaType type, byte[] b, int offset, MessageElement sig) {
- this(name, type, b, offset, b.length - offset, sig);
- }
-
- /**
- * Create a new Element, but dont add it to the message. The contents of
- * the byte array are not copied during construction.
- *
- * @param name Name of the MessageElement. May be the empty string ("") if
- * the MessageElement is not named.
- * @param type Type of the MessageElement. null is the same as specifying
- * the type "Application/Octet-stream".
- * @param b A byte array containing the contents of this Element.
- * @param offset all bytes before this location will be ignored.
- * @param len number of bytes to include
- * @param sig optional message digest/digital signature element or null if
- * no signature is desired.
- */
- public ByteArrayMessageElement(String name, MimeMediaType type, byte[] b, int offset, int len, MessageElement sig) {
- super(name, type, sig);
-
- if (null == b) {
- throw new IllegalArgumentException("byte array must not be null");
- }
-
- if (len < 0) {
- throw new IllegalArgumentException("len must be >= 0 : " + len);
- }
-
- if (offset < 0) {
- throw new IllegalArgumentException("offset must within byte array : " + offset);
- }
-
- if ((0 != len) && (offset >= b.length)) {
- throw new IllegalArgumentException("offset must be positioned within byte array : " + offset + "," + len);
- }
-
- if (((offset + len) > b.length) || ((offset + len) < 0)) {
- throw new IllegalArgumentException("offset + len must be positioned within byte array");
- }
-
- // if we get an empty request and a non-empty buffer, we don't use the provided buffer.
- if ((0 == len) && (0 != b.length)) {
- b = new byte[len];
- offset = 0;
- }
-
- this.b = b;
- this.offset = offset;
- this.len = len;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean equals(Object target) {
- if (this == target) {
- return true;
- }
-
- if (target instanceof MessageElement) {
- if (!super.equals(target)) {
- return false;
- }
-
- if (target instanceof ByteArrayMessageElement) {
- ByteArrayMessageElement likeMe = (ByteArrayMessageElement) target;
-
- synchronized (this) {
- synchronized (likeMe) {
- if (likeMe.len != len) {
- return false;
- }
-
- for (int eachByte = len - 1; eachByte >= 0; eachByte--) {
- if (likeMe.b[likeMe.offset + eachByte] != b[offset + eachByte]) {
- return false;
- }
- }
- }
- }
-
- return true;
- } else {
- // have to do a slow stream comparison.
- // XXX 20020615 bondolo@jxta.org the performance of this could be much improved.
- try {
- MessageElement likeMe = (MessageElement) target;
-
- InputStream myStream = getStream();
- InputStream itsStream = likeMe.getStream();
-
- int mine;
- int its;
-
- do {
- mine = myStream.read();
- its = itsStream.read();
-
- if (mine != its) {
- return false;
- } // content didn't match
-
- } while ((-1 != mine) && (-1 != its));
-
- return ((-1 == mine) && (-1 == its)); // end at the same time?
- } catch (IOException fatal) {
- if (Logging.SHOW_SEVERE && LOG.isLoggable(Level.SEVERE)) {
- LOG.log(Level.SEVERE, "MessageElements could not be compared.", fatal);
- }
-
- throw new IllegalStateException("MessageElements could not be compared." + fatal);
- }
- }
- }
-
- return false; // not a message element
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public synchronized int hashCode() {
- Checksum crc = new CRC32();
-
- crc.update(b, offset, len);
- int dataHash = (int) crc.getValue();
-
- int result = super.hashCode() * 6037 + // a prime
- dataHash;
-
- return (0 != result) ? result : 1;
- }
-
- /**
- * {@inheritDoc}
- *
- * Returns the string representation of this element. The 'charset'
- * parameter of the mimetype, if any, is used to determine encoding. If
- * the charset specified is unsupported then the default encoding will be
- * used.
- *
- * @return String string representation of this message element.
- */
- @Override
- public synchronized String toString() {
- String result;
-
- if (null != cachedToString) {
- result = cachedToString.get();
-
- if (null != result) {
- return result;
- }
- }
-
- if (LOG.isLoggable(Level.FINER)) {
- LOG.finer("creating toString of " + getClass().getName() + '@' + Integer.toHexString(hashCode()));
- }
-
- String charset = type.getParameter("charset");
-
- try {
- if (null == charset) {
- result = new String(b, offset, len);
- } else {
- result = new String(b, offset, len, charset);
- }
- } catch (UnsupportedEncodingException caught) {
- result = new String(b, offset, len);
- }
-
- cachedToString = new SoftReference(result);
-
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public long getByteLength() {
- return len;
- }
-
- /**
- * {@inheritDoc}
- *
- * synchronized so that we can replace our internal buffer with
- * the buffer we are returning if we were using a shared buffer.
- */
- @Override
- public synchronized byte[] getBytes(boolean copy) {
- if ((!copy) && (0 == offset) && (b.length == len)) {
- return b;
- }
-
- byte[] result = new byte[len];
-
- System.arraycopy(b, offset, result, 0, len);
-
- // if we were using a sub-array we can switch to using this copy.
- if (!copy) {
- b = result;
- offset = 0;
- }
-
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- public synchronized InputStream getStream() {
- return new ByteArrayInputStream(b, offset, len);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void sendToStream(OutputStream sendTo) throws IOException {
- byte[] sending;
- int sendingOffset;
-
- // locals enable us to reduce the time which the object is synchronized.
- synchronized (this) {
- sending = b;
- sendingOffset = offset;
- }
-
- sendTo.write(sending, sendingOffset, len);
- }
-
- /**
- * Returns the contents of this element as a byte array. If this elements
- * was originally constructed from a intact byte array, the array returned
- * is a "shared" copy of the byte array used by this element. If this
- * element was constructed with an offset of other than zero and a length
- * different than the length of the source array then this function WILL
- * RETURN A COPY OF THE BYTE ARRAY.
- *
- * @return a byte array containing the contents of this element.
- */
- public byte[] getBytes() {
- return getBytes(false);
- }
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/ChannelMessenger.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/ChannelMessenger.java
deleted file mode 100644
index 38beb662..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/ChannelMessenger.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Copyright (c) 2004-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.endpoint;
-
-
-import net.jxta.peergroup.PeerGroupID;
-
-
-/**
- * A Channel Messenger provides an exclusive interface to the shared messenger.
- *
- * What is typically exclusive is the message queue, addressing parameters
- * that are not usefully shared (serviceName, serviceParam), and if needed
- * cross-group address rewriting parameters.
- *
- * This class is provided as a base for implementing such channel messengers,
- * which are typically what Messenger.getChannelMessenger() needs to return.
- *
- * @see net.jxta.endpoint.EndpointService
- * @see net.jxta.endpoint.EndpointAddress
- * @see net.jxta.endpoint.Message
- */
-public abstract class ChannelMessenger extends AbstractMessenger implements Messenger {
-
- /**
- * insertedServicePrefix This is how all valid inserted services start. This
- * lets us recognize if a message already has an inserted service. Then we
- * must not add another one. Only the top-most one counts. Since insertion
- * is only done here, the constant is defined here. Even if historically it
- * was done within the endpoint implementation, it has become a protocol now.
- */
- public static final String InsertedServicePrefix = "EndpointService:";
-
- private String insertedService;
-
- /**
- * The worker that implements sendMessage-with-listener for this channel. If
- * there's none, sendMessage-with-listener will throw an exception. Channels
- * returned by getMessenger methods all have one already. It is up to the
- * invoker of getChannelMessenger to supply one or not.
- */
- private ListenerAdaptor messageWatcher;
-
- protected String origService;
-
- protected String origServiceParam;
-
- /**
- * Figure out what the service string will be after mangling (if required)
- * and applying relevant defaults.
- *
- * @param service The service name in the unmangled address.
- * @return String The service name in the mangled address.
- */
- protected String effectiveService(String service) {
-
- // No redirection required. Just apply the default service.
- if (insertedService == null) {
- return (service == null) ? origService : service;
- }
-
- // Check if redirection is applicable.
- return ((service != null) && service.startsWith(InsertedServicePrefix)) ? service : insertedService;
- }
-
- /**
- * Figure out what the param string will be after mangling (if required) and
- * applying relevant defaults.
- *
- * @param service The service name in the unmangled address.
- * @param serviceParam The service parameter in the unmangled address.
- * @return String The service parameter in the mangled address.
- */
- protected String effectiveParam(String service, String serviceParam) {
-
- // No redirection required. Or not applicable. Just apply the default param.
- if ((insertedService == null) || ((service != null) && service.startsWith(InsertedServicePrefix))) {
- return (serviceParam == null) ? origServiceParam : serviceParam;
- }
-
- // Apply redirection. We need the effective service, now.
- if (service == null) {
- service = origService;
- }
-
- if (serviceParam == null) {
- serviceParam = origServiceParam;
- }
-
- return ((null != service) && (null != serviceParam)) ? (service + "/" + serviceParam) : service;
- }
-
- /**
- * Give this channel the watcher that it must use whenever sendMessage(...,listener) is used. If not set,
- * sendMessage(..., listener) will throw.
- *
- * @param messageWatcher the listener
- */
- public void setMessageWatcher(ListenerAdaptor messageWatcher) {
- this.messageWatcher = messageWatcher;
- }
-
- /**
- * Create a new ChannelMessenger
- *
- * @param baseAddress The network address messages go to; regardless of service, param, or group.
- * @param groupRedirection Group to which the messages must be redirected. This is used to implement the automatic group
- * segregation which has become a de-facto standard. If not null, the unique portion of the specified groupID is
- * prepended with {@link #InsertedServicePrefix} and inserted in every message's destination address in place of the
- * the original service name, which gets shifted into the beginning of the service parameter. The opposite is done
- * on arrival to restore the original destination address before the message is delivered to the listener in the
- * the specified group. Messages that already bear a group redirection are not affected.
- * @param origService The default destination service for messages sent without specifying a different service.
- * @param origServiceParam The default destination service parameter for messages sent without specifying a different service
- * parameter.
- */
- public ChannelMessenger(EndpointAddress baseAddress, PeerGroupID groupRedirection, String origService, String origServiceParam) {
-
- // FIXME: The inserted service business is really messy. Group seggregation does not have to be the endpoint service's
- // business. It should be specified by the app as part of the destination address. What we're doing here
- // is simply enforcing what could just be a convention.
-
- super(baseAddress);
- if (groupRedirection == null) {
- insertedService = null;
- } else {
- insertedService = InsertedServicePrefix + groupRedirection.getUniqueValue().toString();
- }
- this.origService = origService;
- this.origServiceParam = origServiceParam;
- }
-
- /**
- * {@inheritDoc}
- *
- * By default a channel refuses to make a channel.
- */
- public Messenger getChannelMessenger(PeerGroupID redirection, String service, String serviceParam) {
- return null;
- }
-
- /**
- * {@inheritDoc}
- *
- */
- @Override
- public void sendMessage(Message msg, String service, String serviceParam, OutgoingMessageEventListener listener) {
- if (messageWatcher == null) {
- throw new UnsupportedOperationException("This channel was not configured to emulate this legacy method.");
- }
-
- // Cleanup the message from any existing result prop since we're going to use select.
- msg.setMessageProperty(Messenger.class, null);
-
- // Tell the watcher to select that message.
- messageWatcher.watchMessage(listener, msg);
-
- sendMessageN(msg, service, serviceParam);
- }
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/EndpointAddress.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/EndpointAddress.java
deleted file mode 100644
index e804f579..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/EndpointAddress.java
+++ /dev/null
@@ -1,637 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-package net.jxta.endpoint;
-
-import net.jxta.id.ID;
-import net.jxta.logging.Logging;
-
-import java.lang.ref.SoftReference;
-import java.net.URI;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Describes a destination to which JXTA messages may be sent. This may be:
- *
- *
- *
- *
A Pipe
- *
A Peergroup (propagate)
- *
A Peer
- *
A Message Transport for a Peer
- *
- *
- * An Endpoint Address is a specialized interpretation of a URI.
- * Wherever it makes sense you should use a URI in preference to an Endpoint
- * Address. An Endpoint Address is composed of four components: a protocol
- * (also called a scheme), a protocol address (also called an authority), an
- * optional service name and optional service parameter.
- *
- * The Protocol
- *
Describes the method of addressing used by the remainder of the
- * endpoint address.
- *
Indicates how the address will be resolved, ie. who will resolve it.
- *
Corresponds to the "scheme" portion of a URI in W3C parlance.
- *
May not contain the ":" character.
- *
- *
- * The Protocol Address
- *
Describes the destination entity of this address.
- *
Form is dependant upon the protocol being used.
- *
Corresponds to the "Authority" portion of a URI in W3C parlance.
- *
May not contain the "/" character.
- *
- *
- * The Service Name (optional)
- *
Describes the service that is the destination. A service cannot be
- * a protocol address because a service must have a location; a group or a
- * specific peer.
- *
Form is dependant upon service intent. This is matched as a UTF8
- * string.
- *
May not contain the "/" character.
- *
- *
- * The Service Parameter (optional)
- *
Describes parameters for the service.
- *
Form is dependant upon service intent. This is matched as a UTF-8
- * string (if it is used for matching).
- *
- *
- * @see net.jxta.endpoint.EndpointService
- * @see net.jxta.endpoint.MessageTransport
- * @see net.jxta.endpoint.Messenger
- * @see net.jxta.pipe.PipeService
- */
-public class EndpointAddress {
-
- /**
- * Logger
- */
- private static final Logger LOG = Logger.getLogger(EndpointAddress.class.getName());
-
- /**
- * If {@code true} then endpoint addresses based upon IDs are represented
- * using the "jxta://" form. If false then they are presented using the
- * "urn:jxta:" form. The two forms are meant to be logically equivalent.
- */
- private final static boolean IDS_USE_JXTA_URL_FORM = true;
-
- /**
- * The default protocol value for Endpoint Addresses based upon JXTA IDs.
- */
- private final static String JXTA_ID_PROTOCOL = ID.URIEncodingName + ":" + ID.URNNamespace;
-
- /**
- * if true then the address is a url, otherwise its a uri (likely a urn).
- */
- private boolean hierarchical = true;
-
- /**
- * Describes the method of addressing used by the remainder of the
- * endpoint address.
- */
- private String protocol = null;
-
- /**
- * Describes the destination entity of this address.
- */
- private String protocolAddress = null;
-
- /**
- * Describes the service that is the destination.
- */
- private String service = null;
-
- /**
- * Describes parameters for the service.
- */
- private String serviceParam = null;
-
- /**
- * cached calculated hash code.
- */
- private transient int cachedHashCode = 0;
-
- /**
- * cached copy of string representation.
- */
- private transient SoftReference cachedToString = null;
-
- /**
- * Returns an unmodifiable clone of the provided EndpointAddress.
- *
- * @param address the address to be cloned.
- * @return the unmodifiable address clone.
- * @deprecated All EndpointAddresses are now unmodifiable so this method is
- * no longer needed.
- */
- @Deprecated
- public static EndpointAddress unmodifiableEndpointAddress(EndpointAddress address) {
- return address;
- }
-
- /**
- * Builds an Address from a string
- *
- * @param address the string representation of the address.
- */
- public EndpointAddress(String address) {
- parseURI(address);
- }
-
- /**
- * Create an EndpointAddress whose value is initialized from the provided
- * URI.
- *
- * @param address the URI representation of the address.
- */
- public EndpointAddress(URI address) {
- this(address.toString());
- }
-
- /**
- * Constructor which builds an endpoint address from a base address and
- * replacement service and params
- *
- * @param base The EndpointAddress on which the new EndpointAddress will be based
- * @param service The service name for the endpoint address or
- * {@code null} if there is no service name.
- * @param serviceParam The service parameter for the endpoint address or
- * {@code null} if there is no parameter.
- */
- public EndpointAddress(EndpointAddress base, String service, String serviceParam) {
- setProtocolName(base.getProtocolName());
- setProtocolAddress(base.getProtocolAddress());
- setServiceName(service);
- setServiceParameter(serviceParam);
- }
-
- /**
- * Constructor which builds an address the four standard constituent parts.
- *
- * @param protocol The addressing scheme to be used for the endpoint address.
- * @param address The destination for the endpoint address.
- * @param service The service name for the endpoint address or
- * {@code null} if there is no service name.
- * @param serviceParam The service parameter for the endpoint address or
- * {@code null} if there is no parameter.
- */
- public EndpointAddress(String protocol, String address, String service, String serviceParam) {
- setProtocolName(protocol);
- setProtocolAddress(address);
- setServiceName(service);
- setServiceParameter(serviceParam);
- }
-
- /**
- * Constructor which builds an address from a standard jxta id and a
- * service and param.
- *
- * @param id the ID which will be the destination of the endpoint address.
- * @param service The service name for the endpoint address or
- * {@code null} if there is no service name.
- * @param serviceParam The service parameter for the endpoint address or
- * {@code null} if there is no parameter.
- */
- public EndpointAddress(ID id, String service, String serviceParam) {
- setProtocolName(JXTA_ID_PROTOCOL);
- setProtocolAddress(id.getUniqueValue().toString());
- setServiceName(service);
- setServiceParameter(serviceParam);
- }
-
- /**
- * {@inheritDoc}
- *
- * @deprecated EndpointAddress objects are immutable and never need to be
- * cloned.
- */
- @Override
- @Deprecated
- public EndpointAddress clone() {
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean equals(Object target) {
- if (this == target) {
- return true;
- }
-
- if (target instanceof EndpointAddress) {
- EndpointAddress likeMe = (EndpointAddress) target;
-
- boolean result = (hierarchical == likeMe.hierarchical) && protocol.equalsIgnoreCase(likeMe.protocol)
- && protocolAddress.equalsIgnoreCase(likeMe.protocolAddress)
- && ((service != null)
- ? ((likeMe.service != null) && service.equals(likeMe.service))
- : (likeMe.service == null))
- && ((serviceParam != null)
- ? ((likeMe.serviceParam != null) && serviceParam.equals(likeMe.serviceParam))
- : (likeMe.serviceParam == null));
-
- return result;
- }
-
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int hashCode() {
- if (0 == cachedHashCode) {
- int calcedHashCode = protocol.toLowerCase().hashCode();
-
- calcedHashCode += protocolAddress.hashCode() * 5741; // a prime
- calcedHashCode += ((service != null) ? service.hashCode() : 1) * 7177; // a prime
- calcedHashCode += ((serviceParam != null) ? serviceParam.hashCode() : 1) * 6733; // a prime
-
- cachedHashCode = (0 == calcedHashCode) ? 1 : calcedHashCode;
- }
-
- return cachedHashCode;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public synchronized String toString() {
- String result;
-
- if (null != cachedToString) {
- result = cachedToString.get();
-
- if (null != result) {
- return result;
- }
- }
-
- StringBuilder newResult = new StringBuilder(protocol.length() + protocolAddress.length() + 64);
-
- newResult.append(protocol);
-
- if (hierarchical) {
- newResult.append("://");
- } else {
- newResult.append(':');
- }
-
- newResult.append(protocolAddress);
-
- if (null != service) {
- if (hierarchical) {
- newResult.append('/');
- } else {
- newResult.append('#');
- }
- newResult.append(service);
-
- if (null != serviceParam) {
- newResult.append('/');
- newResult.append(serviceParam);
- }
- }
-
- result = newResult.toString();
-
- cachedToString = new SoftReference(result);
-
- return result;
- }
-
- /**
- * Return a URI which represents the endpoint address.
- *
- * @return a URI which represents the endpoint address.
- */
- public URI toURI() {
- return URI.create(toString());
- }
-
- /**
- * Return a String that contains the name of the protocol
- * contained in the EndpointAddress
- *
- * @return a String containing the protocol name
- */
- public String getProtocolName() {
- return protocol;
- }
-
- /**
- * Return a String that contains the protocol address contained
- * in the EndpointAddress
- *
- * @return a String containing the protocol address
- */
- public String getProtocolAddress() {
- return protocolAddress;
- }
-
- /**
- * Return a String that contains the service name contained in
- * the EndpointAddress
- *
- * @return a String containing the service name
- */
- public String getServiceName() {
- return service;
- }
-
- /**
- * Return a String that contains the service parameter contained
- * in the EndpointAddress
- *
- * @return a String containing the protocol name
- */
- public String getServiceParameter() {
- return serviceParam;
- }
-
- /**
- * Set the protocol name.
- *
- * @param name String containing the name of the protocol
- */
- private void setProtocolName(String name) {
- if ((null == name) || (0 == name.length())) {
- throw new IllegalArgumentException("name must be non-null and contain at least one character");
- }
-
- if (-1 != name.indexOf("/")) {
- throw new IllegalArgumentException("name may not contain '/' character");
- }
-
- // XXX 20070207 bondolo We explicitly force all use of either "jxta" or "urn:jxta" to our prefered form.
- if (IDS_USE_JXTA_URL_FORM) {
- if (JXTA_ID_PROTOCOL.equals(name)) {
- name = "jxta";
- }
- } else {
- if ("jxta".equals(name)) {
- name = JXTA_ID_PROTOCOL;
- }
- }
-
- int colonAt = name.indexOf(':');
-
- if (-1 == colonAt) {
- hierarchical = true;
- } else {
- if (!"urn".equalsIgnoreCase(name.substring(0, colonAt))) {
- throw new IllegalArgumentException("Only urn may contain colon");
- }
-
- if (colonAt == (name.length() - 1)) {
- throw new IllegalArgumentException("empty urn namespace!");
- }
-
- hierarchical = false;
- }
-
- protocol = name;
- cachedToString = null;
- }
-
- /**
- * Set the protocol address.
- *
- * @param address String containing the peer address.
- */
- private void setProtocolAddress(String address) {
- if ((null == address) || (0 == address.length())) {
- throw new IllegalArgumentException("address must be non-null and contain at least one character");
- }
-
- if (-1 != address.indexOf("/")) {
- throw new IllegalArgumentException("address may not contain '/' character");
- }
-
- protocolAddress = address;
- cachedToString = null;
- }
-
- /**
- * Set the service name.
- *
- * @param name String containing the name of the destination service
- */
- private void setServiceName(String name) {
- if (null != name) {
- if (-1 != name.indexOf("/")) {
- throw new IllegalArgumentException("service name may not contain '/' character");
- }
- }
-
- service = name;
- cachedToString = null;
- }
-
- /**
- * Set the service parameter
- *
- * @param param String containing the service parameter
- */
- private void setServiceParameter(String param) {
- serviceParam = param;
- cachedToString = null;
- }
-
- /**
- * Parse any EndpointAddress from a URI
- *
- * @param addr endpoint address to parse
- */
- private void parseURI(String addr) {
- int index = addr.indexOf("://");
-
- if (index == -1) {
- parseURN(addr);
- } else {
- parseURL(addr);
- }
- }
-
- /**
- * Parse an EndpointAddress from a URN
- *
- * @param addr endpoint address to parse
- */
- private void parseURN(String addr) {
- int protocolEnd = addr.indexOf(':');
-
- if (-1 == protocolEnd) {
- if (Logging.SHOW_FINE && LOG.isLoggable(Level.FINE)) {
- LOG.fine("Address is not a valid URI: " + addr);
- }
- throw new IllegalArgumentException("Address is not a valid URI: " + addr);
- }
-
- if (!"urn".equalsIgnoreCase(addr.substring(0, protocolEnd))) {
- if (Logging.SHOW_FINE && LOG.isLoggable(Level.FINE)) {
- LOG.fine("Address is unrecognized URI form: " + addr);
- }
- throw new IllegalArgumentException("Address is unrecognized URI form: " + addr);
- }
-
- if ((addr.length() - 1) == protocolEnd) {
- if (Logging.SHOW_FINE && LOG.isLoggable(Level.FINE)) {
- LOG.fine("Address URN does not have a namespace: " + addr);
- }
- throw new IllegalArgumentException("Address URN does not have a namespace: " + addr);
- }
-
- // gather the namespace as well.
- int namespaceEnd = addr.indexOf(':', protocolEnd + 1);
-
- if (-1 == namespaceEnd) {
- if (Logging.SHOW_FINE && LOG.isLoggable(Level.FINE)) {
- LOG.fine("Address URN does not have a namespace: " + addr);
- }
- throw new IllegalArgumentException("Address URN does not have a namespace: " + addr);
- }
-
- setProtocolName(addr.substring(0, namespaceEnd));
-
- if ((addr.length() - 1) == namespaceEnd) {
- if (Logging.SHOW_FINE && LOG.isLoggable(Level.FINE)) {
- LOG.fine("Address URN does not have a NSS portion: " + addr);
- }
- throw new IllegalArgumentException("Address URN does not have a NSS portion: " + addr);
- }
-
- // check for service and param
- int nssEnd = addr.indexOf('#', namespaceEnd + 1);
-
- if (-1 == nssEnd) {
- setProtocolAddress(addr.substring(namespaceEnd + 1));
- } else {
- setProtocolAddress(addr.substring(namespaceEnd + 1, nssEnd));
-
- int serviceEnd = addr.indexOf('/', nssEnd + 1);
-
- if (-1 == serviceEnd) {
- setServiceName(addr.substring(nssEnd + 1));
- } else {
- setServiceName(addr.substring(nssEnd + 1, serviceEnd));
-
- setServiceParameter(addr.substring(serviceEnd + 1));
- }
- }
- }
-
- /**
- * Parse and EndpointAddress from a URL
- *
- * @param addr endpoint address to parse
- */
- private void parseURL(String addr) {
- String remainder;
-
- int index = addr.indexOf("://");
-
- if (index == -1) {
- if (Logging.SHOW_FINE && LOG.isLoggable(Level.FINE)) {
- LOG.fine("Address is not in absolute form: " + addr);
- }
- throw new IllegalArgumentException("Address is not in absolute form: " + addr);
- }
-
- if (0 == index) {
- if (Logging.SHOW_FINE && LOG.isLoggable(Level.FINE)) {
- LOG.fine("Protocol is missing: " + addr);
- }
- throw new IllegalArgumentException("Protocol is missing: " + addr);
- }
-
- try {
- setProtocolName(addr.substring(0, index));
- remainder = addr.substring(index + 3);
- } catch (Exception e) {
- if (Logging.SHOW_FINE && LOG.isLoggable(Level.FINE)) {
- LOG.fine("Protocol address is missing: " + addr);
- }
- throw new IllegalArgumentException("Protocol address is missing: " + addr);
- }
- index = remainder.indexOf("/");
- if (index == -1) {
- setProtocolAddress(remainder);
- return;
- }
-
- setProtocolAddress(remainder.substring(0, index));
-
- remainder = remainder.substring(index + 1);
-
- index = remainder.indexOf("/");
- if (index == -1) {
- setServiceName(remainder);
- return;
- }
-
- setServiceName(remainder.substring(0, index));
-
- remainder = remainder.substring(index + 1);
-
- setServiceParameter(remainder);
- }
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/EndpointListener.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/EndpointListener.java
deleted file mode 100644
index a61d3cc9..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/EndpointListener.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.endpoint;
-
-
-/**
- * A listener for messages. The listener is invoked for each incoming message
- * which is destined for this listener. Various services register
- *
- * @see net.jxta.endpoint.EndpointService
- * @see net.jxta.endpoint.EndpointAddress
- * @see net.jxta.endpoint.Message
- */
-public interface EndpointListener {
-
- /**
- * This method is invoked by the EndpointService for each incoming message
- * which is addressed to this listener.
- *
- * @param message Incoming message
- * @param srcAddr Endpoint Address of the source of the message.
- * @param dstAddr Endpoint Address of the destination of the message.
- */
- public void processIncomingMessage(Message message, EndpointAddress srcAddr, EndpointAddress dstAddr);
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/EndpointService.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/EndpointService.java
deleted file mode 100644
index 27a8bf3c..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/EndpointService.java
+++ /dev/null
@@ -1,552 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.endpoint;
-
-
-import net.jxta.peergroup.PeerGroup;
-import net.jxta.service.Service;
-
-import java.io.IOException;
-import java.util.Iterator;
-
-
-/**
- * The EndpointService provides the API for sending and receiving messages
- * between peers. In general, applications and services use the
- * {@link net.jxta.pipe.PipeService}, or {@link net.jxta.socket.JxtaSocket}
- * rather than using this API directly.
- */
-public interface EndpointService extends Service, EndpointListener {
-
- /**
- * Low Priority Messenger Event Listener.
- */
- public static final int LowPrecedence = 0;
-
- /**
- * Medium Priority Messenger Event Listener.
- */
- public static final int MediumPrecedence = 1;
-
- /**
- * High Priority Messenger Event Listener.
- */
- public static final int HighPrecedence = 2;
-
- /**
- * Returns the group to which this EndpointService is attached.
- *
- * @return the group.
- */
- public PeerGroup getGroup();
-
- /**
- * Returns a messenger to the specified destination.
- *
- * The canonical messenger is shared between all channels who's
- * destination contain the same protocol name and protocol address, in all
- * groups that have access to the same transport. The ChannelMessenger
- * returned is configured to send messages to the specified service name and
- * service param when these are not specified at the time of sending.
- *
- * The channel will also ensure delivery to this EndpointService's group
- * on arrival. The channel is not shared with any other module. That is,
- * each endpoint service interface object (as returned by {@link
- * net.jxta.peergroup.PeerGroup#getEndpointService()}) will return a
- * different channel messenger for the same destination. However, there is
- * no guarantee that two invocations of the same endpoint service interface
- * object for the same destination will return different channel objects.
- * Notably, if the result of a previous invocation is still strongly
- * referenced and in a {@link Messenger#USABLE} state, then that is what
- * this method will return.
- *
- * This method returns immediately. The messenger is not necessarily
- * resolved (the required underlying connection established, for example),
- * and it might never resolve at all. Changes in the state of a messenger
- * may monitored with {@link Messenger#getState} and
- * {@link Messenger#waitState}. One may monitor multiple
- * {@link Messenger messengers} (and {@link Message Messages}) at a time by
- * using a {@link net.jxta.util.SimpleSelector}. One may also arrange to
- * have a listener invoked when resolution is complete by using
- * {@link ListenerAdaptor}.
- *
- * The {@code hint} is interpreted by the transport. The only transport
- * known to consider hints is the endpoint router, and the hint is a route.
- * As a result, if addr is in the form: jxta://uniqueID, then hint may be a
- * RouteAdvertisement. If that route is valid the router will add it to
- * it's cache of route and may then use it to successfully create a messenger
- * to the given destination. There is no guarantee at this time that the
- * route will end up being the one specified, nor that this route will be
- * used only for this messenger (likely the opposite), nor that it will
- * remain in use in the future, nor that it will be used at all. However, if
- * there is no other route, and if the specified route is valid, it will be
- * used rather than seeking an alternative.
- *
- * @param addr The complete destination address.
- * @param hint A optional hint to be supplied to whichever transport ends-up
- * making the real messenger. May be {@code null}, when no hint applies.
- * @return A messenger for the specified destination address or {@code null}
- * if the address is not handled by any of the available Message Transports.
- * The messenger, if returned, is not necessarily functional, nor resolved.
- * @see net.jxta.endpoint.ChannelMessenger
- */
- public Messenger getMessengerImmediate(EndpointAddress addr, Object hint);
-
- /**
- * Returns a messenger for the specified destination address.
- *
- * Behaves like {@link #getMessengerImmediate(EndpointAddress,Object)},
- * except that the invoker is blocked until the Messenger either resolves or
- * it is determined that no usable messenger can be created.
- *
- * @param addr The destination address.
- * @param hint A optional hint to be supplied to whichever transport ends-up
- * making the real messenger. May be {@code null}, when no hint applies.
- * @return A messenger for the specified destination address or {@code null}
- * if the destination address is not reachable.
- */
- public Messenger getMessenger(EndpointAddress addr, Object hint);
-
- /**
- * Creates and maps a canonical messenger to the specified destination.
- *
- * Behaves like {@link #getMessengerImmediate(EndpointAddress,Object)}
- * except that it returns a canonical messenger.
- *
- * The messenger is said to be canonical, because there is only one such
- * live object for any given destination address. The term "live",
- * here means that the messenger is not in any of the
- * {@link Messenger#TERMINAL} states as defined by {@link MessengerState}.
- * Therefore, for a given destination there may be any number of messengers
- * in a {@link Messenger#TERMINAL} state, but at most one in any other state.
- * As long as such an object exists, all calls to
- * {@code getCanonicalMessenger()} for the same address return this very
- * object.
- *
- * When first created, a canonical messenger is usually in the
- * {@link Messenger#UNRESOLVED} state. It becomes resolved by obtaining an
- * actual transport messenger to the destination upon the first attempt at
- * using it or when first forced to attempt resolution. Should resolution
- * fail at that point, it becomes {@link Messenger#UNRESOLVABLE}. Otherwise,
- * subsequent, failures are repaired automatically by obtaining a new
- * transport messenger when needed. If a failure cannot be repaired, the
- * messenger becomes {@link Messenger#BROKEN}.
- *
- * {@code getCanonicalMessenger()} is a recursive function.
- * Exploration of the parent endpoint is done automatically.
- *
- * Note 1: This method is the most fundamental messenger
- * instantiation method. It creates a different messenger for each variant
- * of destination address passed to the constructor. In general invokers
- * should use plain addresses; stripped of any service-specific destination.
- *
- * Note 2: The messengers that this method returns, are not
- * generally meant to be used directly. They provide a single queue for all
- * invokers, and do not perform group redirection and only support only a
- * subset of the {@code sendMessage()} methods. One must get a properly
- * configured channel in order to send messages.
- *
- * If one of the other {@code getMessenger()} methods fits the
- * application needs, it should be preferred.
- *
- * @param addr The destination address. It is recommended, though not
- * mandatory, that the address be stripped of its service name and service
- * param elements.
- * @param hint An object, of a type specific to the protocol of the address,
- * that may be provide additional information to the transport in
- * establishing the connection. Typically but not necessarily, this is a
- * route advertisement. If the transport cannot use the hint, or if it is
- * {@code null}, it will be ignored.
- * @return A Canonical messenger that obtains transport messengers to the
- * specified address, from LOCAL transports. Returns {@code null} if no
- * local transport handles this type address.
- */
- public Messenger getCanonicalMessenger(EndpointAddress addr, Object hint);
-
- /**
- * Removes the specified listener.
- *
- * @param listener The listener that would have been called.
- * @param priority Priority set from which to remove this listener.
- * @return true if the listener was removed, otherwise false.
- */
- public boolean removeMessengerEventListener(MessengerEventListener listener, int priority);
-
- /**
- * Adds the specified listener for all messenger creation.
- *
- * @param listener The listener that will be called.
- * @param priority Order of precedence requested (from 0 to 2). 2 has the
- * highest precedence. Listeners are called in decreasing order of
- * precedence. Listeners with equal precedence are called in an unspecified
- * order. There cannot be more than one listener object for a given
- * precedence. Redundant calls have no effect.
- * @return true if the listener was added, otherwise false.
- */
- public boolean addMessengerEventListener(MessengerEventListener listener, int priority);
-
- /**
- * Propagates (broadcasts) a message via all available Message Transports.
- * Each Message Transport that implements propagation will send the message
- * using it's broadcast functionality to a configured broadcast address. Any
- * peers in the same network scope listening on that broadcast address will
- * receive the propagated message.
- *
- * The message will be sent using the default TTL value (which is
- * unspecified).
- *
- * @param message The message to be propagated. The message will not be
- * modified by this method.
- * @param serviceName The name of the destination service.
- * @param serviceParam An optional parameter for the destination service or
- * {@code null}.
- * @throws IOException Thrown if the message could not be propagated.
- */
- public void propagate(Message message, String serviceName, String serviceParam) throws IOException;
-
- /**
- * Propagates (broadcasts) a message via all available Message Transports.
- * Each Message Transport that implements propagation will send the message
- * using it's broadcast functionality to a configured broadcast address. Any
- * peers in the same network scope listening on that broadcast address will
- * receive the propagated message.
- *
- * @param message The message to be propagated. The message will not be
- * modified by this method.
- * @param serviceName The name of the destination service.
- * @param serviceParam An optional parameter for the destination service or
- * {@code null}.
- * @param initialTTL The requested initial TTL for this message. The actual
- * TTL value used may be lower than this value but will never be higher.
- */
- public void propagate(Message message, String serviceName, String serviceParam, int initialTTL);
-
- /**
- * Verifies that the given address can be reached. The method, and accuracy
- * of the verification depends upon each Message Transport. In some cases
- * the address may be contacted to determine connectivity but this is not
- * guaranteed.
- *
- * @param addr is the Endpoint Address to ping.
- * @return {@code true} if the address can be reached otherwise {@code false}.
- * @deprecated The cost of performing this operation is generally the same
- * as getting a Messenger for the destination. Using {@code getMessenger()}
- * is a better approach because the resulting Messenger is generally needed
- * soon after ping.
- */
- @Deprecated
- public boolean ping(EndpointAddress addr);
-
- /**
- * Add a listener for the specified address.
- *
- * A single registered listener will be called for incoming messages
- * when (in order of preference) :
- *
The service name and service parameter match exactly to the
- * service name and service parameter specified in the destination
- * address of the message.
- *
- *
The service name matches exactly the service name from the
- * message destination address and service parameter is {@code null}.
- *
- *
- *
- * @param listener The listener which will be called when messages are
- * received for the registered destination.
- * @param serviceName The name of the service destination which will be
- * matched against incoming message destination endpoint addresses.
- * @param serviceParam An optional service parameter value which will be
- * matched against destination endpoint addresses. May be null.
- * @return true if the listener was registered, otherwise false.
- */
- public boolean addIncomingMessageListener(EndpointListener listener, String serviceName, String serviceParam);
-
- /**
- * Get the listener for the specified address.
- *
- * @param serviceName The service name to which the listener is registered.
- * @param serviceParam The service parameter to which the listener is
- * registered. May be {@code null}.
- * @return The currently registered listener or {@code null} if there is no
- * listener for the specified name and parameter.
- */
- public EndpointListener getIncomingMessageListener(String serviceName, String serviceParam);
-
- /**
- * Remove the listener for the specified address.
- *
- * @param serviceName The service name to which the listener is registered.
- * @param serviceParam The service parameter to which the listener is
- * registered. May be {@code null}.
- * @return The listener which was removed or {@code null} if there was
- * no listener for the specified name and parameter.
- */
- public EndpointListener removeIncomingMessageListener(String serviceName, String serviceParam);
-
- /**
- * Registers a message filter listener. Each message will be tested against
- * the list of filters as part of its sending or receiving.
- *
- * The listener is invoked for a message when:
- *
- *
The message contains a message element which matches exactly the
- * values specified by namespace and name.
- *
- *
The message contains a message element who's namespace value
- * matches exactly the specified namespace value and the specified name is
- * {@code null}.
- *
- *
The message contains a message element who's names value matches
- * exactly the specified name value and the specified namespace is
- * {@code null}.
- *
- *
The specified name value and the specified namespace are both
- * {@code null}.
- *
- *
- * @param listener The filter which will be called.
- * @param namespace Only messages containing elements of this namespace
- * which also match the 'name' parameter will be processed. {@code null}
- * may be use to specify all namespaces.
- * @param name only messages containing elements of this name which also
- * match the 'namespace' parameter will be processed. {@code null} may be
- * use to specify all names.
- */
- public void addIncomingMessageFilterListener(MessageFilterListener listener, String namespace, String name);
-
- /**
- * Registers a message filter listener. Each message will be tested against
- * the list of filters as part of its sending or receiving.
- *
- * The listener is invoked for a message when:
- *
- *
The message contains a message element which matches exactly the
- * values specified by namespace and name.
- *
- *
The message contains a message element who's namespace value
- * matches exactly the specified namespace value and the specified name is
- * {@code null}.
- *
- *
The message contains a message element who's names value matches
- * exactly the specified name value and the specified namespace is
- * {@code null}.
- *
- *
The specified name value and the specified namespace are both
- * {@code null}.
- *
- *
- * @param listener The filter which will be called.
- * @param namespace Only messages containing elements of this namespace
- * which also match the 'name' parameter will be processed. {@code null}
- * may be used to specify all namespaces.
- * @param name only messages containing elements of this name which also
- * match the 'namespace' parameter will be processed. {@code null} may be
- * use to specify all names.
- */
- public void addOutgoingMessageFilterListener(MessageFilterListener listener, String namespace, String name);
-
- /**
- * Removes the given listener previously registered under the given element
- * name
- *
- * @param listener the listener to remove
- * @param namespace the name space
- * @param name the name
- * @return the removed listener
- */
- public MessageFilterListener removeIncomingMessageFilterListener(MessageFilterListener listener, String namespace, String name);
-
- /**
- * Removes the given listener previously registered under the given element
- * name.
- *
- * @param listener the listener to remove
- * @param namespace the name space
- * @param name the name
- * @return the removed listener
- */
- public MessageFilterListener removeOutgoingMessageFilterListener(MessageFilterListener listener, String namespace, String name);
-
- /**
- * Delivers the provided message to the correct listener as specified by
- * the message's destination address.
- *
- * Two additional common message elements are optionally used by Message
- * Transports in conjunction with the Endpoint Service. Message Transports
- * may typically provide received messages to the Endpoint Service
- * containing these elements and the Endpoint service will dispatch the
- * messages based upon their content. Message Transports may use alternate
- * mechanisms for determining message source and destination addresses and
- * need not use these elements.
- *
- * The {@code jxta:EndpointSourceAddress} Message Element contains an
- * Endpoint Address for the source of this message. The source address has a
- * variety of meanings based upon the usage of the underlying Message
- * Transport. For low level transports such as TCP or HTTP the source
- * address is the return address of the peer from which the message was
- * received, ie. the hop address. For higher level Message Transports such
- * as the Endpoint Router Transport or the TLS transport the source address
- * is the virtual Endpoint Address of the peer which originated the message
- * regardless of any intervening hops the message may have made.
- *
- * The {@code jxta:EndpointDestinationAddress} Message Element contains an
- * Endpoint Address which will be used by the Endpoint Service to dispatch a
- * received message to the recipient specified by the service name and
- * service parameter. The protocol address is also provided to the recipient
- * service and can be used in some protocols for determining how the message
- * was received. For example a service may wish to handle messages which
- * were sent directly differently than messages which were sent via
- * propagation.
- *
- * @param msg The message to be delivered.
- * @deprecated Please convert your code to use the
- * {@link EndpointListener#processIncomingMessage(Message,EndpointAddress,EndpointAddress)}
- * method instead. The addressing method used by demux() was never part of
- * the formal JXTA protocol specification but was a defacto part because
- * demux() depended upon it.
- */
- @Deprecated
- public void demux(Message msg);
-
- /**
- * Adds the specified MessageTransport to this endpoint. A MessageTransport
- * may only be added if there are no other equivalent MessageTransports
- * available (as determined by {@link Object#equals(Object) equals()}).
- *
- * The MessageTransport becomes usable by the endpoint service to send
- * unicast messages and optionally propagation and ping messages if it is a
- * {@link net.jxta.endpoint.MessageSender}. The endpoint service becomes
- * usable by this MessageTransport to handle incoming messages if it is a
- * {@link MessageReceiver}.
- *
- * @param transport the MessageTransport to be installed.
- * @return A messenger event listener to invoke when incoming messengers are
- * created or {@code null} if the MessageTransport was not installed.
- */
- public MessengerEventListener addMessageTransport(MessageTransport transport);
-
- /**
- * Removes the given MessageTransport protocol from this endpoint service.
- *
- * Transports remove themselves from the list when stopped. This method
- * is normally only called from the stoppApp method of the transport. To
- * cleanly remove a transport, call the transport's
- * {@link net.jxta.platform.Module#stopApp() stopApp()}and allow it to call
- * this method.
- *
- * @param transpt the MessageTransport to be removed.
- * @return {@code true} if the Message Transport was removed, otherwise
- * {@code false}.
- */
- public boolean removeMessageTransport(MessageTransport transpt);
-
- /**
- * Get an iterator of the MessageTransports available to this
- * EndpointService.
- *
- * @return the iterator of all message transports.
- */
- public Iterator getAllMessageTransports();
-
- /**
- * Get a Message Transport by protocol name.
- *
- * @param name The protocol name of the MessageTransport.
- * @return The Message Transport for the specified protocol name or
- * {@code null} if there is no matching Message Transport
- */
- public MessageTransport getMessageTransport(String name);
-
- /**
- * Returns a Messenger that may be used to send messages via this endpoint
- * to the specified destination.
- *
- * @param addr the destination address.
- * @return The messenger or {@code null} is returned if the destination
- * address is not reachable.
- */
- public Messenger getMessenger(EndpointAddress addr);
-
- /**
- * Asynchronously acquire a messenger for the specified address. The
- * listener will be called when the messenger has been constructed.
- *
- * @param listener the listener to call when the messenger is ready.
- * @param addr the destination for the messenger.
- * @param hint the messenger hint, if any, otherwise null.
- * @return {@code true} if the messenger is queued for construction
- * otherwise {@code false}.
- * @deprecated This method is being phased out. Prefer one of the other
- * non-blocking variants. If a listener style paradigm is required, use
- * {@link ListenerAdaptor} which emulates this functionality.
- */
- @Deprecated
- public boolean getMessenger(MessengerEventListener listener, EndpointAddress addr, Object hint);
-
- /**
- * Returns a Direct Messenger that may be used to send messages via this endpoint to the specified destination.
- *
- * Direct messengers are non self destructive, they must be explicilty closed.
- *
- * @param addr the destination address.
- * @param hint the messenger hint, if any, otherwise null.
- * @param exclusive if true avoids caching the messenger
- * @return The messenger or {@code null} is returned if the destination address is not reachable.
- * @throws IllegalArgumentException if hint is not of RouteAdvertisement, or PeerAdvertisement type.
- */
- public Messenger getDirectMessenger(EndpointAddress addr, Object hint, boolean exclusive);
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/InputStreamMessageElement.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/InputStreamMessageElement.java
deleted file mode 100644
index 16b30edc..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/InputStreamMessageElement.java
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-
-package net.jxta.endpoint;
-
-
-import net.jxta.document.MimeMediaType;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.SequenceInputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.zip.CRC32;
-import java.util.zip.Checksum;
-
-
-/**
- * A Message Element using {@link java.io.InputStream} as the source for the
- * element data. This implementation copies all of the data from the stream at
- * the time of creation.
- *
- * InputStreamMessageElement is not as efficient as other message element types
- * and should only be used when an input stream is the only available source for
- * the element data.
- */
-public class InputStreamMessageElement extends MessageElement {
-
- /**
- * The bytes of this element.
- */
- protected final List databytes;
-
- /**
- * The length of the data.
- */
- protected final long length;
-
- /**
- * Cached Hash Code
- */
- protected transient int cachedHashCode = 0;
-
- /**
- * Create a new MessageElement. This constructor copies the data as needed
- * and closes the stream upon completion.
- *
- * @param name Name of the MessageElement. May be the empty string ("") if
- * the MessageElement is not named.
- * @param type Type of the MessageElement. null is the same as specifying
- * the type "Application/Octet-stream".
- * @param in the stream containing the body of the MessageElement. The
- * stream will be closed by the MessageElement.
- * @param sig optional message digest/digital signature element or null if
- * no signature is desired.
- * @throws IOException If there is a problem reading from the source stream.
- */
- public InputStreamMessageElement(String name, MimeMediaType type, InputStream in, MessageElement sig) throws IOException {
- this(name, type, in, Long.MAX_VALUE, sig);
- }
-
- /**
- * Create a new Message Element.
- *
- * @param name Name of the MessageElement. May be the empty string ("") if
- * the MessageElement is not named.
- * @param type Type of the MessageElement. null is the same as specifying
- * the type "Application/Octet-stream".
- * @param in the stream containing the body of the MessageElement.
- * The stream will NOT be closed unless EOF is unexpectedly reached.
- * @param len The size of the Element will be limited to len bytes
- * from the stream. If you are using the stream interface and know
- * the size of the stream, specifying it here improves performance
- * and space efficiency a lot. The stream must contain at least
- * len bytes.
- * @param sig optional message digest/digital signature element or null if
- * no signature is desired.
- * @throws IOException if there is a problem reading from the source stream
- */
- public InputStreamMessageElement(String name, MimeMediaType type, InputStream in, long len, MessageElement sig) throws IOException {
- super(name, type, sig);
-
- if ((len < 0)) {
- throw new IllegalArgumentException("len must be >= 0");
- }
-
- // copy the data from the stream
- databytes = CopyToDataBytes(in, len);
-
- // calculate the length
- long buffersSum = 0;
- for (byte[] aBuffer : databytes) {
- buffersSum += aBuffer.length;
- }
-
- length = buffersSum;
-
- // fail if the length is not as promised.
- if ((len != Long.MAX_VALUE) && (len != length)) {
- throw new IllegalArgumentException("Stream was shorter than promised length.");
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean equals(Object target) {
- if (this == target) {
- return true;
- }
-
- if (target instanceof MessageElement) {
- if (!super.equals(target)) {
- return false;
- }
-
- if (target instanceof InputStreamMessageElement) {
- // have to do a slow stream comparison.
- // XXX 20020615 bondolo@jxta.org the performance of this could be much improved.
-
- MessageElement likeMe = (MessageElement) target;
-
- try {
- InputStream myStream = getStream();
- InputStream itsStream = likeMe.getStream();
-
- int mine;
- int its;
-
- do {
- mine = myStream.read();
- its = itsStream.read();
-
- if (mine != its) {
- return false;
- } // content didn't match
-
- } while ((-1 != mine) && (-1 != its));
-
- return ((-1 == mine) && (-1 == its)); // end at the same time?
- } catch (IOException fatal) {
- throw new IllegalStateException("MessageElements could not be compared." + fatal);
- }
- }
- }
-
- return false; // not a new message element
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public synchronized int hashCode() {
- if (0 == cachedHashCode) {
- Checksum crc = new CRC32();
-
- for (byte[] aBuffer : databytes) {
- crc.update(aBuffer, 0, aBuffer.length);
- }
-
- int result = super.hashCode() + (int) crc.getValue() * 6037; // a prime
-
- cachedHashCode = 0 != result ? result : 1;
- }
-
- return cachedHashCode;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public long getByteLength() {
- return length;
- }
-
- /**
- * {@inheritDoc}
- */
- public InputStream getStream() throws IOException {
- List buffers = new ArrayList();
-
- for (byte[] aBuffer : databytes) {
- buffers.add(new ByteArrayInputStream(aBuffer));
- }
-
- return new SequenceInputStream(Collections.enumeration(buffers));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void sendToStream(OutputStream sendTo) throws IOException {
- for (byte[] aBuffer : databytes) {
- sendTo.write(aBuffer);
- }
- }
-
- /**
- * Copy data from a stream with best possible efficiency. Unfortunately,
- * this still results in a lot of copying since we have often have no
- * fore-knowledge of the length of the stream.
- *
- * @param in the stream to copy from
- * @param limit the maximum number of bytes to copy from the stream.
- * Long.LONG_MAX will read until EOF.
- * @return A list of buffers.
- * @throws IOException if there is a problem reading from the stream.
- */
- protected List CopyToDataBytes(InputStream in, long limit) throws IOException {
- final long INITIAL_INTERMEDIATE_BUFFERSIZE = 6;
- final long MAXIMUM_INTERMEDIATE_BUFFERSIZE = 18;
-
- List buffs = new ArrayList();
- boolean atEOF = false;
- long read = 0;
- long currentIntermediateBufferSize = INITIAL_INTERMEDIATE_BUFFERSIZE;
-
- // build a list of buffers containing all the element data.
- do {
- long readRequest = (limit - read);
-
- if (Long.MAX_VALUE == limit) {
- readRequest = Math.min(readRequest, (1L << currentIntermediateBufferSize));
- }
- readRequest = Math.min(readRequest, Integer.MAX_VALUE); // limited by size of arrays which are Integer indexed.
-
- byte[] nextBuffer = new byte[(int) readRequest];
- int offsetInThisBuffer = 0;
-
- // fully read the buffer if we can.
- do {
- int readLength = in.read(nextBuffer, offsetInThisBuffer, nextBuffer.length - offsetInThisBuffer);
-
- if (readLength == -1) {
- atEOF = true;
- break;
- }
-
- offsetInThisBuffer += readLength;
- } while (offsetInThisBuffer < nextBuffer.length);
-
- // handle the final buffer.
- if (atEOF) {
- byte[] anotherBuffer = new byte[offsetInThisBuffer];
-
- System.arraycopy(nextBuffer, 0, anotherBuffer, 0, offsetInThisBuffer);
- nextBuffer = anotherBuffer;
- }
-
- read += nextBuffer.length;
- buffs.add(nextBuffer);
-
- if (currentIntermediateBufferSize < MAXIMUM_INTERMEDIATE_BUFFERSIZE) {
- currentIntermediateBufferSize++;
- }
- } while (!atEOF && (read < limit));
-
- // we are done, close if we are at EOF.
- if (atEOF) {
- in.close();
- in = null;
- }
- return buffs;
- }
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/ListenerAdaptor.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/ListenerAdaptor.java
deleted file mode 100644
index 4ebc94e0..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/ListenerAdaptor.java
+++ /dev/null
@@ -1,481 +0,0 @@
-/*
- * Copyright (c) 2004-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-package net.jxta.endpoint;
-
-import net.jxta.logging.Logging;
-import net.jxta.util.SimpleSelectable;
-import net.jxta.util.SimpleSelectable.IdentityReference;
-import net.jxta.util.SimpleSelector;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.Executor;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * The legacy getMessenger asynchronous API never returns any object to the invoker until a messenger could actually be made,
- * allowing the application to supply a listener to be invoked when the operation completes. The legacy Messenger API also
- * provides a method to send messages that calls a listener to report the outcome of the operation.
- *
- * The model has changed, so that an asynchronous messenger is made unresolved and returned immediately to the invoker, which can
- * then request opening or even just send a message to force the opening. Subsequently, the messenger can be used as a control
- * block to monitor progress with {@link Messenger#register} and {@link Messenger#waitState}.
- *
- * Likewise, the outcome of sending a message is a property of that message. Messages can be selected to monitor property changes
- * with {@link Message#register} and {@link net.jxta.endpoint.Message#getMessageProperty(Object)} (the outcome property key is
- * Messenger.class).
- *
- * This class here provides the legacy listener model on top of the new model for applications that prefer listeners. This class
- * is used internally to emulate the legacy listener behaviour, so that applications do not need to be adapted.
- *
- * Note: one instance of this class gets instantiated by each EndpointService interface. However, it does not start using any
- * resources until it first gets used.
- */
-public class ListenerAdaptor implements Runnable {
-
- // FIXME - jice 20040413: Eventhough it is not as critical as it used to be we should get rid of old, never resolved entries.
- // Attempts are supposed to always fail or succeed rather soon. Here, we trust transports in that matter. Is it safe ?
-
- /**
- * Logger
- */
- private final static transient Logger LOG = Logger.getLogger(ListenerAdaptor.class.getName());
-
- /**
- * The in progress messages.
- */
- private final Map inprogress = new HashMap(32);
-
- /**
- * The thread that does the work.
- */
- private Thread bgThread = null;
-
- /**
- * The selector that we use to watch messengers progress.
- */
- private final SimpleSelector selector = new SimpleSelector();
-
- /**
- * Have we been shutdown?
- */
- private volatile boolean shutdown = false;
-
- /**
- * The exceutor service.
- */
- private final Executor executor;
-
- /**
- * The ThreadGroup in which this adaptor will run.
- */
- private final ThreadGroup threadGroup;
-
- /**
- * Standard Constructor
- *
- * @param threadGroup The ThreadGroup in which this adaptor will run.
- */
- public ListenerAdaptor(ThreadGroup threadGroup) {
- this(threadGroup, null);
- }
- /**
- * Creates a ListenerAdaptor with a threadpool for notification callback.
- *
- * @param threadGroup The ThreadGroup in which this adaptor will run.
- * @param executor the excutor to use for notification callback
- */
- public ListenerAdaptor(ThreadGroup threadGroup, Executor executor) {
- this.executor = executor;
- this.threadGroup = threadGroup;
- }
-
- /**
- * Cannot be re-started. Do not call once shutdown.
- */
- private synchronized void init() {
- assert !shutdown;
-
- if (bgThread != null) {
- return;
- }
-
- bgThread = new Thread(threadGroup, this, "Listener Adaptor");
- bgThread.setDaemon(true);
- bgThread.start();
- }
-
- public synchronized void shutdown() {
- shutdown = true;
-
- // Stop the thread if it was ever created.
- Thread bg = bgThread;
- if (bg != null) {
- bg.interrupt();
- }
- }
-
- /**
- * Stop watching a given selectable.
- *
- * @param ts the selectable
- */
- private void forgetSelectable(SimpleSelectable ts) {
- // Either way, we're done with this one.
- ts.unregister(selector);
-
- synchronized (this) {
- inprogress.remove(ts.getIdentityReference());
- }
- }
-
- /**
- * Select the given message and invoke the given listener when the message sending is complete.
- *
- * @param listener The listener to invoke. If null the resolution will take place, but obviously no listener will be invoked.
- * @param message The message being sent.
- * @return true if the message was registered successfully or the listener is null. If true it is guaranteed that the listener
- * will be invoked unless null. If false, it is guaranteed that the listener will not be invoked.
- */
- public boolean watchMessage(OutgoingMessageEventListener listener, Message message) {
- synchronized (this) {
- if (shutdown) {
- return false;
- }
-
- if (listener == null) {
- // We're done, then. The invoker does not really care.
- return true;
- }
-
- // Init if needed.
- init();
-
- // First we must ensure that if the state changes we'll get to handle it.
- MessageListenerContainer allListeners = (MessageListenerContainer) inprogress.get(message.getIdentityReference());
-
- if (allListeners == null) {
- allListeners = new MessageListenerContainer();
- inprogress.put(message.getIdentityReference(), allListeners);
- }
- allListeners.add(listener);
- }
-
- // When we do that, the selector gets notified. Therefore always check the initial state automatically. If the
- // selectable is already done with, the listener will be called by the selector's handler.
- message.register(selector);
-
- return true;
- }
-
- /**
- * Select the given messenger and invoke the given listener when the messenger is resolved.
- *
- * @param listener The listener to invoke. If null the resolution will take place, but obviously no listener will be invoked.
- * @param messenger The messenger being resolved.
- * @return true if the messenger was registered successfully or the listener is null. If true it is guaranteed that the listener
- * will be invoked unless null. If false, it is guaranteed that the listener will not be invoked.
- */
- public boolean watchMessenger(MessengerEventListener listener, Messenger messenger) {
- synchronized (this) {
-
- if (shutdown) {
- return false;
- }
-
- if (listener == null) {
- // We're done, then. The invoker does not really care.
- return true;
- }
-
- // Init if needed.
- init();
-
- // First we must ensure that if the state changes we'll get to handle it.
- MessengerListenerContainer allListeners = (MessengerListenerContainer) inprogress.get(messenger.getIdentityReference());
-
- if (allListeners == null) {
- // Use ArrayList. The code is optimized for that.
- allListeners = new MessengerListenerContainer();
- inprogress.put(messenger.getIdentityReference(), allListeners);
- }
- allListeners.add(listener);
- }
-
- // When we do that, the selector get notified. Therefore we will always check the initial state automatically. If the
- // selectable is already done with, the listener will be called by the selector's handler.
- messenger.register(selector);
-
- return true;
- }
-
- /*
- * Any sort of listener type.
- */
- static abstract class ListenerContainer extends ArrayList {
-
- public ListenerContainer() {
- super(1);
- }
-
- protected abstract void giveUp(S what, Throwable how);
-
- protected abstract void process(S what);
- }
-
-
- /**
- * For messages
- */
- @SuppressWarnings("serial")
- class MessageListenerContainer extends ListenerContainer {
-
- private void messageDone(Message message, OutgoingMessageEvent event) {
- // Note: synchronization is externally provided. When this method is invoked, this
- // object has already been removed from the map, so the list of listener cannot change.
-
- if (event == OutgoingMessageEvent.SUCCESS) {
- // Replace it with a msg-specific one.
- event = new OutgoingMessageEvent(message, null);
-
- for (OutgoingMessageEventListener eachListener : this) {
- try {
- eachListener.messageSendSucceeded(event);
- } catch (Throwable any) {
- if (Logging.SHOW_WARNING && LOG.isLoggable(Level.WARNING)) {
- LOG.log(Level.WARNING, "Uncaught throwable from listener", any);
- }
- }
- }
- } else {
- if (event == OutgoingMessageEvent.OVERFLOW) {
- // Replace it with a msg-specific one.
- event = new OutgoingMessageEvent(message, null);
- }
-
- for (OutgoingMessageEventListener eachListener : this) {
- try {
- eachListener.messageSendFailed(event);
- } catch (Throwable any) {
- if (Logging.SHOW_WARNING && LOG.isLoggable(Level.WARNING)) {
- LOG.log(Level.WARNING, "Uncaught throwable in listener", any);
- }
- }
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void process(Message message) {
- OutgoingMessageEvent event = (OutgoingMessageEvent) message.getMessageProperty(Messenger.class);
-
- if (event == null) {
- return;
- }
-
- // Remove this container-selectable binding
- forgetSelectable(message);
-
- // Invoke app listeners
- messageDone(message, event);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void giveUp(Message m, Throwable how) {
- messageDone(m, new OutgoingMessageEvent(m, how));
- }
- }
-
- /**
- * For messengers
- */
- @SuppressWarnings("serial")
- class MessengerListenerContainer extends ListenerContainer {
-
- private void messengerDone(Messenger messenger) {
-
- // Note: synchronization is externally provided. When this method is invoked, this
- // object has already been removed from the map, so the list of listener cannot change.
-
- MessengerEvent event = new MessengerEvent(ListenerAdaptor.this, messenger, null);
-
- for (MessengerEventListener eachListener : this) {
- try {
- eachListener.messengerReady(event);
- } catch (Throwable any) {
- if (Logging.SHOW_WARNING && LOG.isLoggable(Level.WARNING)) {
- LOG.log(Level.WARNING, "Uncaught throwable in listener", any);
- }
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void process(Messenger messenger) {
- if ((messenger.getState() & (Messenger.RESOLVED | Messenger.TERMINAL)) == 0) {
- return;
- }
-
- // Remove this container-selectable binding
- forgetSelectable(messenger);
-
- if ((messenger.getState() & Messenger.USABLE) == 0) {
- messenger = null;
- }
-
- // Invoke app listeners
- messengerDone(messenger);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void giveUp(Messenger m, Throwable how) {
- messengerDone(null);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void run() {
- try {
- while (!shutdown) {
- try {
- Collection changed = selector.select();
- for (SimpleSelectable simpleSelectable : changed) {
- ListenerContainer listeners;
- synchronized (this) {
- listeners = inprogress.get(simpleSelectable.getIdentityReference());
- }
- if (listeners == null) {
- simpleSelectable.unregister(selector);
- continue;
- }
- if (executor == null) {
- listeners.process(simpleSelectable);
- } else {
- executor.execute(new ListenerProcessor(listeners, simpleSelectable));
- }
- }
- } catch (InterruptedException ie) {
- Thread.interrupted();
- }
- }
- } catch (Throwable anyOther) {
- if (Logging.SHOW_SEVERE && LOG.isLoggable(Level.SEVERE)) {
- LOG.log(Level.SEVERE, "Uncaught Throwable in background thread", anyOther);
- }
-
- // There won't be any other thread. This thing is dead if that
- // happens. And it really shouldn't.
- synchronized (this) {
- shutdown = true;
- }
- } finally {
- try {
- // It's only us now. Stopped is true.
- IOException failed = new IOException("Endpoint interface terminated");
- for (Map.Entry entry : inprogress.entrySet()) {
- SimpleSelectable simpleSelectable = entry.getKey().getObject();
- ListenerContainer listeners = entry.getValue();
- simpleSelectable.unregister(selector);
-
- if (listeners != null) {
- listeners.giveUp(simpleSelectable, failed);
- }
- }
- inprogress.clear();
- } catch (Throwable anyOther) {
- if (Logging.SHOW_SEVERE && LOG.isLoggable(Level.SEVERE)) {
- LOG.log(Level.SEVERE, "Uncaught Throwable while shutting down background thread", anyOther);
- }
- }
- bgThread = null;
- }
- }
-
- /**
- * A small class for processing individual messages.
- */
- private class ListenerProcessor implements Runnable {
-
- private SimpleSelectable simpleSelectable;
- private ListenerContainer listeners;
- ListenerProcessor(ListenerContainer listeners, SimpleSelectable simpleSelectable) {
- this.listeners = listeners;
- this.simpleSelectable = simpleSelectable;
- }
-
- public void run() {
- listeners.process(simpleSelectable);
- }
- }
-}
diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/Message.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/Message.java
deleted file mode 100644
index 134699a8..00000000
--- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/Message.java
+++ /dev/null
@@ -1,1444 +0,0 @@
-/*
- * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The Sun Project JXTA(TM) Software License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by Sun Microsystems, Inc. for JXTA(TM) technology."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must
- * not be used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please contact
- * Project JXTA at http://www.jxta.org.
- *
- * 5. Products derived from this software may not be called "JXTA", nor may
- * "JXTA" appear in their name, without prior written permission of Sun.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN
- * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * JXTA is a registered trademark of Sun Microsystems, Inc. in the United
- * States and other countries.
- *
- * Please see the license information page at :
- * for instructions on use of
- * the license in source files.
- *
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of Project JXTA. For more information on Project JXTA, please see
- * http://www.jxta.org.
- *
- * This license is based on the BSD license adopted by the Apache Foundation.
- */
-package net.jxta.endpoint;
-
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.PrintWriter;
-import java.io.Serializable;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-
-import java.io.IOException;
-import java.util.ConcurrentModificationException;
-import java.util.NoSuchElementException;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import java.util.logging.Level;
-import net.jxta.logging.Logging;
-import java.util.logging.Logger;
-
-import net.jxta.document.MimeMediaType;
-import net.jxta.util.AbstractSimpleSelectable;
-import net.jxta.util.SimpleSelectable;
-
-import net.jxta.impl.id.UUID.UUID;
-import net.jxta.impl.id.UUID.UUIDFactory;
-
-/**
- * Messages are abstract containers for protocol messages within JXTA. Services
- * and applications are expected to use Messages as the basis for any protocols
- * implemented within JXTA. Messages are exchanged through the
- * {@link net.jxta.endpoint.EndpointService} or
- * {@link net.jxta.pipe.PipeService}.
- *
- * A Message is composed of an ordered list of zero or more
- * {@link net.jxta.endpoint.MessageElement MessageElements}. Each
- * {@link net.jxta.endpoint.MessageElement} is associated with a namespace at
- * the time it is added to the message. Duplicate
- * {@link net.jxta.endpoint.MessageElement MessageElements} are permitted.
- *
- * Messages are not synchronized. All of the iterators returned by this
- * implementation are "fail-fast". Concurrent modification of messages from
- * multiple threads will produce unexpected results and
- * {@code ConcurrentModificationException}.
- *
- * @see net.jxta.endpoint.MessageElement
- * @see net.jxta.endpoint.EndpointAddress
- * @see net.jxta.endpoint.EndpointService
- * @see net.jxta.pipe.InputPipe
- * @see net.jxta.pipe.OutputPipe
- * @see net.jxta.pipe.PipeService
- */
-public class Message extends AbstractSimpleSelectable implements Serializable {
-
- /**
- * Logger
- */
- private static final transient Logger LOG = Logger.getLogger(Message.class.getName());
-
- /**
- * Magic value for this format of serialization version.
- */
- private static final long serialVersionUID = 3418026921074097757L;
-
- /**
- * If {@code true}, then modification logging be activated. This is a very
- * expensive option as it causes a stack crawl to be captured for every
- * message modification.
- *
- * To enable modification tracking, set to {@code true} and recompile.
- */
- protected static final boolean LOG_MODIFICATIONS = false;
-
- /**
- * If {@code true}, then a special tracking element is added to every
- * message. This provides the ability to follow messages throughout the
- * network. If a message has a tracking element then it will be used in
- * the {@code toString()} representation.
- *
- * The element is currently named "Tracking UUID" and is stored in the
- * "jxta" namespace. The element contains an IETF version 1 UUID in string
- * form.
- *
- * To enable addition of a tracking element to every message, set the
- * Java System Property {@code net.jxta.endpoint.Message.globalTracking} to
- * {@code true} and restart your JXTA application.
- *
- * @see java.lang.System#setProperty(String,String)
- */
- protected static final boolean GLOBAL_TRACKING_ELEMENT =
- Boolean.getBoolean(Message.class.getName() + ".globalTracking");
-
- /**
- * Incremented for each standalone message instance. {@see #lineage} for
- * information about how message numbers can be used.
- */
- private static transient AtomicInteger messagenumber = new AtomicInteger(1);
-
- /**
- * This string identifies the namespace which is assumed when calls are
- * made that don't include a namespace specification.
- */
- protected final String defaultNamespace;
-
- /**
- * the namespaces in this message and the elements in each.
- */
- protected transient Map> namespaces = new HashMap>();
-
- /**
- * List of the elements.
- */
- protected transient List elements = new ArrayList();
-
- /**
- * Message properties HashMap
- */
- protected transient Map