Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.net4j.buddies.server')
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/.settings/org.eclipse.jdt.ui.prefs240
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/about.properties62
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/build.properties54
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/copyright.txt14
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/plugin.properties22
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/plugin.xml48
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/BuddyAdmin.java530
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/ServerBuddy.java124
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/ServerSession.java204
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/bundle/OM.java130
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/messages/Messages.java82
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/messages/messages.properties22
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/BuddiesServerProtocol.java172
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/BuddyAddedNotification.java78
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/BuddyRemovedNotification.java78
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/CollaborationInitiatedNotification.java102
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/FacilityInstalledNotification.java84
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/InitiateCollaborationIndication.java104
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/InstallFacilityIndication.java186
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/InviteBuddiesIndication.java184
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/LoadAccountIndication.java96
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/OpenSessionIndication.java208
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/ServerBuddyStateIndication.java90
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/ServerCollaborationLeftIndication.java124
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/server/IBuddyAdmin.java74
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/server/ServerConstants.java42
26 files changed, 1577 insertions, 1577 deletions
diff --git a/plugins/org.eclipse.net4j.buddies.server/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.net4j.buddies.server/.settings/org.eclipse.jdt.ui.prefs
index aaef0ccba1..6726e7034a 100644
--- a/plugins/org.eclipse.net4j.buddies.server/.settings/org.eclipse.jdt.ui.prefs
+++ b/plugins/org.eclipse.net4j.buddies.server/.settings/org.eclipse.jdt.ui.prefs
@@ -1,120 +1,120 @@
-#Thu Feb 04 09:44:24 CET 2010
-cleanup.add_default_serial_version_id=true
-cleanup.add_generated_serial_version_id=false
-cleanup.add_missing_annotations=true
-cleanup.add_missing_deprecated_annotations=true
-cleanup.add_missing_methods=false
-cleanup.add_missing_nls_tags=false
-cleanup.add_missing_override_annotations=true
-cleanup.add_missing_override_annotations_interface_methods=true
-cleanup.add_serial_version_id=true
-cleanup.always_use_blocks=true
-cleanup.always_use_parentheses_in_expressions=false
-cleanup.always_use_this_for_non_static_field_access=false
-cleanup.always_use_this_for_non_static_method_access=false
-cleanup.convert_to_enhanced_for_loop=false
-cleanup.correct_indentation=true
-cleanup.format_source_code=true
-cleanup.format_source_code_changes_only=false
-cleanup.make_local_variable_final=true
-cleanup.make_parameters_final=false
-cleanup.make_private_fields_final=true
-cleanup.make_type_abstract_if_missing_method=false
-cleanup.make_variable_declarations_final=false
-cleanup.never_use_blocks=false
-cleanup.never_use_parentheses_in_expressions=true
-cleanup.organize_imports=true
-cleanup.qualify_static_field_accesses_with_declaring_class=false
-cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-cleanup.qualify_static_member_accesses_with_declaring_class=false
-cleanup.qualify_static_method_accesses_with_declaring_class=false
-cleanup.remove_private_constructors=true
-cleanup.remove_trailing_whitespaces=true
-cleanup.remove_trailing_whitespaces_all=true
-cleanup.remove_trailing_whitespaces_ignore_empty=false
-cleanup.remove_unnecessary_casts=true
-cleanup.remove_unnecessary_nls_tags=true
-cleanup.remove_unused_imports=true
-cleanup.remove_unused_local_variables=false
-cleanup.remove_unused_private_fields=true
-cleanup.remove_unused_private_members=false
-cleanup.remove_unused_private_methods=true
-cleanup.remove_unused_private_types=true
-cleanup.sort_members=false
-cleanup.sort_members_all=false
-cleanup.use_blocks=true
-cleanup.use_blocks_only_for_return_and_throw=false
-cleanup.use_parentheses_in_expressions=true
-cleanup.use_this_for_non_static_field_access=true
-cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-cleanup.use_this_for_non_static_method_access=true
-cleanup.use_this_for_non_static_method_access_only_if_necessary=true
-cleanup_profile=_EMFT
-cleanup_settings_version=2
-eclipse.preferences.version=1
-editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-formatter_profile=_EMFT
-formatter_settings_version=11
-org.eclipse.jdt.ui.exception.name=ex
-org.eclipse.jdt.ui.gettersetter.use.is=true
-org.eclipse.jdt.ui.ignorelowercasenames=true
-org.eclipse.jdt.ui.importorder=org.eclipse.emf.cdo;org.eclipse.emf.internal.cdo;org.eclipse.net4j;org.eclipse.internal.net4j;org.eclipse.emf;org.eclipse;com;org;javax;java;
-org.eclipse.jdt.ui.javadoc=true
-org.eclipse.jdt.ui.keywordthis=false
-org.eclipse.jdt.ui.ondemandthreshold=99
-org.eclipse.jdt.ui.overrideannotation=true
-org.eclipse.jdt.ui.staticondemandthreshold=99
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="false" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment"/><template autoinsert\="false" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment"/><template autoinsert\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment"/><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\r\n * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n * \r\n * Contributors\:\r\n * Eike Stepper - initial API and implementation\r\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author Eike Stepper\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="false" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment"/><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment"/><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">${exception_var}.printStackTrace();</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">${body_statement}</template><template autoinsert\="false" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
-sp_cleanup.add_default_serial_version_id=true
-sp_cleanup.add_generated_serial_version_id=false
-sp_cleanup.add_missing_annotations=true
-sp_cleanup.add_missing_deprecated_annotations=true
-sp_cleanup.add_missing_methods=false
-sp_cleanup.add_missing_nls_tags=false
-sp_cleanup.add_missing_override_annotations=true
-sp_cleanup.add_missing_override_annotations_interface_methods=false
-sp_cleanup.add_serial_version_id=false
-sp_cleanup.always_use_blocks=true
-sp_cleanup.always_use_parentheses_in_expressions=false
-sp_cleanup.always_use_this_for_non_static_field_access=false
-sp_cleanup.always_use_this_for_non_static_method_access=false
-sp_cleanup.convert_to_enhanced_for_loop=false
-sp_cleanup.correct_indentation=true
-sp_cleanup.format_source_code=true
-sp_cleanup.format_source_code_changes_only=false
-sp_cleanup.make_local_variable_final=false
-sp_cleanup.make_parameters_final=false
-sp_cleanup.make_private_fields_final=true
-sp_cleanup.make_type_abstract_if_missing_method=false
-sp_cleanup.make_variable_declarations_final=false
-sp_cleanup.never_use_blocks=false
-sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=true
-sp_cleanup.organize_imports=true
-sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
-sp_cleanup.remove_private_constructors=true
-sp_cleanup.remove_trailing_whitespaces=true
-sp_cleanup.remove_trailing_whitespaces_all=true
-sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
-sp_cleanup.remove_unnecessary_casts=true
-sp_cleanup.remove_unnecessary_nls_tags=true
-sp_cleanup.remove_unused_imports=true
-sp_cleanup.remove_unused_local_variables=false
-sp_cleanup.remove_unused_private_fields=true
-sp_cleanup.remove_unused_private_members=false
-sp_cleanup.remove_unused_private_methods=true
-sp_cleanup.remove_unused_private_types=true
-sp_cleanup.sort_members=false
-sp_cleanup.sort_members_all=false
-sp_cleanup.use_blocks=true
-sp_cleanup.use_blocks_only_for_return_and_throw=false
-sp_cleanup.use_parentheses_in_expressions=true
-sp_cleanup.use_this_for_non_static_field_access=true
-sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-sp_cleanup.use_this_for_non_static_method_access=true
-sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+#Thu Feb 04 09:44:24 CET 2010
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=true
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=true
+cleanup.format_source_code=true
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=true
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=false
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=true
+cleanup.use_this_for_non_static_field_access=true
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=true
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_EMFT
+cleanup_settings_version=2
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_EMFT
+formatter_settings_version=11
+org.eclipse.jdt.ui.exception.name=ex
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=org.eclipse.emf.cdo;org.eclipse.emf.internal.cdo;org.eclipse.net4j;org.eclipse.internal.net4j;org.eclipse.emf;org.eclipse;com;org;javax;java;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.overrideannotation=true
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="false" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment"/><template autoinsert\="false" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment"/><template autoinsert\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment"/><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\r\n * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n * \r\n * Contributors\:\r\n * Eike Stepper - initial API and implementation\r\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author Eike Stepper\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="false" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment"/><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment"/><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">${exception_var}.printStackTrace();</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">${body_statement}</template><template autoinsert\="false" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=false
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=true
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=true
+sp_cleanup.use_this_for_non_static_field_access=true
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=true
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/plugins/org.eclipse.net4j.buddies.server/about.properties b/plugins/org.eclipse.net4j.buddies.server/about.properties
index cd5da18507..8062fca294 100644
--- a/plugins/org.eclipse.net4j.buddies.server/about.properties
+++ b/plugins/org.eclipse.net4j.buddies.server/about.properties
@@ -1,31 +1,31 @@
-# Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Eike Stepper - initial API and implementation
-
-# NLS_MESSAGEFORMAT_VAR
-
-# ==============================================================================
-# Do not change the properties between this line and the last line containing:
-# %%% END OF TRANSLATED PROPERTIES %%%
-# Instead, either redefine an existing property, or create a new property,
-# append it to the end of the file, and change the code to use the new name.
-# ==============================================================================
-
-featureName = Net4j Buddies Server
-featureText = Net4j Buddies Server\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others. All rights reserved.\n\
-\n\
-Visit http://wiki.eclipse.org/Net4j
-
-# ==============================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# The above properties have been shipped for translation.
-# ==============================================================================
+# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Eike Stepper - initial API and implementation
+
+# NLS_MESSAGEFORMAT_VAR
+
+# ==============================================================================
+# Do not change the properties between this line and the last line containing:
+# %%% END OF TRANSLATED PROPERTIES %%%
+# Instead, either redefine an existing property, or create a new property,
+# append it to the end of the file, and change the code to use the new name.
+# ==============================================================================
+
+featureName = Net4j Buddies Server
+featureText = Net4j Buddies Server\n\
+Version: {featureVersion}\n\
+Build id: {0}\n\
+\n\
+Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others. All rights reserved.\n\
+\n\
+Visit http://wiki.eclipse.org/Net4j
+
+# ==============================================================================
+# %%% END OF TRANSLATED PROPERTIES %%%
+# The above properties have been shipped for translation.
+# ==============================================================================
diff --git a/plugins/org.eclipse.net4j.buddies.server/build.properties b/plugins/org.eclipse.net4j.buddies.server/build.properties
index f8eda5512f..cb14f95e99 100644
--- a/plugins/org.eclipse.net4j.buddies.server/build.properties
+++ b/plugins/org.eclipse.net4j.buddies.server/build.properties
@@ -1,27 +1,27 @@
-# Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Eike Stepper - initial API and implementation
-
-# NLS_MESSAGEFORMAT_VAR
-
-bin.includes = .,\
- META-INF/,\
- plugin.properties,\
- .options,\
- about.html,\
- copyright.txt,\
- plugin.xml,\
- about.ini,\
- about.mappings,\
- about.properties,\
- modeling32.png
-jars.compile.order = .
-source.. = src/
-output.. = bin/
-src.includes = about.html,\
- copyright.txt
+# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Eike Stepper - initial API and implementation
+
+# NLS_MESSAGEFORMAT_VAR
+
+bin.includes = .,\
+ META-INF/,\
+ plugin.properties,\
+ .options,\
+ about.html,\
+ copyright.txt,\
+ plugin.xml,\
+ about.ini,\
+ about.mappings,\
+ about.properties,\
+ modeling32.png
+jars.compile.order = .
+source.. = src/
+output.. = bin/
+src.includes = about.html,\
+ copyright.txt
diff --git a/plugins/org.eclipse.net4j.buddies.server/copyright.txt b/plugins/org.eclipse.net4j.buddies.server/copyright.txt
index e921242cf0..8f6328980e 100644
--- a/plugins/org.eclipse.net4j.buddies.server/copyright.txt
+++ b/plugins/org.eclipse.net4j.buddies.server/copyright.txt
@@ -1,8 +1,8 @@
-Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
-All rights reserved. This program and the accompanying materials
-are made available under the terms of the Eclipse Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/epl-v10.html
-
-Contributors:
+Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html
+
+Contributors:
Eike Stepper - initial API and implementation \ No newline at end of file
diff --git a/plugins/org.eclipse.net4j.buddies.server/plugin.properties b/plugins/org.eclipse.net4j.buddies.server/plugin.properties
index df7e75a27d..0066761750 100644
--- a/plugins/org.eclipse.net4j.buddies.server/plugin.properties
+++ b/plugins/org.eclipse.net4j.buddies.server/plugin.properties
@@ -1,11 +1,11 @@
-# Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Eike Stepper - initial API and implementation
-
-pluginName = Net4j Buddies Server
-providerName = Eclipse Modeling Project
+# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Eike Stepper - initial API and implementation
+
+pluginName = Net4j Buddies Server
+providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.net4j.buddies.server/plugin.xml b/plugins/org.eclipse.net4j.buddies.server/plugin.xml
index 1467ee331d..6709be82cd 100644
--- a/plugins/org.eclipse.net4j.buddies.server/plugin.xml
+++ b/plugins/org.eclipse.net4j.buddies.server/plugin.xml
@@ -1,24 +1,24 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<!--
- Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
-
- Contributors:
- Eike Stepper - initial API and implementation
--->
-
-<plugin>
-
- <extension
- point="org.eclipse.net4j.util.factories">
- <factory
- class="org.eclipse.net4j.buddies.internal.server.protocol.BuddiesServerProtocol$Factory"
- productGroup="org.eclipse.net4j.serverProtocols"
- type="buddies"/>
- </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<!--
+ Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Eike Stepper - initial API and implementation
+-->
+
+<plugin>
+
+ <extension
+ point="org.eclipse.net4j.util.factories">
+ <factory
+ class="org.eclipse.net4j.buddies.internal.server.protocol.BuddiesServerProtocol$Factory"
+ productGroup="org.eclipse.net4j.serverProtocols"
+ type="buddies"/>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/BuddyAdmin.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/BuddyAdmin.java
index 782df0c449..f4ca83f070 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/BuddyAdmin.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/BuddyAdmin.java
@@ -1,265 +1,265 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.buddies.internal.server;
-
-import org.eclipse.net4j.buddies.common.IAccount;
-import org.eclipse.net4j.buddies.common.IBuddy;
-import org.eclipse.net4j.buddies.common.IBuddyStateEvent;
-import org.eclipse.net4j.buddies.common.ICollaboration;
-import org.eclipse.net4j.buddies.common.ISession;
-import org.eclipse.net4j.buddies.internal.common.Account;
-import org.eclipse.net4j.buddies.internal.common.Buddy;
-import org.eclipse.net4j.buddies.internal.common.Collaboration;
-import org.eclipse.net4j.buddies.internal.common.CollaborationContainer;
-import org.eclipse.net4j.buddies.internal.common.Membership;
-import org.eclipse.net4j.buddies.internal.common.protocol.BuddyStateNotification;
-import org.eclipse.net4j.buddies.internal.server.bundle.OM;
-import org.eclipse.net4j.buddies.internal.server.protocol.BuddiesServerProtocol;
-import org.eclipse.net4j.buddies.internal.server.protocol.BuddyRemovedNotification;
-import org.eclipse.net4j.buddies.internal.server.protocol.CollaborationInitiatedNotification;
-import org.eclipse.net4j.buddies.server.IBuddyAdmin;
-import org.eclipse.net4j.buddies.spi.common.ServerFacilityFactory;
-import org.eclipse.net4j.channel.IChannel;
-import org.eclipse.net4j.util.ObjectUtil;
-import org.eclipse.net4j.util.container.IPluginContainer;
-import org.eclipse.net4j.util.event.IEvent;
-import org.eclipse.net4j.util.lifecycle.ILifecycleEvent;
-import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
-import org.eclipse.net4j.util.om.trace.ContextTracer;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-/**
- * @author Eike Stepper
- */
-public class BuddyAdmin extends CollaborationContainer implements IBuddyAdmin
-{
- public static final BuddyAdmin INSTANCE = new BuddyAdmin();
-
- private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, BuddyAdmin.class);
-
- private ConcurrentMap<String, IAccount> accounts = new ConcurrentHashMap<String, IAccount>();
-
- private ConcurrentMap<String, ISession> sessions = new ConcurrentHashMap<String, ISession>();
-
- private long lastCollaborationID;
-
- public BuddyAdmin()
- {
- activate();
- }
-
- public Map<String, IAccount> getAccounts()
- {
- return accounts;
- }
-
- public ISession getSession(IBuddy buddy)
- {
- return getSession(buddy.getUserID());
- }
-
- public ISession getSession(String userID)
- {
- return sessions.get(userID);
- }
-
- public ISession[] getSessions()
- {
- return sessions.values().toArray(new ISession[sessions.size()]);
- }
-
- public IBuddy[] getBuddies()
- {
- List<IBuddy> buddies = new ArrayList<IBuddy>();
- for (ISession session : sessions.values())
- {
- buddies.add(session.getSelf());
- }
-
- return buddies.toArray(new IBuddy[buddies.size()]);
- }
-
- public IBuddy getBuddy(String userID)
- {
- ISession session = getSession(userID);
- if (session == null)
- {
- return null;
- }
-
- return session.getSelf();
- }
-
- public synchronized ISession openSession(IChannel channel, String userID, String password, String[] facilityTypes)
- {
- if (sessions.containsKey(userID))
- {
- return null;
- }
-
- IAccount account = accounts.get(userID);
- if (account != null)
- {
- if (!account.authenticate(password))
- {
- return null;
- }
- }
- else
- {
- account = new Account(userID, password);
- accounts.put(userID, account);
- }
-
- ServerBuddy buddy = new ServerBuddy(account, facilityTypes);
- buddy.activate();
- buddy.addListener(this);
-
- BuddiesServerProtocol protocol = (BuddiesServerProtocol)channel.getReceiveHandler();
- ServerSession session = new ServerSession(protocol, buddy);
- protocol.setInfraStructure(session);
- session.addListener(this);
- buddy.setSession(session);
- LifecycleUtil.activate(session);
-
- if (TRACER.isEnabled())
- {
- TRACER.trace("Opened session: " + userID); //$NON-NLS-1$
- }
-
- sessions.put(userID, session);
- return session;
- }
-
- public ICollaboration initiateCollaboration(IBuddy initiator, String... userIDs)
- {
- long collaborationID;
- synchronized (this)
- {
- collaborationID = ++lastCollaborationID;
- }
-
- Collaboration collaboration = new Collaboration(collaborationID);
- collaboration.activate();
- Membership.create(initiator, collaboration);
-
- Set<IBuddy> buddies = new HashSet<IBuddy>();
- buddies.add(initiator);
- for (String userID : userIDs)
- {
- Buddy buddy = (Buddy)getBuddy(userID);
- if (buddy != null)
- {
- buddies.add(buddy);
- Membership.create(buddy, collaboration);
- }
- }
-
- addCollaboration(collaboration);
-
- Set<IBuddy> invitations = new HashSet<IBuddy>(buddies);
- for (IBuddy buddy : buddies)
- {
- if (buddy != initiator)
- {
- try
- {
- invitations.remove(buddy);
- BuddiesServerProtocol protocol = (BuddiesServerProtocol)buddy.getSession().getProtocol();
- new CollaborationInitiatedNotification(protocol, collaborationID, invitations, null).sendAsync();
- }
- catch (Exception ex)
- {
- OM.LOG.error(ex);
- }
- finally
- {
- invitations.add(buddy);
- }
- }
- }
-
- return collaboration;
- }
-
- @Override
- public void notifyEvent(IEvent event)
- {
- if (event.getSource() instanceof ServerSession)
- {
- if (event instanceof ILifecycleEvent)
- {
- if (((ILifecycleEvent)event).getKind() == ILifecycleEvent.Kind.DEACTIVATED)
- {
- String userID = ((ServerSession)event.getSource()).getSelf().getUserID();
- synchronized (this)
- {
- ServerSession removed = (ServerSession)sessions.remove(userID);
- if (removed != null)
- {
- removed.removeListener(this);
- removed.getSelf().removeListener(this);
- for (ISession session : sessions.values())
- {
- try
- {
- BuddiesServerProtocol protocol = (BuddiesServerProtocol)session.getProtocol();
- new BuddyRemovedNotification(protocol, userID).sendAsync();
- }
- catch (Exception ex)
- {
- OM.LOG.error(ex);
- }
- }
- }
- }
- }
- }
- }
- else if (event.getSource() instanceof ServerBuddy)
- {
- if (event instanceof IBuddyStateEvent)
- {
- IBuddyStateEvent e = (IBuddyStateEvent)event;
- synchronized (this)
- {
- for (ISession session : sessions.values())
- {
- try
- {
- if (!ObjectUtil.equals(session.getSelf(), e.getSource()))
- {
- BuddiesServerProtocol protocol = (BuddiesServerProtocol)session.getProtocol();
- new BuddyStateNotification(protocol, e.getSource().getUserID(), e.getNewState()).sendAsync();
- }
- }
- catch (Exception ex)
- {
- OM.LOG.error(ex);
- }
- }
- }
- }
- }
- }
-
- public static Set<String> getFacilityTypes()
- {
- return IPluginContainer.INSTANCE.getFactoryTypes(ServerFacilityFactory.PRODUCT_GROUP);
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.buddies.internal.server;
+
+import org.eclipse.net4j.buddies.common.IAccount;
+import org.eclipse.net4j.buddies.common.IBuddy;
+import org.eclipse.net4j.buddies.common.IBuddyStateEvent;
+import org.eclipse.net4j.buddies.common.ICollaboration;
+import org.eclipse.net4j.buddies.common.ISession;
+import org.eclipse.net4j.buddies.internal.common.Account;
+import org.eclipse.net4j.buddies.internal.common.Buddy;
+import org.eclipse.net4j.buddies.internal.common.Collaboration;
+import org.eclipse.net4j.buddies.internal.common.CollaborationContainer;
+import org.eclipse.net4j.buddies.internal.common.Membership;
+import org.eclipse.net4j.buddies.internal.common.protocol.BuddyStateNotification;
+import org.eclipse.net4j.buddies.internal.server.bundle.OM;
+import org.eclipse.net4j.buddies.internal.server.protocol.BuddiesServerProtocol;
+import org.eclipse.net4j.buddies.internal.server.protocol.BuddyRemovedNotification;
+import org.eclipse.net4j.buddies.internal.server.protocol.CollaborationInitiatedNotification;
+import org.eclipse.net4j.buddies.server.IBuddyAdmin;
+import org.eclipse.net4j.buddies.spi.common.ServerFacilityFactory;
+import org.eclipse.net4j.channel.IChannel;
+import org.eclipse.net4j.util.ObjectUtil;
+import org.eclipse.net4j.util.container.IPluginContainer;
+import org.eclipse.net4j.util.event.IEvent;
+import org.eclipse.net4j.util.lifecycle.ILifecycleEvent;
+import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
+import org.eclipse.net4j.util.om.trace.ContextTracer;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
+/**
+ * @author Eike Stepper
+ */
+public class BuddyAdmin extends CollaborationContainer implements IBuddyAdmin
+{
+ public static final BuddyAdmin INSTANCE = new BuddyAdmin();
+
+ private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, BuddyAdmin.class);
+
+ private ConcurrentMap<String, IAccount> accounts = new ConcurrentHashMap<String, IAccount>();
+
+ private ConcurrentMap<String, ISession> sessions = new ConcurrentHashMap<String, ISession>();
+
+ private long lastCollaborationID;
+
+ public BuddyAdmin()
+ {
+ activate();
+ }
+
+ public Map<String, IAccount> getAccounts()
+ {
+ return accounts;
+ }
+
+ public ISession getSession(IBuddy buddy)
+ {
+ return getSession(buddy.getUserID());
+ }
+
+ public ISession getSession(String userID)
+ {
+ return sessions.get(userID);
+ }
+
+ public ISession[] getSessions()
+ {
+ return sessions.values().toArray(new ISession[sessions.size()]);
+ }
+
+ public IBuddy[] getBuddies()
+ {
+ List<IBuddy> buddies = new ArrayList<IBuddy>();
+ for (ISession session : sessions.values())
+ {
+ buddies.add(session.getSelf());
+ }
+
+ return buddies.toArray(new IBuddy[buddies.size()]);
+ }
+
+ public IBuddy getBuddy(String userID)
+ {
+ ISession session = getSession(userID);
+ if (session == null)
+ {
+ return null;
+ }
+
+ return session.getSelf();
+ }
+
+ public synchronized ISession openSession(IChannel channel, String userID, String password, String[] facilityTypes)
+ {
+ if (sessions.containsKey(userID))
+ {
+ return null;
+ }
+
+ IAccount account = accounts.get(userID);
+ if (account != null)
+ {
+ if (!account.authenticate(password))
+ {
+ return null;
+ }
+ }
+ else
+ {
+ account = new Account(userID, password);
+ accounts.put(userID, account);
+ }
+
+ ServerBuddy buddy = new ServerBuddy(account, facilityTypes);
+ buddy.activate();
+ buddy.addListener(this);
+
+ BuddiesServerProtocol protocol = (BuddiesServerProtocol)channel.getReceiveHandler();
+ ServerSession session = new ServerSession(protocol, buddy);
+ protocol.setInfraStructure(session);
+ session.addListener(this);
+ buddy.setSession(session);
+ LifecycleUtil.activate(session);
+
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Opened session: " + userID); //$NON-NLS-1$
+ }
+
+ sessions.put(userID, session);
+ return session;
+ }
+
+ public ICollaboration initiateCollaboration(IBuddy initiator, String... userIDs)
+ {
+ long collaborationID;
+ synchronized (this)
+ {
+ collaborationID = ++lastCollaborationID;
+ }
+
+ Collaboration collaboration = new Collaboration(collaborationID);
+ collaboration.activate();
+ Membership.create(initiator, collaboration);
+
+ Set<IBuddy> buddies = new HashSet<IBuddy>();
+ buddies.add(initiator);
+ for (String userID : userIDs)
+ {
+ Buddy buddy = (Buddy)getBuddy(userID);
+ if (buddy != null)
+ {
+ buddies.add(buddy);
+ Membership.create(buddy, collaboration);
+ }
+ }
+
+ addCollaboration(collaboration);
+
+ Set<IBuddy> invitations = new HashSet<IBuddy>(buddies);
+ for (IBuddy buddy : buddies)
+ {
+ if (buddy != initiator)
+ {
+ try
+ {
+ invitations.remove(buddy);
+ BuddiesServerProtocol protocol = (BuddiesServerProtocol)buddy.getSession().getProtocol();
+ new CollaborationInitiatedNotification(protocol, collaborationID, invitations, null).sendAsync();
+ }
+ catch (Exception ex)
+ {
+ OM.LOG.error(ex);
+ }
+ finally
+ {
+ invitations.add(buddy);
+ }
+ }
+ }
+
+ return collaboration;
+ }
+
+ @Override
+ public void notifyEvent(IEvent event)
+ {
+ if (event.getSource() instanceof ServerSession)
+ {
+ if (event instanceof ILifecycleEvent)
+ {
+ if (((ILifecycleEvent)event).getKind() == ILifecycleEvent.Kind.DEACTIVATED)
+ {
+ String userID = ((ServerSession)event.getSource()).getSelf().getUserID();
+ synchronized (this)
+ {
+ ServerSession removed = (ServerSession)sessions.remove(userID);
+ if (removed != null)
+ {
+ removed.removeListener(this);
+ removed.getSelf().removeListener(this);
+ for (ISession session : sessions.values())
+ {
+ try
+ {
+ BuddiesServerProtocol protocol = (BuddiesServerProtocol)session.getProtocol();
+ new BuddyRemovedNotification(protocol, userID).sendAsync();
+ }
+ catch (Exception ex)
+ {
+ OM.LOG.error(ex);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ else if (event.getSource() instanceof ServerBuddy)
+ {
+ if (event instanceof IBuddyStateEvent)
+ {
+ IBuddyStateEvent e = (IBuddyStateEvent)event;
+ synchronized (this)
+ {
+ for (ISession session : sessions.values())
+ {
+ try
+ {
+ if (!ObjectUtil.equals(session.getSelf(), e.getSource()))
+ {
+ BuddiesServerProtocol protocol = (BuddiesServerProtocol)session.getProtocol();
+ new BuddyStateNotification(protocol, e.getSource().getUserID(), e.getNewState()).sendAsync();
+ }
+ }
+ catch (Exception ex)
+ {
+ OM.LOG.error(ex);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public static Set<String> getFacilityTypes()
+ {
+ return IPluginContainer.INSTANCE.getFactoryTypes(ServerFacilityFactory.PRODUCT_GROUP);
+ }
+}
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/ServerBuddy.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/ServerBuddy.java
index 90aaa3798b..704fc64ae3 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/ServerBuddy.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/ServerBuddy.java
@@ -1,62 +1,62 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.buddies.internal.server;
-
-import org.eclipse.net4j.buddies.common.IAccount;
-import org.eclipse.net4j.buddies.common.IBuddy;
-import org.eclipse.net4j.buddies.common.IMembership;
-import org.eclipse.net4j.buddies.internal.common.Buddy;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-
-/**
- * @author Eike Stepper
- */
-public class ServerBuddy extends Buddy
-{
- private IAccount account;
-
- public ServerBuddy(IAccount account, String[] facilityTypes)
- {
- super(null, new HashSet<String>(Arrays.asList(facilityTypes)));
- this.account = account;
- }
-
- public String getUserID()
- {
- return account.getUserID();
- }
-
- public IAccount getAccount()
- {
- return account;
- }
-
- public IMembership[] initiate(Collection<IBuddy> buddies)
- {
- // TODO Implement method ServerBuddy.initiate()
- throw new UnsupportedOperationException("Not yet implemented"); //$NON-NLS-1$
- }
-
- public IMembership join(long collaborationID)
- {
- // TODO Implement method ServerBuddy.join()
- throw new UnsupportedOperationException("Not yet implemented"); //$NON-NLS-1$
- }
-
- public IMembership join(Object invitationToken)
- {
- // TODO Implement method ServerBuddy.join()
- throw new UnsupportedOperationException("Not yet implemented"); //$NON-NLS-1$
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.buddies.internal.server;
+
+import org.eclipse.net4j.buddies.common.IAccount;
+import org.eclipse.net4j.buddies.common.IBuddy;
+import org.eclipse.net4j.buddies.common.IMembership;
+import org.eclipse.net4j.buddies.internal.common.Buddy;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+
+/**
+ * @author Eike Stepper
+ */
+public class ServerBuddy extends Buddy
+{
+ private IAccount account;
+
+ public ServerBuddy(IAccount account, String[] facilityTypes)
+ {
+ super(null, new HashSet<String>(Arrays.asList(facilityTypes)));
+ this.account = account;
+ }
+
+ public String getUserID()
+ {
+ return account.getUserID();
+ }
+
+ public IAccount getAccount()
+ {
+ return account;
+ }
+
+ public IMembership[] initiate(Collection<IBuddy> buddies)
+ {
+ // TODO Implement method ServerBuddy.initiate()
+ throw new UnsupportedOperationException("Not yet implemented"); //$NON-NLS-1$
+ }
+
+ public IMembership join(long collaborationID)
+ {
+ // TODO Implement method ServerBuddy.join()
+ throw new UnsupportedOperationException("Not yet implemented"); //$NON-NLS-1$
+ }
+
+ public IMembership join(Object invitationToken)
+ {
+ // TODO Implement method ServerBuddy.join()
+ throw new UnsupportedOperationException("Not yet implemented"); //$NON-NLS-1$
+ }
+}
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/ServerSession.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/ServerSession.java
index a36502d5a8..2ef52123b1 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/ServerSession.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/ServerSession.java
@@ -1,102 +1,102 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.buddies.internal.server;
-
-import org.eclipse.net4j.buddies.common.IBuddy;
-import org.eclipse.net4j.buddies.common.ISession;
-import org.eclipse.net4j.buddies.internal.server.protocol.BuddiesServerProtocol;
-import org.eclipse.net4j.util.event.IEvent;
-import org.eclipse.net4j.util.event.IListener;
-import org.eclipse.net4j.util.lifecycle.ILifecycleEvent;
-import org.eclipse.net4j.util.lifecycle.Lifecycle;
-import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
-import org.eclipse.net4j.util.om.log.OMLogger;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.PlatformObject;
-
-/**
- * @author Eike Stepper
- */
-public class ServerSession extends Lifecycle implements ISession, IListener
-{
- private BuddiesServerProtocol protocol;
-
- private IBuddy self;
-
- /**
- * @since 2.0
- */
- public ServerSession(BuddiesServerProtocol protocol, IBuddy self)
- {
- this.protocol = protocol;
- this.self = self;
- }
-
- /**
- * @since 2.0
- */
- public BuddiesServerProtocol getProtocol()
- {
- return protocol;
- }
-
- public IBuddy getSelf()
- {
- return self;
- }
-
- public void close()
- {
- protocol.close();
- protocol = null;
- LifecycleUtil.deactivate(this, OMLogger.Level.DEBUG);
- }
-
- /**
- * @see PlatformObject#getAdapter(Class)
- */
- @SuppressWarnings("rawtypes")
- public Object getAdapter(Class adapter)
- {
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-
- public void notifyEvent(IEvent event)
- {
- if (event.getSource() == protocol)
- {
- if (event instanceof ILifecycleEvent)
- {
- if (((ILifecycleEvent)event).getKind() == ILifecycleEvent.Kind.DEACTIVATED)
- {
- deactivate();
- }
- }
- }
- }
-
- @Override
- protected void doActivate() throws Exception
- {
- super.doActivate();
- protocol.addListener(this);
- self.getAccount().touch();
- }
-
- @Override
- protected void doDeactivate() throws Exception
- {
- self.getAccount().touch();
- protocol.removeListener(this);
- super.doDeactivate();
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.buddies.internal.server;
+
+import org.eclipse.net4j.buddies.common.IBuddy;
+import org.eclipse.net4j.buddies.common.ISession;
+import org.eclipse.net4j.buddies.internal.server.protocol.BuddiesServerProtocol;
+import org.eclipse.net4j.util.event.IEvent;
+import org.eclipse.net4j.util.event.IListener;
+import org.eclipse.net4j.util.lifecycle.ILifecycleEvent;
+import org.eclipse.net4j.util.lifecycle.Lifecycle;
+import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
+import org.eclipse.net4j.util.om.log.OMLogger;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.PlatformObject;
+
+/**
+ * @author Eike Stepper
+ */
+public class ServerSession extends Lifecycle implements ISession, IListener
+{
+ private BuddiesServerProtocol protocol;
+
+ private IBuddy self;
+
+ /**
+ * @since 2.0
+ */
+ public ServerSession(BuddiesServerProtocol protocol, IBuddy self)
+ {
+ this.protocol = protocol;
+ this.self = self;
+ }
+
+ /**
+ * @since 2.0
+ */
+ public BuddiesServerProtocol getProtocol()
+ {
+ return protocol;
+ }
+
+ public IBuddy getSelf()
+ {
+ return self;
+ }
+
+ public void close()
+ {
+ protocol.close();
+ protocol = null;
+ LifecycleUtil.deactivate(this, OMLogger.Level.DEBUG);
+ }
+
+ /**
+ * @see PlatformObject#getAdapter(Class)
+ */
+ @SuppressWarnings("rawtypes")
+ public Object getAdapter(Class adapter)
+ {
+ return Platform.getAdapterManager().getAdapter(this, adapter);
+ }
+
+ public void notifyEvent(IEvent event)
+ {
+ if (event.getSource() == protocol)
+ {
+ if (event instanceof ILifecycleEvent)
+ {
+ if (((ILifecycleEvent)event).getKind() == ILifecycleEvent.Kind.DEACTIVATED)
+ {
+ deactivate();
+ }
+ }
+ }
+ }
+
+ @Override
+ protected void doActivate() throws Exception
+ {
+ super.doActivate();
+ protocol.addListener(this);
+ self.getAccount().touch();
+ }
+
+ @Override
+ protected void doDeactivate() throws Exception
+ {
+ self.getAccount().touch();
+ protocol.removeListener(this);
+ super.doDeactivate();
+ }
+}
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/bundle/OM.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/bundle/OM.java
index 199b738ae3..efc8c9ce0d 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/bundle/OM.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/bundle/OM.java
@@ -1,65 +1,65 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.buddies.internal.server.bundle;
-
-import org.eclipse.net4j.buddies.internal.server.BuddyAdmin;
-import org.eclipse.net4j.util.om.OMBundle;
-import org.eclipse.net4j.util.om.OMPlatform;
-import org.eclipse.net4j.util.om.OSGiActivator;
-import org.eclipse.net4j.util.om.log.OMLogger;
-import org.eclipse.net4j.util.om.trace.OMTracer;
-
-/**
- * The <em>Operations & Maintenance</em> class of this bundle.
- *
- * @author Eike Stepper
- */
-public abstract class OM
-{
- public static final String BUNDLE_ID = "org.eclipse.net4j.buddies.server"; //$NON-NLS-1$
-
- public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class);
-
- public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$
-
- public static final OMTracer DEBUG_PROTOCOL = DEBUG.tracer("protocol"); //$NON-NLS-1$
-
- public static final OMTracer DEBUG_REPOSITORY = DEBUG.tracer("repository"); //$NON-NLS-1$
-
- public static final OMTracer DEBUG_SESSION = DEBUG.tracer("session"); //$NON-NLS-1$
-
- public static final OMTracer DEBUG_REVISION = DEBUG.tracer("revision"); //$NON-NLS-1$
-
- public static final OMTracer DEBUG_RESOURCE = DEBUG.tracer("resource"); //$NON-NLS-1$
-
- public static final OMTracer DEBUG_STORE = DEBUG.tracer("store"); //$NON-NLS-1$
-
- public static final OMTracer DEBUG_TYPES = DEBUG.tracer("types"); //$NON-NLS-1$
-
- public static final OMLogger LOG = BUNDLE.logger();
-
- /**
- * @author Eike Stepper
- */
- public static final class Activator extends OSGiActivator
- {
- public Activator()
- {
- super(BUNDLE);
- }
-
- @Override
- protected void doStop() throws Exception
- {
- BuddyAdmin.INSTANCE.deactivate();
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.buddies.internal.server.bundle;
+
+import org.eclipse.net4j.buddies.internal.server.BuddyAdmin;
+import org.eclipse.net4j.util.om.OMBundle;
+import org.eclipse.net4j.util.om.OMPlatform;
+import org.eclipse.net4j.util.om.OSGiActivator;
+import org.eclipse.net4j.util.om.log.OMLogger;
+import org.eclipse.net4j.util.om.trace.OMTracer;
+
+/**
+ * The <em>Operations & Maintenance</em> class of this bundle.
+ *
+ * @author Eike Stepper
+ */
+public abstract class OM
+{
+ public static final String BUNDLE_ID = "org.eclipse.net4j.buddies.server"; //$NON-NLS-1$
+
+ public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class);
+
+ public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$
+
+ public static final OMTracer DEBUG_PROTOCOL = DEBUG.tracer("protocol"); //$NON-NLS-1$
+
+ public static final OMTracer DEBUG_REPOSITORY = DEBUG.tracer("repository"); //$NON-NLS-1$
+
+ public static final OMTracer DEBUG_SESSION = DEBUG.tracer("session"); //$NON-NLS-1$
+
+ public static final OMTracer DEBUG_REVISION = DEBUG.tracer("revision"); //$NON-NLS-1$
+
+ public static final OMTracer DEBUG_RESOURCE = DEBUG.tracer("resource"); //$NON-NLS-1$
+
+ public static final OMTracer DEBUG_STORE = DEBUG.tracer("store"); //$NON-NLS-1$
+
+ public static final OMTracer DEBUG_TYPES = DEBUG.tracer("types"); //$NON-NLS-1$
+
+ public static final OMLogger LOG = BUNDLE.logger();
+
+ /**
+ * @author Eike Stepper
+ */
+ public static final class Activator extends OSGiActivator
+ {
+ public Activator()
+ {
+ super(BUNDLE);
+ }
+
+ @Override
+ protected void doStop() throws Exception
+ {
+ BuddyAdmin.INSTANCE.deactivate();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/messages/Messages.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/messages/Messages.java
index 94894320d1..fb538eb646 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/messages/Messages.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/messages/Messages.java
@@ -1,41 +1,41 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Victor Roldan Betancort - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.buddies.internal.server.messages;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * @author Victor Roldan Betancort
- */
-public class Messages
-{
- private static final String BUNDLE_NAME = "org.eclipse.net4j.buddies.internal.server.messages.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private Messages()
- {
- }
-
- public static String getString(String key)
- {
- try
- {
- return RESOURCE_BUNDLE.getString(key);
- }
- catch (MissingResourceException e)
- {
- return '!' + key + '!';
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.net4j.buddies.internal.server.messages;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * @author Victor Roldan Betancort
+ */
+public class Messages
+{
+ private static final String BUNDLE_NAME = "org.eclipse.net4j.buddies.internal.server.messages.messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private Messages()
+ {
+ }
+
+ public static String getString(String key)
+ {
+ try
+ {
+ return RESOURCE_BUNDLE.getString(key);
+ }
+ catch (MissingResourceException e)
+ {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/messages/messages.properties b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/messages/messages.properties
index eaec7e0c00..bf91c875f3 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/messages/messages.properties
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/messages/messages.properties
@@ -1,11 +1,11 @@
-# Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Victor Roldan Betancort - initial API and implementation
-# Eike Stepper - maintenance
-
-OpenSessionIndication.0=User denied {0}
+# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Victor Roldan Betancort - initial API and implementation
+# Eike Stepper - maintenance
+
+OpenSessionIndication.0=User denied {0}
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/BuddiesServerProtocol.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/BuddiesServerProtocol.java
index caf353a792..1d2063c1e2 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/BuddiesServerProtocol.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/BuddiesServerProtocol.java
@@ -1,86 +1,86 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.buddies.internal.server.protocol;
-
-import org.eclipse.net4j.buddies.internal.common.protocol.MessageIndication;
-import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
-import org.eclipse.net4j.buddies.internal.server.ServerSession;
-import org.eclipse.net4j.buddies.server.IBuddyAdmin;
-import org.eclipse.net4j.signal.SignalProtocol;
-import org.eclipse.net4j.signal.SignalReactor;
-import org.eclipse.net4j.util.container.IManagedContainer;
-
-/**
- * @author Eike Stepper
- * @since 2.0
- */
-public class BuddiesServerProtocol extends SignalProtocol<ServerSession>
-{
- public BuddiesServerProtocol()
- {
- super(ProtocolConstants.PROTOCOL_NAME);
- }
-
- @Override
- protected SignalReactor createSignalReactor(short signalID)
- {
- switch (signalID)
- {
- case ProtocolConstants.SIGNAL_OPEN_SESSION:
- return new OpenSessionIndication(this);
-
- case ProtocolConstants.SIGNAL_LOAD_ACCOUNT:
- return new LoadAccountIndication(this);
-
- case ProtocolConstants.SIGNAL_BUDDY_STATE:
- return new ServerBuddyStateIndication(this);
-
- case ProtocolConstants.SIGNAL_INSTALL_FACILITY:
- return new InstallFacilityIndication(this);
-
- case ProtocolConstants.SIGNAL_INITIATE_COLLABORATION:
- return new InitiateCollaborationIndication(this);
-
- case ProtocolConstants.SIGNAL_INVITE_BUDDIES:
- return new InviteBuddiesIndication(this);
-
- case ProtocolConstants.SIGNAL_COLLABORATION_LEFT:
- return new ServerCollaborationLeftIndication(this);
-
- case ProtocolConstants.SIGNAL_MESSAGE:
- return new MessageIndication(this, IBuddyAdmin.INSTANCE);
-
- default:
- return super.createSignalReactor(signalID);
- }
- }
-
- /**
- * @author Eike Stepper
- */
- public static class Factory extends org.eclipse.spi.net4j.ServerProtocolFactory
- {
- public Factory()
- {
- super(ProtocolConstants.PROTOCOL_NAME);
- }
-
- public BuddiesServerProtocol create(String description)
- {
- return new BuddiesServerProtocol();
- }
-
- public static BuddiesServerProtocol get(IManagedContainer container, String description)
- {
- return (BuddiesServerProtocol)container.getElement(PRODUCT_GROUP, ProtocolConstants.PROTOCOL_NAME, description);
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.buddies.internal.server.protocol;
+
+import org.eclipse.net4j.buddies.internal.common.protocol.MessageIndication;
+import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
+import org.eclipse.net4j.buddies.internal.server.ServerSession;
+import org.eclipse.net4j.buddies.server.IBuddyAdmin;
+import org.eclipse.net4j.signal.SignalProtocol;
+import org.eclipse.net4j.signal.SignalReactor;
+import org.eclipse.net4j.util.container.IManagedContainer;
+
+/**
+ * @author Eike Stepper
+ * @since 2.0
+ */
+public class BuddiesServerProtocol extends SignalProtocol<ServerSession>
+{
+ public BuddiesServerProtocol()
+ {
+ super(ProtocolConstants.PROTOCOL_NAME);
+ }
+
+ @Override
+ protected SignalReactor createSignalReactor(short signalID)
+ {
+ switch (signalID)
+ {
+ case ProtocolConstants.SIGNAL_OPEN_SESSION:
+ return new OpenSessionIndication(this);
+
+ case ProtocolConstants.SIGNAL_LOAD_ACCOUNT:
+ return new LoadAccountIndication(this);
+
+ case ProtocolConstants.SIGNAL_BUDDY_STATE:
+ return new ServerBuddyStateIndication(this);
+
+ case ProtocolConstants.SIGNAL_INSTALL_FACILITY:
+ return new InstallFacilityIndication(this);
+
+ case ProtocolConstants.SIGNAL_INITIATE_COLLABORATION:
+ return new InitiateCollaborationIndication(this);
+
+ case ProtocolConstants.SIGNAL_INVITE_BUDDIES:
+ return new InviteBuddiesIndication(this);
+
+ case ProtocolConstants.SIGNAL_COLLABORATION_LEFT:
+ return new ServerCollaborationLeftIndication(this);
+
+ case ProtocolConstants.SIGNAL_MESSAGE:
+ return new MessageIndication(this, IBuddyAdmin.INSTANCE);
+
+ default:
+ return super.createSignalReactor(signalID);
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static class Factory extends org.eclipse.spi.net4j.ServerProtocolFactory
+ {
+ public Factory()
+ {
+ super(ProtocolConstants.PROTOCOL_NAME);
+ }
+
+ public BuddiesServerProtocol create(String description)
+ {
+ return new BuddiesServerProtocol();
+ }
+
+ public static BuddiesServerProtocol get(IManagedContainer container, String description)
+ {
+ return (BuddiesServerProtocol)container.getElement(PRODUCT_GROUP, ProtocolConstants.PROTOCOL_NAME, description);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/BuddyAddedNotification.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/BuddyAddedNotification.java
index 9f050ffb28..f962edfd3b 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/BuddyAddedNotification.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/BuddyAddedNotification.java
@@ -1,39 +1,39 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.buddies.internal.server.protocol;
-
-import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
-import org.eclipse.net4j.signal.Request;
-import org.eclipse.net4j.signal.SignalProtocol;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-/**
- * @author Eike Stepper
- */
-public class BuddyAddedNotification extends Request
-{
- private String buddy;
-
- /**
- * @since 2.0
- */
- public BuddyAddedNotification(SignalProtocol<?> protocol, String buddy)
- {
- super(protocol, ProtocolConstants.SIGNAL_BUDDY_ADDED);
- this.buddy = buddy;
- }
-
- @Override
- protected void requesting(ExtendedDataOutputStream out) throws Exception
- {
- out.writeString(buddy);
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.buddies.internal.server.protocol;
+
+import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
+import org.eclipse.net4j.signal.Request;
+import org.eclipse.net4j.signal.SignalProtocol;
+import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
+
+/**
+ * @author Eike Stepper
+ */
+public class BuddyAddedNotification extends Request
+{
+ private String buddy;
+
+ /**
+ * @since 2.0
+ */
+ public BuddyAddedNotification(SignalProtocol<?> protocol, String buddy)
+ {
+ super(protocol, ProtocolConstants.SIGNAL_BUDDY_ADDED);
+ this.buddy = buddy;
+ }
+
+ @Override
+ protected void requesting(ExtendedDataOutputStream out) throws Exception
+ {
+ out.writeString(buddy);
+ }
+}
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/BuddyRemovedNotification.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/BuddyRemovedNotification.java
index 6d0244d25d..7bd9b67572 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/BuddyRemovedNotification.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/BuddyRemovedNotification.java
@@ -1,39 +1,39 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.buddies.internal.server.protocol;
-
-import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
-import org.eclipse.net4j.signal.Request;
-import org.eclipse.net4j.signal.SignalProtocol;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-/**
- * @author Eike Stepper
- */
-public class BuddyRemovedNotification extends Request
-{
- private String buddy;
-
- /**
- * @since 2.0
- */
- public BuddyRemovedNotification(SignalProtocol<?> protocol, String buddy)
- {
- super(protocol, ProtocolConstants.SIGNAL_BUDDY_REMOVED);
- this.buddy = buddy;
- }
-
- @Override
- protected void requesting(ExtendedDataOutputStream out) throws Exception
- {
- out.writeString(buddy);
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.buddies.internal.server.protocol;
+
+import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
+import org.eclipse.net4j.signal.Request;
+import org.eclipse.net4j.signal.SignalProtocol;
+import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
+
+/**
+ * @author Eike Stepper
+ */
+public class BuddyRemovedNotification extends Request
+{
+ private String buddy;
+
+ /**
+ * @since 2.0
+ */
+ public BuddyRemovedNotification(SignalProtocol<?> protocol, String buddy)
+ {
+ super(protocol, ProtocolConstants.SIGNAL_BUDDY_REMOVED);
+ this.buddy = buddy;
+ }
+
+ @Override
+ protected void requesting(ExtendedDataOutputStream out) throws Exception
+ {
+ out.writeString(buddy);
+ }
+}
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/CollaborationInitiatedNotification.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/CollaborationInitiatedNotification.java
index f37b3440bc..f8cacc7733 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/CollaborationInitiatedNotification.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/CollaborationInitiatedNotification.java
@@ -1,51 +1,51 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.buddies.internal.server.protocol;
-
-import org.eclipse.net4j.buddies.common.IBuddy;
-import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
-import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolUtil;
-import org.eclipse.net4j.signal.Request;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import java.util.Collection;
-
-/**
- * @author Eike Stepper
- */
-public class CollaborationInitiatedNotification extends Request
-{
- private long collaborationID;
-
- private Collection<IBuddy> buddies;
-
- private String[] facilityTypes;
-
- /**
- * @since 2.0
- */
- public CollaborationInitiatedNotification(BuddiesServerProtocol protocol, long collaborationID,
- Collection<IBuddy> buddies, String[] facilityTypes)
- {
- super(protocol, ProtocolConstants.SIGNAL_COLLABORATION_INITIATED);
- this.collaborationID = collaborationID;
- this.buddies = buddies;
- this.facilityTypes = facilityTypes;
- }
-
- @Override
- protected void requesting(ExtendedDataOutputStream out) throws Exception
- {
- out.writeLong(collaborationID);
- ProtocolUtil.writeBuddies(out, buddies);
- ProtocolUtil.writeFacilityTypes(out, facilityTypes);
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.buddies.internal.server.protocol;
+
+import org.eclipse.net4j.buddies.common.IBuddy;
+import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
+import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolUtil;
+import org.eclipse.net4j.signal.Request;
+import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
+
+import java.util.Collection;
+
+/**
+ * @author Eike Stepper
+ */
+public class CollaborationInitiatedNotification extends Request
+{
+ private long collaborationID;
+
+ private Collection<IBuddy> buddies;
+
+ private String[] facilityTypes;
+
+ /**
+ * @since 2.0
+ */
+ public CollaborationInitiatedNotification(BuddiesServerProtocol protocol, long collaborationID,
+ Collection<IBuddy> buddies, String[] facilityTypes)
+ {
+ super(protocol, ProtocolConstants.SIGNAL_COLLABORATION_INITIATED);
+ this.collaborationID = collaborationID;
+ this.buddies = buddies;
+ this.facilityTypes = facilityTypes;
+ }
+
+ @Override
+ protected void requesting(ExtendedDataOutputStream out) throws Exception
+ {
+ out.writeLong(collaborationID);
+ ProtocolUtil.writeBuddies(out, buddies);
+ ProtocolUtil.writeFacilityTypes(out, facilityTypes);
+ }
+}
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/FacilityInstalledNotification.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/FacilityInstalledNotification.java
index f704e29da5..4594989f4b 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/FacilityInstalledNotification.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/FacilityInstalledNotification.java
@@ -1,42 +1,42 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.buddies.internal.server.protocol;
-
-import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
-import org.eclipse.net4j.signal.Request;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-/**
- * @author Eike Stepper
- */
-public class FacilityInstalledNotification extends Request
-{
- private long collaborationID;
-
- private String facilityType;
-
- /**
- * @since 2.0
- */
- public FacilityInstalledNotification(BuddiesServerProtocol protocol, long collaborationID, String facilityType)
- {
- super(protocol, ProtocolConstants.SIGNAL_FACILITY_INSTALLED);
- this.collaborationID = collaborationID;
- this.facilityType = facilityType;
- }
-
- @Override
- protected void requesting(ExtendedDataOutputStream out) throws Exception
- {
- out.writeLong(collaborationID);
- out.writeString(facilityType);
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.buddies.internal.server.protocol;
+
+import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
+import org.eclipse.net4j.signal.Request;
+import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
+
+/**
+ * @author Eike Stepper
+ */
+public class FacilityInstalledNotification extends Request
+{
+ private long collaborationID;
+
+ private String facilityType;
+
+ /**
+ * @since 2.0
+ */
+ public FacilityInstalledNotification(BuddiesServerProtocol protocol, long collaborationID, String facilityType)
+ {
+ super(protocol, ProtocolConstants.SIGNAL_FACILITY_INSTALLED);
+ this.collaborationID = collaborationID;
+ this.facilityType = facilityType;
+ }
+
+ @Override
+ protected void requesting(ExtendedDataOutputStream out) throws Exception
+ {
+ out.writeLong(collaborationID);
+ out.writeString(facilityType);
+ }
+}
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/InitiateCollaborationIndication.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/InitiateCollaborationIndication.java
index 20731a7480..18cddad673 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/InitiateCollaborationIndication.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/InitiateCollaborationIndication.java
@@ -1,52 +1,52 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.buddies.internal.server.protocol;
-
-import org.eclipse.net4j.buddies.common.IBuddy;
-import org.eclipse.net4j.buddies.common.ICollaboration;
-import org.eclipse.net4j.buddies.common.ISession;
-import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
-import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolUtil;
-import org.eclipse.net4j.buddies.server.IBuddyAdmin;
-import org.eclipse.net4j.signal.IndicationWithResponse;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-/**
- * @author Eike Stepper
- */
-public class InitiateCollaborationIndication extends IndicationWithResponse
-{
- private ICollaboration collaboration;
-
- /**
- * @since 2.0
- */
- public InitiateCollaborationIndication(BuddiesServerProtocol protocol)
- {
- super(protocol, ProtocolConstants.SIGNAL_INITIATE_COLLABORATION);
- }
-
- @Override
- protected void indicating(ExtendedDataInputStream in) throws Exception
- {
- String[] userIDs = ProtocolUtil.readUserIDs(in);
- ISession session = (ISession)getProtocol().getInfraStructure();
- IBuddy initiator = session.getSelf();
- collaboration = IBuddyAdmin.INSTANCE.initiateCollaboration(initiator, userIDs);
- }
-
- @Override
- protected void responding(ExtendedDataOutputStream out) throws Exception
- {
- out.writeLong(collaboration.getID());
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.buddies.internal.server.protocol;
+
+import org.eclipse.net4j.buddies.common.IBuddy;
+import org.eclipse.net4j.buddies.common.ICollaboration;
+import org.eclipse.net4j.buddies.common.ISession;
+import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
+import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolUtil;
+import org.eclipse.net4j.buddies.server.IBuddyAdmin;
+import org.eclipse.net4j.signal.IndicationWithResponse;
+import org.eclipse.net4j.util.io.ExtendedDataInputStream;
+import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
+
+/**
+ * @author Eike Stepper
+ */
+public class InitiateCollaborationIndication extends IndicationWithResponse
+{
+ private ICollaboration collaboration;
+
+ /**
+ * @since 2.0
+ */
+ public InitiateCollaborationIndication(BuddiesServerProtocol protocol)
+ {
+ super(protocol, ProtocolConstants.SIGNAL_INITIATE_COLLABORATION);
+ }
+
+ @Override
+ protected void indicating(ExtendedDataInputStream in) throws Exception
+ {
+ String[] userIDs = ProtocolUtil.readUserIDs(in);
+ ISession session = (ISession)getProtocol().getInfraStructure();
+ IBuddy initiator = session.getSelf();
+ collaboration = IBuddyAdmin.INSTANCE.initiateCollaboration(initiator, userIDs);
+ }
+
+ @Override
+ protected void responding(ExtendedDataOutputStream out) throws Exception
+ {
+ out.writeLong(collaboration.getID());
+ }
+}
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/InstallFacilityIndication.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/InstallFacilityIndication.java
index 8283b31ab1..0864a180e9 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/InstallFacilityIndication.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/InstallFacilityIndication.java
@@ -1,93 +1,93 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.buddies.internal.server.protocol;
-
-import org.eclipse.net4j.buddies.common.IBuddy;
-import org.eclipse.net4j.buddies.common.IFacility;
-import org.eclipse.net4j.buddies.common.ISession;
-import org.eclipse.net4j.buddies.internal.common.Collaboration;
-import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
-import org.eclipse.net4j.buddies.internal.server.BuddyAdmin;
-import org.eclipse.net4j.buddies.internal.server.bundle.OM;
-import org.eclipse.net4j.buddies.spi.common.ServerFacilityFactory;
-import org.eclipse.net4j.signal.IndicationWithResponse;
-import org.eclipse.net4j.util.container.IPluginContainer;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-/**
- * @author Eike Stepper
- */
-public class InstallFacilityIndication extends IndicationWithResponse
-{
- private static final String FACILITY_GROUP = ServerFacilityFactory.PRODUCT_GROUP;
-
- private boolean success;
-
- /**
- * @since 2.0
- */
- public InstallFacilityIndication(BuddiesServerProtocol protocol)
- {
- super(protocol, ProtocolConstants.SIGNAL_INSTALL_FACILITY);
- }
-
- @Override
- protected void indicating(ExtendedDataInputStream in) throws Exception
- {
- long collaborationID = in.readLong();
- String facilityType = in.readString();
-
- try
- {
- String description = String.valueOf(collaborationID);
- IFacility facility = (IFacility)IPluginContainer.INSTANCE.getElement(FACILITY_GROUP, facilityType, description);
-
- Collaboration collaboration = (Collaboration)BuddyAdmin.INSTANCE.getCollaboration(collaborationID);
- if (collaboration != null)
- {
- facility.setCollaboration(collaboration);
- collaboration.addFacility(facility, true);
-
- ISession session = (ISession)getProtocol().getInfraStructure();
- IBuddy initiator = session.getSelf();
-
- for (IBuddy buddy : collaboration.getBuddies())
- {
- if (buddy != initiator)
- {
- try
- {
- BuddiesServerProtocol protocol = (BuddiesServerProtocol)buddy.getSession().getProtocol();
- new FacilityInstalledNotification(protocol, collaborationID, facilityType).sendAsync();
- }
- catch (Exception ex)
- {
- OM.LOG.error(ex);
- }
- }
- }
-
- success = true;
- }
- }
- catch (RuntimeException ex)
- {
- OM.LOG.error(ex);
- }
- }
-
- @Override
- protected void responding(ExtendedDataOutputStream out) throws Exception
- {
- out.writeBoolean(success);
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.buddies.internal.server.protocol;
+
+import org.eclipse.net4j.buddies.common.IBuddy;
+import org.eclipse.net4j.buddies.common.IFacility;
+import org.eclipse.net4j.buddies.common.ISession;
+import org.eclipse.net4j.buddies.internal.common.Collaboration;
+import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
+import org.eclipse.net4j.buddies.internal.server.BuddyAdmin;
+import org.eclipse.net4j.buddies.internal.server.bundle.OM;
+import org.eclipse.net4j.buddies.spi.common.ServerFacilityFactory;
+import org.eclipse.net4j.signal.IndicationWithResponse;
+import org.eclipse.net4j.util.container.IPluginContainer;
+import org.eclipse.net4j.util.io.ExtendedDataInputStream;
+import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
+
+/**
+ * @author Eike Stepper
+ */
+public class InstallFacilityIndication extends IndicationWithResponse
+{
+ private static final String FACILITY_GROUP = ServerFacilityFactory.PRODUCT_GROUP;
+
+ private boolean success;
+
+ /**
+ * @since 2.0
+ */
+ public InstallFacilityIndication(BuddiesServerProtocol protocol)
+ {
+ super(protocol, ProtocolConstants.SIGNAL_INSTALL_FACILITY);
+ }
+
+ @Override
+ protected void indicating(ExtendedDataInputStream in) throws Exception
+ {
+ long collaborationID = in.readLong();
+ String facilityType = in.readString();
+
+ try
+ {
+ String description = String.valueOf(collaborationID);
+ IFacility facility = (IFacility)IPluginContainer.INSTANCE.getElement(FACILITY_GROUP, facilityType, description);
+
+ Collaboration collaboration = (Collaboration)BuddyAdmin.INSTANCE.getCollaboration(collaborationID);
+ if (collaboration != null)
+ {
+ facility.setCollaboration(collaboration);
+ collaboration.addFacility(facility, true);
+
+ ISession session = (ISession)getProtocol().getInfraStructure();
+ IBuddy initiator = session.getSelf();
+
+ for (IBuddy buddy : collaboration.getBuddies())
+ {
+ if (buddy != initiator)
+ {
+ try
+ {
+ BuddiesServerProtocol protocol = (BuddiesServerProtocol)buddy.getSession().getProtocol();
+ new FacilityInstalledNotification(protocol, collaborationID, facilityType).sendAsync();
+ }
+ catch (Exception ex)
+ {
+ OM.LOG.error(ex);
+ }
+ }
+ }
+
+ success = true;
+ }
+ }
+ catch (RuntimeException ex)
+ {
+ OM.LOG.error(ex);
+ }
+ }
+
+ @Override
+ protected void responding(ExtendedDataOutputStream out) throws Exception
+ {
+ out.writeBoolean(success);
+ }
+}
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/InviteBuddiesIndication.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/InviteBuddiesIndication.java
index ded9c06ca1..c847dfc007 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/InviteBuddiesIndication.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/InviteBuddiesIndication.java
@@ -1,92 +1,92 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.buddies.internal.server.protocol;
-
-import org.eclipse.net4j.buddies.common.IBuddy;
-import org.eclipse.net4j.buddies.internal.common.Collaboration;
-import org.eclipse.net4j.buddies.internal.common.Membership;
-import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
-import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolUtil;
-import org.eclipse.net4j.buddies.internal.server.BuddyAdmin;
-import org.eclipse.net4j.signal.Indication;
-import org.eclipse.net4j.util.WrappedException;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * @author Eike Stepper
- */
-public class InviteBuddiesIndication extends Indication
-{
- /**
- * @since 2.0
- */
- public InviteBuddiesIndication(BuddiesServerProtocol protocol)
- {
- super(protocol, ProtocolConstants.SIGNAL_INVITE_BUDDIES);
- }
-
- @Override
- protected void indicating(ExtendedDataInputStream in) throws Exception
- {
- long collaborationID = in.readLong();
- String[] userIDs = ProtocolUtil.readUserIDs(in);
-
- Collaboration collaboration = (Collaboration)BuddyAdmin.INSTANCE.getCollaboration(collaborationID);
- if (collaboration != null)
- {
- Set<IBuddy> added = new HashSet<IBuddy>();
- for (String userID : userIDs)
- {
- IBuddy buddy = BuddyAdmin.INSTANCE.getBuddy(userID);
- if (buddy != null && collaboration.getMembership(buddy) == null)
- {
- Membership.create(buddy, collaboration);
- added.add(buddy);
- }
- }
-
- List<IBuddy> buddies = Arrays.asList(collaboration.getBuddies());
- for (IBuddy buddy : buddies)
- {
- String[] facilityTypes = null;
- Set<IBuddy> set = new HashSet<IBuddy>();
- if (added.contains(buddy))
- {
- set.addAll(buddies);
- set.remove(buddy);
- facilityTypes = collaboration.getFacilityTypes();
- }
- else
- {
- set.addAll(added);
- }
-
- if (!set.isEmpty())
- {
- try
- {
- BuddiesServerProtocol protocol = (BuddiesServerProtocol)buddy.getSession().getProtocol();
- new CollaborationInitiatedNotification(protocol, collaborationID, set, facilityTypes).sendAsync();
- }
- catch (Exception ex)
- {
- throw WrappedException.wrap(ex);
- }
- }
- }
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.buddies.internal.server.protocol;
+
+import org.eclipse.net4j.buddies.common.IBuddy;
+import org.eclipse.net4j.buddies.internal.common.Collaboration;
+import org.eclipse.net4j.buddies.internal.common.Membership;
+import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
+import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolUtil;
+import org.eclipse.net4j.buddies.internal.server.BuddyAdmin;
+import org.eclipse.net4j.signal.Indication;
+import org.eclipse.net4j.util.WrappedException;
+import org.eclipse.net4j.util.io.ExtendedDataInputStream;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author Eike Stepper
+ */
+public class InviteBuddiesIndication extends Indication
+{
+ /**
+ * @since 2.0
+ */
+ public InviteBuddiesIndication(BuddiesServerProtocol protocol)
+ {
+ super(protocol, ProtocolConstants.SIGNAL_INVITE_BUDDIES);
+ }
+
+ @Override
+ protected void indicating(ExtendedDataInputStream in) throws Exception
+ {
+ long collaborationID = in.readLong();
+ String[] userIDs = ProtocolUtil.readUserIDs(in);
+
+ Collaboration collaboration = (Collaboration)BuddyAdmin.INSTANCE.getCollaboration(collaborationID);
+ if (collaboration != null)
+ {
+ Set<IBuddy> added = new HashSet<IBuddy>();
+ for (String userID : userIDs)
+ {
+ IBuddy buddy = BuddyAdmin.INSTANCE.getBuddy(userID);
+ if (buddy != null && collaboration.getMembership(buddy) == null)
+ {
+ Membership.create(buddy, collaboration);
+ added.add(buddy);
+ }
+ }
+
+ List<IBuddy> buddies = Arrays.asList(collaboration.getBuddies());
+ for (IBuddy buddy : buddies)
+ {
+ String[] facilityTypes = null;
+ Set<IBuddy> set = new HashSet<IBuddy>();
+ if (added.contains(buddy))
+ {
+ set.addAll(buddies);
+ set.remove(buddy);
+ facilityTypes = collaboration.getFacilityTypes();
+ }
+ else
+ {
+ set.addAll(added);
+ }
+
+ if (!set.isEmpty())
+ {
+ try
+ {
+ BuddiesServerProtocol protocol = (BuddiesServerProtocol)buddy.getSession().getProtocol();
+ new CollaborationInitiatedNotification(protocol, collaborationID, set, facilityTypes).sendAsync();
+ }
+ catch (Exception ex)
+ {
+ throw WrappedException.wrap(ex);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/LoadAccountIndication.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/LoadAccountIndication.java
index 0792c19118..499ca0fa61 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/LoadAccountIndication.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/LoadAccountIndication.java
@@ -1,48 +1,48 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.buddies.internal.server.protocol;
-
-import org.eclipse.net4j.buddies.common.IAccount;
-import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
-import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolUtil;
-import org.eclipse.net4j.buddies.server.IBuddyAdmin;
-import org.eclipse.net4j.signal.IndicationWithResponse;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-/**
- * @author Eike Stepper
- */
-public class LoadAccountIndication extends IndicationWithResponse
-{
- private IAccount account;
-
- /**
- * @since 2.0
- */
- public LoadAccountIndication(BuddiesServerProtocol protocol)
- {
- super(protocol, ProtocolConstants.SIGNAL_LOAD_ACCOUNT);
- }
-
- @Override
- protected void indicating(ExtendedDataInputStream in) throws Exception
- {
- String userID = in.readString();
- account = IBuddyAdmin.INSTANCE.getAccounts().get(userID);
- }
-
- @Override
- protected void responding(ExtendedDataOutputStream out) throws Exception
- {
- ProtocolUtil.writeAccount(out, account);
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.buddies.internal.server.protocol;
+
+import org.eclipse.net4j.buddies.common.IAccount;
+import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
+import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolUtil;
+import org.eclipse.net4j.buddies.server.IBuddyAdmin;
+import org.eclipse.net4j.signal.IndicationWithResponse;
+import org.eclipse.net4j.util.io.ExtendedDataInputStream;
+import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
+
+/**
+ * @author Eike Stepper
+ */
+public class LoadAccountIndication extends IndicationWithResponse
+{
+ private IAccount account;
+
+ /**
+ * @since 2.0
+ */
+ public LoadAccountIndication(BuddiesServerProtocol protocol)
+ {
+ super(protocol, ProtocolConstants.SIGNAL_LOAD_ACCOUNT);
+ }
+
+ @Override
+ protected void indicating(ExtendedDataInputStream in) throws Exception
+ {
+ String userID = in.readString();
+ account = IBuddyAdmin.INSTANCE.getAccounts().get(userID);
+ }
+
+ @Override
+ protected void responding(ExtendedDataOutputStream out) throws Exception
+ {
+ ProtocolUtil.writeAccount(out, account);
+ }
+}
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/OpenSessionIndication.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/OpenSessionIndication.java
index 2d8939871d..0f07b32007 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/OpenSessionIndication.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/OpenSessionIndication.java
@@ -1,104 +1,104 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.buddies.internal.server.protocol;
-
-import org.eclipse.net4j.buddies.common.IAccount;
-import org.eclipse.net4j.buddies.common.IBuddy;
-import org.eclipse.net4j.buddies.common.ISession;
-import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
-import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolUtil;
-import org.eclipse.net4j.buddies.internal.server.bundle.OM;
-import org.eclipse.net4j.buddies.internal.server.messages.Messages;
-import org.eclipse.net4j.buddies.server.IBuddyAdmin;
-import org.eclipse.net4j.signal.IndicationWithResponse;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Eike Stepper
- */
-public class OpenSessionIndication extends IndicationWithResponse
-{
- private IAccount account;
-
- private IBuddy[] buddies;
-
- /**
- * @since 2.0
- */
- public OpenSessionIndication(BuddiesServerProtocol protocol)
- {
- super(protocol, ProtocolConstants.SIGNAL_OPEN_SESSION);
- }
-
- @Override
- protected void indicating(ExtendedDataInputStream in) throws Exception
- {
- String userID = in.readString();
- String password = in.readString();
- int size = in.readInt();
- String[] facilityTypes = new String[size];
- for (int i = 0; i < size; i++)
- {
- facilityTypes[i] = in.readString();
- }
-
- synchronized (IBuddyAdmin.INSTANCE)
- {
- buddies = IBuddyAdmin.INSTANCE.getBuddies();
- ISession session = IBuddyAdmin.INSTANCE.openSession(getProtocol().getChannel(), userID, password, facilityTypes);
- if (session != null)
- {
- account = session.getSelf().getAccount();
- }
- else
- {
- OM.LOG.info(MessageFormat.format(Messages.getString("OpenSessionIndication.0"), userID)); //$NON-NLS-1$
- }
- }
- }
-
- @Override
- protected void responding(ExtendedDataOutputStream out) throws Exception
- {
- ProtocolUtil.writeAccount(out, account);
- if (account != null)
- {
- List<BuddiesServerProtocol> protocols = new ArrayList<BuddiesServerProtocol>();
- out.writeInt(buddies.length);
- for (IBuddy buddy : buddies)
- {
- out.writeString(buddy.getUserID());
- ISession buddySession = IBuddyAdmin.INSTANCE.getSession(buddy);
- if (buddySession != null)
- {
- protocols.add((BuddiesServerProtocol)buddySession.getProtocol());
- }
- }
-
- for (BuddiesServerProtocol protocol : protocols)
- {
- try
- {
- new BuddyAddedNotification(protocol, account.getUserID()).sendAsync();
- }
- catch (Exception ex)
- {
- OM.LOG.error(ex);
- }
- }
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.buddies.internal.server.protocol;
+
+import org.eclipse.net4j.buddies.common.IAccount;
+import org.eclipse.net4j.buddies.common.IBuddy;
+import org.eclipse.net4j.buddies.common.ISession;
+import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
+import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolUtil;
+import org.eclipse.net4j.buddies.internal.server.bundle.OM;
+import org.eclipse.net4j.buddies.internal.server.messages.Messages;
+import org.eclipse.net4j.buddies.server.IBuddyAdmin;
+import org.eclipse.net4j.signal.IndicationWithResponse;
+import org.eclipse.net4j.util.io.ExtendedDataInputStream;
+import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Eike Stepper
+ */
+public class OpenSessionIndication extends IndicationWithResponse
+{
+ private IAccount account;
+
+ private IBuddy[] buddies;
+
+ /**
+ * @since 2.0
+ */
+ public OpenSessionIndication(BuddiesServerProtocol protocol)
+ {
+ super(protocol, ProtocolConstants.SIGNAL_OPEN_SESSION);
+ }
+
+ @Override
+ protected void indicating(ExtendedDataInputStream in) throws Exception
+ {
+ String userID = in.readString();
+ String password = in.readString();
+ int size = in.readInt();
+ String[] facilityTypes = new String[size];
+ for (int i = 0; i < size; i++)
+ {
+ facilityTypes[i] = in.readString();
+ }
+
+ synchronized (IBuddyAdmin.INSTANCE)
+ {
+ buddies = IBuddyAdmin.INSTANCE.getBuddies();
+ ISession session = IBuddyAdmin.INSTANCE.openSession(getProtocol().getChannel(), userID, password, facilityTypes);
+ if (session != null)
+ {
+ account = session.getSelf().getAccount();
+ }
+ else
+ {
+ OM.LOG.info(MessageFormat.format(Messages.getString("OpenSessionIndication.0"), userID)); //$NON-NLS-1$
+ }
+ }
+ }
+
+ @Override
+ protected void responding(ExtendedDataOutputStream out) throws Exception
+ {
+ ProtocolUtil.writeAccount(out, account);
+ if (account != null)
+ {
+ List<BuddiesServerProtocol> protocols = new ArrayList<BuddiesServerProtocol>();
+ out.writeInt(buddies.length);
+ for (IBuddy buddy : buddies)
+ {
+ out.writeString(buddy.getUserID());
+ ISession buddySession = IBuddyAdmin.INSTANCE.getSession(buddy);
+ if (buddySession != null)
+ {
+ protocols.add((BuddiesServerProtocol)buddySession.getProtocol());
+ }
+ }
+
+ for (BuddiesServerProtocol protocol : protocols)
+ {
+ try
+ {
+ new BuddyAddedNotification(protocol, account.getUserID()).sendAsync();
+ }
+ catch (Exception ex)
+ {
+ OM.LOG.error(ex);
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/ServerBuddyStateIndication.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/ServerBuddyStateIndication.java
index eb4f77a9d9..1e5cce850f 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/ServerBuddyStateIndication.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/ServerBuddyStateIndication.java
@@ -1,45 +1,45 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.buddies.internal.server.protocol;
-
-import org.eclipse.net4j.buddies.common.IBuddy.State;
-import org.eclipse.net4j.buddies.common.ISession;
-import org.eclipse.net4j.buddies.internal.common.protocol.BuddyStateIndication;
-import org.eclipse.net4j.buddies.internal.server.ServerBuddy;
-import org.eclipse.net4j.buddies.server.IBuddyAdmin;
-
-/**
- * @author Eike Stepper
- */
-public class ServerBuddyStateIndication extends BuddyStateIndication
-{
- /**
- * @since 2.0
- */
- public ServerBuddyStateIndication(BuddiesServerProtocol protocol)
- {
- super(protocol);
- }
-
- @Override
- protected void stateChanged(String userID, State state)
- {
- synchronized (IBuddyAdmin.INSTANCE)
- {
- ISession session = IBuddyAdmin.INSTANCE.getSession(userID);
- if (session != null)
- {
- ServerBuddy buddy = (ServerBuddy)session.getSelf();
- buddy.setState(state);
- }
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.buddies.internal.server.protocol;
+
+import org.eclipse.net4j.buddies.common.IBuddy.State;
+import org.eclipse.net4j.buddies.common.ISession;
+import org.eclipse.net4j.buddies.internal.common.protocol.BuddyStateIndication;
+import org.eclipse.net4j.buddies.internal.server.ServerBuddy;
+import org.eclipse.net4j.buddies.server.IBuddyAdmin;
+
+/**
+ * @author Eike Stepper
+ */
+public class ServerBuddyStateIndication extends BuddyStateIndication
+{
+ /**
+ * @since 2.0
+ */
+ public ServerBuddyStateIndication(BuddiesServerProtocol protocol)
+ {
+ super(protocol);
+ }
+
+ @Override
+ protected void stateChanged(String userID, State state)
+ {
+ synchronized (IBuddyAdmin.INSTANCE)
+ {
+ ISession session = IBuddyAdmin.INSTANCE.getSession(userID);
+ if (session != null)
+ {
+ ServerBuddy buddy = (ServerBuddy)session.getSelf();
+ buddy.setState(state);
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/ServerCollaborationLeftIndication.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/ServerCollaborationLeftIndication.java
index fd0c2c6dbc..d619089513 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/ServerCollaborationLeftIndication.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/ServerCollaborationLeftIndication.java
@@ -1,62 +1,62 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.buddies.internal.server.protocol;
-
-import org.eclipse.net4j.buddies.common.IBuddy;
-import org.eclipse.net4j.buddies.common.IMembership;
-import org.eclipse.net4j.buddies.internal.common.Buddy;
-import org.eclipse.net4j.buddies.internal.common.Collaboration;
-import org.eclipse.net4j.buddies.internal.common.protocol.CollaborationLeftIndication;
-import org.eclipse.net4j.buddies.internal.common.protocol.CollaborationLeftNotification;
-import org.eclipse.net4j.buddies.internal.server.BuddyAdmin;
-import org.eclipse.net4j.buddies.server.IBuddyAdmin;
-import org.eclipse.net4j.util.WrappedException;
-
-/**
- * @author Eike Stepper
- */
-public class ServerCollaborationLeftIndication extends CollaborationLeftIndication
-{
- /**
- * @since 2.0
- */
- public ServerCollaborationLeftIndication(BuddiesServerProtocol protocol)
- {
- super(protocol, IBuddyAdmin.INSTANCE, IBuddyAdmin.INSTANCE);
- }
-
- @Override
- protected void collaborationLeft(Buddy buddy, Collaboration collaboration)
- {
- for (IMembership membership : collaboration.getMemberships())
- {
- IBuddy member = membership.getBuddy();
- if (member != buddy)
- {
- try
- {
- BuddiesServerProtocol protocol = (BuddiesServerProtocol)buddy.getSession().getProtocol();
- new CollaborationLeftNotification(protocol, collaboration.getID(), buddy.getUserID()).sendAsync();
- }
- catch (Exception ex)
- {
- throw WrappedException.wrap(ex);
- }
- }
- }
-
- super.collaborationLeft(buddy, collaboration);
- if (collaboration.getBuddies().length == 0 && !collaboration.isPublic())
- {
- BuddyAdmin.INSTANCE.removeCollaboration(collaboration.getID());
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.buddies.internal.server.protocol;
+
+import org.eclipse.net4j.buddies.common.IBuddy;
+import org.eclipse.net4j.buddies.common.IMembership;
+import org.eclipse.net4j.buddies.internal.common.Buddy;
+import org.eclipse.net4j.buddies.internal.common.Collaboration;
+import org.eclipse.net4j.buddies.internal.common.protocol.CollaborationLeftIndication;
+import org.eclipse.net4j.buddies.internal.common.protocol.CollaborationLeftNotification;
+import org.eclipse.net4j.buddies.internal.server.BuddyAdmin;
+import org.eclipse.net4j.buddies.server.IBuddyAdmin;
+import org.eclipse.net4j.util.WrappedException;
+
+/**
+ * @author Eike Stepper
+ */
+public class ServerCollaborationLeftIndication extends CollaborationLeftIndication
+{
+ /**
+ * @since 2.0
+ */
+ public ServerCollaborationLeftIndication(BuddiesServerProtocol protocol)
+ {
+ super(protocol, IBuddyAdmin.INSTANCE, IBuddyAdmin.INSTANCE);
+ }
+
+ @Override
+ protected void collaborationLeft(Buddy buddy, Collaboration collaboration)
+ {
+ for (IMembership membership : collaboration.getMemberships())
+ {
+ IBuddy member = membership.getBuddy();
+ if (member != buddy)
+ {
+ try
+ {
+ BuddiesServerProtocol protocol = (BuddiesServerProtocol)buddy.getSession().getProtocol();
+ new CollaborationLeftNotification(protocol, collaboration.getID(), buddy.getUserID()).sendAsync();
+ }
+ catch (Exception ex)
+ {
+ throw WrappedException.wrap(ex);
+ }
+ }
+ }
+
+ super.collaborationLeft(buddy, collaboration);
+ if (collaboration.getBuddies().length == 0 && !collaboration.isPublic())
+ {
+ BuddyAdmin.INSTANCE.removeCollaboration(collaboration.getID());
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/server/IBuddyAdmin.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/server/IBuddyAdmin.java
index 53f2be9ce5..ecfad99ac0 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/server/IBuddyAdmin.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/server/IBuddyAdmin.java
@@ -1,37 +1,37 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.buddies.server;
-
-import org.eclipse.net4j.buddies.common.IAccount;
-import org.eclipse.net4j.buddies.common.IBuddy;
-import org.eclipse.net4j.buddies.common.IBuddyProvider;
-import org.eclipse.net4j.buddies.common.ICollaboration;
-import org.eclipse.net4j.buddies.common.ICollaborationContainer;
-import org.eclipse.net4j.buddies.common.ISession;
-import org.eclipse.net4j.buddies.common.ISessionProvider;
-import org.eclipse.net4j.buddies.internal.server.BuddyAdmin;
-import org.eclipse.net4j.channel.IChannel;
-
-import java.util.Map;
-
-/**
- * @author Eike Stepper
- */
-public interface IBuddyAdmin extends ICollaborationContainer, IBuddyProvider, ISessionProvider
-{
- public static final IBuddyAdmin INSTANCE = BuddyAdmin.INSTANCE;
-
- public Map<String, IAccount> getAccounts();
-
- public ISession openSession(IChannel channel, String userID, String password, String[] facilityTypes);
-
- public ICollaboration initiateCollaboration(IBuddy initiator, String... userIDs);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.buddies.server;
+
+import org.eclipse.net4j.buddies.common.IAccount;
+import org.eclipse.net4j.buddies.common.IBuddy;
+import org.eclipse.net4j.buddies.common.IBuddyProvider;
+import org.eclipse.net4j.buddies.common.ICollaboration;
+import org.eclipse.net4j.buddies.common.ICollaborationContainer;
+import org.eclipse.net4j.buddies.common.ISession;
+import org.eclipse.net4j.buddies.common.ISessionProvider;
+import org.eclipse.net4j.buddies.internal.server.BuddyAdmin;
+import org.eclipse.net4j.channel.IChannel;
+
+import java.util.Map;
+
+/**
+ * @author Eike Stepper
+ */
+public interface IBuddyAdmin extends ICollaborationContainer, IBuddyProvider, ISessionProvider
+{
+ public static final IBuddyAdmin INSTANCE = BuddyAdmin.INSTANCE;
+
+ public Map<String, IAccount> getAccounts();
+
+ public ISession openSession(IChannel channel, String userID, String password, String[] facilityTypes);
+
+ public ICollaboration initiateCollaboration(IBuddy initiator, String... userIDs);
+}
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/server/ServerConstants.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/server/ServerConstants.java
index 4a2e0da635..ba5b766a9a 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/server/ServerConstants.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/server/ServerConstants.java
@@ -1,21 +1,21 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.buddies.server;
-
-import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
-
-/**
- * @author Eike Stepper
- */
-public interface ServerConstants
-{
- public static final String TYPE = ProtocolConstants.PROTOCOL_NAME + "server"; //$NON-NLS-1$
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.buddies.server;
+
+import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
+
+/**
+ * @author Eike Stepper
+ */
+public interface ServerConstants
+{
+ public static final String TYPE = ProtocolConstants.PROTOCOL_NAME + "server"; //$NON-NLS-1$
+}

Back to the top