solved master merge conflicts in DomainFactory

This commit is contained in:
Alexander Ries committed 2015-11-25 11:20:46 +01:00
commit 567070c77f
945 files changed
+22948 -15399

No files matched your search

+67
View File
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>java</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
<filteredResources>
<filter>
<id>1447316122256</id>
<name></name>
<type>10</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-true-com\.sap\..*</arguments>
</matcher>
</filter>
<filter>
<id>1447316122263</id>
<name></name>
<type>10</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-true-com\.google.*</arguments>
</matcher>
</filter>
<filter>
<id>1447316122270</id>
<name></name>
<type>10</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-true-com\.tractrac\..*</arguments>
</matcher>
</filter>
<filter>
<id>1447316122279</id>
<name></name>
<type>10</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-true-org\.json\..*</arguments>
</matcher>
</filter>
<filter>
<id>1447316122293</id>
<name></name>
<type>10</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-true-org\.moxieapps\..*</arguments>
</matcher>
</filter>
<filter>
<id>1447316122310</id>
<name></name>
<type>10</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-true-org\.openqa\..*</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
@@ -1,47 +1,47 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="com.google.gdt.eclipse.suite.webapp">
<booleanAttribute key="com.google.gdt.eclipse.core.RUN_SERVER" value="false"/>
<stringAttribute key="com.google.gdt.eclipse.suiteMainTypeProcessor.PREVIOUSLY_SET_MAIN_TYPE_NAME" value="com.google.gwt.dev.GWTShell"/>
<booleanAttribute key="com.google.gdt.eclipse.suiteWarArgumentProcessor.IS_WAR_FROM_PROJECT_PROPERTIES" value="false"/>
<stringAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT" value="9998"/>
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
<listEntry value="com.sap.sailing.dashboards.gwt.RibDashboard"/>
</listAttribute>
<booleanAttribute key="com.google.gwt.eclipse.core.SUPERDEVMODE_ENABLED" value="true"/>
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/dashboards/RibDashboard.html"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.dashboards.gwt"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.gwt.ui/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.gwt.ui/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.dashboards.gwt/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.dashboards.gwt/src/main/resources&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.server/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.gwt/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.common/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;com.sap.sailing.dashboards.gwt&quot;/&gt;&#10;&lt;/runtimeClasspathEntry&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.google.gwt.osgi/lib/gwt-servlet.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.google.gwt.osgi/lib/gwt-user.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.common/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/org.moxieapps.gwt.highcharts/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.gwt.adminconsole/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gwt.eclipse.core.moduleClasspathProvider"/>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-superDevMode -incremental -war &quot;${project_loc:com.sap.sailing.dashboards.gwt}&quot; -startupUrl /dashboards/RibDashboard.html -noserver -remoteUI &quot;${gwt_remote_ui_server_port}:${unique_id}&quot; -logLevel INFO -codeServerPort 9998 com.sap.sailing.dashboards.gwt.RibDashboard"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.dashboards.gwt"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx2048m"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="com.google.gdt.eclipse.suite.webapp">
<booleanAttribute key="com.google.gdt.eclipse.core.RUN_SERVER" value="false"/>
<stringAttribute key="com.google.gdt.eclipse.suiteMainTypeProcessor.PREVIOUSLY_SET_MAIN_TYPE_NAME" value="com.google.gwt.dev.GWTShell"/>
<booleanAttribute key="com.google.gdt.eclipse.suiteWarArgumentProcessor.IS_WAR_FROM_PROJECT_PROPERTIES" value="false"/>
<stringAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT" value="9998"/>
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
<listEntry value="com.sap.sailing.dashboards.gwt.RibDashboard"/>
</listAttribute>
<booleanAttribute key="com.google.gwt.eclipse.core.SUPERDEVMODE_ENABLED" value="true"/>
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/dashboards/RibDashboard.html"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.dashboards.gwt"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.gwt.ui/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.gwt.ui/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.dashboards.gwt/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.dashboards.gwt/src/main/resources&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.server/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.gwt/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.common/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;com.sap.sailing.dashboards.gwt&quot;/&gt;&#10;&lt;/runtimeClasspathEntry&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.google.gwt.osgi/lib/gwt-servlet.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.google.gwt.osgi/lib/gwt-user.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.common/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/org.moxieapps.gwt.highcharts/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.gwt.adminconsole/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gwt.eclipse.core.moduleClasspathProvider"/>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-superDevMode -incremental -war &quot;${project_loc:com.sap.sailing.dashboards.gwt}&quot; -startupUrl /dashboards/RibDashboard.html -noserver -remoteUI &quot;${gwt_remote_ui_server_port}:${unique_id}&quot; -logLevel INFO -codeServerPort 9998 com.sap.sailing.dashboards.gwt.RibDashboard"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.dashboards.gwt"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx2048m"/>
</launchConfiguration>
@@ -1,47 +1,47 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="com.google.gdt.eclipse.suite.webapp">
<booleanAttribute key="com.google.gdt.eclipse.core.RUN_SERVER" value="false"/>
<stringAttribute key="com.google.gdt.eclipse.suiteMainTypeProcessor.PREVIOUSLY_SET_MAIN_TYPE_NAME" value="com.google.gwt.dev.GWTShell"/>
<booleanAttribute key="com.google.gdt.eclipse.suiteWarArgumentProcessor.IS_WAR_FROM_PROJECT_PROPERTIES" value="false"/>
<stringAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT" value="9998"/>
<booleanAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT_AUTO" value="true"/>
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
<listEntry value="com.sap.sailing.dashboards.gwt.RibDashboard"/>
</listAttribute>
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/dashboards/RibDashboard.html"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.dashboards.gwt"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.gwt.ui/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.gwt.ui/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.dashboards.gwt/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.dashboards.gwt/src/main/resources&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.server/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.gwt/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.common/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#13;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;com.sap.sailing.dashboards.gwt&quot;/&gt;&#13;&#10;&lt;/runtimeClasspathEntry&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.google.gwt.osgi/lib/gwt-servlet.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.google.gwt.osgi/lib/gwt-user.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.common/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/org.moxieapps.gwt.highcharts/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.gwt.adminconsole/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gwt.eclipse.core.moduleClasspathProvider"/>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-nosuperDevMode -incremental -war &quot;${project_loc:com.sap.sailing.dashboards.gwt}&quot; -startupUrl /dashboards/RibDashboard.html -noserver -remoteUI &quot;${gwt_remote_ui_server_port}:${unique_id}&quot; -logLevel INFO -codeServerPort auto com.sap.sailing.dashboards.gwt.RibDashboard"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.dashboards.gwt"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx2048m"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="com.google.gdt.eclipse.suite.webapp">
<booleanAttribute key="com.google.gdt.eclipse.core.RUN_SERVER" value="false"/>
<stringAttribute key="com.google.gdt.eclipse.suiteMainTypeProcessor.PREVIOUSLY_SET_MAIN_TYPE_NAME" value="com.google.gwt.dev.GWTShell"/>
<booleanAttribute key="com.google.gdt.eclipse.suiteWarArgumentProcessor.IS_WAR_FROM_PROJECT_PROPERTIES" value="false"/>
<stringAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT" value="9998"/>
<booleanAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT_AUTO" value="true"/>
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
<listEntry value="com.sap.sailing.dashboards.gwt.RibDashboard"/>
</listAttribute>
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/dashboards/RibDashboard.html"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.dashboards.gwt"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.gwt.ui/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.gwt.ui/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.dashboards.gwt/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.dashboards.gwt/src/main/resources&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.server/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.gwt/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.common/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#13;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;com.sap.sailing.dashboards.gwt&quot;/&gt;&#13;&#10;&lt;/runtimeClasspathEntry&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.google.gwt.osgi/lib/gwt-servlet.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.google.gwt.osgi/lib/gwt-user.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.common/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/org.moxieapps.gwt.highcharts/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.gwt.adminconsole/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gwt.eclipse.core.moduleClasspathProvider"/>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-nosuperDevMode -incremental -war &quot;${project_loc:com.sap.sailing.dashboards.gwt}&quot; -startupUrl /dashboards/RibDashboard.html -noserver -remoteUI &quot;${gwt_remote_ui_server_port}:${unique_id}&quot; -logLevel INFO -codeServerPort auto com.sap.sailing.dashboards.gwt.RibDashboard"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.dashboards.gwt"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx2048m"/>
</launchConfiguration>
Binary file not shown.
@@ -11,19 +11,6 @@
<artifactId>com.sap.sailing.dashboards.gwt</artifactId>
<packaging>eclipse-plugin</packaging>
<repositories>
<repository>
<id>sonatype</id>
<url>http://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax.validation</groupId>
@@ -89,8 +89,7 @@ public class RibDashboardDataRetriever implements TimeListener, RaceSelectionPro
@Override
public void onFailure(Throwable caught) {
logger.log(Level.INFO, "Failed to received RibDashboardRaceInfoDTO");
logger.log(Level.INFO, caught.getMessage());
logger.log(Level.INFO, "Failed to received RibDashboardRaceInfoDTO, "+caught.getMessage());
}
});
}
@@ -89,8 +89,7 @@ public class WindBotDataRetriever implements TimeListener, WindBotDataRetrieverP
@Override
public void onFailure(Throwable caught) {
logger.log(Level.INFO, "Failed to received WindInfoForRaceDTO");
logger.log(Level.INFO, caught.getMessage());
logger.log(Level.INFO, "Failed to received WindInfoForRaceDTO, "+caught.getMessage());
}
});
}
@@ -157,8 +156,7 @@ public class WindBotDataRetriever implements TimeListener, WindBotDataRetrieverP
loadWindBotData(finaloldTime, finalNewTime, result);
} else {
notifyListenersAboutNumberOfWindBotsReceivedIsZero();
logger.log(Level.INFO, "RegattaAndRaceIdentifier for race which takes wind is null");
logger.log(Level.INFO, "Can´t load wind data");
logger.log(Level.INFO, "Can´t load wind data because RegattaAndRaceIdentifier for race which takes wind is null");
}
}
@@ -47,8 +47,7 @@ public class EventLogo extends Image {
@Override
public void onFailure(Throwable caught) {
logger.log(Level.INFO, "Failed to received EventDTO");
logger.log(Level.INFO, caught.getMessage());
logger.log(Level.INFO, "Failed to received EventDTO, "+caught.getMessage());
eventLogo.getElement().getStyle().setVisibility(Visibility.HIDDEN);
}
});
@@ -21,6 +21,8 @@ import com.google.gwt.user.client.ui.Widget;
import com.sap.sailing.dashboards.gwt.client.startanalysis.rankingtable.StartAnalysisStartRankTable;
import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.StartAnalysisDTO;
import com.sap.sailing.domain.common.racelog.RacingProcedureType;
import com.sap.sailing.gwt.ui.client.CompetitorColorProvider;
import com.sap.sailing.gwt.ui.client.CompetitorColorProviderImpl;
import com.sap.sailing.gwt.ui.client.CompetitorSelectionModel;
import com.sap.sailing.gwt.ui.client.RaceTimesInfoProvider;
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
@@ -65,7 +67,8 @@ public class StartlineAnalysisCard extends Composite implements HasWidgets, Star
private SailingServiceAsync sailingServiceAsync;
private StringMessages stringMessages;
private final CompetitorSelectionModel competitorSelectionModel;
private final CompetitorColorProvider colorProvider;
private final double WIND_LINE_ADVANTAGE_DIV_WIDTH_IN_PT = 185;
private final double GEOMETRIC_LINE_ADVANTAGE_DIV_WIDTH_IN_PT = 210;
private final int TABLE_MARGIN_IN_PT = 10;
@@ -78,7 +81,8 @@ public class StartlineAnalysisCard extends Composite implements HasWidgets, Star
stringMessages = StringMessages.INSTANCE;
resources.combinedWindPanelStyle().ensureInjected();
this.sailingServiceAsync = sailingServiceAsync;
competitorSelectionModel = new CompetitorSelectionModel(/* hasMultiSelection */true);
colorProvider = new CompetitorColorProviderImpl();
competitorSelectionModel = new CompetitorSelectionModel(/* hasMultiSelection */true, colorProvider);
competitorSelectionModel.setCompetitors(startAnalysisDTO.getCompetitorDTOsFromStartAnaylsisCompetitorDTOs(),
raceMap);
initWidget(uiBinder.createAndBindUi(this));
@@ -146,7 +150,7 @@ public class StartlineAnalysisCard extends Composite implements HasWidgets, Star
AsyncActionsExecutor asyncActionsExecutor = new AsyncActionsExecutor();
RaceTimesInfoProvider raceTimesInfoProvider = new RaceTimesInfoProvider(sailingServiceAsync,
asyncActionsExecutor, null, Collections.singletonList(startAnalysisDTO.regattaAndRaceIdentifier), 5000l /* requestInterval */);
raceMap = new RaceMap(sailingServiceAsync, asyncActionsExecutor, null, timer, competitorSelectionModel,
raceMap = new RaceMap(sailingServiceAsync, asyncActionsExecutor, null, timer, competitorSelectionModel,
StringMessages.INSTANCE, false, false, false, false, startAnalysisDTO.regattaAndRaceIdentifier,
resources.combinedWindPanelStyle(), /* showHeaderPanel */ true);
raceMap.onRaceSelectionChange(Collections.singletonList(startAnalysisDTO.regattaAndRaceIdentifier));
@@ -201,8 +201,7 @@ public class StartlineAnalysisComponent extends Composite implements HasWidgets
@Override
public void onFailure(Throwable caught) {
logger.log(Level.INFO, "Failed to received startanalysis list");
logger.log(Level.INFO, caught.getMessage());
logger.log(Level.INFO, "Failed to received startanalysis list, "+caught.getMessage());
}
});
}
@@ -266,8 +265,7 @@ public class StartlineAnalysisComponent extends Composite implements HasWidgets
@Override
public void onFailure(Throwable caught) {
logger.log(Level.INFO, "Failed to received competitors for leaderboard name");
logger.log(Level.INFO, caught.getMessage());
logger.log(Level.INFO, "Failed to received competitors for leaderboard name, "+caught.getMessage());
}
});
}
@@ -86,8 +86,7 @@ public class StartlineAdvantagesByWindComponent extends Composite implements Has
@Override
public void onFailure(Throwable caught) {
logger.log(Level.INFO, "Failed to received StartlineAdvantagesWithMaxAndAverageDTO");
logger.log(Level.INFO, caught.getMessage());
logger.log(Level.INFO, "Failed to received StartlineAdvantagesWithMaxAndAverageDTO, "+caught.getMessage());
}
});
}
@@ -174,7 +174,8 @@ public class WindBotComponent extends Composite implements HasWidgets, WindBotDa
WindTrackInfoDTO windTrackInfoDTO = getWindTrackInfoDTOFromAndWindBotID(windInfoForRaceDTO, windBotId);
if (windTrackInfoDTO != null) {
logger.log(Level.INFO, "WindInfoForRaceDTO contains WindTrackInfoDTO for Windbot id "+ windBotId);
if (windTrackInfoDTO.windFixes != null && windTrackInfoDTO.windFixes.size() > 0) {
if (windTrackInfoDTO.windFixes != null) {
if (windTrackInfoDTO.windFixes.size() > 0) {
logger.log(Level.INFO, "Upating UI with Wind Fixes for WindBot id "+ windBotId);
Point[] speedPoints = convertWindFixListIntoPointsArray(windTrackInfoDTO.windFixes, WindType.SPEED);
Point[] directionPoints = convertWindFixListIntoPointsArray(windTrackInfoDTO.windFixes,
@@ -192,8 +193,11 @@ public class WindBotComponent extends Composite implements HasWidgets, WindBotDa
movingAverageDirection.getAverage());
locationPointerCompass.windBotPositionChanged(windTrackInfoDTO.windFixes
.get(windTrackInfoDTO.windFixes.size() - 1).position);
} else {
logger.log(Level.INFO, "WindTrackInfoDTO.windFixes is empty");
}
} else {
logger.log(Level.INFO, "WindTrackInfoDTO.windFixes is null or empty");
logger.log(Level.INFO, "WindTrackInfoDTO.windFixes is null");
}
} else {
logger.log(Level.INFO, "WindInfoForRaceDTO does not contains WindTrackInfoDTO for Windbot id "+ windBotId);
@@ -240,7 +240,7 @@ public class RibDashboardServiceImpl extends RemoteServiceServlet implements Rib
}
private Pair<Position, Position> retrieveStartlineMarkPositionsFromStartLineWayPoint(Waypoint startLineWayPoint) {
Pair<Position, Position> startLineMarkPositions = null;
Pair<Position, Position> result = null;
Iterator<Mark> markIterator = startLineWayPoint.getMarks().iterator();
if (markIterator.hasNext()) {
Mark startboat = (Mark) markIterator.next();
@@ -249,10 +249,12 @@ public class RibDashboardServiceImpl extends RemoteServiceServlet implements Rib
TimePoint now = MillisecondsTimePoint.now();
Position startBoatPosition = getPositionFromMarkAtTimePoint(runningRace, startboat, now);
Position pinEndPosition = getPositionFromMarkAtTimePoint(runningRace, pinEnd, now);
return new Pair<Position, Position>(startBoatPosition, pinEndPosition);
if(startBoatPosition != null && pinEndPosition != null) {
result = new Pair<Position, Position>(startBoatPosition, pinEndPosition);
}
}
}
return startLineMarkPositions;
return result;
}
private Position getPositionFromMarkAtTimePoint(TrackedRace trackedRace, Mark mark, TimePoint timePoint) {
@@ -1,14 +1,16 @@
package com.sap.sailing.domain.common;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.sap.sailing.domain.common.impl.MeterDistance;
public enum BoatClassMasterdata {
_18Footer ("18Footer", true, 8.90, 2.00, BoatHullType.MONOHULL, true, "18.Footer", "18ft", "18ft Skiff", "18. Footer"),
_2_4M ("2.4 Meter", true, 4.11, 0.81, BoatHullType.MONOHULL, false, "2.4M", "2.4mR", "2.4 Metre", "2.4-metre"),
_2_4M ("2.4 Meter", true, 4.11, 0.81, BoatHullType.MONOHULL, false, "2.4M", "2.4mR", "2.4 Metre", "2.4-metre", "24MR"),
_5O5 ("5O5", true, 5.03, 1.88, BoatHullType.MONOHULL, true, "505", "5o5", "505er", "5o5er"),
_12M ("12 Meter", true, 5.97, 1.43, BoatHullType.MONOHULL, true, "12M", "12mR", "12SQM", "12-metre", "12 metre"),
_29ER ("29er", true, 4.45, 1.70, BoatHullType.MONOHULL, true),
@@ -27,7 +29,7 @@ public enum BoatClassMasterdata {
D_ONE ("D-One", true, 4.23, 2.31, BoatHullType.MONOHULL, true, "Devoti D-One", "DOne", "D_One"),
DRAGON_INT ("Dragon Int.", true, 8.89, 1.96, BoatHullType.MONOHULL, true, "Drachen", "Dragon"),
DYAS("Dyas", true, 7.15, 1.95, BoatHullType.MONOHULL, true),
EXTREME_40 ("Extreme 40", false, 12.2, 6.60, BoatHullType.CATAMARAN, true, "Extreme-40", "Extreme40", "ESS40"),
EXTREME_40 ("Extreme 40", false, 12.2, 6.60, BoatHullType.CATAMARAN, true, "Extreme-40", "Extreme40", "ESS40", "ess"),
D_35 ("D35", false, 10.81, 6.89, BoatHullType.CATAMARAN, false),
ELLIOTT_6M ("Elliott 6m", true, 6.0, 2.35, BoatHullType.MONOHULL, true, "Elliott6m"),
EUROPE_INT ("Europe Int.", true, 3.35, 1.35, BoatHullType.MONOHULL, false, "Europe"),
@@ -84,7 +86,6 @@ public enum BoatClassMasterdata {
ORC_CLUB ("ORC Club", true, 13.83, 3.91, BoatHullType.MONOHULL, true),
ORC_INTERNATIONAL ("ORC International", true, 13.83, 3.91, BoatHullType.MONOHULL, true, "ORC Int.");
private final String displayName;
private final String[] alternativeNames;
private final double hullLengthInMeter;
@@ -93,6 +94,8 @@ public enum BoatClassMasterdata {
private final boolean typicallyStartsUpwind;
private final boolean hasAdditionalDownwindSail;
private static Map<String, BoatClassMasterdata> fromUnifiedDisplayAndAlternativeNamesToBoatClassMasterdata;
private BoatClassMasterdata(String displayName, boolean typicallyStartsUpwind, double hullLengthInMeter,
double hullBeamInMeter, BoatHullType hullType, boolean hasAdditionalDownwindSail, String... alternativeNames) {
this.displayName = displayName;
@@ -102,6 +105,17 @@ public enum BoatClassMasterdata {
this.hullType = hullType;
this.hasAdditionalDownwindSail = hasAdditionalDownwindSail;
this.alternativeNames = alternativeNames;
addToCache(this);
}
private void addToCache(BoatClassMasterdata boatClassMasterdata) {
if (fromUnifiedDisplayAndAlternativeNamesToBoatClassMasterdata == null) {
fromUnifiedDisplayAndAlternativeNamesToBoatClassMasterdata = new HashMap<>();
}
fromUnifiedDisplayAndAlternativeNamesToBoatClassMasterdata.put(unifyBoatClassName(getDisplayName()), this);
for (final String alternativeName : getAlternativeNames()) {
fromUnifiedDisplayAndAlternativeNamesToBoatClassMasterdata.put(unifyBoatClassName(alternativeName), this);
}
}
private BoatClassMasterdata(String displayName, boolean typicallyStartsUpwind, double hullLengthInMeter,
@@ -113,28 +127,45 @@ public enum BoatClassMasterdata {
this.hullType = hullType;
this.hasAdditionalDownwindSail = hasAdditionalDownwindSail;
this.alternativeNames = null;
addToCache(this);
}
public static BoatClassMasterdata resolveBoatClass(String boatClassName) {
String boatClassNameToResolve = unifyBoatClassName(boatClassName);
for (BoatClassMasterdata boatClass : values()) {
if (unifyBoatClassName(boatClass.displayName).equals(boatClassNameToResolve)) {
return boatClass;
} else if (boatClass.alternativeNames != null) {
for (String name : boatClass.alternativeNames) {
if (unifyBoatClassName(name).equals(boatClassNameToResolve)) {
return boatClass;
}
}
}
}
return null;
return fromUnifiedDisplayAndAlternativeNamesToBoatClassMasterdata.get(unifyBoatClassName(boatClassName));
}
/**
* Maps the <code>boatClassName</code> string by removing all whitespace and converting to all upper case.
* Example: "Laser Int." becomes "LASERINT."<p>
*
* Note that the mapping is not related to the set of {@link BoatClassMasterdata} objects known and works the same
* regardless of whether <code>boatClassName</code> matches any of the existing {@link BoatClassMasterdata} literals,
* display names or alternative names.
*/
public static String unifyBoatClassName(String boatClassName) {
return boatClassName == null ? null : boatClassName.toUpperCase().replaceAll("\\s+","");
}
/**
* If any of the existing {@link BoatClassMasterdata} objects has a matching {@link #unifyBoatClassName(String)
* unified} display or alternative name, the unified display name of that object is returned. Otherwise, the
* {@link #unifyBoatClassName(String) unified} <code>boatClassName</code> value is returned. Example: "LASER" and
* "Laser" and "LSR" and "lsr" and "Laser Int." and "LASER INT ." and "LASERINT." will all be mapped to "LASERINT."
* based on the boat class masterdata object whose display name is "Laser Int.". In turn, "xyz" and "x y z" will be
* mapped to "XYZ" without any matching {@link BoatClassMasterdata} object existing, simply based on the string
* mapping described for {@link #unifyBoatClassName(String)}.
*/
public static String unifyBoatClassNameBasedOnExistingMasterdata(String boatClassName) {
BoatClassMasterdata bcm = resolveBoatClass(boatClassName);
final String result;
if (bcm != null) {
result = unifyBoatClassName(bcm.getDisplayName());
} else {
result = unifyBoatClassName(boatClassName);
}
return result;
}
public Distance getHullLength() {
return new MeterDistance(hullLengthInMeter);
}
@@ -3,5 +3,6 @@ package com.sap.sailing.domain.common;
public enum ScoringSchemeType {
LOW_POINT, HIGH_POINT, HIGH_POINT_ESS_OVERALL, HIGH_POINT_LAST_BREAKS_TIE, HIGH_POINT_FIRST_GETS_TEN,
HIGH_POINT_FIRST_GETS_ONE, LOW_POINT_WINNER_GETS_ZERO, HIGH_POINT_WINNER_GETS_SIX, HIGH_POINT_WINNER_GETS_FIVE, HIGH_POINT_WINNER_GETS_EIGHT,
HIGH_POINT_WINNER_GETS_EIGHT_AND_INTERPOLATION, HIGH_POINT_FIRST_GETS_TEN_OR_EIGHT, LOW_POINT_WITH_ELIMINATIONS_AND_ROUNDS_WINNER_GETS_07
HIGH_POINT_WINNER_GETS_EIGHT_AND_INTERPOLATION, HIGH_POINT_FIRST_GETS_TEN_OR_EIGHT, LOW_POINT_WITH_ELIMINATIONS_AND_ROUNDS_WINNER_GETS_07,
LOW_POINT_LEAGUE_OVERALL
}
@@ -26,6 +26,10 @@ public abstract class AbstractLeaderboardDTO implements Serializable {
public Map<CompetitorDTO, LeaderboardRowDTO> rows;
public boolean hasCarriedPoints;
public int[] discardThresholds;
/**
* Set to the non-<code>null</code> regatta name if this DTO represents a <code>RegattaLeaderboard</code>.
*/
public String regattaName;
public String displayName;
public UUID defaultCourseAreaId;
@@ -0,0 +1,64 @@
package com.sap.sailing.domain.common.dto;
import java.io.Serializable;
import com.sap.sse.common.Color;
public class BoatDTO extends NamedDTO implements Serializable {
private static final long serialVersionUID = -4076992788294272162L;
private String sailId;
private Color color;
// for GWT
BoatDTO() {}
public BoatDTO(String name, String sailId) {
this(name, sailId, null);
}
public BoatDTO(String name, String sailId, Color color) {
super(name);
this.sailId = sailId;
this.color = color;
}
public Color getColor() {
return color;
}
public String getSailId() {
return sailId;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((color == null) ? 0 : color.hashCode());
result = prime * result + ((sailId == null) ? 0 : sailId.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
BoatDTO other = (BoatDTO) obj;
if (color == null) {
if (other.color != null)
return false;
} else if (!color.equals(other.color))
return false;
if (sailId == null) {
if (other.sailId != null)
return false;
} else if (!sailId.equals(other.sailId))
return false;
return true;
}
}
@@ -14,10 +14,12 @@ public interface CompetitorDTO extends Serializable, MappableToDevice {
String getCountryName();
String getSailID();
String getIdAsString();
String getSailID();
BoatDTO getBoat();
BoatClassDTO getBoatClass();
String getName();
@@ -21,9 +21,9 @@ public class CompetitorDTOImpl extends NamedDTO implements CompetitorDTO, Serial
private String threeLetterIocCountryCode;
private Color color;
private String email;
private String sailID;
private String idAsString;
private BoatClassDTO boatClass;
private BoatDTO boat;
private String imageURL;
private String flagImageURL;
private Double timeOnTimeFactor;
@@ -32,17 +32,18 @@ public class CompetitorDTOImpl extends NamedDTO implements CompetitorDTO, Serial
public CompetitorDTOImpl() {}
public CompetitorDTOImpl(String name, Color color, String email, String twoLetterIsoCountryCode, String threeLetterIocCountryCode,
String countryName, String sailID, String idAsString, String imageURL, String flagImageURL, BoatClassDTO boatClass, Double timeOnTimeFactor, Duration timeOnDistanceAllowancePerNauticalMile) {
String countryName, String idAsString, String imageURL, String flagImageURL,
BoatDTO boat, BoatClassDTO boatClass, Double timeOnTimeFactor, Duration timeOnDistanceAllowancePerNauticalMile) {
super(name);
this.color = color;
this.email = email;
this.twoLetterIsoCountryCode = twoLetterIsoCountryCode;
this.threeLetterIocCountryCode = threeLetterIocCountryCode;
this.countryName = countryName;
this.sailID = sailID;
this.idAsString = idAsString;
this.imageURL = imageURL;
this.flagImageURL = flagImageURL;
this.boat = boat;
this.boatClass = boatClass;
this.timeOnTimeFactor = timeOnTimeFactor;
this.timeOnDistanceAllowancePerNauticalMile = timeOnDistanceAllowancePerNauticalMile;
@@ -53,8 +54,8 @@ public class CompetitorDTOImpl extends NamedDTO implements CompetitorDTO, Serial
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((boatClass == null) ? 0 : boatClass.hashCode());
result = prime * result + ((boat == null) ? 0 : boat.hashCode());
result = prime * result + ((idAsString == null) ? 0 : idAsString.hashCode());
result = prime * result + ((sailID == null) ? 0 : sailID.hashCode());
result = prime * result + ((color == null) ? 0 : color.hashCode());
result = prime * result + ((email == null) ? 0 : email.hashCode());
result = prime * result + ((threeLetterIocCountryCode == null) ? 0 : threeLetterIocCountryCode.hashCode());
@@ -79,16 +80,16 @@ public class CompetitorDTOImpl extends NamedDTO implements CompetitorDTO, Serial
return false;
} else if (!boatClass.equals(other.boatClass))
return false;
if (boat == null) {
if (other.boat != null)
return false;
} else if (!boat.equals(other.boat))
return false;
if (idAsString == null) {
if (other.idAsString != null)
return false;
} else if (!idAsString.equals(other.idAsString))
return false;
if (sailID == null) {
if (other.sailID != null)
return false;
} else if (!sailID.equals(other.sailID))
return false;
if (threeLetterIocCountryCode == null) {
if (other.threeLetterIocCountryCode != null)
return false;
@@ -144,7 +145,7 @@ public class CompetitorDTOImpl extends NamedDTO implements CompetitorDTO, Serial
@Override
public String getSailID() {
return sailID;
return boat==null?null:boat.getSailId();
}
@Override
@@ -198,4 +199,9 @@ public class CompetitorDTOImpl extends NamedDTO implements CompetitorDTO, Serial
public Duration getTimeOnDistanceAllowancePerNauticalMile() {
return timeOnDistanceAllowancePerNauticalMile;
}
@Override
public BoatDTO getBoat() {
return boat;
}
}
@@ -9,10 +9,12 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.sap.sse.common.Cloner;
import com.sap.sse.common.Util;
import com.sap.sse.common.Util.Pair;
/**
* Reduces the transmission size of a {@link LeaderboardDTO} by comparing this object to a previous version of
@@ -174,16 +176,20 @@ public class IncrementalLeaderboardDTO extends LeaderboardDTO implements Increme
}
/**
* @param previousVersion needed because after serialization/deserialization, the transient {@link #previousLeaderboard} will be <code>null</code>
* @param previousVersion
* needed because after serialization/deserialization, the transient {@link #previousLeaderboard}
* will be <code>null</code>.
* @return a map whose keys are the {@link CompetitorDTO#getIdAsString()} of the competitors for which the value
* tells the set of keys that are unchanged
*/
public Set<com.sap.sse.common.Util.Pair<CompetitorDTO, K>> getAllUnchangedCompetitorsAndKeys(LeaderboardDTO previousVersion) {
Set<com.sap.sse.common.Util.Pair<CompetitorDTO, K>> result = new HashSet<com.sap.sse.common.Util.Pair<CompetitorDTO,K>>();
public Map<String, Set<K>> getAllUnchangedCompetitorIdsAsStringAndKeys(LeaderboardDTO previousVersion) {
Map<String, Set<K>> result = new HashMap<>();
for (Map.Entry<K, long[]> raceColumnNameAndBitSet : unchanged.entrySet()) {
final long[] bitset = raceColumnNameAndBitSet.getValue();
if (bitset == null) {
// this means that all entries for the column are unchanged for all competitors
for (CompetitorDTO competitor : previousVersion.competitors) {
result.add(new com.sap.sse.common.Util.Pair<CompetitorDTO, K>(competitor, raceColumnNameAndBitSet.getKey()));
Util.add(result, competitor.getIdAsString(), raceColumnNameAndBitSet.getKey());
}
} else {
int competitorNumber = 0;
@@ -191,7 +197,7 @@ public class IncrementalLeaderboardDTO extends LeaderboardDTO implements Increme
long bitValue = 1;
for (int bit=0; bit<Long.SIZE; bit++) {
if ((bitset[arrayIndex] & bitValue) != 0) {
result.add(new com.sap.sse.common.Util.Pair<CompetitorDTO, K>(previousVersion.competitors.get(competitorNumber), raceColumnNameAndBitSet.getKey()));
Util.add(result, previousVersion.competitors.get(competitorNumber).getIdAsString(), raceColumnNameAndBitSet.getKey());
}
bitValue <<= 1;
competitorNumber++;
@@ -321,6 +327,14 @@ public class IncrementalLeaderboardDTO extends LeaderboardDTO implements Increme
}
private void applyThisToPreviousVersionByUpdatingThis(LeaderboardDTO previousVersion) {
// As a performance improvement for the GWT-compiled version of this class, try to avoid key types
// other than strings when there is a map or set to be implemented that has a lot of strain on the
// put / add / contains methods. For this, we use the competitor's getIdAsString() result that
// identifies them reasonably well.
final Map<String, CompetitorDTO> competitorsOfPreviousVersionByIdAsString = new HashMap<>();
for (final CompetitorDTO c : previousVersion.competitors) {
competitorsOfPreviousVersionByIdAsString.put(c.getIdAsString(), c);
}
if (this.updatedFromPreviousVersionWithId != null) {
if (!this.updatedFromPreviousVersionWithId.equals(previousVersion.getId())) {
throw new IllegalStateException("This incremental leaderboard DTO was already applied to a different previous version. It cannot be applied multiple times.");
@@ -410,62 +424,66 @@ public class IncrementalLeaderboardDTO extends LeaderboardDTO implements Increme
row.competitor = expandedCompetitor;
rows.put(expandedCompetitor, row);
}
final Set<CompetitorDTO> rowsUnchangedForCompetitors = new HashSet<CompetitorDTO>();
final Set<String> rowsUnchangedForCompetitorsWithIdAsString = new HashSet<>();
if (rowsUnchanged != null) {
for (com.sap.sse.common.Util.Pair<CompetitorDTO, Void> rowUnchanged : rowsUnchanged.getAllUnchangedCompetitorsAndKeys(previousVersion)) {
rowsUnchangedForCompetitors.add(rowUnchanged.getA());
rows.put(rowUnchanged.getA(), previousVersion.rows.get(rowUnchanged.getA()));
for (Entry<String, Set<Void>> rowUnchanged : rowsUnchanged.getAllUnchangedCompetitorIdsAsStringAndKeys(previousVersion).entrySet()) {
rowsUnchangedForCompetitorsWithIdAsString.add(rowUnchanged.getKey());
final CompetitorDTO previousCompetitor = competitorsOfPreviousVersionByIdAsString.get(rowUnchanged.getKey());
rows.put(previousCompetitor, previousVersion.rows.get(previousCompetitor));
}
}
final Set<com.sap.sse.common.Util.Pair<CompetitorDTO, String>> allUnchangedLeaderboardEntriesAsCompetitorsAndColumnNames =
unchangedLeaderboardEntries == null ? new HashSet<com.sap.sse.common.Util.Pair<CompetitorDTO,String>>() :
unchangedLeaderboardEntries.getAllUnchangedCompetitorsAndKeys(previousVersion);
final Map<String, Set<String>> allUnchangedLeaderboardEntriesAsCompetitorIdsAsStringAndColumnNames =
unchangedLeaderboardEntries == null ? new HashMap<String, Set<String>>() :
unchangedLeaderboardEntries.getAllUnchangedCompetitorIdsAsStringAndKeys(previousVersion);
if (unchangedLeaderboardEntries != null) {
for (com.sap.sse.common.Util.Pair<CompetitorDTO, String> competitorAndColumnName : allUnchangedLeaderboardEntriesAsCompetitorsAndColumnNames) {
CompetitorDTO previousCompetitor = competitorAndColumnName.getA();
if (!rowsUnchangedForCompetitors.contains(previousCompetitor)) { // only care if not the entire row was marked unchanged
LeaderboardEntryDTO previousEntry = previousVersion.rows.get(previousCompetitor).fieldsByRaceColumnName.get(
competitorAndColumnName.getB());
final LeaderboardRowDTO row = rows.get(previousCompetitor);
if (row != null) { // may be null if the competitor disappeared, e.g., because of suppression
row.fieldsByRaceColumnName.put(competitorAndColumnName.getB(), previousEntry);
for (Entry<String, Set<String>> competitorAndColumnNames : allUnchangedLeaderboardEntriesAsCompetitorIdsAsStringAndColumnNames.entrySet()) {
CompetitorDTO previousCompetitor = competitorsOfPreviousVersionByIdAsString.get(competitorAndColumnNames.getKey());
for (final String columnName : competitorAndColumnNames.getValue()) {
if (!rowsUnchangedForCompetitorsWithIdAsString.contains(competitorAndColumnNames.getKey())) { // only care if not the entire row was marked unchanged
LeaderboardEntryDTO previousEntry = previousVersion.rows.get(previousCompetitor).fieldsByRaceColumnName.get(columnName);
final LeaderboardRowDTO row = rows.get(previousCompetitor);
if (row != null) { // may be null if the competitor disappeared, e.g., because of suppression
row.fieldsByRaceColumnName.put(columnName, previousEntry);
}
}
}
}
}
if (legDetailsUnchanged != null) {
for (com.sap.sse.common.Util.Pair<CompetitorDTO, com.sap.sse.common.Util.Pair<String, Integer>> competitorInPreviosAndColumnNameAndLegDetailsIndex : legDetailsUnchanged
.getAllUnchangedCompetitorsAndKeys(previousVersion)) {
CompetitorDTO previousCompetitor = competitorInPreviosAndColumnNameAndLegDetailsIndex.getA();
final String raceColumnName = competitorInPreviosAndColumnNameAndLegDetailsIndex.getB().getA();
// if it's already clear that the entire LeaderboardEntryDTO was unchanged, the entry in legDetailsUnchanged was
// merely a hint for column compression within legDetailsUnchanged and doesn't need to be handled here
if (!allUnchangedLeaderboardEntriesAsCompetitorsAndColumnNames
.contains(new com.sap.sse.common.Util.Pair<CompetitorDTO, String>(previousCompetitor, raceColumnName))) {
final LeaderboardRowDTO leaderboardRowDTO = rows.get(previousCompetitor);
LeaderboardEntryDTO leaderboardEntry = leaderboardRowDTO == null ? null
: leaderboardRowDTO.fieldsByRaceColumnName.get(raceColumnName);
if (leaderboardEntry != null) {
final LeaderboardRowDTO previousLeaderboardRowDTO = previousVersion.rows
.get(previousCompetitor);
final LeaderboardEntryDTO previousLeaderboardEntryDTO = previousLeaderboardRowDTO == null ? null
: previousLeaderboardRowDTO.fieldsByRaceColumnName.get(raceColumnName);
final List<LegEntryDTO> previousLegDetails = previousLeaderboardEntryDTO == null ? null
: previousLeaderboardEntryDTO.legDetails;
if (previousLegDetails == null) {
// the leg index can only be null if the previous leg details are null
leaderboardEntry.legDetails = null;
} else {
// here, the leg index cannot be null
if (leaderboardEntry.legDetails == null) {
leaderboardEntry.legDetails = new ArrayList<LegEntryDTO>();
for (Entry<String, Set<Pair<String, Integer>>> competitorInPreviosAndColumnNameAndLegDetailsIndex :
legDetailsUnchanged.getAllUnchangedCompetitorIdsAsStringAndKeys(previousVersion).entrySet()) {
CompetitorDTO previousCompetitor = competitorsOfPreviousVersionByIdAsString.get(competitorInPreviosAndColumnNameAndLegDetailsIndex.getKey());
for (final Pair<String, Integer> columnNameAndLegDetailsIndex : competitorInPreviosAndColumnNameAndLegDetailsIndex.getValue()) {
final String raceColumnName = columnNameAndLegDetailsIndex.getA();
// if it's already clear that the entire LeaderboardEntryDTO was unchanged, the entry in legDetailsUnchanged was
// merely a hint for column compression within legDetailsUnchanged and doesn't need to be handled here
final Set<String> unchangedRaceColumnNamesForCompetitor;
if ((unchangedRaceColumnNamesForCompetitor=allUnchangedLeaderboardEntriesAsCompetitorIdsAsStringAndColumnNames.get(competitorInPreviosAndColumnNameAndLegDetailsIndex.getKey())) == null
|| !unchangedRaceColumnNamesForCompetitor.contains(raceColumnName)) {
final LeaderboardRowDTO leaderboardRowDTO = rows.get(previousCompetitor);
LeaderboardEntryDTO leaderboardEntry = leaderboardRowDTO == null ? null
: leaderboardRowDTO.fieldsByRaceColumnName.get(raceColumnName);
if (leaderboardEntry != null) {
final LeaderboardRowDTO previousLeaderboardRowDTO = previousVersion.rows.get(previousCompetitor);
final LeaderboardEntryDTO previousLeaderboardEntryDTO = previousLeaderboardRowDTO == null ? null
: previousLeaderboardRowDTO.fieldsByRaceColumnName.get(raceColumnName);
final List<LegEntryDTO> previousLegDetails = previousLeaderboardEntryDTO == null ? null
: previousLeaderboardEntryDTO.legDetails;
if (previousLegDetails == null) {
// the leg index can only be null if the previous leg details are null
leaderboardEntry.legDetails = null;
} else {
// here, the leg index cannot be null
if (leaderboardEntry.legDetails == null) {
leaderboardEntry.legDetails = new ArrayList<LegEntryDTO>();
}
final Integer pos = columnNameAndLegDetailsIndex.getB();
ensureSize(leaderboardEntry.legDetails, pos + 1);
leaderboardEntry.legDetails.set(pos, previousLegDetails.get(pos));
}
final Integer pos = competitorInPreviosAndColumnNameAndLegDetailsIndex.getB().getB();
ensureSize(leaderboardEntry.legDetails, pos + 1);
leaderboardEntry.legDetails.set(pos, previousLegDetails.get(pos));
}
}
}
}
}
}
}
@@ -70,6 +70,12 @@ public class PreviousCompetitorDTOImpl implements CompetitorDTO {
" need to be replaced by an object of "+CompetitorDTOImpl.class.getName()+" after deserialization");
}
@Override
public BoatDTO getBoat() {
throw new RuntimeException("Internal error. Objects of type "+PreviousCompetitorDTOImpl.class.getName()+
" need to be replaced by an object of "+CompetitorDTOImpl.class.getName()+" after deserialization");
}
@Override
public Color getColor() {
throw new RuntimeException("Internal error. Objects of type "+PreviousCompetitorDTOImpl.class.getName()+
@@ -157,7 +157,7 @@ public class RaceColumnDTO extends NamedDTO implements Serializable {
public boolean isLive(FleetDTO fleet, long serverTimePointAsMillis) {
boolean result = false;
final RaceDTO raceDTO = racesPerFleet.get(fleet);
if(raceDTO != null) {
if (raceDTO != null) {
result = raceDTO.isLive(serverTimePointAsMillis);
}
return result;
@@ -169,7 +169,7 @@ public class RaceColumnDTO extends NamedDTO implements Serializable {
public boolean hasLiveRaces(long serverTimePointAsMillis) {
boolean result = false;
for(FleetDTO fleet: fleets) {
for (FleetDTO fleet: fleets) {
result |= isLive(fleet, serverTimePointAsMillis);
}
return result;
@@ -14,7 +14,8 @@ Require-Bundle: com.sap.sse.mongodb,
com.sap.sailing.server.gateway.serialization,
com.sap.sse.common,
com.sap.sse,
com.sap.sailing.server.gateway.serialization.shared.android
com.sap.sailing.server.gateway.serialization.shared.android,
com.sap.sse.shared.android
Export-Package: com.sap.sailing.domain.persistence,
com.sap.sailing.domain.persistence.impl;
x-friends:="com.sap.sailing.domain.persistence.test,
@@ -41,7 +41,6 @@ import com.sap.sailing.domain.abstractlog.race.RaceLogCourseDesignChangedEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogDependentStartTimeEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEndOfTrackingEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventRestoreFactory;
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningConfirmedEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningListChangedEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogFixedMarkPassingEvent;
@@ -59,10 +58,30 @@ import com.sap.sailing.domain.abstractlog.race.RaceLogSuppressedMarkPassingsEven
import com.sap.sailing.domain.abstractlog.race.RaceLogWindFixEvent;
import com.sap.sailing.domain.abstractlog.race.SimpleRaceLogIdentifier;
import com.sap.sailing.domain.abstractlog.race.impl.CompetitorResultsImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogCourseAreaChangeEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogCourseDesignChangedEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogDependentStartTimeEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogEndOfTrackingEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFinishPositioningConfirmedEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFinishPositioningListChangedEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFixedMarkPassingEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFlagEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogGateLineOpeningTimeEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogPassChangeEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogPathfinderEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogProtestStartTimeEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogRaceStatusEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogRevokeEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartOfTrackingEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartProcedureChangedEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartTimeEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogSuppressedMarkPassingsEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogWindFixEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.SimpleRaceLogIdentifierImpl;
import com.sap.sailing.domain.abstractlog.race.scoring.AdditionalScoringInformationType;
import com.sap.sailing.domain.abstractlog.race.scoring.RaceLogAdditionalScoringInformationEvent;
import com.sap.sailing.domain.abstractlog.race.scoring.impl.RaceLogAdditionalScoringInformationEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogCloseOpenEndedDeviceMappingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDefineMarkEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDenoteForTrackingEvent;
@@ -70,6 +89,13 @@ import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceCompetitorM
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceMarkMappingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogRegisterCompetitorEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogStartTrackingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogCloseOpenEndedDeviceMappingEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDefineMarkEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDenoteForTrackingEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceCompetitorMappingEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceMarkMappingEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogRegisterCompetitorEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogStartTrackingEventImpl;
import com.sap.sailing.domain.abstractlog.regatta.RegattaLog;
import com.sap.sailing.domain.abstractlog.regatta.RegattaLogEvent;
import com.sap.sailing.domain.abstractlog.regatta.events.RegattaLogCloseOpenEndedDeviceMappingEvent;
@@ -198,19 +224,18 @@ import com.sap.sse.common.impl.MillisecondsDurationImpl;
import com.sap.sse.common.impl.MillisecondsTimePoint;
import com.sap.sse.common.impl.RGBColor;
import com.sap.sse.common.impl.TimeRangeImpl;
import com.sap.sse.common.media.ImageDescriptor;
import com.sap.sse.common.media.ImageDescriptorImpl;
import com.sap.sse.common.media.MimeType;
import com.sap.sse.common.media.VideoDescriptor;
import com.sap.sse.common.media.VideoDescriptorImpl;
import com.sap.sse.shared.media.ImageDescriptor;
import com.sap.sse.shared.media.VideoDescriptor;
import com.sap.sse.shared.media.impl.ImageDescriptorImpl;
import com.sap.sse.shared.media.impl.VideoDescriptorImpl;
public class DomainObjectFactoryImpl implements DomainObjectFactory {
private static final Logger logger = Logger.getLogger(DomainObjectFactoryImpl.class.getName());
private final CompetitorJsonDeserializer competitorDeserializer;
private final DB database;
private RaceLogEventRestoreFactory raceLogEventFactory;
private final DomainFactory baseDomainFactory;
private final TypeBasedServiceFinder<DeviceIdentifierMongoHandler> deviceIdentifierServiceFinder;
private final TypeBasedServiceFinderFactory serviceFinderFactory;
@@ -235,7 +260,6 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
this.baseDomainFactory = baseDomainFactory;
this.competitorDeserializer = CompetitorJsonDeserializer.create(baseDomainFactory);
this.database = db;
this.raceLogEventFactory = RaceLogEventRestoreFactory.INSTANCE;
}
@Override
@@ -614,11 +638,18 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
// deprecated style: a DBObject whose keys are the escaped competitor names
// new style: a BasicDBList whose entries are DBObjects with COMPETITOR_ID and COMPETITOR_DISPLAY_NAME fields
if (competitorDisplayNames != null) {
for (Object o : (BasicDBList) competitorDisplayNames) {
DBObject competitorDisplayName = (DBObject) o;
final Serializable competitorId = (Serializable) competitorDisplayName.get(FieldNames.COMPETITOR_ID.name());
final String displayName = (String) competitorDisplayName.get(FieldNames.COMPETITOR_DISPLAY_NAME.name());
correctionsToUpdate.setDisplayNameByID(competitorId, displayName);
if (competitorDisplayNames instanceof BasicDBList) {
for (Object o : (BasicDBList) competitorDisplayNames) {
DBObject competitorDisplayName = (DBObject) o;
final Serializable competitorId = (Serializable) competitorDisplayName.get(FieldNames.COMPETITOR_ID.name());
final String displayName = (String) competitorDisplayName.get(FieldNames.COMPETITOR_DISPLAY_NAME.name());
correctionsToUpdate.setDisplayNameByID(competitorId, displayName);
}
} else {
logger.severe("Deprecated, now unreadable format of the "+FieldNames.LEADERBOARD_COMPETITOR_DISPLAY_NAMES.name()
+" field for leaderboard "+dbLeaderboard.get(FieldNames.LEADERBOARD_NAME.name())+
". You will have to update the competitor display names manually: "+
competitorDisplayNames);
}
}
}
@@ -1363,7 +1394,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
Wind wind = loadWind((DBObject) dbObject.get(FieldNames.WIND.name()));
Boolean isMagnetic = (Boolean) dbObject.get(FieldNames.IS_MAGNETIC.name());
return raceLogEventFactory.createWindFixEvent(createdAt, author, logicalTimePoint, id, competitors, passId, wind, isMagnetic == null ? true : isMagnetic);
return new RaceLogWindFixEventImpl(createdAt, logicalTimePoint, author, id, passId, wind, isMagnetic == null ? true : isMagnetic);
}
private RaceLogEvent loadRaceLogDeviceCompetitorMappingEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
@@ -1380,7 +1411,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
(Serializable) dbObject.get(FieldNames.COMPETITOR_ID.name()));
TimePoint from = loadTimePoint(dbObject, FieldNames.RACE_LOG_FROM);
TimePoint to = loadTimePoint(dbObject, FieldNames.RACE_LOG_TO);
return raceLogEventFactory.createDeviceCompetitorMappingEvent(createdAt, author, logicalTimePoint, id, device, mappedTo, passId, from, to);
return new RaceLogDeviceCompetitorMappingEventImpl(createdAt, logicalTimePoint, author, id, passId, mappedTo, device, from, to);
}
private RaceLogEvent loadRaceLogDeviceMarkMappingEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
@@ -1397,7 +1428,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
Mark mappedTo = loadMark((DBObject) dbObject.get(FieldNames.MARK.name()));
TimePoint from = loadTimePoint(dbObject, FieldNames.RACE_LOG_FROM);
TimePoint to = loadTimePoint(dbObject, FieldNames.RACE_LOG_TO);
return raceLogEventFactory.createDeviceMarkMappingEvent(createdAt, author, logicalTimePoint, id, device, mappedTo, passId, from, to);
return new RaceLogDeviceMarkMappingEventImpl(createdAt, logicalTimePoint, author, id, passId, mappedTo, device, from, to);
}
private RaceLogEvent loadRaceLogDenoteForTrackingEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
@@ -1405,12 +1436,12 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
String raceName = (String) dbObject.get(FieldNames.RACE_NAME.name());
BoatClass boatClass = baseDomainFactory.getOrCreateBoatClass((String) dbObject.get(FieldNames.BOAT_CLASS_NAME.name()));
Serializable raceId = (Serializable) dbObject.get(FieldNames.RACE_ID.name());
return raceLogEventFactory.createDenoteForTrackingEvent(createdAt, author, logicalTimePoint, id, passId, raceName, boatClass, raceId);
return new RaceLogDenoteForTrackingEventImpl(createdAt, logicalTimePoint, author, id, passId, raceName, boatClass, raceId);
}
private RaceLogEvent loadRaceLogStartTrackingEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
return raceLogEventFactory.createStartTrackingEvent(createdAt, author, logicalTimePoint, id, passId);
return new RaceLogStartTrackingEventImpl(createdAt, logicalTimePoint, author, id, passId);
}
private RaceLogEvent loadRaceLogRevokeEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
@@ -1420,7 +1451,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
String revokedEventType = (String) dbObject.get(FieldNames.RACE_LOG_REVOKED_EVENT_TYPE.name());
String revokedEventShortInfo = (String) dbObject.get(FieldNames.RACE_LOG_REVOKED_EVENT_SHORT_INFO.name());
String reason = (String) dbObject.get(FieldNames.RACE_LOG_REVOKED_REASON.name());
return raceLogEventFactory.createRevokeEvent(createdAt, author, logicalTimePoint, id, passId,
return new RaceLogRevokeEventImpl(createdAt, logicalTimePoint, author, id, passId,
revokedEventId, revokedEventType, revokedEventShortInfo, reason);
}
@@ -1428,20 +1459,20 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
Serializable competitorId = (Serializable) dbObject.get(FieldNames.RACE_LOG_COMPETITOR_ID.name());
Competitor comp = baseDomainFactory.getCompetitorStore().getExistingCompetitorById(competitorId);
return raceLogEventFactory.createRegisterCompetitorEvent(createdAt, author, logicalTimePoint, id, passId, comp);
return new RaceLogRegisterCompetitorEventImpl(createdAt, logicalTimePoint, author, id, passId, comp);
}
private RaceLogEvent loadRaceLogDefineMarkEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
Mark mark = loadMark((DBObject) dbObject.get(FieldNames.RACE_LOG_MARK.name()));
return raceLogEventFactory.createDefineMarkEvent(createdAt, author, logicalTimePoint, id, passId, mark);
return new RaceLogDefineMarkEventImpl(createdAt, logicalTimePoint, author, id, passId, mark);
}
private RaceLogEvent loadRaceLogCloseOpenEndedDeviceMappingEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
Serializable deviceMappingEventId = Helpers.tryUuidConversion((Serializable) dbObject.get(FieldNames.RACE_LOG_DEVICE_MAPPING_EVENT_ID.name()));
TimePoint closingTimePoint = loadTimePoint(dbObject, FieldNames.RACE_LOG_CLOSING_TIMEPOINT);
return raceLogEventFactory.createCloseOpenEndedDeviceMappingEvent(createdAt, author, logicalTimePoint, id, passId,
return new RaceLogCloseOpenEndedDeviceMappingEventImpl(createdAt, logicalTimePoint, author, id, passId,
deviceMappingEventId, closingTimePoint);
}
@@ -1454,19 +1485,19 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
} else {
logger.warning("Could not find additional scoring information attached to db log for " + dbObject.toString());
}
return raceLogEventFactory.createAdditionalScoringInformationEvent(createdAt, author, logicalTimePoint, id, competitors, passId, informationType);
return new RaceLogAdditionalScoringInformationEventImpl(createdAt, logicalTimePoint, author, id, passId, informationType);
}
private RaceLogEvent loadRaceLogProtestStartTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
TimePoint protestStartTime = loadTimePoint(dbObject, FieldNames.RACE_LOG_PROTEST_START_TIME);
return raceLogEventFactory.createProtestStartTimeEvent(createdAt, author, logicalTimePoint, id, competitors, passId, protestStartTime);
return new RaceLogProtestStartTimeEventImpl(createdAt, logicalTimePoint, author, id, passId, protestStartTime);
}
private RaceLogEvent loadRaceLogStartProcedureChangedEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
RacingProcedureType type = RacingProcedureType.valueOf(dbObject.get(FieldNames.RACE_LOG_START_PROCEDURE_TYPE.name()).toString());
return raceLogEventFactory.createStartProcedureChangedEvent(createdAt, author, logicalTimePoint, id, competitors, passId, type);
return new RaceLogStartProcedureChangedEventImpl(createdAt, logicalTimePoint, author, id, passId, type);
}
private RaceLogEvent loadRaceLogGateLineOpeningTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
@@ -1476,14 +1507,14 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
if (dbObject.containsField(FieldNames.RACE_LOG_GOLF_DOWN_TIME.name())) {
golfDownTime = (Number) dbObject.get(FieldNames.RACE_LOG_GOLF_DOWN_TIME.name());
}
return raceLogEventFactory.createGateLineOpeningTimeEvent(createdAt, author, logicalTimePoint, id, competitors,
return new RaceLogGateLineOpeningTimeEventImpl(createdAt, logicalTimePoint, author, id,
passId, gateLaunchStopTime == null ? null : gateLaunchStopTime.longValue(), golfDownTime.longValue());
}
private RaceLogEvent loadRaceLogPathfinderEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
String pathfinderId = dbObject.get(FieldNames.RACE_LOG_PATHFINDER_ID.name()).toString();
return raceLogEventFactory.createPathfinderEvent(createdAt, author, logicalTimePoint, id, competitors, passId, pathfinderId);
return new RaceLogPathfinderEventImpl(createdAt, logicalTimePoint, author, id, passId, pathfinderId);
}
private RaceLogEvent loadRaceLogFinishPositioningConfirmedEvent(TimePoint createdAt, AbstractLogEventAuthor author,
@@ -1496,7 +1527,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
positionedCompetitors = loadPositionedCompetitors(dbPositionedCompetitorList);
}
return raceLogEventFactory.createFinishPositioningConfirmedEvent(createdAt, author, logicalTimePoint, id, competitors, passId, positionedCompetitors);
return new RaceLogFinishPositioningConfirmedEventImpl(createdAt, logicalTimePoint, author, id, passId, positionedCompetitors);
}
private RaceLogEvent loadRaceLogFinishPositioningListChangedEvent(TimePoint createdAt, AbstractLogEventAuthor author,
@@ -1504,36 +1535,36 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
BasicDBList dbPositionedCompetitorList = (BasicDBList) dbObject.get(FieldNames.RACE_LOG_POSITIONED_COMPETITORS.name());
CompetitorResults positionedCompetitors = loadPositionedCompetitors(dbPositionedCompetitorList);
return raceLogEventFactory.createFinishPositioningListChangedEvent(createdAt, author, logicalTimePoint, id, competitors, passId, positionedCompetitors);
return new RaceLogFinishPositioningListChangedEventImpl(createdAt, logicalTimePoint, author, id, passId, positionedCompetitors);
}
private RaceLogEvent loadRaceLogPassChangeEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable id, Integer passId, List<Competitor> competitors) {
return raceLogEventFactory.createPassChangeEvent(createdAt, author, logicalTimePoint, id, competitors, passId);
return new RaceLogPassChangeEventImpl(createdAt, logicalTimePoint, author, id, passId);
}
private RaceLogCourseDesignChangedEvent loadRaceLogCourseDesignChangedEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
String courseName = (String) dbObject.get(FieldNames.RACE_LOG_COURSE_DESIGN_NAME.name());
CourseBase courseData = loadCourseData((BasicDBList) dbObject.get(FieldNames.RACE_LOG_COURSE_DESIGN.name()), courseName);
return raceLogEventFactory.createCourseDesignChangedEvent(createdAt, author, logicalTimePoint, id, competitors, passId, courseData);
return new RaceLogCourseDesignChangedEventImpl(createdAt, logicalTimePoint, author, id, passId, courseData);
}
private RaceLogCourseAreaChangedEvent loadRaceLogCourseAreaChangedEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
Serializable courseAreaId = (Serializable) dbObject.get(FieldNames.COURSE_AREA_ID.name());
return raceLogEventFactory.createCourseAreaChangedEvent(createdAt, author, logicalTimePoint, id, competitors, passId, courseAreaId);
return new RaceLogCourseAreaChangeEventImpl(createdAt, logicalTimePoint, author, id, passId, courseAreaId);
}
private RaceLogEvent loadRaceLogFixedMarkPassingEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
TimePoint ofFixedPassing = loadTimePoint(dbObject, FieldNames.TIMEPOINT_OF_FIXED_MARKPASSING);
Integer zeroBasedIndexOfWaypoint = (Integer) dbObject.get(FieldNames.INDEX_OF_PASSED_WAYPOINT.name());
return raceLogEventFactory.createFixedMarkPassingEvent(logicalTimePoint, author, id, competitors, passId, ofFixedPassing, zeroBasedIndexOfWaypoint);
return new RaceLogFixedMarkPassingEventImpl(createdAt, logicalTimePoint, author, id, competitors, passId, ofFixedPassing, zeroBasedIndexOfWaypoint);
}
private RaceLogEvent loadRaceLogSuppressedMarkPassingsEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
Integer zeroBasedIndexOfFirstSuppressedWaypoint = (Integer) dbObject.get(FieldNames.INDEX_OF_FIRST_SUPPRESSED_WAYPOINT.name());
return raceLogEventFactory.createSuppressedMarkPassingsEvent(logicalTimePoint, author, id, competitors, passId, zeroBasedIndexOfFirstSuppressedWaypoint);
return new RaceLogSuppressedMarkPassingsEventImpl(createdAt, logicalTimePoint, author, id, competitors, passId, zeroBasedIndexOfFirstSuppressedWaypoint);
}
private CompetitorResults loadPositionedCompetitors(BasicDBList dbPositionedCompetitorList) {
@@ -1581,22 +1612,21 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
return null;
}
return raceLogEventFactory.createFlagEvent(createdAt, author, logicalTimePoint, id, competitors, passId, upperFlag, lowerFlag, displayed);
return new RaceLogFlagEventImpl(createdAt, logicalTimePoint, author, id, passId, upperFlag, lowerFlag, displayed);
}
private RaceLogStartTimeEvent loadRaceLogStartTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
TimePoint startTime = loadTimePoint(dbObject, FieldNames.RACE_LOG_EVENT_START_TIME);
final String nextStatusName = (String) dbObject.get(FieldNames.RACE_LOG_EVENT_NEXT_STATUS.name());
final RaceLogRaceStatus nextStatus = nextStatusName==null?null:RaceLogRaceStatus.valueOf(nextStatusName);
return raceLogEventFactory.createStartTimeEvent(createdAt, author, logicalTimePoint, id, competitors, passId, startTime, nextStatus);
RaceLogRaceStatus nextStatus = RaceLogRaceStatus.valueOf((String) dbObject.get(FieldNames.RACE_LOG_EVENT_NEXT_STATUS.name()));
return new RaceLogStartTimeEventImpl(createdAt, logicalTimePoint, author, id, passId, startTime, nextStatus);
}
private RaceLogStartOfTrackingEvent loadRaceLogStartOfTrackingEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
return raceLogEventFactory.createStartOfTrackingEvent(logicalTimePoint, author, id, competitors, passId);
return new RaceLogStartOfTrackingEventImpl(createdAt, logicalTimePoint, author, id, passId);
}
private RaceLogEndOfTrackingEvent loadRaceLogEndOfTrackingEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
return raceLogEventFactory.createEndOfTrackingEvent(logicalTimePoint, author, id, competitors, passId);
return new RaceLogEndOfTrackingEventImpl(createdAt, logicalTimePoint, author, id, passId);
}
private RaceLogDependentStartTimeEvent loadRaceLogDependentStartTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
@@ -1611,13 +1641,13 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
final Duration startTimeDifference = startTimeDifferenceObject == null ? null :
new MillisecondsDurationImpl(((Number) startTimeDifferenceObject).longValue());
RaceLogRaceStatus nextStatus = RaceLogRaceStatus.valueOf((String) dbObject.get(FieldNames.RACE_LOG_EVENT_NEXT_STATUS.name()));
return raceLogEventFactory.createDependentStartTimeEvent(createdAt, author, logicalTimePoint, id, competitors,
return new RaceLogDependentStartTimeEventImpl(createdAt, logicalTimePoint, author, id,
passId, dependentRaceLog, startTimeDifference, nextStatus);
}
private RaceLogRaceStatusEvent loadRaceLogRaceStatusEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
RaceLogRaceStatus nextStatus = RaceLogRaceStatus.valueOf((String) dbObject.get(FieldNames.RACE_LOG_EVENT_NEXT_STATUS.name()));
return raceLogEventFactory.createRaceStatusEvent(createdAt, author, logicalTimePoint, id, competitors, passId, nextStatus);
return new RaceLogRaceStatusEventImpl(createdAt, logicalTimePoint, author, id, passId, nextStatus);
}
@Override
@@ -1689,7 +1719,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, DBObject dbObject) {
final Competitor comp = getCompetitorByID(dbObject);
final Double timeOnTimeFactor = (Double) dbObject.get(FieldNames.REGATTA_LOG_TIME_ON_TIME_FACTOR.name());
return new RegattaLogSetCompetitorTimeOnTimeFactorEventImpl(createdAt, author, logicalTimePoint, id, comp, timeOnTimeFactor);
return new RegattaLogSetCompetitorTimeOnTimeFactorEventImpl(createdAt, logicalTimePoint, author, id, comp, timeOnTimeFactor);
}
private RegattaLogEvent loadRegattaLogSetCompetitorTimeOnTimeFactorEvent(TimePoint createdAt,
@@ -1698,7 +1728,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
final Double timeOnDistanceSecondsAllowancePerNauticalMile = (Double) dbObject.get(FieldNames.REGATTA_LOG_TIME_ON_DISTANCE_SECONDS_ALLOWANCE_PER_NAUTICAL_MILE.name());
final Duration timeOnDistanceAllowancePerNauticalMile = timeOnDistanceSecondsAllowancePerNauticalMile == null ? null :
new MillisecondsDurationImpl((long) (timeOnDistanceSecondsAllowancePerNauticalMile*1000));
return new RegattaLogSetCompetitorTimeOnDistanceAllowancePerNauticalMileEventImpl(createdAt, author, logicalTimePoint, id, comp, timeOnDistanceAllowancePerNauticalMile);
return new RegattaLogSetCompetitorTimeOnDistanceAllowancePerNauticalMileEventImpl(createdAt, logicalTimePoint, author, id, comp, timeOnDistanceAllowancePerNauticalMile);
}
private RegattaLogRevokeEvent loadRegattaLogRevokeEvent(TimePoint createdAt, AbstractLogEventAuthor author,
@@ -1708,14 +1738,14 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
String revokedEventType = (String) dbObject.get(FieldNames.REGATTA_LOG_REVOKED_EVENT_TYPE.name());
String revokedEventShortInfo = (String) dbObject.get(FieldNames.REGATTA_LOG_REVOKED_EVENT_SHORT_INFO.name());
String reason = (String) dbObject.get(FieldNames.REGATTA_LOG_REVOKED_REASON.name());
return new RegattaLogRevokeEventImpl(createdAt, author, logicalTimePoint, id,
return new RegattaLogRevokeEventImpl(createdAt, logicalTimePoint, author, id,
revokedEventId, revokedEventType, revokedEventShortInfo, reason);
}
private RegattaLogRegisterCompetitorEvent loadRegattaLogRegisterCompetitorEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, DBObject dbObject) {
Competitor comp = getCompetitorByID(dbObject);
return new RegattaLogRegisterCompetitorEventImpl(createdAt, author, logicalTimePoint, id, comp);
return new RegattaLogRegisterCompetitorEventImpl(createdAt, logicalTimePoint, author, id, comp);
}
private RegattaLogCloseOpenEndedDeviceMappingEvent loadRegattaLogCloseOpenEndedDeviceMappingEvent(TimePoint createdAt,
@@ -1742,7 +1772,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
Triple<TimePoint, TimePoint, Boolean> times = loadFromToTimePoint(dbObject, FieldNames.REGATTA_LOG_FROM, FieldNames.RACE_LOG_FROM, FieldNames.REGATTA_LOG_TO, FieldNames.RACE_LOG_TO);
final TimePoint from = times.getA();
final TimePoint to = times.getB();
final RegattaLogDeviceMarkMappingEventImpl result = new RegattaLogDeviceMarkMappingEventImpl(createdAt, author, logicalTimePoint, id, mappedTo, device, from, to);
final RegattaLogDeviceMarkMappingEventImpl result = new RegattaLogDeviceMarkMappingEventImpl(createdAt, logicalTimePoint, author, id, mappedTo, device, from, to);
final boolean needsMigration = times.getC();
if (needsMigration) {
// remove old version of mapping event
@@ -1804,7 +1834,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
final TimePoint from = times.getA();
final TimePoint to = times.getB();
final boolean needsMigration = times.getC();
final RegattaLogDeviceCompetitorMappingEventImpl result = new RegattaLogDeviceCompetitorMappingEventImpl(createdAt, author, logicalTimePoint, id, mappedTo, device, from, to);
final RegattaLogDeviceCompetitorMappingEventImpl result = new RegattaLogDeviceCompetitorMappingEventImpl(createdAt, logicalTimePoint, author, id, mappedTo, device, from, to);
if (needsMigration) {
// remove old version of mapping event
WriteResult removeResult = database.getCollection(CollectionNames.REGATTA_LOGS.name()).remove(outerDBObject);
@@ -9,8 +9,9 @@ import org.junit.Before;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceCompetitorMappingEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceMarkMappingEventImpl;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.DomainFactory;
import com.sap.sailing.domain.base.Mark;
@@ -66,8 +67,8 @@ public class AbstractGPSFixStoreTest {
}
protected void map(RaceLog raceLog, Competitor comp, DeviceIdentifier device, long from, long to) {
raceLog.add(RaceLogEventFactory.INSTANCE.createDeviceCompetitorMappingEvent(MillisecondsTimePoint.now(), author, device,
comp, 0, new MillisecondsTimePoint(from), new MillisecondsTimePoint(to)));
raceLog.add(new RaceLogDeviceCompetitorMappingEventImpl(MillisecondsTimePoint.now(), author, 0,
comp, device, new MillisecondsTimePoint(from), new MillisecondsTimePoint(to)));
}
protected void map(Competitor comp, DeviceIdentifier device, long from, long to) {
@@ -75,8 +76,8 @@ public class AbstractGPSFixStoreTest {
}
protected void map(Mark mark, DeviceIdentifier device, long from, long to) {
raceLog.add(RaceLogEventFactory.INSTANCE.createDeviceMarkMappingEvent(MillisecondsTimePoint.now(), author, device,
mark, 0, new MillisecondsTimePoint(from), new MillisecondsTimePoint(to)));
raceLog.add(new RaceLogDeviceMarkMappingEventImpl(MillisecondsTimePoint.now(), author, 0,
mark, device, new MillisecondsTimePoint(from), new MillisecondsTimePoint(to)));
}
protected void testNumberOfRawFixes(Track<?> track, long expected) {
@@ -19,7 +19,8 @@ import org.junit.rules.ExpectedException;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceCompetitorMappingEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogRegisterCompetitorEventImpl;
import com.sap.sailing.domain.abstractlog.regatta.RegattaLog;
import com.sap.sailing.domain.abstractlog.regatta.events.impl.RegattaLogDeviceCompetitorMappingEventImpl;
import com.sap.sailing.domain.abstractlog.regatta.events.impl.RegattaLogRegisterCompetitorEventImpl;
@@ -68,8 +69,6 @@ public class CreateAndTrackWithRaceLogTest {
private long time = 0;
private static final RaceLogEventFactory factory = RaceLogEventFactory.INSTANCE;
@Before
public void setup() {
service = new RacingEventServiceImpl(true, new MockSmartphoneImeiServiceFinderFactory());
@@ -172,9 +171,9 @@ public class CreateAndTrackWithRaceLogTest {
Competitor comp1 = DomainFactory.INSTANCE.getOrCreateCompetitor("comp1", "comp1", null, null, null, null, null,
/* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null);
DeviceIdentifier dev1 = new SmartphoneImeiIdentifier("dev1");
raceLog.add(factory.createDeviceCompetitorMappingEvent(t(), author, dev1, comp1, 0, t(0), t(10)));
raceLog.add(new RaceLogDeviceCompetitorMappingEventImpl(t(), author, 0, comp1, dev1, t(0), t(10)));
addFixes0(dev1);
raceLog.add(factory.createRegisterCompetitorEvent(t(), author, 0, comp1));
raceLog.add(new RaceLogRegisterCompetitorEventImpl(t(), author, 0, comp1));
// start tracking
adapter.startTracking(service, leaderboard, column, fleet);
@@ -185,7 +184,7 @@ public class CreateAndTrackWithRaceLogTest {
race.waitForLoadingFromGPSFixStoreToFinishRunning(raceLog);
addFixes1(race, comp1, dev1);
raceLog.add(factory.createDeviceCompetitorMappingEvent(t(), author, dev1, comp1, 0, t(11), t(20)));
raceLog.add(new RaceLogDeviceCompetitorMappingEventImpl(t(), author, 0, comp1, dev1, t(11), t(20)));
// add another mapping on the fly, other old fixes should be loaded
addFixes2(race, comp1, dev1);
@@ -207,10 +206,10 @@ public class CreateAndTrackWithRaceLogTest {
Competitor comp1 = DomainFactory.INSTANCE.getOrCreateCompetitor("comp1", "comp1", null, null, null, null, null,
/* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null);
DeviceIdentifier dev1 = new SmartphoneImeiIdentifier("dev1");
regattaLog.add(new RegattaLogDeviceCompetitorMappingEventImpl(t(), author, t(), UUID.randomUUID(), comp1, dev1,
regattaLog.add(new RegattaLogDeviceCompetitorMappingEventImpl(t(), t(), author, UUID.randomUUID(), comp1, dev1,
t(0), t(10)));
addFixes0(dev1);
regattaLog.add(new RegattaLogRegisterCompetitorEventImpl(t(), author, t(), UUID.randomUUID(), comp1));
regattaLog.add(new RegattaLogRegisterCompetitorEventImpl(t(), t(), author, UUID.randomUUID(), comp1));
// start tracking
adapter.startTracking(service, leaderboard, column, fleet);
@@ -223,7 +222,7 @@ public class CreateAndTrackWithRaceLogTest {
addFixes1(race, comp1, dev1);
// add another mapping on the fly, other old fixes should be loaded
regattaLog.add(new RegattaLogDeviceCompetitorMappingEventImpl(t(), author, t(), UUID.randomUUID(), comp1, dev1,
regattaLog.add(new RegattaLogDeviceCompetitorMappingEventImpl(t(), t(), author, UUID.randomUUID(), comp1, dev1,
t(11), t(20)));
addFixes2(race, comp1, dev1);
@@ -29,14 +29,22 @@ import com.sap.sailing.domain.abstractlog.impl.AllEventsOfTypeFinder;
import com.sap.sailing.domain.abstractlog.impl.LastEventOfTypeFinder;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.LastPublishedCourseDesignFinder;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogCourseDesignChangedEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDefineMarkEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDenoteForTrackingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceMarkMappingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogStartTrackingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.analyzing.impl.RaceLogTrackingStateAnalyzer;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDefineMarkEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDenoteForTrackingEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceMarkMappingEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogRegisterCompetitorEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogStartTrackingEventImpl;
import com.sap.sailing.domain.abstractlog.regatta.RegattaLog;
import com.sap.sailing.domain.abstractlog.regatta.RegattaLogEvent;
import com.sap.sailing.domain.abstractlog.regatta.RegattaLogEventVisitor;
import com.sap.sailing.domain.abstractlog.regatta.events.impl.RegattaLogDeviceMarkMappingEventImpl;
import com.sap.sailing.domain.abstractlog.regatta.events.impl.RegattaLogRegisterCompetitorEventImpl;
import com.sap.sailing.domain.abstractlog.shared.analyzing.RegisteredCompetitorsAnalyzer;
@@ -101,7 +109,7 @@ public class RaceLogTrackingAdapterImpl implements RaceLogTrackingAdapter {
}
RegattaIdentifier regatta = ((RegattaLeaderboard) leaderboard).getRegatta().getRegattaIdentifier();
if (raceLogTrackingState != RaceLogTrackingState.TRACKING) {
RaceLogEvent event = RaceLogEventFactory.INSTANCE.createStartTrackingEvent(MillisecondsTimePoint.now(),
RaceLogEvent event = new RaceLogStartTrackingEventImpl(MillisecondsTimePoint.now(),
service.getServerAuthor(), raceLog.getCurrentPassId());
raceLog.add(event);
}
@@ -157,7 +165,7 @@ public class RaceLogTrackingAdapterImpl implements RaceLogTrackingAdapter {
throw new NotDenotableForRaceLogTrackingException("Already denoted for tracking");
}
RaceLogEvent event = RaceLogEventFactory.INSTANCE.createDenoteForTrackingEvent(MillisecondsTimePoint.now(),
RaceLogEvent event = new RaceLogDenoteForTrackingEventImpl(MillisecondsTimePoint.now(),
service.getServerAuthor(), raceLog.getCurrentPassId(), raceName, boatClass, UUID.randomUUID());
raceLog.add(event);
}
@@ -225,15 +233,15 @@ public class RaceLogTrackingAdapterImpl implements RaceLogTrackingAdapter {
newCourse.addWaypoint(i++, oldWaypoint);
}
for (Mark mark : marks) {
RaceLogEvent event = RaceLogEventFactory.INSTANCE.createDefineMarkEvent(now,
service.getServerAuthor(), toRaceLog.getCurrentPassId(), mark);
RaceLogEvent event = new RaceLogDefineMarkEventImpl(now, service.getServerAuthor(),
toRaceLog.getCurrentPassId(), mark);
toRaceLog.add(event);
}
for (RaceLogEvent raceLogDeviceMarkMappingEvent : raceLogDeviceMarkMappingEvents) {
toRaceLog.add(raceLogDeviceMarkMappingEvent);
}
int passId = toRaceLog.getCurrentPassId();
RaceLogEvent newCourseEvent = RaceLogEventFactory.INSTANCE.createCourseDesignChangedEvent(now,
RaceLogEvent newCourseEvent = new RaceLogCourseDesignChangedEventImpl(now,
service.getServerAuthor(), passId, newCourse);
toRaceLog.add(newCourseEvent);
}
@@ -243,8 +251,7 @@ public class RaceLogTrackingAdapterImpl implements RaceLogTrackingAdapter {
}
@Override
public void copyCompetitors(RaceLog fromRaceLog, Set<RaceLog> toRaceLogs,
RacingEventService service) {
public void copyCompetitors(RaceLog fromRaceLog, Set<RaceLog> toRaceLogs, RacingEventService service) {
final Set<Competitor> competitors = new RegisteredCompetitorsAnalyzer<>(fromRaceLog).analyze();
for (RaceLog toRaceLog : toRaceLogs) {
registerCompetitors(service, toRaceLog, competitors);
@@ -271,17 +278,25 @@ public class RaceLogTrackingAdapterImpl implements RaceLogTrackingAdapter {
@Override
public void pingMark(RaceLog raceLog, Mark mark, GPSFix gpsFix, RacingEventService service) {
pingMark(raceLog, mark, gpsFix, service,
(DeviceIdentifier dev, TimePoint timePoint) -> RaceLogEventFactory.INSTANCE
.createDeviceMarkMappingEvent(timePoint, service.getServerAuthor(), dev, mark,
raceLog.getCurrentPassId(), timePoint, timePoint), new PingDeviceIdentifierImpl());
DeviceMarkMappingEventFactory<RaceLogEventVisitor, RaceLogEvent> raceLogEventFactory =
(DeviceIdentifier dev, TimePoint timePoint) -> new RaceLogDeviceMarkMappingEventImpl(timePoint, service
.getServerAuthor(), raceLog.getCurrentPassId(), mark, dev, timePoint, timePoint);
pingMark(
raceLog,
mark,
gpsFix,
service,
raceLogEventFactory,
new PingDeviceIdentifierImpl());
}
@Override
public void pingMark(RegattaLog regattaLog, Mark mark, GPSFix gpsFix, RacingEventService service) {
pingMark(regattaLog, mark, gpsFix, service,
DeviceMarkMappingEventFactory<RegattaLogEventVisitor, RegattaLogEvent> regattaLogEventFactory =
(DeviceIdentifier dev, TimePoint timePoint) -> new RegattaLogDeviceMarkMappingEventImpl(timePoint,
service.getServerAuthor(), timePoint, UUID.randomUUID(), mark, dev, timePoint, timePoint),
timePoint, service.getServerAuthor(), UUID.randomUUID(), mark, dev, timePoint, timePoint);
pingMark(regattaLog, mark, gpsFix, service,
regattaLogEventFactory,
new PingDeviceIdentifierImpl());
}
@@ -337,19 +352,16 @@ public class RaceLogTrackingAdapterImpl implements RaceLogTrackingAdapter {
@Override
public void registerCompetitors(RacingEventService service, RaceLog raceLog, Set<Competitor> competitors) {
registerCompetitors(
service.getServerAuthor(),
raceLog,
competitors,
c -> RaceLogEventFactory.INSTANCE.createRegisterCompetitorEvent(MillisecondsTimePoint.now(),
service.getServerAuthor(), raceLog.getCurrentPassId(), c));
registerCompetitors(service.getServerAuthor(), raceLog, competitors,
c -> new RaceLogRegisterCompetitorEventImpl(MillisecondsTimePoint.now(), service.getServerAuthor(),
raceLog.getCurrentPassId(), c));
}
@Override
public void registerCompetitors(RacingEventService service, RegattaLog regattaLog, Set<Competitor> competitors) {
registerCompetitors(service.getServerAuthor(), regattaLog, competitors,
c -> new RegattaLogRegisterCompetitorEventImpl(MillisecondsTimePoint.now(), service.getServerAuthor(),
MillisecondsTimePoint.now(), UUID.randomUUID(), c));
c -> new RegattaLogRegisterCompetitorEventImpl(MillisecondsTimePoint.now(),
MillisecondsTimePoint.now(), service.getServerAuthor(), UUID.randomUUID(), c));
}
private MailService getMailService() {
@@ -21,6 +21,7 @@ import com.sap.sailing.domain.abstractlog.race.impl.RaceLogDependentStartTimeEve
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartTimeEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.SimpleRaceLogIdentifierImpl;
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
import com.sap.sse.common.TimePoint;
import com.sap.sse.common.impl.MillisecondsDurationImpl;
import com.sap.sse.common.impl.MillisecondsTimePoint;
@@ -64,16 +65,16 @@ public class DependentStartTimeFinderTest {
@Test
public void testDependentStartTimeUpdate() {
final MillisecondsDurationImpl cAfterB = new MillisecondsDurationImpl(5000);
raceLogC.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
new SimpleRaceLogIdentifierImpl("B", "", ""), cAfterB));
raceLogC.add(new RaceLogDependentStartTimeEventImpl(nowMock, nowMock, author, "12", 12,
new SimpleRaceLogIdentifierImpl("B", "", ""), cAfterB, RaceLogRaceStatus.SCHEDULED));
StartTimeFinder finder = new StartTimeFinder(raceLogResolver, raceLogC);
// Tests for correct behaviour, when race depending on has no start time set
assertNull(finder.analyze().getStartTime());
final MillisecondsDurationImpl bAfterA = new MillisecondsDurationImpl(6000);
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
new SimpleRaceLogIdentifierImpl("A", "", ""), bAfterA));
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, nowMock, author, "12", 12,
new SimpleRaceLogIdentifierImpl("A", "", ""), bAfterA, RaceLogRaceStatus.SCHEDULED));
finder = new StartTimeFinder(raceLogResolver, raceLogB);
StartTimeFinderResult result = finder.analyze();
@@ -98,7 +99,8 @@ public class DependentStartTimeFinderTest {
assertEquals(expectedDependingOnRaces, result.getRacesDependingOn());
TimePoint now = MillisecondsTimePoint.now();
raceLogA.add(new RaceLogStartTimeEventImpl(now, author, now, "12", null, 12, new MillisecondsTimePoint(5000)));
raceLogA.add(new RaceLogStartTimeEventImpl(now, now, author, "12", 12, new MillisecondsTimePoint(5000),
RaceLogRaceStatus.SCHEDULED));
finder = new StartTimeFinder(raceLogResolver, raceLogB);
result = finder.analyze();
@@ -111,7 +113,8 @@ public class DependentStartTimeFinderTest {
assertEquals(5000, result.getStartTimeDiff().asMillis());
// Test correct behaviour, when middle element changes
raceLogB.add(new RaceLogStartTimeEventImpl(now, author, now, "12", null, 12, new MillisecondsTimePoint(15000)));
raceLogB.add(new RaceLogStartTimeEventImpl(now, now, author, "12", 12, new MillisecondsTimePoint(15000),
RaceLogRaceStatus.SCHEDULED));
finder = new StartTimeFinder(raceLogResolver, raceLogA);
result = finder.analyze();
assertEquals(5000, result.getStartTime().asMillis());
@@ -131,16 +134,16 @@ public class DependentStartTimeFinderTest {
@Test
public void testDependentStartTimeCycle() {
final MillisecondsDurationImpl cAfterB = new MillisecondsDurationImpl(6000);
raceLogC.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
new SimpleRaceLogIdentifierImpl("B", "", ""), cAfterB));
raceLogC.add(new RaceLogDependentStartTimeEventImpl(nowMock, nowMock, author, "12", 12,
new SimpleRaceLogIdentifierImpl("B", "", ""), cAfterB, RaceLogRaceStatus.SCHEDULED));
final MillisecondsDurationImpl bAfterA = new MillisecondsDurationImpl(7000);
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
new SimpleRaceLogIdentifierImpl("A", "", ""), bAfterA));
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, nowMock, author, "12", 12,
new SimpleRaceLogIdentifierImpl("A", "", ""), bAfterA, RaceLogRaceStatus.SCHEDULED));
final MillisecondsDurationImpl aAfterC = new MillisecondsDurationImpl(8000);
raceLogA.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
new SimpleRaceLogIdentifierImpl("C", "", ""), aAfterC));
raceLogA.add(new RaceLogDependentStartTimeEventImpl(nowMock, nowMock, author, "12", 12,
new SimpleRaceLogIdentifierImpl("C", "", ""), aAfterC, RaceLogRaceStatus.SCHEDULED));
// Check that all resolve to null in case of a cycle
StartTimeFinder finder = new StartTimeFinder(raceLogResolver, raceLogC);
@@ -157,7 +160,8 @@ public class DependentStartTimeFinderTest {
// Check that all resolve correctly after changing some element in cycle
TimePoint now = MillisecondsTimePoint.now();
raceLogB.add(new RaceLogStartTimeEventImpl(now, author, now, "12", null, 12, new MillisecondsTimePoint(5000)));
raceLogB.add(new RaceLogStartTimeEventImpl(now, now, author, "12", 12, new MillisecondsTimePoint(5000),
RaceLogRaceStatus.SCHEDULED));
// now A -> C -> B
finder = new StartTimeFinder(raceLogResolver, raceLogA);
@@ -72,11 +72,11 @@ public class MultiLogAnalyzerTest {
Competitor c2 = createCompetitor(2);
Competitor c3 = createCompetitor(3);
raceLog.add(new RaceLogRegisterCompetitorEventImpl(now(), author, now(), uuid(), 0, c1));
regattaLog.add(new RegattaLogRegisterCompetitorEventImpl(now(), author, now(), uuid(), c2));
raceLog.add(new RaceLogRegisterCompetitorEventImpl(now(), now(), author, uuid(), 0, c1));
regattaLog.add(new RegattaLogRegisterCompetitorEventImpl(now(), now(), author, uuid(), c2));
raceLog.add(new RaceLogRegisterCompetitorEventImpl(now(), author, now(), uuid(), 0, c3));
regattaLog.add(new RegattaLogRegisterCompetitorEventImpl(now(), author, now(), uuid(), c3));
raceLog.add(new RaceLogRegisterCompetitorEventImpl(now(), now(), author, uuid(), 0, c3));
regattaLog.add(new RegattaLogRegisterCompetitorEventImpl(now(), now(), author, uuid(), c3));
Set<Competitor> result = new MultiLogAnalyzer<>(
RegisteredCompetitorsAnalyzer.Factory.INSTANCE, new MultiLogAnalyzer.SetReducer<Competitor>(), raceLog,
@@ -96,12 +96,12 @@ public class MultiLogAnalyzerTest {
DeviceIdentifier d1 = createDevice();
DeviceIdentifier d2 = createDevice();
raceLog.add(new RaceLogDeviceCompetitorMappingEventImpl(now(), author, now(), 0, 0, c1, d1, t(0), t(10)));
raceLog.add(new RaceLogDeviceCompetitorMappingEventImpl(now(), author, now(), 1, 0, c1, d2, t(30), t(40)));
regattaLog.add(new RegattaLogDeviceCompetitorMappingEventImpl(now(), author, now(), 2, c2, d2, t(10), t(20)));
raceLog.add(new RaceLogDeviceCompetitorMappingEventImpl(now(), now(), author, 0, 0, c1, d1, t(0), t(10)));
raceLog.add(new RaceLogDeviceCompetitorMappingEventImpl(now(), now(), author, 1, 0, c1, d2, t(30), t(40)));
regattaLog.add(new RegattaLogDeviceCompetitorMappingEventImpl(now(), now(), author, 2, c2, d2, t(10), t(20)));
// and one for same item (competitor) in other log
regattaLog.add(new RegattaLogDeviceCompetitorMappingEventImpl(now(), author, now(), 3, c1, d1, t(10),
regattaLog.add(new RegattaLogDeviceCompetitorMappingEventImpl(now(), now(), author, 3, c1, d1, t(10),
t(20)));
Map<WithID, List<DeviceMapping<WithID>>> result = new MultiLogAnalyzer<>(
@@ -11,7 +11,6 @@ import org.junit.Test;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
import com.sap.sailing.domain.abstractlog.race.SimpleRaceLogIdentifier;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogDependentStartTimeEventImpl;
@@ -27,6 +26,7 @@ import com.sap.sailing.domain.abstractlog.race.state.racingprocedure.impl.Racing
import com.sap.sailing.domain.base.configuration.ConfigurationLoader;
import com.sap.sailing.domain.base.configuration.RegattaConfiguration;
import com.sap.sailing.domain.base.configuration.impl.EmptyRegattaConfiguration;
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
import com.sap.sse.common.TimePoint;
import com.sap.sse.common.impl.MillisecondsDurationImpl;
import com.sap.sse.common.impl.MillisecondsTimePoint;
@@ -46,17 +46,15 @@ public class DependentRaceStateTest {
private RaceStateChangedListener listenerC;
private AbstractLogEventAuthor author;
private RaceLogEventFactory factory;
private ConfigurationLoader<RegattaConfiguration> configuration;
private TimePoint nowMock;
private RaceLogResolver raceLogResolver;
@Before
public void setUp() {
author = new LogEventAuthorImpl("Test", 1);
factory = RaceLogEventFactory.INSTANCE;
configuration = new EmptyRegattaConfiguration();
raceLogA = new RaceLogImpl("raceLogA");
@@ -82,12 +80,12 @@ public class DependentRaceStateTest {
}
};
stateA = new RaceStateImpl(raceLogResolver, raceLogA, author, factory, new RacingProcedureFactoryImpl(author,
factory, configuration));
stateB = new RaceStateImpl(raceLogResolver, raceLogB, author, factory, new RacingProcedureFactoryImpl(author,
factory, configuration));
stateC = new RaceStateImpl(raceLogResolver, raceLogC, author, factory, new RacingProcedureFactoryImpl(author,
factory, configuration));
stateA = new RaceStateImpl(raceLogResolver, raceLogA, author, new RacingProcedureFactoryImpl(author,
configuration));
stateB = new RaceStateImpl(raceLogResolver, raceLogB, author, new RacingProcedureFactoryImpl(author,
configuration));
stateC = new RaceStateImpl(raceLogResolver, raceLogC, author, new RacingProcedureFactoryImpl(author,
configuration));
stateA.addChangedListener(listenerA);
stateB.addChangedListener(listenerB);
@@ -96,27 +94,27 @@ public class DependentRaceStateTest {
@Test
public void testCorrectAmountOfStartTimeChanges() {
raceLogC.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
new SimpleRaceLogIdentifierImpl("B", "", ""), new MillisecondsDurationImpl(5000)));
raceLogC.add(new RaceLogDependentStartTimeEventImpl(nowMock, nowMock, author, "12", 12,
new SimpleRaceLogIdentifierImpl("B", "", ""), new MillisecondsDurationImpl(5000), RaceLogRaceStatus.SCHEDULED));
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
new SimpleRaceLogIdentifierImpl("A", "", ""), new MillisecondsDurationImpl(5000)));
TimePoint now = MillisecondsTimePoint.now();
raceLogA.add(new RaceLogStartTimeEventImpl(now, author, now, "12", null, 12, new MillisecondsTimePoint(5000)));
verify(listenerC, times(3)).onStartTimeChanged(stateC);
verify(listenerB, times(2)).onStartTimeChanged(stateB);
verify(listenerA, times(1)).onStartTimeChanged(stateA);
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, nowMock, author, "12", 12,
new SimpleRaceLogIdentifierImpl("A", "", ""), new MillisecondsDurationImpl(5000), RaceLogRaceStatus.SCHEDULED));
TimePoint now = MillisecondsTimePoint.now();
raceLogA.add(new RaceLogStartTimeEventImpl(now, now, author, "12", 12, new MillisecondsTimePoint(5000), RaceLogRaceStatus.SCHEDULED));
verify(listenerC, times(3)).onStartTimeChanged(stateC);
verify(listenerB, times(2)).onStartTimeChanged(stateB);
verify(listenerA, times(1)).onStartTimeChanged(stateA);
}
@Test
public void testInitialRegistrationOfRaceState() {
final MillisecondsDurationImpl delta = new MillisecondsDurationImpl(5000);
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, 12,
new SimpleRaceLogIdentifierImpl("A", "", ""), delta));
final RaceState stateB2 = new RaceStateImpl(raceLogResolver, raceLogB, author, factory,
new RacingProcedureFactoryImpl(author, factory, configuration));
final RaceState stateB2 = new RaceStateImpl(raceLogResolver, raceLogB, author, new RacingProcedureFactoryImpl(
author, configuration));
final TimePoint[] bTime = new TimePoint[1];
stateB2.addChangedListener(new BaseRaceStateChangedListener() {
@Override
@@ -125,25 +123,25 @@ public class DependentRaceStateTest {
}
});
TimePoint now = MillisecondsTimePoint.now();
raceLogA.add(new RaceLogStartTimeEventImpl(now, author, now, "12", null, 12, now));
raceLogA.add(new RaceLogStartTimeEventImpl(now, author, 12, now));
assertEquals(now.plus(delta), bTime[0]);
}
}
@Test
public void testCorrectAmountOfStartTimeChanges2() {
raceLogC.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
new SimpleRaceLogIdentifierImpl("B", "", ""), new MillisecondsDurationImpl(5000)));
raceLogC.add(new RaceLogDependentStartTimeEventImpl(nowMock, nowMock, author, "12", 12,
new SimpleRaceLogIdentifierImpl("B", "", ""), new MillisecondsDurationImpl(5000), RaceLogRaceStatus.SCHEDULED));
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
new SimpleRaceLogIdentifierImpl("A", "", ""), new MillisecondsDurationImpl(5000)));
TimePoint now = MillisecondsTimePoint.now();
raceLogA.add(new RaceLogStartTimeEventImpl(now, author, now, "12", null, 12, new MillisecondsTimePoint(5000)));
raceLogB.add(new RaceLogStartTimeEventImpl(now, author, now, "12", null, 12, new MillisecondsTimePoint(20000)));
verify(listenerA, times(1)).onStartTimeChanged(stateA);
verify(listenerB, times(3)).onStartTimeChanged(stateB);
verify(listenerC, times(4)).onStartTimeChanged(stateC);
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, nowMock, author, "12", 12,
new SimpleRaceLogIdentifierImpl("A", "", ""), new MillisecondsDurationImpl(5000), RaceLogRaceStatus.SCHEDULED));
TimePoint now = MillisecondsTimePoint.now();
raceLogA.add(new RaceLogStartTimeEventImpl(now, now, author, "12", 12, new MillisecondsTimePoint(5000), RaceLogRaceStatus.SCHEDULED));
raceLogB.add(new RaceLogStartTimeEventImpl(now, now, author, "12", 12, new MillisecondsTimePoint(20000), RaceLogRaceStatus.SCHEDULED));
verify(listenerA, times(1)).onStartTimeChanged(stateA);
verify(listenerB, times(3)).onStartTimeChanged(stateB);
verify(listenerC, times(4)).onStartTimeChanged(stateC);
}
}
@@ -19,7 +19,6 @@ import org.junit.Test;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFlagEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogImpl;
@@ -48,7 +47,6 @@ public class RaceStateTest {
private RaceLog raceLog;
private AbstractLogEventAuthor author;
private RaceLogEventFactory factory;
private RacingProcedureType defaultRacingProcedureType;
private ConfigurationLoader<RegattaConfiguration> configuration;
private RaceStateChangedListener listener;
@@ -60,13 +58,12 @@ public class RaceStateTest {
public void setUp() {
raceLog = new RaceLogImpl("test-log");
author = new LogEventAuthorImpl("Test", 1);
factory = RaceLogEventFactory.INSTANCE;
defaultRacingProcedureType = RacingProcedureType.RRS26;
configuration = new EmptyRegattaConfiguration();
listener = mock(RaceStateChangedListener.class);
nowMock = mock(TimePoint.class);
state = new RaceStateImpl(mock(RaceLogResolver.class), raceLog, author, factory, new RacingProcedureFactoryImpl(author, factory, configuration));
state = new RaceStateImpl(mock(RaceLogResolver.class), raceLog, author, new RacingProcedureFactoryImpl(author, configuration));
}
@Test
@@ -96,7 +93,7 @@ public class RaceStateTest {
config.setBasicConfiguration(mock(RacingProcedureConfiguration.class));
configuration = mock(ConfigurationLoader.class);
when(configuration.load()).thenReturn(config);
state = new RaceStateImpl(mock(RaceLogResolver.class), raceLog, author, factory, new RacingProcedureFactoryImpl(author, factory, configuration));
state = new RaceStateImpl(mock(RaceLogResolver.class), raceLog, author, new RacingProcedureFactoryImpl(author, configuration));
assertEquals(RacingProcedureType.BASIC, state.getRacingProcedure().getType());
}
@@ -110,8 +107,8 @@ public class RaceStateTest {
config.setESSConfiguration(mock(ESSConfiguration.class));
configuration = mock(ConfigurationLoader.class);
when(configuration.load()).thenReturn(config);
raceLog.add(new RaceLogStartProcedureChangedEventImpl(nowMock, author, nowMock, "12", null, 0, RacingProcedureType.ESS));
state = new RaceStateImpl(mock(RaceLogResolver.class), raceLog, author, factory, new RacingProcedureFactoryImpl(author, factory, configuration));
raceLog.add(new RaceLogStartProcedureChangedEventImpl(nowMock, nowMock, author, "12", 0, RacingProcedureType.ESS));
state = new RaceStateImpl(mock(RaceLogResolver.class), raceLog, author, new RacingProcedureFactoryImpl(author, configuration));
assertEquals(RacingProcedureType.ESS, state.getRacingProcedure().getType());
}
@@ -136,8 +133,8 @@ public class RaceStateTest {
@Test
public void testSetIndividualRecall() {
assertFalse(state.getRacingProcedure().isIndividualRecallDisplayed());
raceLog.add(new RaceLogFlagEventImpl(MillisecondsTimePoint.now(), author, MillisecondsTimePoint.now(), UUID
.randomUUID(), null, /* pass */0, Flags.XRAY, Flags.NONE, /* pIsDisplayed */true));
raceLog.add(new RaceLogFlagEventImpl(MillisecondsTimePoint.now(), MillisecondsTimePoint.now(), author, UUID
.randomUUID(), /* pass */0, Flags.XRAY, Flags.NONE, /* pIsDisplayed */true));
assertTrue(state.getRacingProcedure().isIndividualRecallDisplayed());
}
@@ -30,7 +30,7 @@ public class RaceLogEventImplTest {
public TestRaceLogEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable pId, List<Competitor> pInvolvedBoats, int pPassId) {
super(createdAt, author, logicalTimePoint, pId, pInvolvedBoats, pPassId);
super(createdAt, logicalTimePoint, author, pId, pInvolvedBoats, pPassId);
}
@Override
@@ -14,10 +14,10 @@ import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogChangedListener;
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogChangedVisitor;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDenoteForTrackingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDenoteForTrackingEventImpl;
import com.sap.sailing.domain.common.abstractlog.NotRevokableException;
import com.sap.sse.common.TimePoint;
import com.sap.sse.common.Util;
@@ -107,7 +107,7 @@ public class RaceLogRevocationTest {
@Test
public void sameEventRevokedByTwoClientsBeforeSync() throws NotRevokableException {
RaceLogDenoteForTrackingEvent event = RaceLogEventFactory.INSTANCE.createDenoteForTrackingEvent(
RaceLogDenoteForTrackingEvent event = new RaceLogDenoteForTrackingEventImpl(
now(), serverAuthor, 0, "race", null, null);
serverRaceLog.add(event);
@@ -23,12 +23,12 @@ import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.RaceLogFlagEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogStartTimeEvent;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartTimeEventImpl;
import com.sap.sse.common.TimePoint;
import com.sap.sse.common.Util;
import com.sap.sse.common.impl.MillisecondsTimePoint;
@@ -40,8 +40,8 @@ public class RaceLogTest {
private static class MockRaceLogEventForSorting extends RaceLogEventImpl {
public MockRaceLogEventForSorting(long createdAtMillis) {
super(new MillisecondsTimePoint(createdAtMillis),
/* author */ new LogEventAuthorImpl("Dummy Author", /* priority */ 0),
MillisecondsTimePoint.now(), /* ID */ UUID.randomUUID(), /* pInvolvedBoats */ null, /* pass ID */ 1);
MillisecondsTimePoint.now(),
/* author */ new LogEventAuthorImpl("Dummy Author", /* priority */ 0), /* ID */ UUID.randomUUID(), /* pInvolvedBoats */ null, /* pass ID */ 1);
}
private static final long serialVersionUID = 4928452859543831451L;
@@ -433,14 +433,14 @@ public class RaceLogTest {
UUID client1Id = UUID.randomUUID();
UUID client2Id = UUID.randomUUID();
final TimePoint now = MillisecondsTimePoint.now();
RaceLogStartTimeEvent startTimeEvent1 = RaceLogEventFactory.INSTANCE.createStartTimeEvent(now, author, 1, now.plus(1));
RaceLogStartTimeEvent startTimeEvent1 = new RaceLogStartTimeEventImpl(now, author, 1, now.plus(1));
Iterable<RaceLogEvent> empty = raceLog.add(startTimeEvent1, client1Id);
assertTrue(Util.isEmpty(empty));
RaceLogStartTimeEvent startTimeEvent2 = RaceLogEventFactory.INSTANCE.createStartTimeEvent(now.plus(2), author, 1, now.plus(3));
RaceLogStartTimeEvent startTimeEvent2 = new RaceLogStartTimeEventImpl(now.plus(2), author, 1, now.plus(3));
Iterable<RaceLogEvent> nonEmpty = raceLog.add(startTimeEvent2, client2Id);
assertEquals(1, Util.size(nonEmpty));
assertSame(startTimeEvent1, nonEmpty.iterator().next());
RaceLogStartTimeEvent startTimeEvent3 = RaceLogEventFactory.INSTANCE.createStartTimeEvent(now.plus(4), author, 1, now.plus(5));
RaceLogStartTimeEvent startTimeEvent3 = new RaceLogStartTimeEventImpl(now.plus(4), author, 1, now.plus(5));
Iterable<RaceLogEvent> nonEmpty2 = raceLog.add(startTimeEvent3, client1Id);
assertEquals(1, Util.size(nonEmpty2));
assertSame(startTimeEvent2, nonEmpty2.iterator().next());
@@ -13,10 +13,11 @@ import org.junit.Test;
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
import com.sap.sailing.domain.abstractlog.race.RaceLogStartTimeEvent;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartTimeEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceCompetitorMappingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceCompetitorMappingEventImpl;
import com.sap.sailing.domain.racelog.tracking.test.mock.SmartphoneImeiIdentifier;
import com.sap.sailing.domain.test.AbstractLeaderboardTest;
import com.sap.sse.common.Util;
@@ -32,14 +33,12 @@ public class SerializeRaceLogEventsTest {
private ObjectOutputStream oos;
private ByteArrayOutputStream bos;
private RaceLog raceLog;
private RaceLogEventFactory eventFactory;
@Before
public void setUp() throws IOException {
bos = new ByteArrayOutputStream();
oos = new ObjectOutputStream(bos);
raceLog = new RaceLogImpl("Test Race Log");
eventFactory = RaceLogEventFactory.INSTANCE;
}
@Test
@@ -59,7 +58,7 @@ public class SerializeRaceLogEventsTest {
@Test
public void testRaceLogSerializationWithSingleEvent() throws IOException, ClassNotFoundException {
RaceLogStartTimeEvent startTimeEvent = eventFactory.createStartTimeEvent(MillisecondsTimePoint.now(),
RaceLogStartTimeEvent startTimeEvent = new RaceLogStartTimeEventImpl(MillisecondsTimePoint.now(),
new LogEventAuthorImpl("Author Name", /* priority */0), /* passId */1, /* startTime */
MillisecondsTimePoint.now());
raceLog.add(startTimeEvent);
@@ -79,9 +78,9 @@ public class SerializeRaceLogEventsTest {
@Test
public void testRaceLogSerializationWithEventContainingDeviceIdentifier() throws IOException, ClassNotFoundException {
RaceLogDeviceCompetitorMappingEvent mappingEvent = eventFactory.createDeviceCompetitorMappingEvent(
MillisecondsTimePoint.now(), new LogEventAuthorImpl("Author Name", /* priority */0), new SmartphoneImeiIdentifier("1948364938463903"),
AbstractLeaderboardTest.createCompetitor("Test Competitor"), 0, new MillisecondsTimePoint(0), new MillisecondsTimePoint(10));
RaceLogDeviceCompetitorMappingEvent mappingEvent = new RaceLogDeviceCompetitorMappingEventImpl(
MillisecondsTimePoint.now(), new LogEventAuthorImpl("Author Name", /* priority */0), 0,
AbstractLeaderboardTest.createCompetitor("Test Competitor"), new SmartphoneImeiIdentifier("1948364938463903"), new MillisecondsTimePoint(0), new MillisecondsTimePoint(10));
raceLog.add(mappingEvent);
oos.writeObject(raceLog);
ObjectInputStream ois = getObjectInputStream();
@@ -5,7 +5,6 @@ import org.junit.Before;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventRestoreFactory;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogImpl;
import com.sap.sse.common.TimePoint;
import com.sap.sse.common.impl.MillisecondsTimePoint;
@@ -17,7 +16,6 @@ public abstract class AbstractRaceLogTrackingTest {
protected final AbstractLogEventAuthor author1 = new LogEventAuthorImpl("author1", 1);
protected final TimePoint now = MillisecondsTimePoint.now();
protected final RaceLogEventRestoreFactory factory = RaceLogEventRestoreFactory.INSTANCE;
public AbstractRaceLogTrackingTest() {
super();
@@ -12,6 +12,8 @@ import org.junit.Test;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogCloseOpenEndedDeviceMappingEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceCompetitorMappingEventImpl;
import com.sap.sailing.domain.abstractlog.shared.analyzing.DeviceCompetitorMappingFinder;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.impl.CompetitorImpl;
@@ -41,14 +43,14 @@ public class DeviceMappingFinderTest extends AbstractRaceLogTrackingTest {
}
private Serializable addMapping(AbstractLogEventAuthor author, DeviceIdentifier device, Long from, Long to, Competitor item) {
RaceLogEvent mapping = factory.createDeviceCompetitorMappingEvent(t(), author, t(), UUID.randomUUID(), device, item, 0,
RaceLogEvent mapping = new RaceLogDeviceCompetitorMappingEventImpl(t(), t(), author, UUID.randomUUID(), 0, item, device,
t(from), t(to));
log.add(mapping);
return mapping.getId();
}
private void closeMapping(AbstractLogEventAuthor author, DeviceIdentifier device, Serializable mappingId, long millis) {
RaceLogEvent mapping = factory.createCloseOpenEndedDeviceMappingEvent(t(), author, t(), UUID.randomUUID(), 0, mappingId,
RaceLogEvent mapping = new RaceLogCloseOpenEndedDeviceMappingEventImpl(t(), t(), author, UUID.randomUUID(), 0, mappingId,
new MillisecondsTimePoint(millis));
log.add(mapping);
}
@@ -8,13 +8,15 @@ import org.junit.Test;
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogRevokeEvent;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogRevokeEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceCompetitorMappingEventImpl;
import com.sap.sse.common.Util;
public class RevokeEventTest extends AbstractRaceLogTrackingTest {
@Test
public void revokedEventIsExcluded() {
RaceLogEvent event = factory.createDeviceCompetitorMappingEvent(now, author, now, UUID.randomUUID(), null, null, 0, null, null);
RaceLogRevokeEvent revokeEvent = factory.createRevokeEvent(now.plus(1), author, now.plus(1), UUID.randomUUID(), 0, event.getId(),
RaceLogEvent event = new RaceLogDeviceCompetitorMappingEventImpl(now, now, author, UUID.randomUUID(), 0, null, null, null, null);
RaceLogRevokeEvent revokeEvent = new RaceLogRevokeEventImpl(now.plus(1), now.plus(1), author, UUID.randomUUID(), 0, event.getId(),
null, null, null);
log.add(event);
@@ -27,8 +29,8 @@ public class RevokeEventTest extends AbstractRaceLogTrackingTest {
@Test
public void eventRevokedByAuthorWithLowerPrioIsNotExcluded() {
RaceLogEvent event = factory.createDeviceCompetitorMappingEvent(now, author, now, UUID.randomUUID(), null, null, 0, null, null);
RaceLogRevokeEvent revokeEvent = factory.createRevokeEvent(now.plus(1), author1, now.plus(1), UUID.randomUUID(), 0, event.getId(),
RaceLogEvent event = new RaceLogDeviceCompetitorMappingEventImpl(now, now, author, UUID.randomUUID(), 0, null, null, null, null);
RaceLogRevokeEvent revokeEvent = new RaceLogRevokeEventImpl(now.plus(1), now.plus(1), author1, UUID.randomUUID(), 0, event.getId(),
null, null, null);
log.add(event);
@@ -41,10 +43,10 @@ public class RevokeEventTest extends AbstractRaceLogTrackingTest {
@Test
public void revokingRevokeEventIsNotHarmful() {
RaceLogEvent event = factory.createDeviceCompetitorMappingEvent(now, author, now, UUID.randomUUID(), null, null, 0, null, null);
RaceLogRevokeEvent revokeEvent = factory.createRevokeEvent(now.plus(1), author, now.plus(1), UUID.randomUUID(), 0, event.getId(),
RaceLogEvent event = new RaceLogDeviceCompetitorMappingEventImpl(now, now, author, UUID.randomUUID(), 0, null, null, null, null);
RaceLogRevokeEvent revokeEvent = new RaceLogRevokeEventImpl(now.plus(1), now.plus(1), author, UUID.randomUUID(), 0, event.getId(),
null, null, null);
RaceLogRevokeEvent revokeEvent2 = factory.createRevokeEvent(now.plus(2), author, now.plus(2), UUID.randomUUID(), 2, revokeEvent.getId(),
RaceLogRevokeEvent revokeEvent2 = new RaceLogRevokeEventImpl(now.plus(2), now.plus(2), author, UUID.randomUUID(), 2, revokeEvent.getId(),
null, null, null);
log.add(event);
@@ -0,0 +1,75 @@
package com.sap.sailinig.domain.based.impl;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
import org.junit.Before;
import org.junit.Test;
import com.sap.sailing.domain.base.BoatClass;
import com.sap.sailing.domain.base.SharedDomainFactory;
import com.sap.sailing.domain.base.impl.SharedDomainFactoryImpl;
import com.sap.sailing.domain.common.BoatClassMasterdata;
/**
* Tests creation and caching of boat classes. See also bug 3347
* (http://bugzilla.sapsailing.com/bugzilla/show_bug.cgi?id=3347).
*
* @author Axel Uhl (d043530)
*
*/
public class BoatClassCacheTest {
private SharedDomainFactory sharedDomainFactory;
@Before
public void setUp() {
sharedDomainFactory = new SharedDomainFactoryImpl(/* raceLogResolver */ null);
}
@Test
public void testQueryingBoatClassByDisplayNameFirstThenCanonicalizedAlternativeName() {
final BoatClassMasterdata laserMasterData = BoatClassMasterdata.LASER_INT;
final String laserAlternativeName = laserMasterData.getAlternativeNames()[0];
final String unifiedAlternativeName = BoatClassMasterdata.unifyBoatClassName(laserAlternativeName);
final BoatClass laserByDisplayName = sharedDomainFactory.getOrCreateBoatClass(laserMasterData.getDisplayName());
final BoatClass laserByUnifiedAlternativeName = sharedDomainFactory.getOrCreateBoatClass(unifiedAlternativeName);
assertSame(laserByDisplayName, laserByUnifiedAlternativeName);
}
@Test
public void testQueryingBoatClassByAlternativeNameFirstThenCanonicalizedDisplayName() {
final BoatClassMasterdata laserMasterData = BoatClassMasterdata.LASER_INT;
final String laserAlternativeName = laserMasterData.getAlternativeNames()[0];
final BoatClass laserByAlternativeName = sharedDomainFactory.getOrCreateBoatClass(laserAlternativeName);
final String unifiedDisplayName = BoatClassMasterdata.unifyBoatClassName(laserMasterData.getDisplayName());
final BoatClass laserByUnifiedDisplayName = sharedDomainFactory.getOrCreateBoatClass(unifiedDisplayName);
assertSame(laserByAlternativeName, laserByUnifiedDisplayName);
}
@Test
public void testQueryingBoatClassByDisplayNameFirstThenCanonicalizedDisplayName() {
final BoatClassMasterdata laserMasterData = BoatClassMasterdata.LASER_INT;
final BoatClass laserByDisplayName = sharedDomainFactory.getOrCreateBoatClass(laserMasterData.getDisplayName());
final String unifiedDisplayName = BoatClassMasterdata.unifyBoatClassName(laserMasterData.getDisplayName());
final BoatClass laserByUnifiedDisplayName = sharedDomainFactory.getOrCreateBoatClass(unifiedDisplayName);
assertSame(laserByDisplayName, laserByUnifiedDisplayName);
}
@Test
public void testQueryingBoatClassByAlternativeNameFirstThenCanonicalizedAlternativeName() {
final BoatClassMasterdata laserMasterData = BoatClassMasterdata.LASER_INT;
final String laserAlternativeName = laserMasterData.getAlternativeNames()[0];
final BoatClass laserByAlternativeName = sharedDomainFactory.getOrCreateBoatClass(laserAlternativeName);
final String unifiedAlternativeName = BoatClassMasterdata.unifyBoatClassName(laserAlternativeName);
final BoatClass laserByUnifiedAlternativeName = sharedDomainFactory.getOrCreateBoatClass(unifiedAlternativeName);
assertSame(laserByAlternativeName, laserByUnifiedAlternativeName);
}
@Test
public void testEssMayHaveNonUpwindStart() {
for (final String boatClassName : new String[] { "extreme40", "ess", "ess40" }) {
final BoatClass ess40 = sharedDomainFactory.getOrCreateBoatClass(boatClassName);
assertFalse("Boat class "+boatClassName+" expected to allow for non-upwind starts", ess40.typicallyStartsUpwind());
}
}
}
@@ -1,10 +1,12 @@
package com.sap.sailing.domain.abstractlog.impl;
import java.io.Serializable;
import java.util.UUID;
import com.sap.sailing.domain.abstractlog.AbstractLogEvent;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sse.common.TimePoint;
import com.sap.sse.common.impl.MillisecondsTimePoint;
public abstract class AbstractLogEventImpl<VisitorT> implements AbstractLogEvent<VisitorT> {
@@ -15,13 +17,27 @@ public abstract class AbstractLogEventImpl<VisitorT> implements AbstractLogEvent
private final Serializable id;
private final AbstractLogEventAuthor author;
public AbstractLogEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
public AbstractLogEventImpl(TimePoint createdAt, TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable pId) {
this.createdAt = createdAt;
this.author = author;
this.logicalTimePoint = logicalTimePoint;
this.id = pId;
}
/**
* To be used by constructors creating new events as the value for {@link #createdAt}.
*/
protected static final TimePoint now() {
return MillisecondsTimePoint.now();
}
/**
* To be used by constructors creating new events as the value for {@link #id}.
*/
protected static final Serializable randId() {
return UUID.randomUUID();
}
@Override
public TimePoint getCreatedAt() {
@@ -18,14 +18,14 @@ public abstract class RevokeEventImpl<VisitorT> extends AbstractLogEventImpl<Vis
private final String revokedEventShortInfo;
public RevokeEventImpl(AbstractLogEventAuthor author, AbstractLogEvent<?> toRevoke, String reason) {
this(MillisecondsTimePoint.now(), author, MillisecondsTimePoint.now(), UUID.randomUUID(),
this(MillisecondsTimePoint.now(), MillisecondsTimePoint.now(), author, UUID.randomUUID(),
toRevoke.getId(), toRevoke.getClass().getName(), toRevoke.getShortInfo(), reason);
}
public RevokeEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
public RevokeEventImpl(TimePoint createdAt, TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable pId, Serializable revokedEventId, String revokedEventType,
String revokedEventShortInfo, String reason) {
super(createdAt, author, logicalTimePoint, pId);
super(createdAt, logicalTimePoint, author, pId);
this.revokedEventId = revokedEventId;
this.reason = reason;
this.revokedEventType = revokedEventType;
@@ -1,148 +0,0 @@
package com.sap.sailing.domain.abstractlog.race;
import java.io.Serializable;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogEventFactoryImpl;
import com.sap.sailing.domain.abstractlog.race.scoring.AdditionalScoringInformationType;
import com.sap.sailing.domain.abstractlog.race.scoring.RaceLogAdditionalScoringInformationEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogCloseOpenEndedDeviceMappingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDefineMarkEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDenoteForTrackingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceCompetitorMappingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceMarkMappingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogRegisterCompetitorEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogStartTrackingEvent;
import com.sap.sailing.domain.base.BoatClass;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.CourseBase;
import com.sap.sailing.domain.base.Mark;
import com.sap.sailing.domain.common.Wind;
import com.sap.sailing.domain.common.racelog.Flags;
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
import com.sap.sailing.domain.common.racelog.RacingProcedureType;
import com.sap.sailing.domain.racelogtracking.DeviceIdentifier;
import com.sap.sse.common.Duration;
import com.sap.sse.common.TimePoint;
public interface RaceLogEventFactory {
RaceLogEventFactory INSTANCE = new RaceLogEventFactoryImpl();
RaceLogFlagEvent createFlagEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable id, List<Competitor> involvedBoats,
int passId, Flags upperFlag, Flags lowerFlag, boolean isDisplayed);
RaceLogFlagEvent createFlagEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, Flags upperFlag,
Flags lowerFlag, boolean isDisplayed);
RaceLogStartTimeEvent createStartTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable id,
List<Competitor> involvedBoats, int passId, TimePoint startTime);
RaceLogStartTimeEvent createStartTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, TimePoint startTime);
RaceLogRaceStatusEvent createRaceStatusEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable id,
List<Competitor> competitors, int passId, RaceLogRaceStatus nextStatus);
RaceLogRaceStatusEvent createRaceStatusEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, RaceLogRaceStatus nextStatus);
RaceLogPassChangeEvent createPassChangeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable id,
List<Competitor> competitors, int passId);
RaceLogPassChangeEvent createPassChangeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId);
RaceLogCourseAreaChangedEvent createCourseAreaChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable id, List<Competitor> competitors, int passId, Serializable courseAreaId);
RaceLogCourseAreaChangedEvent createCourseAreaChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
int passId, Serializable courseAreaId);
RaceLogCourseDesignChangedEvent createCourseDesignChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable id, List<Competitor> competitors, int passId, CourseBase courseData);
RaceLogCourseDesignChangedEvent createCourseDesignChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
int passId, CourseBase courseData);
RaceLogFinishPositioningListChangedEvent createFinishPositioningListChangedEvent(TimePoint logicalTimePoint,
AbstractLogEventAuthor author, Serializable id, List<Competitor> competitors,
int passId, CompetitorResults positionedCompetitors);
RaceLogFinishPositioningListChangedEvent createFinishPositioningListChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
int passId, CompetitorResults positionedCompetitors);
RaceLogFinishPositioningConfirmedEvent createFinishPositioningConfirmedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable id, List<Competitor> competitors, int passId, CompetitorResults positionedCompetitors);
RaceLogFinishPositioningConfirmedEvent createFinishPositioningConfirmedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
int passId, CompetitorResults positionedCompetitors);
RaceLogPathfinderEvent createPathfinderEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable id,
List<Competitor> competitors, int passId, String pathfinderId);
RaceLogPathfinderEvent createPathfinderEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, String pathfinderId);
RaceLogGateLineOpeningTimeEvent createGateLineOpeningTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable id, List<Competitor> competitors, int passId, Long gateLaunchStopTime, Long golfDownTime);
RaceLogGateLineOpeningTimeEvent createGateLineOpeningTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
int passId, Long gateLaunchStopTime, Long golfDownTime);
RaceLogStartProcedureChangedEvent createStartProcedureChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable id, List<Competitor> competitors, int passId, RacingProcedureType type);
RaceLogStartProcedureChangedEvent createStartProcedureChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
int passId, RacingProcedureType type);
RaceLogProtestStartTimeEvent createProtestStartTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable id, List<Competitor> competitors, int passId, TimePoint protestStartTime);
RaceLogProtestStartTimeEvent createProtestStartTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, TimePoint protestStartTime);
RaceLogWindFixEvent createWindFixEvent(TimePoint eventTime, AbstractLogEventAuthor author, int currentPassId, Wind wind, boolean isMagnetic);
RaceLogWindFixEvent createWindFixEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable id, List<Competitor> competitors, int passId, Wind wind, boolean isMagnetic);
RaceLogDeviceCompetitorMappingEvent createDeviceCompetitorMappingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
DeviceIdentifier device, Competitor mappedTo, int passId, TimePoint from, TimePoint to);
RaceLogDeviceMarkMappingEvent createDeviceMarkMappingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
DeviceIdentifier device, Mark mappedTo, int passId, TimePoint from, TimePoint to);
RaceLogDenoteForTrackingEvent createDenoteForTrackingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId,
String raceName, BoatClass boatClass, Serializable raceId);
RaceLogStartTrackingEvent createStartTrackingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId);
RaceLogRevokeEvent createRevokeEvent(AbstractLogEventAuthor author, int passId, RaceLogEvent toRevoke, String reason);
RaceLogRegisterCompetitorEvent createRegisterCompetitorEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, Competitor competitor);
RaceLogDefineMarkEvent createDefineMarkEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, Mark mark);
RaceLogCloseOpenEndedDeviceMappingEvent createCloseOpenEndedDeviceMappingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId,
Serializable deviceMappingEventId, TimePoint closingTimePoint);
RaceLogFixedMarkPassingEvent createFixedMarkPassingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable id,
List<Competitor> competitors, Integer passId, TimePoint ofFixedPassing, Integer zeroBasedIndexOfWaypoint);
RaceLogAdditionalScoringInformationEvent createAdditionalScoringInformationEvent(TimePoint timePoint, Serializable id, AbstractLogEventAuthor author, int currentPassId,
AdditionalScoringInformationType informationType);
RaceLogSuppressedMarkPassingsEvent createSuppressedMarkPassingsEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable id,
List<Competitor> competitors, Integer passId, Integer zeroBasedIndexOfFirstSuppressedWaypoint);
RaceLogDependentStartTimeEvent createDependentStartTimeEvent(TimePoint logicalTimePoint,
AbstractLogEventAuthor author, Serializable id, List<Competitor> involvedBoats, int passId, SimpleRaceLogIdentifier dependentOnRace,
Duration startTimeDifference);
RaceLogDependentStartTimeEvent createDependentStartTimeEvent(TimePoint logicalTimePoint,
AbstractLogEventAuthor author, int passId, SimpleRaceLogIdentifier dependentOnRace, Duration startTimeDifference);
RaceLogStartOfTrackingEvent createStartOfTrackingEvent(TimePoint startOfTracking, AbstractLogEventAuthor author,
Serializable id, List<Competitor> competitors, Integer passId);
RaceLogEndOfTrackingEvent createEndOfTrackingEvent(TimePoint endOfTracking, AbstractLogEventAuthor author,
Serializable id, List<Competitor> competitors, Integer passId);
}
@@ -1,106 +0,0 @@
package com.sap.sailing.domain.abstractlog.race;
import java.io.Serializable;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogEventRestoreFactoryImpl;
import com.sap.sailing.domain.abstractlog.race.scoring.AdditionalScoringInformationType;
import com.sap.sailing.domain.abstractlog.race.scoring.RaceLogAdditionalScoringInformationEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogCloseOpenEndedDeviceMappingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDefineMarkEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDenoteForTrackingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceCompetitorMappingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceMarkMappingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogRegisterCompetitorEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogStartTrackingEvent;
import com.sap.sailing.domain.base.BoatClass;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.CourseBase;
import com.sap.sailing.domain.base.Mark;
import com.sap.sailing.domain.common.Wind;
import com.sap.sailing.domain.common.racelog.Flags;
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
import com.sap.sailing.domain.common.racelog.RacingProcedureType;
import com.sap.sailing.domain.racelogtracking.DeviceIdentifier;
import com.sap.sse.common.Duration;
import com.sap.sse.common.TimePoint;
public interface RaceLogEventRestoreFactory extends RaceLogEventFactory {
RaceLogEventRestoreFactory INSTANCE = new RaceLogEventRestoreFactoryImpl();
RaceLogFlagEvent createFlagEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable id, List<Competitor> involvedBoats, int passId, Flags upperFlag, Flags lowerFlag, boolean isDisplayed);
RaceLogStartTimeEvent createStartTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable id, List<Competitor> involvedBoats, int passId, TimePoint startTime, RaceLogRaceStatus nextStatue);
RaceLogRaceStatusEvent createRaceStatusEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable id, List<Competitor> competitors, int passId, RaceLogRaceStatus nextStatus);
RaceLogPassChangeEvent createPassChangeEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable id, List<Competitor> competitors, int passId);
RaceLogCourseAreaChangedEvent createCourseAreaChangedEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, Serializable courseAreaId);
RaceLogCourseDesignChangedEvent createCourseDesignChangedEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, CourseBase courseData);
RaceLogFinishPositioningListChangedEvent createFinishPositioningListChangedEvent(TimePoint createdAt,
AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors,
int passId, CompetitorResults positionedCompetitors);
RaceLogFinishPositioningConfirmedEvent createFinishPositioningConfirmedEvent(TimePoint createdAt,
AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors,
int passId, CompetitorResults positionedCompetitors);
RaceLogPathfinderEvent createPathfinderEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable id, List<Competitor> competitors, int passId, String pathfinderId);
RaceLogGateLineOpeningTimeEvent createGateLineOpeningTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, Long gateLaunchStopTime,
Long golfDownTime);
RaceLogStartProcedureChangedEvent createStartProcedureChangedEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, RacingProcedureType type);
RaceLogProtestStartTimeEvent createProtestStartTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, TimePoint protestStartTime);
RaceLogWindFixEvent createWindFixEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable id, List<Competitor> competitors, Integer passId, Wind wind, boolean isMagnetic);
RaceLogDeviceCompetitorMappingEvent createDeviceCompetitorMappingEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable pId, DeviceIdentifier device, Competitor mappedTo, int passId, TimePoint from, TimePoint to);
RaceLogDeviceMarkMappingEvent createDeviceMarkMappingEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable pId, DeviceIdentifier device, Mark mappedTo, int passId, TimePoint from, TimePoint to);
RaceLogDenoteForTrackingEvent createDenoteForTrackingEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable pId, int passId, String raceName, BoatClass boatClass, Serializable raceId);
RaceLogStartTrackingEvent createStartTrackingEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable pId, int passId);
RaceLogRevokeEvent createRevokeEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable pId, int passId, Serializable revokedEventId,
String revokedEventType, String revokedEventShortInfo, String reason);
RaceLogRegisterCompetitorEvent createRegisterCompetitorEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable pId, int passId, Competitor competitor);
RaceLogDefineMarkEvent createDefineMarkEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable pId, int passId, Mark mark);
RaceLogCloseOpenEndedDeviceMappingEvent createCloseOpenEndedDeviceMappingEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable pId, int passId, Serializable deviceMappingEventId, TimePoint closingTimePoint);
RaceLogAdditionalScoringInformationEvent createAdditionalScoringInformationEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable pId, List<Competitor> competitors, int passId,
AdditionalScoringInformationType informationType);
RaceLogDependentStartTimeEvent createDependentStartTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, List<Competitor> involvedBoats, int passId,
SimpleRaceLogIdentifier dependentOnRace, Duration startTimeDifference, RaceLogRaceStatus nextStatus);
}
@@ -3,9 +3,9 @@ package com.sap.sailing.domain.abstractlog.race.analyzing.impl;
import java.util.HashSet;
import java.util.Set;
import com.sap.sailing.domain.abstractlog.race.RaceLogFixedMarkPassingEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogFixedMarkPassingEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogSuppressedMarkPassingsEvent;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sse.common.TimePoint;
@@ -1,13 +1,13 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import com.sap.sailing.domain.abstractlog.race.RaceLogEndOfTrackingEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogFixedMarkPassingEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogCourseAreaChangedEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogCourseDesignChangedEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogDependentStartTimeEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEndOfTrackingEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningConfirmedEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningListChangedEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogFixedMarkPassingEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogFlagEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogGateLineOpeningTimeEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogPassChangeEvent;
@@ -18,8 +18,8 @@ import com.sap.sailing.domain.abstractlog.race.RaceLogRevokeEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogStartOfTrackingEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogStartProcedureChangedEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogStartTimeEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogWindFixEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogSuppressedMarkPassingsEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogWindFixEvent;
import com.sap.sailing.domain.abstractlog.race.scoring.RaceLogAdditionalScoringInformationEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogCloseOpenEndedDeviceMappingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDefineMarkEvent;
@@ -1,26 +1,28 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLogCourseAreaChangedEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sse.common.TimePoint;
public class RaceLogCourseAreaChangeEventImpl extends RaceLogEventImpl implements
RaceLogCourseAreaChangedEvent {
public class RaceLogCourseAreaChangeEventImpl extends RaceLogEventImpl implements RaceLogCourseAreaChangedEvent {
private static final long serialVersionUID = -3943108136024977860L;
private final Serializable courseAreaId;
public RaceLogCourseAreaChangeEventImpl(TimePoint createdAt,
AbstractLogEventAuthor author, TimePoint pTimePoint, Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, Serializable courseAreaId) {
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId);
public RaceLogCourseAreaChangeEventImpl(TimePoint createdAt, TimePoint pTimePoint, AbstractLogEventAuthor author,
Serializable pId, int pPassId, Serializable courseAreaId) {
super(createdAt, pTimePoint, author, pId, pPassId);
this.courseAreaId = courseAreaId;
}
public RaceLogCourseAreaChangeEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
Serializable courseAreaId) {
this(now(), logicalTimePoint, author, randId(), pPassId, courseAreaId);
}
@Override
public Serializable getCourseAreaId() {
return courseAreaId;
@@ -1,26 +1,30 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLogCourseDesignChangedEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.CourseBase;
import com.sap.sse.common.TimePoint;
public class RaceLogCourseDesignChangedEventImpl extends RaceLogEventImpl implements RaceLogCourseDesignChangedEvent {
private static final long serialVersionUID = 1565936170747420547L;
private final CourseBase courseDesign;
public RaceLogCourseDesignChangedEventImpl(TimePoint createdAt,
AbstractLogEventAuthor author, TimePoint pTimePoint, Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, CourseBase courseDesign) {
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId);
public RaceLogCourseDesignChangedEventImpl(TimePoint createdAt, TimePoint pTimePoint,
AbstractLogEventAuthor author, Serializable pId, int pPassId,
CourseBase courseDesign) {
super(createdAt, pTimePoint, author, pId, pPassId);
this.courseDesign = courseDesign;
}
public RaceLogCourseDesignChangedEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
CourseBase courseDesign) {
this(now(), logicalTimePoint, author, randId(), pPassId, courseDesign);
}
@Override
public void accept(RaceLogEventVisitor visitor) {
visitor.visit(this);
@@ -1,32 +1,36 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.Revokable;
import com.sap.sailing.domain.abstractlog.race.RaceLogDependentStartTimeEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.SimpleRaceLogIdentifier;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
import com.sap.sse.common.Duration;
import com.sap.sse.common.TimePoint;
public class RaceLogDependentStartTimeEventImpl extends RaceLogRaceStatusEventImpl implements RaceLogDependentStartTimeEvent, Revokable {
public class RaceLogDependentStartTimeEventImpl extends RaceLogRaceStatusEventImpl implements
RaceLogDependentStartTimeEvent, Revokable {
private static final long serialVersionUID = -2555082771473210123L;
private final Duration startTimeDifference;
private SimpleRaceLogIdentifier dependentOnRace;
public RaceLogDependentStartTimeEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint pTimePoint,
Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, SimpleRaceLogIdentifier dependentOnRace,
Duration startTimeDifference) {
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId, RaceLogRaceStatus.SCHEDULED);
public RaceLogDependentStartTimeEventImpl(TimePoint createdAt, TimePoint pTimePoint, AbstractLogEventAuthor author,
Serializable pId, int pPassId, SimpleRaceLogIdentifier dependentOnRace,
Duration startTimeDifference, RaceLogRaceStatus nextStatus) {
super(createdAt, pTimePoint, author, pId, pPassId, nextStatus);
this.dependentOnRace = dependentOnRace;
this.startTimeDifference = startTimeDifference;
}
public RaceLogDependentStartTimeEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
SimpleRaceLogIdentifier dependentOnRace, Duration startTimeDifference) {
this(now(), logicalTimePoint, author, randId(), pPassId, dependentOnRace, startTimeDifference, RaceLogRaceStatus.SCHEDULED);
}
@Override
public Duration getStartTimeDifference() {
return startTimeDifference;
@@ -1,31 +1,32 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLogEndOfTrackingEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sse.common.TimePoint;
public class RaceLogEndOfTrackingEventImpl extends RaceLogEventImpl implements RaceLogEndOfTrackingEvent {
private static final long serialVersionUID = 3130293807404190473L;
public RaceLogEndOfTrackingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint endOfTracking, Serializable pId, List<Competitor> pInvolvedBoats, int pPassId) {
super(createdAt, author, endOfTracking, pId, pInvolvedBoats, pPassId);
public RaceLogEndOfTrackingEventImpl(TimePoint createdAt, TimePoint endOfTracking, AbstractLogEventAuthor author,
Serializable pId, int pPassId) {
super(createdAt, endOfTracking, author, pId, pPassId);
}
public RaceLogEndOfTrackingEventImpl(TimePoint endOfTracking, AbstractLogEventAuthor author, int pPassId) {
super(endOfTracking, author, pPassId);
}
@Override
public void accept(RaceLogEventVisitor visitor) {
visitor.visit(this);
}
@Override
public String getShortInfo() {
return "endOfTrackingTime=" + getLogicalTimePoint();
}
}
@@ -1,329 +0,0 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.CompetitorResults;
import com.sap.sailing.domain.abstractlog.race.RaceLogCourseAreaChangedEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogCourseDesignChangedEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogDependentStartTimeEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEndOfTrackingEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningConfirmedEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogFixedMarkPassingEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogFlagEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogGateLineOpeningTimeEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogPassChangeEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogPathfinderEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogProtestStartTimeEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogRaceStatusEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogRevokeEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogStartOfTrackingEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogStartProcedureChangedEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogStartTimeEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogSuppressedMarkPassingsEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogWindFixEvent;
import com.sap.sailing.domain.abstractlog.race.SimpleRaceLogIdentifier;
import com.sap.sailing.domain.abstractlog.race.scoring.AdditionalScoringInformationType;
import com.sap.sailing.domain.abstractlog.race.scoring.RaceLogAdditionalScoringInformationEvent;
import com.sap.sailing.domain.abstractlog.race.scoring.impl.RaceLogAdditionalScoringInformationEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogCloseOpenEndedDeviceMappingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDefineMarkEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDenoteForTrackingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceCompetitorMappingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceMarkMappingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogRegisterCompetitorEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogStartTrackingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogCloseOpenEndedDeviceMappingEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDefineMarkEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDenoteForTrackingEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceCompetitorMappingEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceMarkMappingEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogRegisterCompetitorEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogStartTrackingEventImpl;
import com.sap.sailing.domain.base.BoatClass;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.CourseBase;
import com.sap.sailing.domain.base.Mark;
import com.sap.sailing.domain.common.Wind;
import com.sap.sailing.domain.common.racelog.Flags;
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
import com.sap.sailing.domain.common.racelog.RacingProcedureType;
import com.sap.sailing.domain.racelogtracking.DeviceIdentifier;
import com.sap.sse.common.Duration;
import com.sap.sse.common.TimePoint;
import com.sap.sse.common.impl.MillisecondsTimePoint;
public class RaceLogEventFactoryImpl implements RaceLogEventFactory {
@Override
public RaceLogFlagEvent createFlagEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable id,
List<Competitor> involvedBoats, int passId, Flags upperFlag, Flags lowerFlag, boolean isDisplayed) {
return new RaceLogFlagEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, involvedBoats, passId,
upperFlag, lowerFlag, isDisplayed);
}
@Override
public RaceLogFlagEvent createFlagEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, Flags upperFlag,
Flags lowerFlag, boolean isDisplayed) {
return createFlagEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(), passId, upperFlag,
lowerFlag, isDisplayed);
}
@Override
public RaceLogStartTimeEvent createStartTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable id, List<Competitor> involvedBoats, int passId, TimePoint startTime) {
return new RaceLogStartTimeEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, involvedBoats,
passId, startTime);
}
@Override
public RaceLogStartTimeEvent createStartTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, TimePoint startTime) {
return createStartTimeEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(), passId, startTime);
}
@Override
public RaceLogDependentStartTimeEvent createDependentStartTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable id, List<Competitor> involvedBoats, int passId, SimpleRaceLogIdentifier dependentOnRace, Duration startTimeDifference) {
return new RaceLogDependentStartTimeEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, involvedBoats,
passId, dependentOnRace, startTimeDifference);
}
@Override
public RaceLogDependentStartTimeEvent createDependentStartTimeEvent(TimePoint logicalTimePoint,
AbstractLogEventAuthor author, int passId, SimpleRaceLogIdentifier dependentOnRace, Duration startTimeDifference) {
return createDependentStartTimeEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(), passId,
dependentOnRace, startTimeDifference);
}
@Override
public RaceLogRaceStatusEvent createRaceStatusEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable id, List<Competitor> competitors, int passId, RaceLogRaceStatus nextStatus) {
return new RaceLogRaceStatusEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, competitors,
passId, nextStatus);
}
@Override
public RaceLogRaceStatusEvent createRaceStatusEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, RaceLogRaceStatus nextStatus) {
return createRaceStatusEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(), passId, nextStatus);
}
@Override
public RaceLogPassChangeEvent createPassChangeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable id, List<Competitor> competitors, int passId) {
return new RaceLogPassChangeEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, competitors, passId);
}
@Override
public RaceLogPassChangeEvent createPassChangeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId) {
return createPassChangeEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(), passId);
}
@Override
public RaceLogCourseAreaChangedEvent createCourseAreaChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable id, List<Competitor> competitors, int passId, Serializable courseAreaId) {
return new RaceLogCourseAreaChangeEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, competitors,
passId, courseAreaId);
}
@Override
public RaceLogCourseAreaChangedEvent createCourseAreaChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
int passId, Serializable courseAreaId) {
return createCourseAreaChangedEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(),
passId, courseAreaId);
}
@Override
public RaceLogCourseDesignChangedEvent createCourseDesignChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable id, List<Competitor> competitors, int passId, CourseBase courseData) {
return new RaceLogCourseDesignChangedEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, competitors,
passId, courseData);
}
@Override
public RaceLogCourseDesignChangedEvent createCourseDesignChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
int passId, CourseBase courseData) {
return createCourseDesignChangedEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(),
passId, courseData);
}
@Override
public RaceLogFinishPositioningListChangedEventImpl createFinishPositioningListChangedEvent(TimePoint logicalTimePoint,
AbstractLogEventAuthor author, Serializable id, List<Competitor> competitors,
int passId, CompetitorResults positionedCompetitors) {
return new RaceLogFinishPositioningListChangedEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint,
id, competitors, passId, positionedCompetitors);
}
@Override
public RaceLogFinishPositioningListChangedEventImpl createFinishPositioningListChangedEvent(TimePoint logicalTimePoint,
AbstractLogEventAuthor author, int passId, CompetitorResults positionedCompetitors) {
return createFinishPositioningListChangedEvent(logicalTimePoint, author, UUID.randomUUID(),
new ArrayList<Competitor>(), passId, positionedCompetitors);
}
@Override
public RaceLogFinishPositioningConfirmedEvent createFinishPositioningConfirmedEvent(TimePoint logicalTimePoint,
AbstractLogEventAuthor author, Serializable id, List<Competitor> competitors, int passId, CompetitorResults positionedCompetitors) {
return new RaceLogFinishPositioningConfirmedEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id,
competitors, passId, positionedCompetitors);
}
@Override
public RaceLogFinishPositioningConfirmedEvent createFinishPositioningConfirmedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
int passId, CompetitorResults positionedCompetitors) {
return createFinishPositioningConfirmedEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(), passId, positionedCompetitors);
}
@Override
public RaceLogPathfinderEvent createPathfinderEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable id, List<Competitor> competitors, int passId, String pathfinderId) {
return new RaceLogPathfinderEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, competitors,
passId, pathfinderId);
}
@Override
public RaceLogPathfinderEvent createPathfinderEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, String pathfinderId) {
return createPathfinderEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(), passId, pathfinderId);
}
@Override
public RaceLogGateLineOpeningTimeEvent createGateLineOpeningTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable id, List<Competitor> competitors, int passId, Long gateLaunchStopTime, Long golfDownTime) {
return new RaceLogGateLineOpeningTimeEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, competitors,
passId, gateLaunchStopTime, golfDownTime);
}
@Override
public RaceLogGateLineOpeningTimeEvent createGateLineOpeningTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
int passId, Long gateLaunchStopTime, Long golfDownTime) {
return createGateLineOpeningTimeEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(),
passId, gateLaunchStopTime, golfDownTime);
}
@Override
public RaceLogStartProcedureChangedEvent createStartProcedureChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable id, List<Competitor> competitors, int passId, RacingProcedureType type) {
return new RaceLogStartProcedureChangedEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id,
competitors, passId, type);
}
@Override
public RaceLogStartProcedureChangedEvent createStartProcedureChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
int passId, RacingProcedureType type) {
return createStartProcedureChangedEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(), passId, type);
}
@Override
public RaceLogProtestStartTimeEvent createProtestStartTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable id, List<Competitor> competitors, int passId, TimePoint protestStartTime) {
return new RaceLogProtestStartTimeEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id,
competitors, passId, protestStartTime);
}
@Override
public RaceLogProtestStartTimeEvent createProtestStartTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
int passId, TimePoint protestStartTime) {
return createProtestStartTimeEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(),
passId, protestStartTime);
}
@Override
public RaceLogWindFixEvent createWindFixEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, Wind wind, boolean isMagnetic) {
return createWindFixEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(), passId, wind, isMagnetic);
}
@Override
public RaceLogWindFixEvent createWindFixEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable id,
List<Competitor> competitors, int passId, Wind wind, boolean isMagnetic) {
return new RaceLogWindFixEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, competitors, passId, wind, isMagnetic);
}
@Override
public RaceLogDeviceCompetitorMappingEvent createDeviceCompetitorMappingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
DeviceIdentifier device, Competitor mappedTo, int passId, TimePoint from, TimePoint to) {
return new RaceLogDeviceCompetitorMappingEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, UUID.randomUUID(),
passId, mappedTo, device, from, to);
}
@Override
public RaceLogDeviceMarkMappingEvent createDeviceMarkMappingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
DeviceIdentifier device, Mark mappedTo, int passId, TimePoint from, TimePoint to) {
return new RaceLogDeviceMarkMappingEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, UUID.randomUUID(),
passId, mappedTo, device, from, to);
}
@Override
public RaceLogDenoteForTrackingEvent createDenoteForTrackingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId,
String raceName, BoatClass boatClass, Serializable raceId) {
return new RaceLogDenoteForTrackingEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, UUID.randomUUID(), passId, raceName,
boatClass, raceId);
}
@Override
public RaceLogStartTrackingEvent createStartTrackingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId) {
return new RaceLogStartTrackingEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, UUID.randomUUID(), passId);
}
@Override
public RaceLogRevokeEvent createRevokeEvent(AbstractLogEventAuthor author, int passId, RaceLogEvent toRevoke, String reason) {
return new RaceLogRevokeEventImpl(author, passId, toRevoke, reason);
}
@Override
public RaceLogRegisterCompetitorEvent createRegisterCompetitorEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
int passId, Competitor competitor) {
return new RaceLogRegisterCompetitorEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, UUID.randomUUID(), passId, competitor);
}
@Override
public RaceLogDefineMarkEvent createDefineMarkEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
int passId, Mark mark) {
return new RaceLogDefineMarkEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, UUID.randomUUID(), passId, mark);
}
@Override
public RaceLogCloseOpenEndedDeviceMappingEvent createCloseOpenEndedDeviceMappingEvent(TimePoint logicalTimePoint,
AbstractLogEventAuthor author, int passId, Serializable deviceMappingEventId, TimePoint closingTimePoint) {
return new RaceLogCloseOpenEndedDeviceMappingEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint,
UUID.randomUUID(), passId, deviceMappingEventId, closingTimePoint);
}
@Override
public RaceLogAdditionalScoringInformationEvent createAdditionalScoringInformationEvent(TimePoint timePoint, Serializable id,
AbstractLogEventAuthor author, int currentPassId, AdditionalScoringInformationType informationType) {
return new RaceLogAdditionalScoringInformationEventImpl(MillisecondsTimePoint.now(), author, timePoint, id,
Collections.<Competitor> emptyList(), currentPassId, informationType);
}
@Override
public RaceLogFixedMarkPassingEvent createFixedMarkPassingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable id, List<Competitor> competitors, Integer passId, TimePoint ofFixedPassing, Integer zeroBasedIndexOfWaypoint) {
return new RaceLogFixedMarkPassingEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, competitors, passId, ofFixedPassing,
zeroBasedIndexOfWaypoint);
}
@Override
public RaceLogSuppressedMarkPassingsEvent createSuppressedMarkPassingsEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable id,
List<Competitor> competitors, Integer passId, Integer zeroBasedIndexOfFirstSuppressedWaypoint) {
return new RaceLogSuppressedMarkPassingsEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, competitors, passId,
zeroBasedIndexOfFirstSuppressedWaypoint);
}
@Override
public RaceLogStartOfTrackingEvent createStartOfTrackingEvent(TimePoint startOfTracking, AbstractLogEventAuthor author, Serializable id,
List<Competitor> competitors, Integer passId) {
return new RaceLogStartOfTrackingEventImpl(MillisecondsTimePoint.now(), author, startOfTracking, id, competitors, passId);
}
@Override
public RaceLogEndOfTrackingEvent createEndOfTrackingEvent(TimePoint endOfTracking, AbstractLogEventAuthor author, Serializable id,
List<Competitor> competitors, Integer passId) {
return new RaceLogEndOfTrackingEventImpl(MillisecondsTimePoint.now(), author, endOfTracking, id, competitors, passId);
}
}
@@ -1,6 +1,7 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.Collections;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
@@ -15,11 +16,24 @@ public abstract class RaceLogEventImpl extends AbstractLogEventImpl<RaceLogEvent
private static final long serialVersionUID = -2557594972618769182L;
private final RaceLogEventData raceLogEventData;
public RaceLogEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
public RaceLogEventImpl(TimePoint createdAt, TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable pId, List<Competitor> pInvolvedBoats, int pPassId) {
super(createdAt, author, logicalTimePoint, pId);
super(createdAt, logicalTimePoint, author, pId);
this.raceLogEventData = new RaceLogEventDataImpl(pInvolvedBoats, pPassId);
}
public RaceLogEventImpl(TimePoint createdAt, TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable pId, int pPassId) {
this(createdAt, logicalTimePoint, author, pId, Collections.<Competitor>emptyList(), pPassId);
}
public RaceLogEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Competitor competitor, int pPassId) {
this(now(), logicalTimePoint, author, randId(), Collections.singletonList(competitor), pPassId);
}
public RaceLogEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId) {
this(now(), logicalTimePoint, author, randId(), Collections.<Competitor>emptyList(), pPassId);
}
@Override
public List<Competitor> getInvolvedBoats() {
@@ -1,201 +0,0 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.CompetitorResults;
import com.sap.sailing.domain.abstractlog.race.RaceLogCourseAreaChangedEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogCourseDesignChangedEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogDependentStartTimeEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventRestoreFactory;
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningConfirmedEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningListChangedEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogFlagEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogGateLineOpeningTimeEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogPassChangeEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogPathfinderEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogProtestStartTimeEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogRaceStatusEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogRevokeEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogStartProcedureChangedEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogStartTimeEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogWindFixEvent;
import com.sap.sailing.domain.abstractlog.race.SimpleRaceLogIdentifier;
import com.sap.sailing.domain.abstractlog.race.scoring.AdditionalScoringInformationType;
import com.sap.sailing.domain.abstractlog.race.scoring.RaceLogAdditionalScoringInformationEvent;
import com.sap.sailing.domain.abstractlog.race.scoring.impl.RaceLogAdditionalScoringInformationEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogCloseOpenEndedDeviceMappingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDefineMarkEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDenoteForTrackingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceCompetitorMappingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceMarkMappingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogRegisterCompetitorEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogStartTrackingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogCloseOpenEndedDeviceMappingEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDefineMarkEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDenoteForTrackingEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceCompetitorMappingEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceMarkMappingEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogRegisterCompetitorEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogStartTrackingEventImpl;
import com.sap.sailing.domain.base.BoatClass;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.CourseBase;
import com.sap.sailing.domain.base.Mark;
import com.sap.sailing.domain.common.Wind;
import com.sap.sailing.domain.common.racelog.Flags;
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
import com.sap.sailing.domain.common.racelog.RacingProcedureType;
import com.sap.sailing.domain.racelogtracking.DeviceIdentifier;
import com.sap.sse.common.Duration;
import com.sap.sse.common.TimePoint;
public class RaceLogEventRestoreFactoryImpl extends RaceLogEventFactoryImpl implements RaceLogEventRestoreFactory {
@Override
public RaceLogFlagEvent createFlagEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable id, List<Competitor> involvedBoats, int passId, Flags upperFlag, Flags lowerFlag, boolean isDisplayed) {
return new RaceLogFlagEventImpl(createdAt, author, logicalTimePoint, id, involvedBoats, passId, upperFlag, lowerFlag, isDisplayed);
}
@Override
public RaceLogStartTimeEvent createStartTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable id, List<Competitor> involvedBoats, int passId, TimePoint startTime, RaceLogRaceStatus nextStatue) {
return new RaceLogStartTimeEventImpl(createdAt, author, logicalTimePoint, id, involvedBoats, passId, startTime);
}
@Override
public RaceLogRaceStatusEvent createRaceStatusEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, RaceLogRaceStatus nextStatus) {
return new RaceLogRaceStatusEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId, nextStatus);
}
@Override
public RaceLogPassChangeEvent createPassChangeEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId) {
return new RaceLogPassChangeEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId);
}
@Override
public RaceLogCourseAreaChangedEvent createCourseAreaChangedEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, Serializable courseAreaId) {
return new RaceLogCourseAreaChangeEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId, courseAreaId);
}
@Override
public RaceLogCourseDesignChangedEvent createCourseDesignChangedEvent(TimePoint createdAt,
AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, CourseBase courseData) {
return new RaceLogCourseDesignChangedEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId, courseData);
}
@Override
public RaceLogFinishPositioningListChangedEvent createFinishPositioningListChangedEvent(TimePoint createdAt,
AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, CompetitorResults positionedCompetitors) {
return new RaceLogFinishPositioningListChangedEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId, positionedCompetitors);
}
@Override
public RaceLogFinishPositioningConfirmedEvent createFinishPositioningConfirmedEvent(TimePoint createdAt,
AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, CompetitorResults positionedCompetitors) {
return new RaceLogFinishPositioningConfirmedEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId, positionedCompetitors);
}
@Override
public RaceLogPathfinderEvent createPathfinderEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, String pathfinderId) {
return new RaceLogPathfinderEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId, pathfinderId);
}
@Override
public RaceLogGateLineOpeningTimeEvent createGateLineOpeningTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, Long gateLaunchStopTime,
Long golfDownTime) {
return new RaceLogGateLineOpeningTimeEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId, gateLaunchStopTime,
golfDownTime);
}
@Override
public RaceLogStartProcedureChangedEvent createStartProcedureChangedEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, RacingProcedureType type) {
return new RaceLogStartProcedureChangedEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId, type);
}
@Override
public RaceLogProtestStartTimeEvent createProtestStartTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, TimePoint protestStartTime) {
return new RaceLogProtestStartTimeEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId, protestStartTime);
}
@Override
public RaceLogWindFixEvent createWindFixEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable id, List<Competitor> competitors, Integer passId, Wind wind, boolean isMagnetic) {
return new RaceLogWindFixEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId, wind, isMagnetic);
}
@Override
public RaceLogDeviceCompetitorMappingEvent createDeviceCompetitorMappingEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable pId, DeviceIdentifier device, Competitor mappedTo, int passId, TimePoint from, TimePoint to) {
return new RaceLogDeviceCompetitorMappingEventImpl(createdAt, author, logicalTimePoint, pId, passId, mappedTo, device, from, to);
}
@Override
public RaceLogDeviceMarkMappingEvent createDeviceMarkMappingEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable pId, DeviceIdentifier device, Mark mappedTo, int passId, TimePoint from,
TimePoint to) {
return new RaceLogDeviceMarkMappingEventImpl(createdAt, author, logicalTimePoint, pId, passId, mappedTo, device, from, to);
}
@Override
public RaceLogDenoteForTrackingEvent createDenoteForTrackingEvent(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable pId, int passId, String raceName, BoatClass boatClass, Serializable raceId) {
return new RaceLogDenoteForTrackingEventImpl(createdAt, author, logicalTimePoint, pId, passId, raceName, boatClass, raceId);
}
@Override
public RaceLogStartTrackingEvent createStartTrackingEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable pId, int passId) {
return new RaceLogStartTrackingEventImpl(createdAt, author, logicalTimePoint, pId, passId);
}
@Override
public RaceLogRevokeEvent createRevokeEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable pId, int passId, Serializable revokedEventId, String revokedEventType, String revokedEventShortInfo, String reason) {
return new RaceLogRevokeEventImpl(createdAt, author, logicalTimePoint, pId, passId, revokedEventId, revokedEventType, revokedEventShortInfo, reason);
}
@Override
public RaceLogRegisterCompetitorEvent createRegisterCompetitorEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable pId, int passId, Competitor competitor) {
return new RaceLogRegisterCompetitorEventImpl(createdAt, author, logicalTimePoint, pId, passId, competitor);
}
@Override
public RaceLogDefineMarkEvent createDefineMarkEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable pId, int passId, Mark mark) {
return new RaceLogDefineMarkEventImpl(createdAt, author, logicalTimePoint, pId, passId, mark);
}
@Override
public RaceLogCloseOpenEndedDeviceMappingEvent createCloseOpenEndedDeviceMappingEvent(TimePoint createdAt,
AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable pId, int passId,
Serializable deviceMappingEventId, TimePoint closingTimePoint) {
return new RaceLogCloseOpenEndedDeviceMappingEventImpl(createdAt, author, logicalTimePoint, pId, passId,
deviceMappingEventId, closingTimePoint);
}
@Override
public RaceLogAdditionalScoringInformationEvent createAdditionalScoringInformationEvent(TimePoint createdAt,
AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable pId, List<Competitor> competitors, int passId,
AdditionalScoringInformationType informationType) {
return new RaceLogAdditionalScoringInformationEventImpl(createdAt, author, logicalTimePoint, pId, competitors, passId, informationType);
}
@Override
public RaceLogDependentStartTimeEvent createDependentStartTimeEvent(TimePoint createdAt,
AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, List<Competitor> involvedBoats,
int passId, SimpleRaceLogIdentifier dependentOnRace, Duration startTimeDifference, RaceLogRaceStatus nextStatus) {
return new RaceLogDependentStartTimeEventImpl(createdAt, author, logicalTimePoint, id, involvedBoats, passId,
dependentOnRace, startTimeDifference);
}
}
@@ -1,22 +1,27 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.CompetitorResults;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningConfirmedEvent;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sse.common.TimePoint;
public class RaceLogFinishPositioningConfirmedEventImpl extends RaceLogFinishPositioningEventImpl implements RaceLogFinishPositioningConfirmedEvent {
public class RaceLogFinishPositioningConfirmedEventImpl extends RaceLogFinishPositioningEventImpl implements
RaceLogFinishPositioningConfirmedEvent {
private static final long serialVersionUID = 5028181339200048499L;
public RaceLogFinishPositioningConfirmedEventImpl(TimePoint createdAt,
AbstractLogEventAuthor author, TimePoint pTimePoint, Serializable pId, List<Competitor> pCompetitors, int pPassId, CompetitorResults positionedCompetitors) {
super(createdAt, author, pTimePoint, pId, pCompetitors, pPassId, positionedCompetitors);
public RaceLogFinishPositioningConfirmedEventImpl(TimePoint createdAt, TimePoint pTimePoint,
AbstractLogEventAuthor author, Serializable pId, int pPassId,
CompetitorResults positionedCompetitors) {
super(createdAt, pTimePoint, author, pId, pPassId, positionedCompetitors);
}
public RaceLogFinishPositioningConfirmedEventImpl(TimePoint pTimePoint, AbstractLogEventAuthor author, int pPassId,
CompetitorResults positionedCompetitors) {
super(pTimePoint, author, pPassId, positionedCompetitors);
}
@Override
@@ -1,26 +1,30 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.CompetitorResults;
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningEvent;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sse.common.TimePoint;
public abstract class RaceLogFinishPositioningEventImpl extends RaceLogEventImpl implements RaceLogFinishPositioningEvent {
public abstract class RaceLogFinishPositioningEventImpl extends RaceLogEventImpl implements
RaceLogFinishPositioningEvent {
private static final long serialVersionUID = -8168584588697908309L;
private final CompetitorResults positionedCompetitors;
public RaceLogFinishPositioningEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint pTimePoint,
Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, CompetitorResults positionedCompetitors) {
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId);
public RaceLogFinishPositioningEventImpl(TimePoint createdAt, TimePoint pTimePoint, AbstractLogEventAuthor author,
Serializable pId, int pPassId, CompetitorResults positionedCompetitors) {
super(createdAt, pTimePoint, author, pId, pPassId);
this.positionedCompetitors = positionedCompetitors;
}
public RaceLogFinishPositioningEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
CompetitorResults positionedCompetitors) {
this(now(), logicalTimePoint, author, randId(), pPassId, positionedCompetitors);
}
@Override
public CompetitorResults getPositionedCompetitorsIDsNamesMaxPointsReasons() {
return positionedCompetitors;
@@ -1,22 +1,27 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.CompetitorResults;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningListChangedEvent;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sse.common.TimePoint;
public class RaceLogFinishPositioningListChangedEventImpl extends RaceLogFinishPositioningEventImpl implements RaceLogFinishPositioningListChangedEvent {
public class RaceLogFinishPositioningListChangedEventImpl extends RaceLogFinishPositioningEventImpl implements
RaceLogFinishPositioningListChangedEvent {
private static final long serialVersionUID = -8167472925561954739L;
public RaceLogFinishPositioningListChangedEventImpl(TimePoint createdAt,
AbstractLogEventAuthor author, TimePoint pTimePoint, Serializable pId, List<Competitor> competitors, int pPassId, CompetitorResults positionedCompetitors) {
super(createdAt, author, pTimePoint, pId, competitors, pPassId, positionedCompetitors);
public RaceLogFinishPositioningListChangedEventImpl(TimePoint createdAt, TimePoint pTimePoint,
AbstractLogEventAuthor author, Serializable pId, int pPassId,
CompetitorResults positionedCompetitors) {
super(createdAt, pTimePoint, author, pId, pPassId, positionedCompetitors);
}
public RaceLogFinishPositioningListChangedEventImpl(TimePoint pTimePoint, AbstractLogEventAuthor author,
int pPassId, CompetitorResults positionedCompetitors) {
super(pTimePoint, author, pPassId, positionedCompetitors);
}
@Override
@@ -1,28 +1,35 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.Collections;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLogFixedMarkPassingEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.RaceLogFixedMarkPassingEvent;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sse.common.TimePoint;
public class RaceLogFixedMarkPassingEventImpl extends RaceLogEventImpl implements RaceLogFixedMarkPassingEvent {
private final Integer zeroBasedIndexOfWaypointOfPassing;
private final TimePoint timePointOfPassing;
public RaceLogFixedMarkPassingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, TimePoint timePoint, Integer zeroBasedIndexOfWaypointOfPassing) {
super(createdAt, author, logicalTimePoint, pId, pInvolvedBoats, pPassId);
public RaceLogFixedMarkPassingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
AbstractLogEventAuthor author, Serializable pId, List<Competitor> pInvolvedBoats, int pPassId,
TimePoint timePoint, Integer zeroBasedIndexOfWaypointOfPassing) {
super(createdAt, logicalTimePoint, author, pId, pInvolvedBoats, pPassId);
this.timePointOfPassing = timePoint;
this.zeroBasedIndexOfWaypointOfPassing = zeroBasedIndexOfWaypointOfPassing;
}
public RaceLogFixedMarkPassingEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Competitor competitor, int pPassId, TimePoint timePoint, Integer zeroBasedIndexOfWaypointOfPassing) {
this(now(), logicalTimePoint, author, randId(), Collections.singletonList(competitor), pPassId, timePoint,
zeroBasedIndexOfWaypointOfPassing);
}
private static final long serialVersionUID = -1796278009919318553L;
@Override
@@ -42,6 +49,7 @@ public class RaceLogFixedMarkPassingEventImpl extends RaceLogEventImpl implement
@Override
public String getShortInfo() {
return getInvolvedBoats().get(0).getName()+" at mark "+getZeroBasedIndexOfPassedWaypoint()+" at "+getTimePointOfFixedPassing();
return getInvolvedBoats().get(0).getName() + " at mark " + getZeroBasedIndexOfPassedWaypoint() + " at "
+ getTimePointOfFixedPassing();
}
}
@@ -1,12 +1,10 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.RaceLogFlagEvent;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.common.racelog.Flags;
import com.sap.sse.common.TimePoint;
@@ -17,13 +15,20 @@ public class RaceLogFlagEventImpl extends RaceLogEventImpl implements RaceLogFla
private final Flags lowerFlag;
private final boolean isDisplayed;
public RaceLogFlagEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint pTimePoint, Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, Flags pUpperFlag, Flags pLowerFlag, boolean pIsDisplayed) {
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId);
public RaceLogFlagEventImpl(TimePoint createdAt, TimePoint pTimePoint, AbstractLogEventAuthor author,
Serializable pId, int pPassId, Flags pUpperFlag, Flags pLowerFlag,
boolean pIsDisplayed) {
super(createdAt, pTimePoint, author, pId, pPassId);
this.upperFlag = pUpperFlag;
this.lowerFlag = pLowerFlag;
this.isDisplayed = pIsDisplayed;
}
public RaceLogFlagEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId, Flags pUpperFlag,
Flags pLowerFlag, boolean pIsDisplayed) {
this(now(), logicalTimePoint, author, randId(), pPassId, pUpperFlag, pLowerFlag, pIsDisplayed);
}
@Override
public Flags getUpperFlag() {
return upperFlag;
@@ -49,4 +54,4 @@ public class RaceLogFlagEventImpl extends RaceLogEventImpl implements RaceLogFla
return "upperFlag=" + upperFlag + ", lowerFlag=" + lowerFlag + ", isDisplayed=" + isDisplayed;
}
}
}
@@ -1,26 +1,29 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.RaceLogGateLineOpeningTimeEvent;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sse.common.TimePoint;
public class RaceLogGateLineOpeningTimeEventImpl extends RaceLogEventImpl implements RaceLogGateLineOpeningTimeEvent {
private static final long serialVersionUID = 793529890804809490L;
private final GateLineOpeningTimes gateLineOpeningTimes;
public RaceLogGateLineOpeningTimeEventImpl(TimePoint createdAt,
AbstractLogEventAuthor author, TimePoint pTimePoint, Serializable pId, List<Competitor> pCompetitors, int pPassId,
public RaceLogGateLineOpeningTimeEventImpl(TimePoint createdAt, TimePoint pTimePoint,
AbstractLogEventAuthor author, Serializable pId, int pPassId,
long gateLaunchStopTime, long golfDownTime) {
super(createdAt, author, pTimePoint, pId, pCompetitors, pPassId);
super(createdAt, pTimePoint, author, pId, pPassId);
this.gateLineOpeningTimes = new GateLineOpeningTimes(gateLaunchStopTime, golfDownTime);
}
public RaceLogGateLineOpeningTimeEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
long gateLaunchStopTime, long golfDownTime) {
this(now(), logicalTimePoint, author, randId(), pPassId, gateLaunchStopTime, golfDownTime);
}
@Override
public void accept(RaceLogEventVisitor visitor) {
visitor.visit(this);
@@ -7,7 +7,6 @@ import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.impl.AbstractLogImpl;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.tracking.Track;
import com.sap.sailing.domain.tracking.impl.PartialNavigableSetView;
@@ -55,7 +54,7 @@ public class RaceLogImpl extends AbstractLogImpl<RaceLogEvent, RaceLogEventVisit
@Override
protected RaceLogEvent createRevokeEvent(AbstractLogEventAuthor author, RaceLogEvent toRevoke, String reason) {
return RaceLogEventFactory.INSTANCE.createRevokeEvent(author, getCurrentPassId(), toRevoke, reason);
return new RaceLogRevokeEventImpl(author, getCurrentPassId(), toRevoke, reason);
}
@Override
@@ -1,20 +1,22 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.RaceLogPassChangeEvent;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sse.common.TimePoint;
public class RaceLogPassChangeEventImpl extends RaceLogEventImpl implements RaceLogPassChangeEvent {
private static final long serialVersionUID = -3737606977320640630L;
public RaceLogPassChangeEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint pTimePoint, Serializable pId, List<Competitor> pInvolvedBoats, int pPassId) {
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId);
public RaceLogPassChangeEventImpl(TimePoint createdAt, TimePoint pTimePoint, AbstractLogEventAuthor author,
Serializable pId, int pPassId) {
super(createdAt, pTimePoint, author, pId, pPassId);
}
public RaceLogPassChangeEventImpl(TimePoint pTimePoint, AbstractLogEventAuthor author, int pPassId) {
super(pTimePoint, author, pPassId);
}
@Override
@@ -1,25 +1,28 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.RaceLogPathfinderEvent;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sse.common.TimePoint;
public class RaceLogPathfinderEventImpl extends RaceLogEventImpl implements RaceLogPathfinderEvent {
private static final long serialVersionUID = -1654474931330970804L;
private final String pathfinderId;
public RaceLogPathfinderEventImpl(TimePoint createdAt,
AbstractLogEventAuthor author, TimePoint pTimePoint, Serializable pId, List<Competitor> pCompetitors, int pPassId, String pathfinderId) {
super(createdAt, author, pTimePoint, pId, pCompetitors, pPassId);
public RaceLogPathfinderEventImpl(TimePoint createdAt, TimePoint pTimePoint, AbstractLogEventAuthor author,
Serializable pId, int pPassId, String pathfinderId) {
super(createdAt, pTimePoint, author, pId, pPassId);
this.pathfinderId = pathfinderId;
}
public RaceLogPathfinderEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
String pathfinderId) {
this(now(), logicalTimePoint, author, randId(), pPassId, pathfinderId);
}
@Override
public void accept(RaceLogEventVisitor visitor) {
visitor.visit(this);
@@ -1,25 +1,28 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.RaceLogProtestStartTimeEvent;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sse.common.TimePoint;
public class RaceLogProtestStartTimeEventImpl extends RaceLogEventImpl implements RaceLogProtestStartTimeEvent {
private static final long serialVersionUID = -1800827552916395996L;
private final TimePoint protestStartTime;
public RaceLogProtestStartTimeEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint pTimePoint,
Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, TimePoint protestStartTime) {
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId);
public RaceLogProtestStartTimeEventImpl(TimePoint createdAt, TimePoint pTimePoint, AbstractLogEventAuthor author,
Serializable pId, int pPassId, TimePoint protestStartTime) {
super(createdAt, pTimePoint, author, pId, pPassId);
this.protestStartTime = protestStartTime;
}
public RaceLogProtestStartTimeEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
TimePoint protestStartTime) {
this(now(), logicalTimePoint, author, randId(), pPassId, protestStartTime);
}
@Override
public void accept(RaceLogEventVisitor visitor) {
visitor.visit(this);
@@ -1,12 +1,10 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.RaceLogRaceStatusEvent;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
import com.sap.sse.common.TimePoint;
@@ -15,12 +13,17 @@ public class RaceLogRaceStatusEventImpl extends RaceLogEventImpl implements Race
private final RaceLogRaceStatus nextStatus;
public RaceLogRaceStatusEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint pTimePoint,
Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, RaceLogRaceStatus nextStatus) {
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId);
public RaceLogRaceStatusEventImpl(TimePoint createdAt, TimePoint pTimePoint, AbstractLogEventAuthor author,
Serializable pId, int pPassId, RaceLogRaceStatus nextStatus) {
super(createdAt, pTimePoint, author, pId, pPassId);
this.nextStatus = nextStatus;
}
public RaceLogRaceStatusEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
RaceLogRaceStatus nextStatus) {
this(now(), logicalTimePoint, author, randId(), pPassId, nextStatus);
}
@Override
public RaceLogRaceStatus getNextStatus() {
return nextStatus;
@@ -21,10 +21,10 @@ public class RaceLogRevokeEventImpl extends RevokeEventImpl<RaceLogEventVisitor>
this.raceLogEventData = new RaceLogEventDataImpl(null, passId);
}
public RaceLogRevokeEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
public RaceLogRevokeEventImpl(TimePoint createdAt, TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable pId, int passId, Serializable revokedEventId, String revokedEventType, String revokedEventShortInfo,
String reason) {
super(createdAt, author, logicalTimePoint, pId, revokedEventId, revokedEventType, revokedEventShortInfo, reason);
super(createdAt, logicalTimePoint, author, pId, revokedEventId, revokedEventType, revokedEventShortInfo, reason);
this.raceLogEventData = new RaceLogEventDataImpl(null, passId);
}
@@ -1,27 +1,29 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.RaceLogStartOfTrackingEvent;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sse.common.TimePoint;
public class RaceLogStartOfTrackingEventImpl extends RaceLogEventImpl implements RaceLogStartOfTrackingEvent {
private static final long serialVersionUID = -4134608549471817247L;
public RaceLogStartOfTrackingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint startOfTracking, Serializable pId, List<Competitor> pInvolvedBoats, int pPassId) {
super(createdAt, author, startOfTracking, pId, pInvolvedBoats, pPassId);
public RaceLogStartOfTrackingEventImpl(TimePoint createdAt, TimePoint startOfTracking,
AbstractLogEventAuthor author, Serializable pId, int pPassId) {
super(createdAt, startOfTracking, author, pId, pPassId);
}
public RaceLogStartOfTrackingEventImpl(TimePoint startOfTracking, AbstractLogEventAuthor author, int pPassId) {
super(startOfTracking, author, pPassId);
}
@Override
public void accept(RaceLogEventVisitor visitor) {
visitor.visit(this);
}
@Override
public String getShortInfo() {
return "startOfTrackingTime=" + getLogicalTimePoint();
@@ -1,12 +1,10 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.RaceLogStartProcedureChangedEvent;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.common.racelog.RacingProcedureType;
import com.sap.sse.common.TimePoint;
@@ -17,13 +15,17 @@ public class RaceLogStartProcedureChangedEventImpl extends RaceLogEventImpl impl
private final RacingProcedureType startProcedureType;
public RaceLogStartProcedureChangedEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint pTimePoint, Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, RacingProcedureType startProcedureType) {
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId);
public RaceLogStartProcedureChangedEventImpl(TimePoint createdAt, TimePoint pTimePoint,
AbstractLogEventAuthor author, Serializable pId, int pPassId, RacingProcedureType startProcedureType) {
super(createdAt, pTimePoint, author, pId, pPassId);
this.startProcedureType = startProcedureType;
}
public RaceLogStartProcedureChangedEventImpl(TimePoint logicalTimePoint,
AbstractLogEventAuthor author, int pPassId, RacingProcedureType startProcedureType) {
this(now(), logicalTimePoint, author, randId(), pPassId, startProcedureType);
}
@Override
public RacingProcedureType getStartProcedureType() {
return startProcedureType;
@@ -1,12 +1,10 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.RaceLogStartTimeEvent;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
import com.sap.sse.common.TimePoint;
@@ -15,12 +13,17 @@ public class RaceLogStartTimeEventImpl extends RaceLogRaceStatusEventImpl implem
private static final long serialVersionUID = 8185811395997196162L;
private final TimePoint startTime;
public RaceLogStartTimeEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint pTimePoint,
Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, TimePoint pStartTime) {
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId, RaceLogRaceStatus.SCHEDULED);
public RaceLogStartTimeEventImpl(TimePoint createdAt, TimePoint pTimePoint, AbstractLogEventAuthor author,
Serializable pId, int pPassId, TimePoint pStartTime, RaceLogRaceStatus nextStatus) {
super(createdAt, pTimePoint, author, pId, pPassId, nextStatus);
this.startTime = pStartTime;
}
public RaceLogStartTimeEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
TimePoint pStartTime) {
this(now(), logicalTimePoint, author, randId(), pPassId, pStartTime, RaceLogRaceStatus.SCHEDULED);
}
@Override
public TimePoint getStartTime() {
return startTime;
@@ -1,6 +1,7 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.Collections;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
@@ -9,17 +10,24 @@ import com.sap.sailing.domain.abstractlog.race.RaceLogSuppressedMarkPassingsEven
import com.sap.sailing.domain.base.Competitor;
import com.sap.sse.common.TimePoint;
public class RaceLogSuppressedMarkPassingsEventImpl extends RaceLogEventImpl implements RaceLogSuppressedMarkPassingsEvent {
public class RaceLogSuppressedMarkPassingsEventImpl extends RaceLogEventImpl implements
RaceLogSuppressedMarkPassingsEvent {
private static final long serialVersionUID = 3665678555023150888L;
private final Integer indexOfFirstSuppressedWaypoint;
public RaceLogSuppressedMarkPassingsEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable pId,
List<Competitor> pInvolvedBoats, int pPassId, Integer indexOfFirstSuppressedWaypoint) {
super(createdAt, author, logicalTimePoint, pId, pInvolvedBoats, pPassId);
public RaceLogSuppressedMarkPassingsEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
AbstractLogEventAuthor author, Serializable pId, List<Competitor> pInvolvedBoats, int pPassId,
Integer indexOfFirstSuppressedWaypoint) {
super(createdAt, logicalTimePoint, author, pId, pInvolvedBoats, pPassId);
this.indexOfFirstSuppressedWaypoint = indexOfFirstSuppressedWaypoint;
}
public RaceLogSuppressedMarkPassingsEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Competitor competitor, int pPassId, Integer indexOfFirstSuppressedWaypoint) {
this(now(), logicalTimePoint, author, randId(), Collections.singletonList(competitor), pPassId,
indexOfFirstSuppressedWaypoint);
}
@Override
@@ -34,6 +42,6 @@ public class RaceLogSuppressedMarkPassingsEventImpl extends RaceLogEventImpl imp
@Override
public String getShortInfo() {
return getInvolvedBoats().get(0).getName()+" at mark "+getZeroBasedIndexOfFirstSuppressedWaypoint();
return getInvolvedBoats().get(0).getName() + " at mark " + getZeroBasedIndexOfFirstSuppressedWaypoint();
}
}
@@ -1,12 +1,10 @@
package com.sap.sailing.domain.abstractlog.race.impl;
import java.io.Serializable;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.RaceLogWindFixEvent;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.common.Wind;
import com.sap.sse.common.TimePoint;
@@ -16,12 +14,17 @@ public class RaceLogWindFixEventImpl extends RaceLogEventImpl implements RaceLog
private final Wind windFix;
private final boolean isMagnetic;
public RaceLogWindFixEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint pTimePoint,
Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, Wind windFix, boolean isMagnetic) {
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId);
public RaceLogWindFixEventImpl(TimePoint createdAt, TimePoint pTimePoint, AbstractLogEventAuthor author,
Serializable pId, int pPassId, Wind windFix, boolean isMagnetic) {
super(createdAt, pTimePoint, author, pId, pPassId);
this.windFix = windFix;
this.isMagnetic = isMagnetic;
}
public RaceLogWindFixEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
int pPassId, Wind windFix, boolean isMagnetic) {
this(now(), logicalTimePoint, author, randId(), pPassId, windFix, isMagnetic);
}
@Override
public void accept(RaceLogEventVisitor visitor) {
@@ -1,14 +1,12 @@
package com.sap.sailing.domain.abstractlog.race.scoring.impl;
import java.io.Serializable;
import java.util.List;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogEventImpl;
import com.sap.sailing.domain.abstractlog.race.scoring.AdditionalScoringInformationType;
import com.sap.sailing.domain.abstractlog.race.scoring.RaceLogAdditionalScoringInformationEvent;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sse.common.TimePoint;
public class RaceLogAdditionalScoringInformationEventImpl extends RaceLogEventImpl implements RaceLogAdditionalScoringInformationEvent {
@@ -16,11 +14,16 @@ public class RaceLogAdditionalScoringInformationEventImpl extends RaceLogEventIm
private final AdditionalScoringInformationType informationType;
public RaceLogAdditionalScoringInformationEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable pId, List<Competitor> competitors, int pPassId, AdditionalScoringInformationType informationType) {
super(createdAt, author, logicalTimePoint, pId, competitors, pPassId);
public RaceLogAdditionalScoringInformationEventImpl(TimePoint createdAt, TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable pId, int pPassId, AdditionalScoringInformationType informationType) {
super(createdAt, logicalTimePoint, author, pId, pPassId);
this.informationType = informationType;
}
public RaceLogAdditionalScoringInformationEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
int pPassId, AdditionalScoringInformationType informationType) {
this(now(), logicalTimePoint, author, randId(), pPassId, informationType);
}
@Override
public void accept(RaceLogEventVisitor visitor) {
@@ -1,7 +1,6 @@
package com.sap.sailing.domain.abstractlog.race.state.impl;
import java.util.Collections;
import java.util.UUID;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -9,14 +8,25 @@ import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.CompetitorResults;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogDependentStartTimeEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
import com.sap.sailing.domain.abstractlog.race.SimpleRaceLogIdentifier;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.AdditionalScoringInformationFinder;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.DependentStartTimeResolver;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceStatusAnalyzer;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogCourseDesignChangedEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogDependentStartTimeEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFinishPositioningConfirmedEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFinishPositioningListChangedEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFlagEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogPassChangeEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogProtestStartTimeEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogRaceStatusEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartProcedureChangedEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartTimeEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogWindFixEventImpl;
import com.sap.sailing.domain.abstractlog.race.scoring.AdditionalScoringInformationType;
import com.sap.sailing.domain.abstractlog.race.scoring.RaceLogAdditionalScoringInformationEvent;
import com.sap.sailing.domain.abstractlog.race.scoring.impl.RaceLogAdditionalScoringInformationEventImpl;
import com.sap.sailing.domain.abstractlog.race.state.RaceState;
import com.sap.sailing.domain.abstractlog.race.state.ReadonlyRaceState;
import com.sap.sailing.domain.abstractlog.race.state.racingprocedure.RacingProcedure;
@@ -42,7 +52,6 @@ public class RaceStateImpl extends ReadonlyRaceStateImpl implements RaceState {
private static final Logger logger = Logger.getLogger(RaceStateImpl.class.getName());
private final AbstractLogEventAuthor author;
private final RaceLogEventFactory factory;
public static ReadonlyRaceState create(RaceLogResolver raceLogResolver, RaceLog raceLog) {
return create(raceLogResolver, raceLog, /* forRaceLogIdentifier */ null, Collections.<SimpleRaceLogIdentifier, ReadonlyRaceState>emptyMap());
@@ -60,22 +69,19 @@ public class RaceStateImpl extends ReadonlyRaceStateImpl implements RaceState {
*/
public static RaceState create(RaceLogResolver raceLogResolver, RaceLog raceLog, AbstractLogEventAuthor author, ConfigurationLoader<RegattaConfiguration> configuration) {
return new RaceStateImpl(raceLogResolver, raceLog, author,
RaceLogEventFactory.INSTANCE,
new RacingProcedureFactoryImpl(author, RaceLogEventFactory.INSTANCE, configuration));
new RacingProcedureFactoryImpl(author, configuration));
}
public RaceStateImpl(RaceLogResolver raceLogResolver, RaceLog raceLog, AbstractLogEventAuthor author, RaceLogEventFactory eventFactory,
public RaceStateImpl(RaceLogResolver raceLogResolver, RaceLog raceLog, AbstractLogEventAuthor author,
RacingProcedureFactory procedureFactory) {
this(raceLogResolver, raceLog, author, eventFactory, new RaceStatusAnalyzer.StandardClock(), procedureFactory);
this(raceLogResolver, raceLog, author, new RaceStatusAnalyzer.StandardClock(), procedureFactory);
}
private RaceStateImpl(RaceLogResolver raceLogResolver, RaceLog raceLog, AbstractLogEventAuthor author,
RaceLogEventFactory eventFactory, RaceStatusAnalyzer.Clock analyzersClock,
private RaceStateImpl(RaceLogResolver raceLogResolver, RaceLog raceLog, AbstractLogEventAuthor author, RaceStatusAnalyzer.Clock analyzersClock,
RacingProcedureFactory procedureFactory) {
super(raceLogResolver, raceLog, /* forRaceLogIdentifier */ null, analyzersClock, procedureFactory,
Collections.<SimpleRaceLogIdentifier, ReadonlyRaceState>emptyMap(), /* update */ true);
this.author = author;
this.factory = eventFactory;
}
@Override
@@ -107,7 +113,7 @@ public class RaceStateImpl extends ReadonlyRaceStateImpl implements RaceState {
@Override
public void setRacingProcedure(TimePoint timePoint, RacingProcedureType newType) {
raceLog.add(factory.createStartProcedureChangedEvent(timePoint, author, raceLog.getCurrentPassId(), newType));
raceLog.add(new RaceLogStartProcedureChangedEventImpl(timePoint, author, raceLog.getCurrentPassId(), newType));
}
@Override
@@ -115,7 +121,7 @@ public class RaceStateImpl extends ReadonlyRaceStateImpl implements RaceState {
RacingProcedurePrerequisite.FulfillmentFunction function = new RacingProcedurePrerequisite.FulfillmentFunction() {
@Override
public void execute() {
raceLog.add(factory.createStartTimeEvent(now, author, raceLog.getCurrentPassId(), startTime));
raceLog.add(new RaceLogStartTimeEventImpl(now, author, raceLog.getCurrentPassId(), startTime));
}
};
@@ -124,12 +130,12 @@ public class RaceStateImpl extends ReadonlyRaceStateImpl implements RaceState {
@Override
public void forceNewStartTime(TimePoint now, TimePoint startTime) {
raceLog.add(factory.createStartTimeEvent(now, author, raceLog.getCurrentPassId(), startTime));
raceLog.add(new RaceLogStartTimeEventImpl(now, author, raceLog.getCurrentPassId(), startTime));
}
@Override
public void requestNewDependentStartTime(final TimePoint now, final Duration startTimeDifference, final SimpleRaceLogIdentifier dependentRace, RaceLogResolver raceLogResolver, RacingProcedurePrerequisite.Resolver resolver) {
final RaceLogDependentStartTimeEvent dependentStartTimeEvent = factory.createDependentStartTimeEvent(now, author, raceLog.getCurrentPassId(), dependentRace, startTimeDifference);
final RaceLogDependentStartTimeEvent dependentStartTimeEvent = new RaceLogDependentStartTimeEventImpl(now, author, raceLog.getCurrentPassId(), dependentRace, startTimeDifference);
RacingProcedurePrerequisite.FulfillmentFunction function = new RacingProcedurePrerequisite.FulfillmentFunction() {
@Override
@@ -148,60 +154,60 @@ public class RaceStateImpl extends ReadonlyRaceStateImpl implements RaceState {
@Override
public void forceNewDependentStartTime(TimePoint now, final Duration startTimeDifference, final SimpleRaceLogIdentifier dependentOnRace) {
raceLog.add(factory.createDependentStartTimeEvent(now, author, raceLog.getCurrentPassId(), dependentOnRace, startTimeDifference));
raceLog.add(new RaceLogDependentStartTimeEventImpl(now, author, raceLog.getCurrentPassId(), dependentOnRace, startTimeDifference));
}
@Override
public void setFinishingTime(TimePoint timePoint) {
raceLog.add(factory.createRaceStatusEvent(timePoint, author, raceLog.getCurrentPassId(), RaceLogRaceStatus.FINISHING));
raceLog.add(new RaceLogRaceStatusEventImpl(timePoint, author, raceLog.getCurrentPassId(), RaceLogRaceStatus.FINISHING));
}
@Override
public void setFinishedTime(TimePoint timePoint) {
raceLog.add(factory.createRaceStatusEvent(timePoint, author, raceLog.getCurrentPassId(), RaceLogRaceStatus.FINISHED));
raceLog.add(new RaceLogRaceStatusEventImpl(timePoint, author, raceLog.getCurrentPassId(), RaceLogRaceStatus.FINISHED));
}
@Override
public void setProtestTime(TimePoint now, TimePoint timePoint) {
raceLog.add(factory.createProtestStartTimeEvent(now, author, raceLog.getCurrentPassId(), timePoint));
raceLog.add(new RaceLogProtestStartTimeEventImpl(now, author, raceLog.getCurrentPassId(), timePoint));
}
@Override
public void setAdvancePass(TimePoint timePoint) {
raceLog.add(factory.createPassChangeEvent(timePoint, author, raceLog.getCurrentPassId() + 1));
raceLog.add(new RaceLogPassChangeEventImpl(timePoint, author, raceLog.getCurrentPassId() + 1));
}
@Override
public void setAborted(TimePoint timePoint, boolean isPostponed, Flags reasonFlag) {
Flags markerFlag = isPostponed ? Flags.AP : Flags.NOVEMBER;
raceLog.add(factory.createFlagEvent(timePoint, author, raceLog.getCurrentPassId(), markerFlag, reasonFlag, true));
raceLog.add(new RaceLogFlagEventImpl(timePoint, author, raceLog.getCurrentPassId(), markerFlag, reasonFlag, true));
}
@Override
public void setGeneralRecall(TimePoint timePoint) {
raceLog.add(factory.createFlagEvent(timePoint, author, raceLog.getCurrentPassId(), Flags.FIRSTSUBSTITUTE, Flags.NONE, true));
raceLog.add(new RaceLogFlagEventImpl(timePoint, author, raceLog.getCurrentPassId(), Flags.FIRSTSUBSTITUTE, Flags.NONE, true));
}
@Override
public void setFinishPositioningListChanged(TimePoint timePoint, CompetitorResults positionedCompetitors) {
raceLog.add(factory.createFinishPositioningListChangedEvent(
raceLog.add(new RaceLogFinishPositioningListChangedEventImpl(
timePoint, author, raceLog.getCurrentPassId(), positionedCompetitors));
}
@Override
public void setFinishPositioningConfirmed(TimePoint timePoint) {
raceLog.add(factory.createFinishPositioningConfirmedEvent(
raceLog.add(new RaceLogFinishPositioningConfirmedEventImpl(
timePoint, author, raceLog.getCurrentPassId(), getFinishPositioningList()));
}
@Override
public void setCourseDesign(TimePoint timePoint, CourseBase courseDesign) {
raceLog.add(factory.createCourseDesignChangedEvent(timePoint, author, raceLog.getCurrentPassId(), courseDesign));
raceLog.add(new RaceLogCourseDesignChangedEventImpl(timePoint, author, raceLog.getCurrentPassId(), courseDesign));
}
@Override
public void setWindFix(TimePoint timePoint, Wind wind, boolean isMagnetic) {
raceLog.add(factory.createWindFixEvent(timePoint, author, raceLog.getCurrentPassId(), wind, isMagnetic));
raceLog.add(new RaceLogWindFixEventImpl(timePoint, author, raceLog.getCurrentPassId(), wind, isMagnetic));
}
@Override
@@ -209,7 +215,7 @@ public class RaceStateImpl extends ReadonlyRaceStateImpl implements RaceState {
final RaceLogAdditionalScoringInformationEvent event = new AdditionalScoringInformationFinder(raceLog).analyze(/*filterBy*/informationType);
if (enable) {
if (event == null) {
raceLog.add(factory.createAdditionalScoringInformationEvent(timePoint, UUID.randomUUID(), author, raceLog.getCurrentPassId(), informationType));
raceLog.add(new RaceLogAdditionalScoringInformationEventImpl(timePoint, author, raceLog.getCurrentPassId(), informationType));
}
} else {
if (event != null) {
@@ -6,7 +6,6 @@ import java.util.Collections;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
import com.sap.sailing.domain.abstractlog.race.state.RaceStateEvent;
import com.sap.sailing.domain.abstractlog.race.state.impl.RaceStateEventImpl;
@@ -25,9 +24,9 @@ import com.sap.sse.common.TimePoint;
public class BasicRacingProcedureImpl extends BaseRacingProcedure {
public BasicRacingProcedureImpl(RaceLog raceLog, AbstractLogEventAuthor author, RaceLogEventFactory factory,
public BasicRacingProcedureImpl(RaceLog raceLog, AbstractLogEventAuthor author,
RacingProcedureConfiguration configuration, RaceLogResolver raceLogResolver) {
super(raceLog, author, factory, configuration, raceLogResolver);
super(raceLog, author, configuration, raceLogResolver);
}
@Override
@@ -6,7 +6,6 @@ import java.util.Collections;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.FinishingTimeFinder;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
import com.sap.sailing.domain.abstractlog.race.state.RaceStateEvent;
@@ -33,13 +32,13 @@ public class ESSRacingProcedureImpl extends BaseRacingProcedure implements ESSRa
private final static long startPhaseESSThreeUpInterval = 3 * 60 * 1000; // minutes * seconds * milliseconds
private final static long startPhaseESSTwoUpInterval = 2 * 60 * 1000; // minutes * seconds * milliseconds
private final static long startPhaseESSOneUpInterval = 1 * 60 * 1000; // minutes * seconds * milliseconds
@SuppressWarnings("unused")
private final ESSConfiguration configuration;
public ESSRacingProcedureImpl(RaceLog raceLog, AbstractLogEventAuthor author,
RaceLogEventFactory factory, ESSConfiguration configuration, RaceLogResolver raceLogResolver) {
super(raceLog, author, factory, configuration, raceLogResolver);
public ESSRacingProcedureImpl(RaceLog raceLog, AbstractLogEventAuthor author, ESSConfiguration configuration,
RaceLogResolver raceLogResolver) {
super(raceLog, author, configuration, raceLogResolver);
this.configuration = configuration;
update();
}
@@ -48,7 +47,7 @@ public class ESSRacingProcedureImpl extends BaseRacingProcedure implements ESSRa
public RacingProcedureType getType() {
return RacingProcedureType.ESS;
}
@Override
public RacingProcedurePrerequisite checkPrerequisitesForStart(TimePoint now, TimePoint startTime,
FulfillmentFunction function) {
@@ -66,12 +65,11 @@ public class ESSRacingProcedureImpl extends BaseRacingProcedure implements ESSRa
@Override
protected Collection<RaceStateEvent> createStartStateEvents(TimePoint startTime) {
return Arrays.<RaceStateEvent> asList(
new RaceStateEventImpl(startTime.minus(startPhaseAPDownInterval), RaceStateEvents.ESS_AP_DOWN),
new RaceStateEventImpl(startTime.minus(startPhaseESSThreeUpInterval), RaceStateEvents.ESS_THREE_UP),
new RaceStateEventImpl(startTime.minus(startPhaseESSTwoUpInterval), RaceStateEvents.ESS_TWO_UP),
new RaceStateEventImpl(startTime.minus(startPhaseESSOneUpInterval), RaceStateEvents.ESS_ONE_UP),
new RaceStateEventImpl(startTime, RaceStateEvents.START));
return Arrays.<RaceStateEvent> asList(new RaceStateEventImpl(startTime.minus(startPhaseAPDownInterval),
RaceStateEvents.ESS_AP_DOWN), new RaceStateEventImpl(startTime.minus(startPhaseESSThreeUpInterval),
RaceStateEvents.ESS_THREE_UP), new RaceStateEventImpl(startTime.minus(startPhaseESSTwoUpInterval),
RaceStateEvents.ESS_TWO_UP), new RaceStateEventImpl(startTime.minus(startPhaseESSOneUpInterval),
RaceStateEvents.ESS_ONE_UP), new RaceStateEventImpl(startTime, RaceStateEvents.START));
}
@Override
@@ -91,62 +89,51 @@ public class ESSRacingProcedureImpl extends BaseRacingProcedure implements ESSRa
@Override
public FlagPoleState getActiveFlags(TimePoint startTime, TimePoint now) {
if (now.before(startTime.minus(startPhaseAPDownInterval))) {
return new FlagPoleState(
Arrays.asList(new FlagPole(Flags.AP, true), new FlagPole(Flags.ESSTHREE, false)), null,
Arrays.asList(new FlagPole(Flags.AP, false), new FlagPole(Flags.ESSTHREE, false)),
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.AP, true), new FlagPole(Flags.ESSTHREE, false)),
null, Arrays.asList(new FlagPole(Flags.AP, false), new FlagPole(Flags.ESSTHREE, false)),
startTime.minus(startPhaseAPDownInterval));
} else if (now.before(startTime.minus(startPhaseESSThreeUpInterval))) {
return new FlagPoleState(
Arrays.asList(new FlagPole(Flags.AP, false), new FlagPole(Flags.ESSTHREE, false)),
startTime.minus(startPhaseAPDownInterval),
Arrays.asList(new FlagPole(Flags.ESSTHREE, true), new FlagPole(Flags.ESSTWO, false)),
startTime.minus(startPhaseESSThreeUpInterval));
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.AP, false), new FlagPole(Flags.ESSTHREE, false)),
startTime.minus(startPhaseAPDownInterval), Arrays.asList(new FlagPole(Flags.ESSTHREE, true),
new FlagPole(Flags.ESSTWO, false)), startTime.minus(startPhaseESSThreeUpInterval));
} else if (now.before(startTime.minus(startPhaseESSTwoUpInterval))) {
return new FlagPoleState(
Arrays.asList(new FlagPole(Flags.ESSTHREE, true), new FlagPole(Flags.ESSTWO, false)),
startTime.minus(startPhaseESSThreeUpInterval),
Arrays.asList(new FlagPole(Flags.ESSTWO, true), new FlagPole(Flags.ESSONE, false)),
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.ESSTHREE, true),
new FlagPole(Flags.ESSTWO, false)), startTime.minus(startPhaseESSThreeUpInterval), Arrays.asList(
new FlagPole(Flags.ESSTWO, true), new FlagPole(Flags.ESSONE, false)),
startTime.minus(startPhaseESSTwoUpInterval));
} else if (now.before(startTime.minus(startPhaseESSOneUpInterval))) {
return new FlagPoleState(
Arrays.asList(new FlagPole(Flags.ESSTWO, true), new FlagPole(Flags.ESSONE, false)),
startTime.minus(startPhaseESSTwoUpInterval),
Arrays.asList(new FlagPole(Flags.ESSONE, true)),
startTime.minus(startPhaseESSTwoUpInterval), Arrays.asList(new FlagPole(Flags.ESSONE, true)),
startTime.minus(startPhaseESSOneUpInterval));
} if (now.before(startTime)) {
return new FlagPoleState(
Arrays.asList(new FlagPole(Flags.ESSONE, true)),
startTime.minus(startPhaseESSOneUpInterval),
Arrays.asList(new FlagPole(Flags.ESSONE, false)),
}
if (now.before(startTime)) {
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.ESSONE, true)),
startTime.minus(startPhaseESSOneUpInterval), Arrays.asList(new FlagPole(Flags.ESSONE, false)),
startTime);
} else {
if (isIndividualRecallDisplayed(now)) {
return new FlagPoleState(
Arrays.asList(new FlagPole(Flags.XRAY, true)),
getIndividualRecallDisplayedTime(),
Arrays.asList(new FlagPole(Flags.XRAY, false)),
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.XRAY, true)),
getIndividualRecallDisplayedTime(), Arrays.asList(new FlagPole(Flags.XRAY, false)),
getIndividualRecallRemovalTime());
} else if (isFinished(now)) {
return new FlagPoleState(
Arrays.asList(new FlagPole(Flags.BLUE, false)), getFinishedTime());
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.BLUE, false)), getFinishedTime());
} else if (isInFinishingPhase(now)) {
return new FlagPoleState(
Arrays.asList(new FlagPole(Flags.BLUE, true)),
getFinishingTime(),
Arrays.asList(new FlagPole(Flags.BLUE, false)),
null);
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.BLUE, true)), getFinishingTime(),
Arrays.asList(new FlagPole(Flags.BLUE, false)), null);
} else {
TimePoint recallRemoved = getIndividualRecallRemovalTime();
return new FlagPoleState(Collections.<FlagPole>emptyList(), recallRemoved == null ? startTime : recallRemoved);
return new FlagPoleState(Collections.<FlagPole> emptyList(), recallRemoved == null ? startTime
: recallRemoved);
}
}
}
@Override
protected RacingProcedureChangedListeners<? extends RacingProcedureChangedListener> createChangedListenerContainer() {
return new ESSChangedListeners();
}
@Override
protected ESSChangedListeners getChangedListeners() {
return (ESSChangedListeners) super.getChangedListeners();
@@ -156,7 +143,7 @@ public class ESSRacingProcedureImpl extends BaseRacingProcedure implements ESSRa
public void addChangedListener(ESSChangedListener listener) {
getChangedListeners().add(listener);
}
@Override
public TimePoint getTimeLimit(TimePoint startTime) {
TimePoint firstBoatTime = new FinishingTimeFinder(raceLog).analyze();
@@ -165,12 +152,12 @@ public class ESSRacingProcedureImpl extends BaseRacingProcedure implements ESSRa
}
return null;
}
@Override
protected boolean hasIndividualRecallByDefault() {
return true;
}
@Override
public ESSConfiguration getConfiguration() {
return (ESSConfiguration) super.getConfiguration();
@@ -5,11 +5,12 @@ import java.util.Collection;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
import com.sap.sailing.domain.abstractlog.race.RaceLogGateLineOpeningTimeEvent.GateLineOpeningTimes;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.GateLineOpeningTimeFinder;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.PathfinderFinder;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogGateLineOpeningTimeEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogPathfinderEventImpl;
import com.sap.sailing.domain.abstractlog.race.state.RaceStateEvent;
import com.sap.sailing.domain.abstractlog.race.state.ReadonlyRaceState;
import com.sap.sailing.domain.abstractlog.race.state.impl.RaceStateEventImpl;
@@ -43,14 +44,15 @@ public class GateStartRacingProcedureImpl extends BaseRacingProcedure implements
private boolean gateLineOpeningTimesHasBeenSet;
private String cachedPathfinder;
public GateStartRacingProcedureImpl(RaceLog raceLog, AbstractLogEventAuthor author, RaceLogEventFactory factory,
public GateStartRacingProcedureImpl(RaceLog raceLog, AbstractLogEventAuthor author,
GateStartConfiguration configuration, RaceLogResolver raceLogResolver) {
super(raceLog, author, factory, configuration, raceLogResolver);
super(raceLog, author, configuration, raceLogResolver);
this.gateLineOpeningTimeAnalyzer = new GateLineOpeningTimeFinder(raceLog);
this.pathfinderAnalyzer = new PathfinderFinder(raceLog);
long defaultGolfDownTime = getDefaultGolfDownTime();
this.cachedGateLineOpeningTimes = new GateLineOpeningTimes(GateStartRacingProcedure.DefaultGateLaunchStopTime, defaultGolfDownTime);
this.cachedGateLineOpeningTimes = new GateLineOpeningTimes(GateStartRacingProcedure.DefaultGateLaunchStopTime,
defaultGolfDownTime);
this.gateLineOpeningTimesHasBeenSet = false;
update();
@@ -78,7 +80,8 @@ public class GateStartRacingProcedureImpl extends BaseRacingProcedure implements
public RacingProcedurePrerequisite checkPrerequisitesForStart(TimePoint now, TimePoint startTime,
FulfillmentFunction function) {
if (startTime.before(now)) {
if (getConfiguration().hasPathfinder() != null && getConfiguration().hasPathfinder() && getPathfinder() == null) {
if (getConfiguration().hasPathfinder() != null && getConfiguration().hasPathfinder()
&& getPathfinder() == null) {
return new PathfinderPrerequisite(function, this, now, startTime);
} else if (!gateLineOpeningTimesHasBeenSet) {
return new GateLaunchTimePrerequisite(function, this, now, startTime, getDefaultGolfDownTime());
@@ -125,8 +128,8 @@ public class GateStartRacingProcedureImpl extends BaseRacingProcedure implements
switch (event.getEventName()) {
case START:
if (!gateLineOpeningTimesHasBeenSet) {
setGateLineOpeningTimes(event.getTimePoint(),
cachedGateLineOpeningTimes.getGateLaunchStopTime(), cachedGateLineOpeningTimes.getGolfDownTime());
setGateLineOpeningTimes(event.getTimePoint(), cachedGateLineOpeningTimes.getGateLaunchStopTime(),
cachedGateLineOpeningTimes.getGolfDownTime());
}
rescheduleGateShutdownTime(event.getTimePoint());
return true;
@@ -147,35 +150,29 @@ public class GateStartRacingProcedureImpl extends BaseRacingProcedure implements
TimePoint gateShutdownTime = getGateShutdownTimePoint(startTime);
if (now.before(startTime.minus(startPhaseClassOverGolfUpIntervall))) {
return new FlagPoleState(Arrays.asList(new FlagPole(classFlag, Flags.GOLF, false), new FlagPole(Flags.PAPA,
false)), null, Arrays.asList(new FlagPole(classFlag, Flags.GOLF, true), new FlagPole(Flags.PAPA, false)),
startTime.minus(startPhaseClassOverGolfUpIntervall));
false)), null, Arrays.asList(new FlagPole(classFlag, Flags.GOLF, true), new FlagPole(Flags.PAPA,
false)), startTime.minus(startPhaseClassOverGolfUpIntervall));
} else if (now.before(startTime.minus(startPhasePapaUpInterval))) {
return new FlagPoleState(Arrays.asList(new FlagPole(classFlag, Flags.GOLF, true), new FlagPole(Flags.PAPA,
false)), startTime.minus(startPhaseClassOverGolfUpIntervall),
Arrays.asList(new FlagPole(classFlag, Flags.GOLF, true), new FlagPole(Flags.PAPA, true)),
startTime.minus(startPhasePapaUpInterval));
false)), startTime.minus(startPhaseClassOverGolfUpIntervall), Arrays.asList(new FlagPole(classFlag,
Flags.GOLF, true), new FlagPole(Flags.PAPA, true)), startTime.minus(startPhasePapaUpInterval));
} else if (now.before(startTime.minus(startPhasePapaDownInterval))) {
return new FlagPoleState(Arrays.asList(new FlagPole(classFlag, Flags.GOLF, true), new FlagPole(Flags.PAPA,
true)), startTime.minus(startPhasePapaUpInterval),
Arrays.asList(new FlagPole(classFlag, Flags.GOLF, true), new FlagPole(Flags.PAPA, false)),
startTime.minus(startPhasePapaDownInterval));
true)), startTime.minus(startPhasePapaUpInterval), Arrays.asList(new FlagPole(classFlag,
Flags.GOLF, true), new FlagPole(Flags.PAPA, false)), startTime.minus(startPhasePapaDownInterval));
} else if (now.before(startTime)) {
return new FlagPoleState(Arrays.asList(new FlagPole(classFlag, Flags.GOLF, true), new FlagPole(Flags.PAPA,
false)), startTime.minus(startPhasePapaDownInterval),
Arrays.asList(new FlagPole(classFlag, false), new FlagPole(Flags.GOLF, true)), startTime);
false)), startTime.minus(startPhasePapaDownInterval), Arrays.asList(new FlagPole(classFlag, false),
new FlagPole(Flags.GOLF, true)), startTime);
} else if (now.before(gateShutdownTime)) {
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.GOLF, true)), startTime,
Arrays.asList(new FlagPole(Flags.GOLF, false)), gateShutdownTime);
} else {
if (isFinished(now)) {
return new FlagPoleState(
Arrays.asList(new FlagPole(Flags.BLUE, false)), getFinishedTime());
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.BLUE, false)), getFinishedTime());
} else if (isInFinishingPhase(now)) {
return new FlagPoleState(
Arrays.asList(new FlagPole(Flags.BLUE, true)),
getFinishingTime(),
Arrays.asList(new FlagPole(Flags.BLUE, false)),
null);
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.BLUE, true)), getFinishingTime(),
Arrays.asList(new FlagPole(Flags.BLUE, false)), null);
} else {
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.GOLF, false)), gateShutdownTime);
}
@@ -204,7 +201,8 @@ public class GateStartRacingProcedureImpl extends BaseRacingProcedure implements
@Override
public void setGateLineOpeningTimes(TimePoint now, long gateLaunchStopTime, long golfDownTime) {
raceLog.add(factory.createGateLineOpeningTimeEvent(now, author, raceLog.getCurrentPassId(), gateLaunchStopTime, golfDownTime));
raceLog.add(new RaceLogGateLineOpeningTimeEventImpl(now, author, raceLog.getCurrentPassId(), gateLaunchStopTime,
golfDownTime));
}
@Override
@@ -214,7 +212,7 @@ public class GateStartRacingProcedureImpl extends BaseRacingProcedure implements
@Override
public void setPathfinder(TimePoint timePoint, String sailingId) {
raceLog.add(factory.createPathfinderEvent(timePoint, author, raceLog.getCurrentPassId(), sailingId));
raceLog.add(new RaceLogPathfinderEventImpl(timePoint, author, raceLog.getCurrentPassId(), sailingId));
}
@Override
@@ -8,7 +8,6 @@ import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogChangedListener;
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.FinishedTimeFinder;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.FinishingTimeFinder;
@@ -19,6 +18,7 @@ import com.sap.sailing.domain.abstractlog.race.analyzing.impl.IsInFinishingPhase
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.IsIndividualRecallDisplayedAnalyzer;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.StartTimeFinder;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFlagEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.WeakRaceLogChangedVisitor;
import com.sap.sailing.domain.abstractlog.race.state.RaceStateEvent;
import com.sap.sailing.domain.abstractlog.race.state.RaceStateEventScheduler;
@@ -52,7 +52,6 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
protected final RaceLog raceLog;
protected final AbstractLogEventAuthor author;
protected final RaceLogEventFactory factory;
private final RacingProcedureConfiguration configuration;
private final RacingProcedureChangedListeners<? extends RacingProcedureChangedListener> changedListeners;
@@ -66,7 +65,6 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
private boolean cachedIsIndividualRecallDisplayed;
/**
* When calling me, call {@link BaseRacingProcedure#update()} afterwards!
*
@@ -74,14 +72,13 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
* is required for a {@link StartTimeFinder} in order to make individual recall timeouts depend on start
* time rather than the time the individual recall was issued
*/
public BaseRacingProcedure(RaceLog raceLog, AbstractLogEventAuthor author, RaceLogEventFactory factory,
public BaseRacingProcedure(RaceLog raceLog, AbstractLogEventAuthor author,
RacingProcedureConfiguration configuration, RaceLogResolver raceLogResolver) {
if (configuration == null) {
throw new IllegalArgumentException("configuration must not be null");
}
this.raceLog = raceLog;
this.author = author;
this.factory = factory;
this.configuration = configuration;
this.changedListeners = createChangedListenerContainer();
this.isRecallDisplayedAnalyzer = new IsIndividualRecallDisplayedAnalyzer(raceLog);
@@ -94,18 +91,18 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
this.raceLog.addListener(this.raceLogListener);
this.cachedIsIndividualRecallDisplayed = false;
}
@Override
public void detach() {
raceLog.removeListener(raceLogListener);
changedListeners.removeAll();
}
@Override
public void addChangedListener(RacingProcedureChangedListener listener) {
changedListeners.addBaseListener(listener);
}
public void removeChangedListener(RacingProcedureChangedListener listener) {
changedListeners.remove(listener);
};
@@ -155,7 +152,7 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
}
return false;
}
@Override
public TimePoint getIndividualRecallDisplayedTime() {
if (hasIndividualRecall()) {
@@ -163,7 +160,7 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
}
return null;
}
@Override
public TimePoint getIndividualRecallRemovalTime() {
TimePoint displayed = getIndividualRecallDisplayedTime();
@@ -179,8 +176,11 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
if (raceStartTime != null) {
referenceTimePoint = raceStartTime;
} else {
logger.warning("An individual recall was set but we don't have a start time set for the race; using individual recall set time "+
displayed+" + timeout ("+individualRecallRemovalTimeout+") for implicit termination of individual recall");
logger.warning("An individual recall was set but we don't have a start time set for the race; using individual recall set time "
+ displayed
+ " + timeout ("
+ individualRecallRemovalTimeout
+ ") for implicit termination of individual recall");
referenceTimePoint = displayed;
}
return referenceTimePoint.plus(individualRecallRemovalTimeout);
@@ -190,12 +190,14 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
@Override
public void displayIndividualRecall(TimePoint displayTime) {
raceLog.add(factory.createFlagEvent(displayTime, author, raceLog.getCurrentPassId(), Flags.XRAY, Flags.NONE, true));
raceLog.add(new RaceLogFlagEventImpl(displayTime, author, raceLog.getCurrentPassId(), Flags.XRAY, Flags.NONE,
true));
}
@Override
public void removeIndividualRecall(TimePoint timePoint) {
raceLog.add(factory.createFlagEvent(timePoint, author, raceLog.getCurrentPassId(), Flags.XRAY, Flags.NONE, false));
raceLog.add(new RaceLogFlagEventImpl(timePoint, author, raceLog.getCurrentPassId(), Flags.XRAY, Flags.NONE,
false));
}
@Override
@@ -208,11 +210,11 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
return false;
}
}
@Override
public boolean hasIndividualRecall() {
return configuration.hasInidividualRecall() == null ?
hasIndividualRecallByDefault() : configuration.hasInidividualRecall();
return configuration.hasInidividualRecall() == null ? hasIndividualRecallByDefault() : configuration
.hasInidividualRecall();
}
protected abstract boolean hasIndividualRecallByDefault();
@@ -244,23 +246,23 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
unscheduleStateEvent(RaceStateEvents.INDIVIDUAL_RECALL_TIMEOUT);
scheduleStateEvents(new RaceStateEventImpl(removalTime, RaceStateEvents.INDIVIDUAL_RECALL_TIMEOUT));
}
protected void scheduleStateEvents(RaceStateEvent stateEvent) {
scheduleStateEvents(Arrays.asList(stateEvent));
}
protected void scheduleStateEvents(Collection<RaceStateEvent> stateEvents) {
if (scheduler != null) {
scheduler.scheduleStateEvents(stateEvents);
}
}
protected void unscheduleStateEvent(RaceStateEvents raceStateEventName) {
if (scheduler != null) {
scheduler.unscheduleStateEvent(raceStateEventName);
}
}
@Override
public RacingProcedureConfiguration getConfiguration() {
return configuration;
@@ -276,7 +278,7 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
scheduler.scheduleStateEvents(createStartStateEvents(state.getStartTime()));
}
}
@Override
public void onAdvancePass(ReadonlyRaceState state) {
unscheduleAllEvents();
@@ -288,21 +290,21 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
scheduler.unscheduleAllEvents();
}
}
protected boolean isFinished(TimePoint at) {
IsFinishedAnalyzer analyzer = new IsFinishedAnalyzer(raceLog, finishedTimeFinder, at);
return analyzer.analyze();
}
protected boolean isInFinishingPhase(TimePoint at) {
IsInFinishingPhaseAnalyzer analyzer = new IsInFinishingPhaseAnalyzer(raceLog, finishingTimeFinder, at);
return analyzer.analyze();
}
protected TimePoint getFinishingTime() {
return finishingTimeFinder.analyze();
}
protected TimePoint getFinishedTime() {
return finishedTimeFinder.analyze();
}
@@ -2,7 +2,6 @@ package com.sap.sailing.domain.abstractlog.race.state.racingprocedure.impl;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
import com.sap.sailing.domain.abstractlog.race.state.racingprocedure.RacingProcedureFactory;
import com.sap.sailing.domain.abstractlog.race.state.racingprocedure.ReadonlyRacingProcedure;
@@ -13,17 +12,15 @@ import com.sap.sailing.domain.common.racelog.RacingProcedureType;
public class RacingProcedureFactoryImpl extends ReadonlyRacingProcedureFactory implements RacingProcedureFactory {
private final AbstractLogEventAuthor author;
private final RaceLogEventFactory factory;
public RacingProcedureFactoryImpl(AbstractLogEventAuthor author, RaceLogEventFactory factory,
public RacingProcedureFactoryImpl(AbstractLogEventAuthor author,
ConfigurationLoader<RegattaConfiguration> configuration) {
super(configuration);
this.author = author;
this.factory = factory;
}
@Override
public ReadonlyRacingProcedure createRacingProcedure(RacingProcedureType type, RaceLog raceLog, RaceLogResolver raceLogResolver) {
return createProcedure(type, raceLog, author, factory, raceLogResolver);
return createProcedure(type, raceLog, author, raceLogResolver);
}
}
@@ -3,7 +3,6 @@ package com.sap.sailing.domain.abstractlog.race.state.racingprocedure.impl;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
import com.sap.sailing.domain.abstractlog.race.impl.NoAddingRaceLogWrapper;
import com.sap.sailing.domain.abstractlog.race.state.racingprocedure.RacingProcedure;
@@ -38,20 +37,20 @@ public class ReadonlyRacingProcedureFactory implements RacingProcedureFactory {
}
protected ReadonlyRacingProcedure createProcedure(RacingProcedureType type, RaceLog raceLog,
AbstractLogEventAuthor author, RaceLogEventFactory factory, RaceLogResolver raceLogResolver) {
AbstractLogEventAuthor author, RaceLogResolver raceLogResolver) {
RegattaConfiguration loadedConfiguration = configuration.load();
switch (type) {
case ESS:
return new ESSRacingProcedureImpl(raceLog, author, factory, loadedConfiguration.getESSConfiguration(), raceLogResolver);
return new ESSRacingProcedureImpl(raceLog, author, loadedConfiguration.getESSConfiguration(), raceLogResolver);
case GateStart:
return new GateStartRacingProcedureImpl(raceLog, author, factory,
return new GateStartRacingProcedureImpl(raceLog, author,
loadedConfiguration.getGateStartConfiguration(), raceLogResolver);
case RRS26:
return new RRS26RacingProcedureImpl(raceLog, author, factory, loadedConfiguration.getRRS26Configuration(), raceLogResolver);
return new RRS26RacingProcedureImpl(raceLog, author, loadedConfiguration.getRRS26Configuration(), raceLogResolver);
case BASIC:
return new BasicRacingProcedureImpl(raceLog, author, factory, loadedConfiguration.getBasicConfiguration(), raceLogResolver);
return new BasicRacingProcedureImpl(raceLog, author, loadedConfiguration.getBasicConfiguration(), raceLogResolver);
case LEAGUE:
return new LeagueRacingProcedureImpl(raceLog, author, factory, loadedConfiguration.getLeagueConfiguration(), raceLogResolver);
return new LeagueRacingProcedureImpl(raceLog, author, loadedConfiguration.getLeagueConfiguration(), raceLogResolver);
default:
throw new UnsupportedOperationException("Unknown racing procedure " + type.toString());
}
@@ -63,7 +62,7 @@ public class ReadonlyRacingProcedureFactory implements RacingProcedureFactory {
AbstractLogEventAuthor author = new LogEventAuthorImpl("Illegal Author", 128);
// Wrap the racelog to disable adding...
RaceLog wrappedRaceLog = new NoAddingRaceLogWrapper(raceLog);
return createProcedure(type, wrappedRaceLog, author, RaceLogEventFactory.INSTANCE, raceLogResolver);
return createProcedure(type, wrappedRaceLog, author, raceLogResolver);
}
}
@@ -6,7 +6,6 @@ import java.util.Collections;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
import com.sap.sailing.domain.abstractlog.race.state.RaceStateEvent;
import com.sap.sailing.domain.abstractlog.race.state.impl.RaceStateEventImpl;
@@ -34,8 +33,8 @@ public class LeagueRacingProcedureImpl extends BaseRacingProcedure implements Le
private final static Flags startmodeFlag = Flags.PAPA;
public LeagueRacingProcedureImpl(RaceLog raceLog, AbstractLogEventAuthor author,
RaceLogEventFactory factory, LeagueConfiguration configuration, RaceLogResolver raceLogResolver) {
super(raceLog, author, factory, configuration, raceLogResolver);
LeagueConfiguration configuration, RaceLogResolver raceLogResolver) {
super(raceLog, author, configuration, raceLogResolver);
update();
}
@@ -6,10 +6,10 @@ import java.util.Collections;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RRS26StartModeFlagFinder;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RacingProcedureTypeAnalyzer;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFlagEventImpl;
import com.sap.sailing.domain.abstractlog.race.state.RaceStateEvent;
import com.sap.sailing.domain.abstractlog.race.state.impl.RaceStateEventImpl;
import com.sap.sailing.domain.abstractlog.race.state.impl.RaceStateEvents;
@@ -40,8 +40,8 @@ public class RRS26RacingProcedureImpl extends BaseRacingProcedure implements RRS
private boolean startmodeFlagHasBeenSet;
public RRS26RacingProcedureImpl(RaceLog raceLog, AbstractLogEventAuthor author,
RaceLogEventFactory factory, RRS26Configuration configuration, RaceLogResolver raceLogResolver) {
super(raceLog, author, factory, configuration, raceLogResolver);
RRS26Configuration configuration, RaceLogResolver raceLogResolver) {
super(raceLog, author, configuration, raceLogResolver);
RacingProcedureTypeAnalyzer procedureAnalyzer = new RacingProcedureTypeAnalyzer(raceLog);
if (configuration.getStartModeFlags() != null) {
@@ -189,7 +189,7 @@ public class RRS26RacingProcedureImpl extends BaseRacingProcedure implements RRS
@Override
public void setStartModeFlag(TimePoint timePoint, Flags startMode) {
raceLog.add(factory.createFlagEvent(timePoint, author, raceLog.getCurrentPassId(), startMode, Flags.NONE, true));
raceLog.add(new RaceLogFlagEventImpl(timePoint, author, raceLog.getCurrentPassId(), startMode, Flags.NONE, true));
}
@Override
@@ -5,9 +5,9 @@ import java.io.Serializable;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogCloseOpenEndedDeviceMappingEvent;
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogCloseOpenEndedDeviceMappingEventImpl;
import com.sap.sailing.domain.abstractlog.shared.analyzing.OpenEndedDeviceMappingCloser;
import com.sap.sailing.domain.racelogtracking.DeviceMapping;
import com.sap.sse.common.TimePoint;
@@ -23,7 +23,7 @@ public class RaceLogOpenEndedDeviceMappingCloser extends
@Override
protected RaceLogCloseOpenEndedDeviceMappingEvent createCloseEvent(TimePoint logicalTimePoint,
Serializable eventToCloseId) {
return RaceLogEventFactory.INSTANCE.createCloseOpenEndedDeviceMappingEvent(
return new RaceLogCloseOpenEndedDeviceMappingEventImpl(
logicalTimePoint, author, getLog().getCurrentPassId(), eventToCloseId, closingTimePoint);
}
@@ -19,13 +19,19 @@ extends AbstractDeviceMappingEventImpl<RaceLogEventVisitor, ItemT> implements Ra
private static final long serialVersionUID = -5114645637316367845L;
private final RaceLogEventData raceLogEventData;
public AbstractRaceLogDeviceMappingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, int passId, ItemT mappedTo, DeviceIdentifier device,
public AbstractRaceLogDeviceMappingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
AbstractLogEventAuthor author, Serializable id, int passId, ItemT mappedTo, DeviceIdentifier device,
TimePoint from, TimePoint to) {
super(createdAt, author, logicalTimePoint, id, mappedTo, device, from, to);
super(createdAt, logicalTimePoint, author, id, mappedTo, device, from, to);
this.raceLogEventData = new RaceLogEventDataImpl(null, passId);
}
public AbstractRaceLogDeviceMappingEventImpl(TimePoint logicalTimePoint,
AbstractLogEventAuthor author, int passId, ItemT mappedTo, DeviceIdentifier device,
TimePoint from, TimePoint to) {
this(now(), logicalTimePoint, author, randId(), passId, mappedTo, device, from, to);
}
@Override
public int getPassId() {
return raceLogEventData.getPassId();
@@ -12,18 +12,24 @@ import com.sap.sailing.domain.abstractlog.shared.events.impl.BaseCloseOpenEndedD
import com.sap.sailing.domain.base.Competitor;
import com.sap.sse.common.TimePoint;
public class RaceLogCloseOpenEndedDeviceMappingEventImpl extends BaseCloseOpenEndedDeviceMappingEventImpl<RaceLogEventVisitor>
implements RaceLogCloseOpenEndedDeviceMappingEvent {
public class RaceLogCloseOpenEndedDeviceMappingEventImpl extends
BaseCloseOpenEndedDeviceMappingEventImpl<RaceLogEventVisitor> implements
RaceLogCloseOpenEndedDeviceMappingEvent {
private static final long serialVersionUID = -5114645637316367845L;
private final RaceLogEventData raceLogEventData;
public RaceLogCloseOpenEndedDeviceMappingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, int passId, Serializable deviceMappingEventId,
public RaceLogCloseOpenEndedDeviceMappingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
AbstractLogEventAuthor author, Serializable id, int passId, Serializable deviceMappingEventId,
TimePoint closingTimePoint) {
super(createdAt, author, logicalTimePoint, id, deviceMappingEventId, closingTimePoint);
super(createdAt, logicalTimePoint, author, id, deviceMappingEventId, closingTimePoint);
this.raceLogEventData = new RaceLogEventDataImpl(null, passId);
}
public RaceLogCloseOpenEndedDeviceMappingEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
int passId, Serializable deviceMappingEventId, TimePoint closingTimePoint) {
this(now(), logicalTimePoint, author, randId(), passId, deviceMappingEventId, closingTimePoint);
}
@Override
public int getPassId() {
return raceLogEventData.getPassId();
@@ -1,13 +1,11 @@
package com.sap.sailing.domain.abstractlog.race.tracking.impl;
import java.io.Serializable;
import java.util.Collections;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDefineMarkEvent;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.Mark;
import com.sap.sse.common.TimePoint;
@@ -16,11 +14,16 @@ public class RaceLogDefineMarkEventImpl extends RaceLogEventImpl implements Race
private final Mark mark;
public RaceLogDefineMarkEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
public RaceLogDefineMarkEventImpl(TimePoint createdAt, TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable pId, int pPassId, Mark mark) {
super(createdAt, author, logicalTimePoint, pId, Collections.<Competitor>emptyList(), pPassId);
super(createdAt, logicalTimePoint, author, pId, pPassId);
this.mark = mark;
}
public RaceLogDefineMarkEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
int pPassId, Mark mark) {
this(now(), logicalTimePoint, author, randId(), pPassId, mark);
}
@Override
public void accept(RaceLogEventVisitor visitor) {
@@ -1,34 +1,35 @@
package com.sap.sailing.domain.abstractlog.race.tracking.impl;
import java.io.Serializable;
import java.util.Collections;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDenoteForTrackingEvent;
import com.sap.sailing.domain.base.BoatClass;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sse.common.TimePoint;
public class RaceLogDenoteForTrackingEventImpl extends RaceLogEventImpl implements
RaceLogDenoteForTrackingEvent {
public class RaceLogDenoteForTrackingEventImpl extends RaceLogEventImpl implements RaceLogDenoteForTrackingEvent {
private static final long serialVersionUID = 6937741283401976385L;
private final String raceName;
private final BoatClass boatClass;
private final Serializable raceId;
public RaceLogDenoteForTrackingEventImpl(TimePoint createdAt,
AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable pId, int pPassId,
String raceName, BoatClass boatClass, Serializable raceId) {
super(createdAt, author, logicalTimePoint, pId, Collections.<Competitor>emptyList(), pPassId);
public RaceLogDenoteForTrackingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
AbstractLogEventAuthor author, Serializable pId, int pPassId, String raceName,
BoatClass boatClass, Serializable raceId) {
super(createdAt, logicalTimePoint, author, pId, pPassId);
this.raceName = raceName;
this.boatClass = boatClass;
this.raceId = raceId;
}
public RaceLogDenoteForTrackingEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
String raceName, BoatClass boatClass, Serializable raceId) {
this(now(), logicalTimePoint, author, randId(), pPassId, raceName, boatClass, raceId);
}
@Override
public void accept(RaceLogEventVisitor visitor) {
visitor.visit(this);
@@ -43,7 +44,7 @@ RaceLogDenoteForTrackingEvent {
public BoatClass getBoatClass() {
return boatClass;
}
@Override
public Serializable getRaceId() {
return raceId;
@@ -10,10 +10,16 @@ import com.sap.sailing.domain.racelogtracking.DeviceIdentifier;
import com.sap.sse.common.TimePoint;
public class RaceLogDeviceCompetitorMappingEventImpl extends AbstractRaceLogDeviceMappingEventImpl<Competitor>
implements RaceLogDeviceCompetitorMappingEvent {
public RaceLogDeviceCompetitorMappingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable pId, int pPassId, Competitor mappedTo, DeviceIdentifier device, TimePoint from, TimePoint to) {
super(createdAt, author, logicalTimePoint, pId, pPassId, mappedTo, device, from, to);
implements RaceLogDeviceCompetitorMappingEvent {
public RaceLogDeviceCompetitorMappingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
AbstractLogEventAuthor author, Serializable pId, int pPassId, Competitor mappedTo, DeviceIdentifier device,
TimePoint from, TimePoint to) {
super(createdAt, logicalTimePoint, author, pId, pPassId, mappedTo, device, from, to);
}
public RaceLogDeviceCompetitorMappingEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
int pPassId, Competitor mappedTo, DeviceIdentifier device, TimePoint from, TimePoint to) {
super(logicalTimePoint, author, pPassId, mappedTo, device, from, to);
}
private static final long serialVersionUID = -1494030544804758753L;
@@ -9,13 +9,19 @@ import com.sap.sailing.domain.base.Mark;
import com.sap.sailing.domain.racelogtracking.DeviceIdentifier;
import com.sap.sse.common.TimePoint;
public class RaceLogDeviceMarkMappingEventImpl extends AbstractRaceLogDeviceMappingEventImpl<Mark>
implements RaceLogDeviceMarkMappingEvent {
public class RaceLogDeviceMarkMappingEventImpl extends AbstractRaceLogDeviceMappingEventImpl<Mark> implements
RaceLogDeviceMarkMappingEvent {
private static final long serialVersionUID = -7223543830755457196L;
public RaceLogDeviceMarkMappingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable pId, int pPassId, Mark mappedTo, DeviceIdentifier device, TimePoint from, TimePoint to) {
super(createdAt, author, logicalTimePoint, pId, pPassId, mappedTo, device, from, to);
public RaceLogDeviceMarkMappingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
AbstractLogEventAuthor author, Serializable pId, int pPassId, Mark mappedTo, DeviceIdentifier device,
TimePoint from, TimePoint to) {
super(createdAt, logicalTimePoint, author, pId, pPassId, mappedTo, device, from, to);
}
public RaceLogDeviceMarkMappingEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
Mark mappedTo, DeviceIdentifier device, TimePoint from, TimePoint to) {
super(logicalTimePoint, author, pPassId, mappedTo, device, from, to);
}
@Override
@@ -22,13 +22,23 @@ public class RaceLogRegisterCompetitorEventImpl extends BaseRegisterCompetitorEv
* @throws IllegalArgumentException
* if {@code competitor} is null
*/
public RaceLogRegisterCompetitorEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, int passId, Competitor competitor)
public RaceLogRegisterCompetitorEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
AbstractLogEventAuthor author, Serializable id, int passId, Competitor competitor)
throws IllegalArgumentException {
super(createdAt, author, logicalTimePoint, id, competitor);
super(createdAt, logicalTimePoint, author, id, competitor);
this.raceLogEventData = new RaceLogEventDataImpl(null, passId);
}
/**
* @throws IllegalArgumentException
* if {@code competitor} is null
*/
public RaceLogRegisterCompetitorEventImpl(TimePoint logicalTimePoint,
AbstractLogEventAuthor author, int passId, Competitor competitor)
throws IllegalArgumentException {
this(now(), logicalTimePoint, author, randId(), passId, competitor);
}
@Override
public int getPassId() {
return raceLogEventData.getPassId();
@@ -1,22 +1,25 @@
package com.sap.sailing.domain.abstractlog.race.tracking.impl;
import java.io.Serializable;
import java.util.Collections;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogEventImpl;
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogStartTrackingEvent;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sse.common.TimePoint;
public class RaceLogStartTrackingEventImpl extends RaceLogEventImpl implements
RaceLogStartTrackingEvent {
private static final long serialVersionUID = 6017954368580125221L;
public RaceLogStartTrackingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable pId, int pPassId) {
super(createdAt, author, logicalTimePoint, pId, Collections.<Competitor>emptyList(), pPassId);
public RaceLogStartTrackingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
AbstractLogEventAuthor author, Serializable pId, int pPassId) {
super(createdAt, logicalTimePoint, author, pId, pPassId);
}
public RaceLogStartTrackingEventImpl(TimePoint logicalTimePoint,
AbstractLogEventAuthor author, int pPassId) {
super(logicalTimePoint, author, pPassId);
}
@@ -15,7 +15,13 @@ implements RegattaLogCloseOpenEndedDeviceMappingEvent {
public RegattaLogCloseOpenEndedDeviceMappingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, Serializable deviceMappingEventId,
TimePoint closingTimePoint) {
super(createdAt, author, logicalTimePoint, id, deviceMappingEventId, closingTimePoint);
super(createdAt, logicalTimePoint, author, id, deviceMappingEventId, closingTimePoint);
}
public RegattaLogCloseOpenEndedDeviceMappingEventImpl(AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable deviceMappingEventId,
TimePoint closingTimePoint) {
super(logicalTimePoint, author, deviceMappingEventId, closingTimePoint);
}
@Override
@@ -10,11 +10,19 @@ import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.racelogtracking.DeviceIdentifier;
import com.sap.sse.common.TimePoint;
public class RegattaLogDeviceCompetitorMappingEventImpl extends AbstractDeviceMappingEventImpl<RegattaLogEventVisitor, Competitor>
implements RegattaLogDeviceCompetitorMappingEvent {
public RegattaLogDeviceCompetitorMappingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
Serializable pId, Competitor mappedTo, DeviceIdentifier device, TimePoint from, TimePoint to) {
super(createdAt, author, logicalTimePoint, pId, mappedTo, device, from, to);
public class RegattaLogDeviceCompetitorMappingEventImpl extends
AbstractDeviceMappingEventImpl<RegattaLogEventVisitor, Competitor> implements
RegattaLogDeviceCompetitorMappingEvent {
public RegattaLogDeviceCompetitorMappingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
AbstractLogEventAuthor author, Serializable pId, Competitor mappedTo, DeviceIdentifier device,
TimePoint from, TimePoint to) {
super(createdAt, logicalTimePoint, author, pId, mappedTo, device, from, to);
}
public RegattaLogDeviceCompetitorMappingEventImpl(TimePoint logicalTimePoint,
AbstractLogEventAuthor author, Competitor mappedTo, DeviceIdentifier device,
TimePoint from, TimePoint to) {
super(logicalTimePoint, author, mappedTo, device, from, to);
}
private static final long serialVersionUID = -1494030544804758753L;
@@ -14,9 +14,14 @@ public class RegattaLogDeviceMarkMappingEventImpl extends AbstractDeviceMappingE
implements RegattaLogDeviceMarkMappingEvent {
private static final long serialVersionUID = -7223543830755457196L;
public RegattaLogDeviceMarkMappingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
public RegattaLogDeviceMarkMappingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable pId, Mark mappedTo, DeviceIdentifier device, TimePoint from, TimePoint to) {
super(createdAt, author, logicalTimePoint, pId, mappedTo, device, from, to);
super(createdAt, logicalTimePoint, author, pId, mappedTo, device, from, to);
}
public RegattaLogDeviceMarkMappingEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Mark mappedTo, DeviceIdentifier device, TimePoint from, TimePoint to) {
super(logicalTimePoint, author, mappedTo, device, from, to);
}
@Override
@@ -17,9 +17,18 @@ public class RegattaLogRegisterCompetitorEventImpl extends BaseRegisterCompetito
* @throws IllegalArgumentException
* if {@code competitor} is null
*/
public RegattaLogRegisterCompetitorEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, Competitor competitor) throws IllegalArgumentException {
super(createdAt, author, logicalTimePoint, id, competitor);
public RegattaLogRegisterCompetitorEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
AbstractLogEventAuthor author, Serializable id, Competitor competitor) throws IllegalArgumentException {
super(createdAt, logicalTimePoint, author, id, competitor);
}
/**
* @throws IllegalArgumentException
* if {@code competitor} is null
*/
public RegattaLogRegisterCompetitorEventImpl(TimePoint logicalTimePoint,
AbstractLogEventAuthor author, Competitor competitor) throws IllegalArgumentException {
super(logicalTimePoint, author, competitor);
}
@Override
@@ -12,10 +12,10 @@ import com.sap.sse.common.TimePoint;
public class RegattaLogRevokeEventImpl extends RevokeEventImpl<RegattaLogEventVisitor> implements RegattaLogRevokeEvent {
private static final long serialVersionUID = -3470191515219206588L;
public RegattaLogRevokeEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
public RegattaLogRevokeEventImpl(TimePoint createdAt, TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable pId, Serializable revokedEventId, String revokedEventType, String revokedEventShortInfo,
String reason) {
super(createdAt, author, logicalTimePoint, pId, revokedEventId, revokedEventType, revokedEventShortInfo, reason);
super(createdAt, logicalTimePoint, author, pId, revokedEventId, revokedEventType, revokedEventShortInfo, reason);
}
public RegattaLogRevokeEventImpl(AbstractLogEventAuthor author, RegattaLogEvent toRevoke, String reason) {
@@ -15,9 +15,9 @@ public abstract class RegattaLogSetCompetitorHandicapInfoEventImpl extends Abstr
private final Competitor competitor;
protected RegattaLogSetCompetitorHandicapInfoEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable pId, Competitor competitor) {
super(createdAt, author, logicalTimePoint, pId);
protected RegattaLogSetCompetitorHandicapInfoEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
AbstractLogEventAuthor author, Serializable pId, Competitor competitor) {
super(createdAt, logicalTimePoint, author, pId);
this.competitor = competitor;
}
@@ -16,9 +16,9 @@ public class RegattaLogSetCompetitorTimeOnDistanceAllowancePerNauticalMileEventI
private final Duration timeOnDistanceAllowancePerNauticalMile;
public RegattaLogSetCompetitorTimeOnDistanceAllowancePerNauticalMileEventImpl(TimePoint createdAt,
AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable pId, Competitor competitor,
TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable pId, Competitor competitor,
Duration timeOnDistanceAllowancePerNauticalMile) {
super(createdAt, author, logicalTimePoint, pId, competitor);
super(createdAt, logicalTimePoint, author, pId, competitor);
this.timeOnDistanceAllowancePerNauticalMile = timeOnDistanceAllowancePerNauticalMile;
}
@@ -12,9 +12,9 @@ public class RegattaLogSetCompetitorTimeOnTimeFactorEventImpl extends RegattaLog
private static final long serialVersionUID = -7891407213804859604L;
private final Double timeOnTimeFactor;
public RegattaLogSetCompetitorTimeOnTimeFactorEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable pId, Competitor competitor, Double timeOnTimeFactor) {
super(createdAt, author, logicalTimePoint, pId, competitor);
public RegattaLogSetCompetitorTimeOnTimeFactorEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
AbstractLogEventAuthor author, Serializable pId, Competitor competitor, Double timeOnTimeFactor) {
super(createdAt, logicalTimePoint, author, pId, competitor);
this.timeOnTimeFactor = timeOnTimeFactor;
}
@@ -1,7 +1,6 @@
package com.sap.sailing.domain.abstractlog.regatta.tracking.analyzing.impl;
import java.io.Serializable;
import java.util.UUID;
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
import com.sap.sailing.domain.abstractlog.regatta.RegattaLog;
@@ -12,7 +11,6 @@ import com.sap.sailing.domain.abstractlog.regatta.events.impl.RegattaLogCloseOpe
import com.sap.sailing.domain.abstractlog.shared.analyzing.OpenEndedDeviceMappingCloser;
import com.sap.sailing.domain.racelogtracking.DeviceMapping;
import com.sap.sse.common.TimePoint;
import com.sap.sse.common.impl.MillisecondsTimePoint;
public class RegattaLogOpenEndedDeviceMappingCloser extends
OpenEndedDeviceMappingCloser<RegattaLog, RegattaLogEvent, RegattaLogEventVisitor, RegattaLogCloseOpenEndedDeviceMappingEvent> {
@@ -25,7 +23,7 @@ public class RegattaLogOpenEndedDeviceMappingCloser extends
@Override
protected RegattaLogCloseOpenEndedDeviceMappingEvent createCloseEvent(TimePoint logicalTimePoint,
Serializable eventToCloseId) {
return new RegattaLogCloseOpenEndedDeviceMappingEventImpl(MillisecondsTimePoint.now(), author,
logicalTimePoint, UUID.randomUUID(), eventToCloseId, closingTimePoint);
return new RegattaLogCloseOpenEndedDeviceMappingEventImpl(author,
logicalTimePoint, eventToCloseId, closingTimePoint);
}
}
@@ -18,16 +18,22 @@ DeviceMappingEvent<VisitorT, ItemType> {
private final TimePoint from;
private final TimePoint to;
public AbstractDeviceMappingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable id, ItemType mappedTo,
public AbstractDeviceMappingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
AbstractLogEventAuthor author, Serializable id, ItemType mappedTo,
DeviceIdentifier device, TimePoint from, TimePoint to) {
super(createdAt, author, logicalTimePoint, id);
super(createdAt, logicalTimePoint, author, id);
this.mappedTo = mappedTo;
this.device = device;
this.from = from;
this.to = to;
}
public AbstractDeviceMappingEventImpl(TimePoint logicalTimePoint,
AbstractLogEventAuthor author, ItemType mappedTo,
DeviceIdentifier device, TimePoint from, TimePoint to) {
this(now(), logicalTimePoint, author, randId(), mappedTo, device, from, to);
}
public ItemType getMappedTo() {
return mappedTo;
}
@@ -8,20 +8,24 @@ import com.sap.sailing.domain.abstractlog.shared.events.CloseOpenEndedDeviceMapp
import com.sap.sse.common.TimePoint;
public abstract class BaseCloseOpenEndedDeviceMappingEventImpl<VisitorT> extends AbstractLogEventImpl<VisitorT>
implements CloseOpenEndedDeviceMappingEvent<VisitorT> {
implements CloseOpenEndedDeviceMappingEvent<VisitorT> {
private static final long serialVersionUID = -2401732623610224918L;
private final Serializable deviceMappingEventId;
private final TimePoint closingTimePoint;
public BaseCloseOpenEndedDeviceMappingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
TimePoint logicalTimePoint, Serializable pId, Serializable deviceMappingEventId,
TimePoint closingTimePoint) {
super(createdAt, author, logicalTimePoint, pId);
public BaseCloseOpenEndedDeviceMappingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
AbstractLogEventAuthor author, Serializable pId, Serializable deviceMappingEventId, TimePoint closingTimePoint) {
super(createdAt, logicalTimePoint, author, pId);
this.deviceMappingEventId = deviceMappingEventId;
this.closingTimePoint = closingTimePoint;
}
public BaseCloseOpenEndedDeviceMappingEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
Serializable deviceMappingEventId, TimePoint closingTimePoint) {
this(now(), logicalTimePoint, author, randId(), deviceMappingEventId, closingTimePoint);
}
@Override
public Serializable getDeviceMappingEventId() {
return deviceMappingEventId;
Loaded 100 of 945 files, more files were not shown because too many files have changed in this diff. Show more