mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-07 11:32:16 +00:00
bug5178: fixed review remarks
This commit is contained in:
1 parent
a479374f81
commit
64eefb6271
19 files changed
+206
-381
No files matched your search
-12
@@ -146,18 +146,6 @@ public interface SharedSailingData extends ReplicableWithObjectInputStream<Repli
|
||||
|
||||
void deleteMarkProperties(MarkProperties markProperties);
|
||||
|
||||
/**
|
||||
* deletes the mark role
|
||||
* @param markRole mark role object which is being deleted
|
||||
*/
|
||||
void deleteMarkRole(MarkRole markRole);
|
||||
|
||||
/**
|
||||
* deletes the mark template
|
||||
* @param markTemplate mark template object which is being deleted
|
||||
*/
|
||||
void deleteMarkTemplate(MarkTemplate markTemplate);
|
||||
|
||||
void deleteCourseTemplate(CourseTemplate courseTemplate);
|
||||
|
||||
Iterable<MarkProperties> getAllMarkProperties();
|
||||
|
||||
-4
@@ -33,10 +33,6 @@ public interface ReplicatingSharedSailingData extends SharedSailingData {
|
||||
|
||||
Void internalDeleteMarkProperties(UUID markPropertiesUUID);
|
||||
|
||||
Void internalDeleteMarkTemplate(UUID markPropertiesUUID);
|
||||
|
||||
Void internalDeleteMarkRole(UUID markRoleUUID);
|
||||
|
||||
Void internalDeleteCourseTemplate(UUID courseTemplateUUID);
|
||||
|
||||
Void internalRecordUsage(UUID markTemplateId, UUID markPropertiesId);
|
||||
|
||||
+1
-37
@@ -46,8 +46,6 @@ import com.sap.sailing.shared.server.operations.CreateMarkRoleOperation;
|
||||
import com.sap.sailing.shared.server.operations.CreateMarkTemplateOperation;
|
||||
import com.sap.sailing.shared.server.operations.DeleteCourseTemplateOperation;
|
||||
import com.sap.sailing.shared.server.operations.DeleteMarkPropertiesOperation;
|
||||
import com.sap.sailing.shared.server.operations.DeleteMarkRoleOperation;
|
||||
import com.sap.sailing.shared.server.operations.DeleteMarkTemplateOperation;
|
||||
import com.sap.sailing.shared.server.operations.RecordUsageForMarkRoleOperation;
|
||||
import com.sap.sailing.shared.server.operations.RecordUsageForMarkTemplateOperation;
|
||||
import com.sap.sailing.shared.server.operations.SetPositioningInformationForMarkPropertiesOperation;
|
||||
@@ -202,7 +200,7 @@ public class SharedSailingDataImpl implements ReplicatingSharedSailingData, Clea
|
||||
});
|
||||
return getMarkRoleById(idOfNewMarkRole);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Void internalCreateMarkRole(UUID idOfNewMarkRole, String name, String shortName) {
|
||||
final MarkRole markRole = new MarkRoleImpl(idOfNewMarkRole, name, shortName);
|
||||
@@ -551,40 +549,6 @@ public class SharedSailingDataImpl implements ReplicatingSharedSailingData, Clea
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMarkTemplate(MarkTemplate markTemplate) {
|
||||
final UUID id = markTemplate.getId();
|
||||
getSecurityService().checkPermissionAndDeleteOwnershipForObjectRemoval(markTemplate,
|
||||
() -> apply(new DeleteMarkTemplateOperation(id)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void internalDeleteMarkTemplate(UUID markTemplateUUID) {
|
||||
if (this.markTemplatesById.remove(markTemplateUUID) != null) {
|
||||
mongoObjectFactory.removeMarkTemplate(markTemplateUUID);
|
||||
} else {
|
||||
throw new NullPointerException(String.format("Did not find a mark template with ID %s", markTemplateUUID));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMarkRole(final MarkRole markRole) {
|
||||
final UUID id = markRole.getId();
|
||||
getSecurityService().checkPermissionAndDeleteOwnershipForObjectRemoval(markRole,
|
||||
() -> apply(new DeleteMarkRoleOperation(id)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void internalDeleteMarkRole(UUID markRoleUUID) {
|
||||
if (this.markRolesById.remove(markRoleUUID) != null) {
|
||||
mongoObjectFactory.removeMarkRole(markRoleUUID);
|
||||
} else {
|
||||
throw new NullPointerException(String.format("Did not find a mark role with ID %s", markRoleUUID));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteCourseTemplate(CourseTemplate courseTemplate) {
|
||||
final UUID id = courseTemplate.getId();
|
||||
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
package com.sap.sailing.shared.server.operations;
|
||||
|
||||
import com.sap.sailing.shared.server.impl.ReplicatingSharedSailingData;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class DeleteMarkRoleOperation implements SharedSailingDataOperation<Void> {
|
||||
private static final long serialVersionUID = 6069375751925606420L;
|
||||
private final UUID markRoleUUID;
|
||||
|
||||
public DeleteMarkRoleOperation(UUID markRoleUUID) {
|
||||
this.markRoleUUID = markRoleUUID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void internalApplyTo(ReplicatingSharedSailingData toState) throws Exception {
|
||||
toState.internalDeleteMarkRole(markRoleUUID);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
package com.sap.sailing.shared.server.operations;
|
||||
|
||||
import com.sap.sailing.shared.server.impl.ReplicatingSharedSailingData;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class DeleteMarkTemplateOperation implements SharedSailingDataOperation<Void> {
|
||||
private static final long serialVersionUID = 4157045245768162929L;
|
||||
private final UUID markTemplateUUID;
|
||||
|
||||
public DeleteMarkTemplateOperation(UUID markTemplateUUID) {
|
||||
this.markTemplateUUID = markTemplateUUID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void internalApplyTo(ReplicatingSharedSailingData toState) throws Exception {
|
||||
toState.internalDeleteMarkTemplate(markTemplateUUID);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user