bug5311: added JSON (de-)serializers for MasterDataImportResult and DataImportProgress and use them in SailingServerImpl

This commit is contained in:
Axel Uhl
2021-08-20 15:00:57 +02:00
parent 372c692e45
commit 225678ba29
19 changed files with 486 additions and 84 deletions
@@ -7,3 +7,5 @@ Bundle-Vendor: SAP
Automatic-Module-Name: com.sap.sailing.server.gateway.interface
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: com.sap.sailing.server.gateway.interfaces
Import-Package: com.sap.sailing.domain.common,
com.sap.sse.common
@@ -1,5 +1,23 @@
package com.sap.sailing.server.gateway.interfaces;
public interface MasterDataImportResult {
import java.util.UUID;
import com.sap.sse.common.NamedWithUUID;
public interface MasterDataImportResult {
interface LeaderboardGroupWithEventIds extends NamedWithUUID {
Iterable<UUID> getEventIds();
}
Iterable<LeaderboardGroupWithEventIds> getLeaderboardGroupsImported();
String getRemoteServerUrl();
boolean isOverride();
boolean isImportWind();
boolean isImportDeviceConfigurations();
boolean isImportTrackedRacesAndStartTracking();
}
@@ -1,9 +1,12 @@
package com.sap.sailing.server.gateway.interfaces;
import java.net.URL;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import com.sap.sailing.domain.common.DataImportProgress;
/**
* Represents a remote instance of a server process running the Sailing Analytics and exposes various methods as a
* convenient Java API which are implemented using the remote server's REST API. In short, this is a Java facade for a
@@ -13,15 +16,29 @@ import java.util.UUID;
* Objects of this type manage authentication information required for executing its methods as part of their immutable
* state, therefore at object construction time. Authentication information may be provided in the form of
* username/password which can then be used to obtain a bearer token for remote access. Or the bearer token for the
* server can be provided explicitly. Or, as the default, the constructor checks whether running in the scope of
* an authenticated session and then uses that session user's bearer token, assuming that the server to be represented
* by this object shares its security service with the server where this object is constructed.<p>
* server can be provided explicitly. Or, as the default, the constructor checks whether running in the scope of an
* authenticated session and then uses that session user's bearer token, assuming that the server to be represented by
* this object shares its security service with the server where this object is constructed.
* <p>
*/
public interface SailingServer {
URL getBaseUrl();
Iterable<UUID> getLeaderboardGroupIds() throws Exception;
Iterable<UUID> getEventIds() throws Exception;
MasterDataImportResult importMasterData(SailingServer from, Iterable<UUID> leaderboardGroupIds);
CompareServersResult compareServers(SailingServer a, Optional<SailingServer> b);
void addRemoteServerReference(SailingServer referencedServer, Optional<Set<UUID>> eventIds);
void removeRemoteServerReference(SailingServer referencedServer, Optional<Set<UUID>> eventIds);
MasterDataImportResult importMasterData(SailingServer from, Iterable<UUID> leaderboardGroupIds, boolean override,
boolean compress, boolean exportWind, boolean exportDeviceConfigs,
boolean exportTrackedRacesAndStartTracking, Optional<UUID> progressTrackingUuid) throws Exception;
DataImportProgress getMasterDataImportProgress(UUID progressTrackingUuid) throws Exception;
CompareServersResult compareServers(SailingServer a, Optional<SailingServer> b) throws Exception;
void addRemoteServerReference(SailingServer referencedServer, Optional<Set<UUID>> eventIds) throws Exception;
void removeRemoteServerReference(SailingServer referencedServer, Optional<Set<UUID>> eventIds) throws Exception;
String getBearerToken();
}