diff options
author | Michael Petretti | 2014-05-07 17:19:57 +0200 |
---|---|---|
committer | Michael Petretti | 2014-05-07 17:19:57 +0200 |
commit | 615da090f14bf75b3bc843f503f9d4357f25641d (patch) | |
tree | 92115e74caba56273b07f731605e7b85220b4fcd | |
parent | fix dependencies (diff) | |
parent | Add DB classes + dummy DbImage class (diff) | |
download | satellite-daemon-615da090f14bf75b3bc843f503f9d4357f25641d.tar.gz satellite-daemon-615da090f14bf75b3bc843f503f9d4357f25641d.tar.xz satellite-daemon-615da090f14bf75b3bc843f503f9d4357f25641d.zip |
Merge branch 'master' of git.openslx.org:bwlp/satellite-daemon
-rw-r--r-- | extras/eclipse-code-style.xml | 291 | ||||
-rw-r--r-- | extras/offenburg-scheme.sql | 365 | ||||
-rw-r--r-- | pom.xml | 12 | ||||
-rw-r--r-- | src/main/java/org/openslx/satellitedaemon/db/DbImage.java | 26 | ||||
-rw-r--r-- | src/main/java/org/openslx/satellitedaemon/db/MySQL.java | 118 | ||||
-rw-r--r-- | src/main/java/org/openslx/satellitedaemon/util/Util.java | 32 |
6 files changed, 844 insertions, 0 deletions
diff --git a/extras/eclipse-code-style.xml b/extras/eclipse-code-style.xml new file mode 100644 index 0000000..de10e5e --- /dev/null +++ b/extras/eclipse-code-style.xml @@ -0,0 +1,291 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<profiles version="12"> +<profile kind="CodeFormatterProfile" name="bwLP Satellite-Daemon" version="12"> +<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/> +<setting id="org.eclipse.jdt.core.compiler.source" value="1.7"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="180"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="3"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/> +<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/> +<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="mixed"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/> +<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="3"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="32"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/> +<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.7"/> +<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="insert"/> +<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="100"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="32"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/> +<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.7"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/> +<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/> +</profile> +</profiles> diff --git a/extras/offenburg-scheme.sql b/extras/offenburg-scheme.sql new file mode 100644 index 0000000..16745e5 --- /dev/null +++ b/extras/offenburg-scheme.sql @@ -0,0 +1,365 @@ +-- MySQL dump 10.13 Distrib 5.5.35, for debian-linux-gnu (i686) +-- +-- Host: localhost Database: bwLehrpool +-- ------------------------------------------------------ +-- Server version 5.5.35-0+wheezy1 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `FtpUsers` +-- + +DROP TABLE IF EXISTS `FtpUsers`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `FtpUsers` ( + `User` varchar(16) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `Password` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `Uid` int(11) NOT NULL DEFAULT '-1', + `Gid` int(11) NOT NULL DEFAULT '-1', + `Dir` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `CreationDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`User`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `m_VLData_imageContent` +-- + +DROP TABLE IF EXISTS `m_VLData_imageContent`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_VLData_imageContent` ( + `imageID` int(11) NOT NULL, + `imageVersion` int(11) NOT NULL, + `SW_ID` int(11) NOT NULL, + `LicenseType` int(11) NOT NULL COMMENT 'free | testVersion | Key | ownLicenseKey | licenseServer | onlyOne', + `licenseServerAdress` varchar(100) DEFAULT NULL, + `comment` varchar(255) DEFAULT NULL, + PRIMARY KEY (`imageID`,`imageVersion`,`SW_ID`), + KEY `imageID_idx` (`imageID`), + KEY `imageVersion_idx` (`imageVersion`), + KEY `SW_ID_idx` (`SW_ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `m_VLData_imageInfo` +-- + +DROP TABLE IF EXISTS `m_VLData_imageInfo`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_VLData_imageInfo` ( + `GUID_imageID` varchar(45) NOT NULL, + `imageVersion` int(11) NOT NULL, + `image_name` varchar(45) DEFAULT NULL, + `image_path` varchar(255) DEFAULT NULL, + `image_lastCall` datetime DEFAULT NULL, + `image_create_time` datetime DEFAULT NULL, + `image_update_time` datetime DEFAULT NULL, + `image_owner` varchar(45) DEFAULT NULL, + `image_change_by` varchar(45) DEFAULT NULL, + `rec_create_time` datetime DEFAULT NULL, + `rec_change_time` datetime DEFAULT NULL, + `rec_owner` varchar(45) DEFAULT NULL, + `rec_change_by` varchar(45) DEFAULT NULL, + `content_operatingSystem` int(11) DEFAULT NULL, + `status_isCompressed` tinyint(1) DEFAULT '0', + `status_isSecure` tinyint(1) DEFAULT '0', + `status_isOptimzed` tinyint(1) DEFAULT '0', + `status_isValid` tinyint(1) DEFAULT '0', + `status_isReady` tinyint(1) DEFAULT '0', + `status_isDeleted` tinyint(1) DEFAULT NULL, + `status_isLastOfficialVersion` tinyint(1) DEFAULT NULL COMMENT 'wird verwendet, wenn z.B. eine Lecturezeit verändert werden soll, so dass dies nur möglich ist, wenn die Lecture auch die aktuelle Version verwendet. Wenn auf eine ImageVersion keine aktive Lecture mehr verweist, kann diese gelöscht werden.', + `cond_hasLicenseRestriction` tinyint(1) DEFAULT '0' COMMENT 'mehrere Kategorien: 1: free; 2: UserOwnLicense; 3: licenseServer; 4: restricted; wobei als Wert immer die höherwertigste der Programmpakete genommen wird', + `cond_hasInternetRestriction` tinyint(1) DEFAULT '0', + `cond_minRAM` int(11) DEFAULT NULL, + `cond_minCPUs` int(11) DEFAULT NULL, + `image_isTemplate` varchar(45) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT 'FALSE' COMMENT 'Flag zum setzen, ob ein Image als Vorlage behandelt werden soll oder als bestehendes Labor', + PRIMARY KEY (`GUID_imageID`,`imageVersion`), + KEY `userID_idx` (`image_owner`,`image_change_by`,`rec_owner`,`rec_change_by`), + KEY `operatingSystemID_idx` (`content_operatingSystem`), + KEY `GUID_imageID_idx` (`GUID_imageID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `m_VLData_lecture` +-- + +DROP TABLE IF EXISTS `m_VLData_lecture`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_VLData_lecture` ( + `lectureID` varchar(45) NOT NULL, + `name` varchar(45) DEFAULT NULL, + `isActive` tinyint(1) DEFAULT NULL, + `startTime` datetime DEFAULT NULL, + `endTime` datetime DEFAULT NULL, + `lastUsed` datetime DEFAULT NULL, + `shortDescription` varchar(50) DEFAULT NULL, + `description` varchar(500) DEFAULT NULL, + `imageID` varchar(45) DEFAULT NULL, + `imageVersion` int(11) DEFAULT NULL, + `admin_createTime` datetime DEFAULT NULL, + `admin_changeTime` datetime DEFAULT NULL, + `admin_owner` varchar(45) DEFAULT NULL, + `admin_change_by` varchar(45) DEFAULT NULL, + PRIMARY KEY (`lectureID`), + KEY `imageID_idx` (`imageID`), + KEY `userID_idx` (`admin_owner`,`admin_change_by`), + KEY `imageVersion_idx` (`imageVersion`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `m_applicationsoftware` +-- + +DROP TABLE IF EXISTS `m_applicationsoftware`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_applicationsoftware` ( + `SoftwarePackageID` int(11) NOT NULL, + `name` varchar(45) DEFAULT NULL, + `architecture` int(11) DEFAULT NULL COMMENT 'Angaben in Bit\n32 | 64', + `supplier` int(11) DEFAULT NULL, + PRIMARY KEY (`SoftwarePackageID`), + KEY `supplierID_idx` (`supplier`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `m_group` +-- + +DROP TABLE IF EXISTS `m_group`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_group` ( + `groupID` int(11) NOT NULL, + `name` varchar(45) DEFAULT NULL, + `description` varchar(100) DEFAULT NULL, + PRIMARY KEY (`groupID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `m_image` +-- + +DROP TABLE IF EXISTS `m_image`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_image` ( + `GUID_imageID` int(11) NOT NULL, + PRIMARY KEY (`GUID_imageID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `m_institution` +-- + +DROP TABLE IF EXISTS `m_institution`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_institution` ( + `institutionID` varchar(50) NOT NULL, + `name` varchar(80) DEFAULT NULL, + PRIMARY KEY (`institutionID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `m_operatingSystem` +-- + +DROP TABLE IF EXISTS `m_operatingSystem`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_operatingSystem` ( + `operatingSystemID` int(11) NOT NULL, + `name` varchar(45) DEFAULT NULL, + `architecture` int(11) DEFAULT NULL COMMENT 'Angaben in Bit\n32 | 64', + `supplier` int(11) DEFAULT NULL, + PRIMARY KEY (`operatingSystemID`), + KEY `supplierID_idx` (`supplier`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `m_role` +-- + +DROP TABLE IF EXISTS `m_role`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_role` ( + `roleID` int(11) NOT NULL, + `name` varchar(45) DEFAULT NULL, + `description` varchar(100) DEFAULT NULL, + PRIMARY KEY (`roleID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `m_supplier` +-- + +DROP TABLE IF EXISTS `m_supplier`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_supplier` ( + `supplierID` int(11) NOT NULL, + `name` varchar(45) DEFAULT NULL, + PRIMARY KEY (`supplierID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `m_user` +-- + +DROP TABLE IF EXISTS `m_user`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_user` ( + `userID` varchar(45) NOT NULL, + `loginName` varchar(45) DEFAULT NULL, + `Nachname` varchar(45) DEFAULT NULL, + `Vorname` varchar(45) DEFAULT NULL, + `mail` varchar(45) DEFAULT NULL, + `lastLogin` datetime DEFAULT NULL, + `institution` varchar(45) DEFAULT NULL, + PRIMARY KEY (`userID`), + KEY `institutionID_idx` (`institution`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `pm_VLData_image` +-- + +DROP TABLE IF EXISTS `pm_VLData_image`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pm_VLData_image` ( + `GUID` bigint(20) NOT NULL COMMENT 'GUID Typ', + `GUID_imageID` int(11) DEFAULT NULL, + `roleID` int(11) DEFAULT NULL, + `userID` int(11) DEFAULT NULL, + `groupID` int(11) DEFAULT NULL COMMENT 'es gibt eine Gruppe ALL', + `image_read` tinyint(1) DEFAULT NULL, + `image_write` tinyint(1) DEFAULT NULL, + `image_admin` tinyint(1) DEFAULT NULL, + `image_changePermission` tinyint(1) DEFAULT NULL, + `info_read` tinyint(1) DEFAULT NULL, + `info_write` tinyint(1) DEFAULT NULL, + `info_admin` tinyint(1) DEFAULT NULL, + `info_changePermission` tinyint(1) DEFAULT NULL, + `link_allowed` tinyint(1) DEFAULT NULL, + PRIMARY KEY (`GUID`), + KEY `GUID_imageID_idx` (`GUID_imageID`), + KEY `userID_idx` (`userID`), + KEY `roleID_idx` (`roleID`), + KEY `groupID_idx` (`groupID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `pm_VLData_lecture` +-- + +DROP TABLE IF EXISTS `pm_VLData_lecture`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pm_VLData_lecture` ( + `GUID` bigint(20) NOT NULL COMMENT 'GUID Typ', + `lectureID` int(11) DEFAULT NULL, + `roleID` int(11) DEFAULT NULL, + `userID` int(11) DEFAULT NULL, + `groupID` int(11) DEFAULT NULL COMMENT 'es gibt eine Gruppe ALL', + `rec_read` tinyint(1) DEFAULT NULL, + `rec_write` tinyint(1) DEFAULT NULL, + `rec_admin` tinyint(1) DEFAULT NULL, + `rec_changePermission` tinyint(1) DEFAULT NULL, + PRIMARY KEY (`GUID`), + KEY `lectureID_idx` (`lectureID`), + KEY `roleID_idx` (`roleID`), + KEY `userID_idx` (`userID`), + KEY `groupID_idx` (`groupID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `pm_group_role` +-- + +DROP TABLE IF EXISTS `pm_group_role`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pm_group_role` ( + `groupID` int(11) NOT NULL, + `roleID` int(11) NOT NULL, + PRIMARY KEY (`groupID`,`roleID`), + KEY `groupID_idx` (`groupID`), + KEY `roleID_idx` (`roleID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `pm_user_group` +-- + +DROP TABLE IF EXISTS `pm_user_group`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pm_user_group` ( + `userID` int(11) NOT NULL, + `groupID` int(11) NOT NULL, + PRIMARY KEY (`userID`,`groupID`), + KEY `userID_idx` (`userID`), + KEY `groupID_idx` (`groupID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `pm_user_role` +-- + +DROP TABLE IF EXISTS `pm_user_role`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pm_user_role` ( + `userID` int(11) NOT NULL, + `roleID` int(11) NOT NULL, + PRIMARY KEY (`userID`,`roleID`), + KEY `userID_idx` (`userID`), + KEY `roleID_idx` (`roleID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2014-05-07 15:46:24 + @@ -68,6 +68,18 @@ <dependencies> <dependency> + <groupId>mysql</groupId> + <artifactId>mysql-connector-java</artifactId> + <version>5.1.28</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>fi.evident.dalesbred</groupId> + <artifactId>dalesbred</artifactId> + <version>0.6.0</version> + <scope>compile</scope> + </dependency> + <dependency> <groupId>org.apache.thrift</groupId> <artifactId>libthrift</artifactId> <version>0.9.1</version> diff --git a/src/main/java/org/openslx/satellitedaemon/db/DbImage.java b/src/main/java/org/openslx/satellitedaemon/db/DbImage.java new file mode 100644 index 0000000..b7fb67d --- /dev/null +++ b/src/main/java/org/openslx/satellitedaemon/db/DbImage.java @@ -0,0 +1,26 @@ +package org.openslx.satellitedaemon.db; + +import java.util.ArrayList; +import java.util.List; + +/** + * Represents an image in the satellite's database (mostly from + * m_VLData_imageInfo) + */ +public class DbImage +{ + + /** + * Returns a list of all images on this satellite that should be + * uploaded to the central server. + * + * @return list of images that are marked for upload, where the upload + * was either not started yet, or is incomplete + */ + public List<DbImage> getAllMarkedForUpload() + { + // TODO: Implement + return new ArrayList<>(); + } + +} diff --git a/src/main/java/org/openslx/satellitedaemon/db/MySQL.java b/src/main/java/org/openslx/satellitedaemon/db/MySQL.java new file mode 100644 index 0000000..c5f2fce --- /dev/null +++ b/src/main/java/org/openslx/satellitedaemon/db/MySQL.java @@ -0,0 +1,118 @@ +package org.openslx.satellitedaemon.db; + +import java.io.FileInputStream; +import java.io.BufferedInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.List; +import java.util.Properties; + +import com.mysql.jdbc.jdbc2.optional.MysqlDataSource; + +import org.apache.log4j.Logger; +import org.openslx.satellitedaemon.util.Util; + +import fi.evident.dalesbred.Database; + +/** + * Class for talking to the DB via the dalesbred jdbc wrapper. Package private, + * so only the Db* classes can actually communicate with the database. + * + */ +class MySQL +{ + private static final Logger log = Logger.getLogger( MySQL.class ); + private static Database db = null; + + /** + * Static initializer for setting up the database connection. + * This gets called implicitly as soon as the class loader loads + * the class. In most cases that happens when the class is being + * accessed for the first time during run time. + */ + static + { + // Load connection info from class (TODO: Make pretty) + Properties properties = new Properties(); + try { + final BufferedInputStream stream = new BufferedInputStream( new FileInputStream( "config/mysql.properties" ) ); + properties.load( stream ); + stream.close(); + } catch ( FileNotFoundException e ) { + log.fatal( "config/mysql.properties not found!" ); + System.exit( 1 ); + } catch ( IOException e ) { + log.fatal( "Error reading from config/mysql.properties: " + e.getMessage() ); + System.exit( 1 ); + } catch ( Exception e ) { + log.fatal( "Generic error loading mysql properties file." ); + e.printStackTrace(); + System.exit( 1 ); + } + final String host = properties.getProperty( "host" ); + final String dbname = properties.getProperty( "db" ); + final String user = properties.getProperty( "user" ); + final String password = properties.getProperty( "password" ); + + Util.notNullFatal( host, "host not set in mysql properties" ); + Util.notNullFatal( dbname, "db not set in mysql properties" ); + Util.notNullFatal( user, "user not set in mysql properties" ); + Util.notNullFatal( password, "password not set in mysql properties" ); + + // Setup db connection + try { + MysqlDataSource ds = new MysqlDataSource(); + ds.setServerName( host ); + ds.setDatabaseName( dbname ); + ds.setUser( user ); + ds.setPassword( password ); + db = Database.forDataSource( ds ); + } catch ( Exception e ) { + log.fatal( "Error initializing mysql data source!" ); + e.printStackTrace(); + System.exit( 1 ); + } + } + + /** + * Get a list of objects of the given class from the database. + * The class needs a matching constructor for the query you pass in, i.e. number of + * arguments has to be equal to number of columns returned by query. + * + * @param clazz The class to instanciate for the result(s) + * @param sql The sql query to run + * @param args Any number of arguments to the query (using the '?' placeholder) + * @return A list containing the rows returned by the query, represented by the given class + */ + protected static <T> List<T> findAll( final Class<T> clazz, final String sql, final Object... args ) + { + return db.findAll( clazz, sql, args ); + } + + /** + * Run a query on the database that will return at most one result. + * If the query returns a row, it will be used to instanciate the given class. If + * it doesn't return a row, null will be returned. + * + * @param clazz The class to instanciate for the result (if any) + * @param sql The sql query to run + * @param args Any number of arguments to the query (using the '?' placeholder) + * @return Instance of clazz or null + */ + protected static <T> T findUniqueOrNull( final Class<T> clazz, final String sql, final Object... args ) + { + return db.findUniqueOrNull( clazz, sql, args ); + } + + /** + * Run an update on the database, return number of rows affected. + * + * @param sql The update/insert query to run + * @param args Any number of arguments to the query (using the '?' placeholder) + * @return Number of rows affected by query + */ + protected static int update( String sql, Object... args ) + { + return db.update( sql, args ); + } +} diff --git a/src/main/java/org/openslx/satellitedaemon/util/Util.java b/src/main/java/org/openslx/satellitedaemon/util/Util.java new file mode 100644 index 0000000..4f39e71 --- /dev/null +++ b/src/main/java/org/openslx/satellitedaemon/util/Util.java @@ -0,0 +1,32 @@ +package org.openslx.satellitedaemon.util; + +import org.apache.log4j.Logger; + +public class Util +{ + private static Logger log = Logger.getLogger( Util.class ); + + /** + * Check if the given object is null, abort program if true. An optional + * message to be printed can be passed. A stack trace will be printed, too. + * Finally the application terminates with exit code 2. + * + * This comes in handy if something must not be null, and you want user + * friendly output. A perfect example would be reading settings from a + * config file. You can use this on mandatory fields. + * + * @param something + * the object to compare to null + * @param message + * the message to be printed if something is null + */ + public static void notNullFatal( Object something, String message ) + { + if ( something == null ) { + if ( message != null ) + log.fatal( "[NOTNULL] " + message ); + log.warn( Thread.currentThread().getStackTrace().toString() ); + System.exit( 2 ); + } + } +} |