каскадное изменение конфигураций в случае удаления группы
This commit is contained in:
6
.idea/workspace.xml
generated
6
.idea/workspace.xml
generated
@@ -8,14 +8,8 @@
|
|||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/StartSelectedDVMConfigurations.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/StartSelectedDVMConfigurations.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SynchronizeTests.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SynchronizeTests.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ServerObjectsCache/ConfigurationCache.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ServerObjectsCache/ConfigurationCache.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ServerObjectsCache/VisualCaches.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ServerObjectsCache/VisualCaches.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Configuration/Configuration.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Configuration/Configuration.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Configuration/Configuration.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Configuration/Configuration.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingServer.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingServer.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestsDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestsDatabase.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/TestingForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/TestingForm.java" afterDir="false" />
|
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ import _VisualDVM.TestingSystem.Common.Settings.Json.SettingsArrayJson;
|
|||||||
import _VisualDVM.TestingSystem.Common.Settings.Settings;
|
import _VisualDVM.TestingSystem.Common.Settings.Settings;
|
||||||
import _VisualDVM.TestingSystem.Common.Test.Json.TestsJson;
|
import _VisualDVM.TestingSystem.Common.Test.Json.TestsJson;
|
||||||
import _VisualDVM.TestingSystem.Common.Test.Test;
|
import _VisualDVM.TestingSystem.Common.Test.Test;
|
||||||
import _VisualDVM.Utils;
|
|
||||||
import com.sun.org.glassfish.gmbal.Description;
|
import com.sun.org.glassfish.gmbal.Description;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public class Configuration extends riDBObject {
|
public class Configuration extends riDBObject {
|
||||||
//конфигурация = данные для пакета.
|
//конфигурация = данные для пакета.
|
||||||
@@ -98,6 +98,22 @@ public class Configuration extends riDBObject {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
public boolean tryDeleteGroup(Group group) {
|
||||||
|
boolean flag = false;
|
||||||
|
ConfigurationCache unpacked = new ConfigurationCache(this);
|
||||||
|
List<GroupJson> actualGroups = new Vector<>();
|
||||||
|
for (GroupJson groupJson : unpacked.groupsJson.array) {
|
||||||
|
if (groupJson.id == group.id)
|
||||||
|
flag = true;
|
||||||
|
else actualGroups.add(groupJson);
|
||||||
|
}
|
||||||
|
if (flag) {
|
||||||
|
unpacked.groupsJson.array = actualGroups;
|
||||||
|
packedGroupsJson = Utils_.gson.toJson(unpacked.groupsJson);
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
public void updateTest(Test test){
|
public void updateTest(Test test){
|
||||||
ConfigurationCache unpacked = new ConfigurationCache(this);
|
ConfigurationCache unpacked = new ConfigurationCache(this);
|
||||||
|
|||||||
@@ -137,6 +137,19 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
Utils_.forceDeleteWithCheck(group_test.getArchive());
|
Utils_.forceDeleteWithCheck(group_test.getArchive());
|
||||||
Utils_.forceDeleteWithCheck(group_test.getServerPath());
|
Utils_.forceDeleteWithCheck(group_test.getServerPath());
|
||||||
}
|
}
|
||||||
|
//--
|
||||||
|
//-
|
||||||
|
for (DVMConfiguration dvmConfiguration : db.dvmConfigurations.Data.values()) {
|
||||||
|
if (dvmConfiguration.tryDeleteGroup(group)){
|
||||||
|
db.Update(dvmConfiguration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (SapforConfiguration sapforConfiguration : db.sapforConfigurations.Data.values()) {
|
||||||
|
if (sapforConfiguration.tryDeleteGroup(group)){
|
||||||
|
db.Update(sapforConfiguration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//--
|
||||||
} else if (object instanceof ServerSapfor) {
|
} else if (object instanceof ServerSapfor) {
|
||||||
Utils_.forceDeleteWithCheck(
|
Utils_.forceDeleteWithCheck(
|
||||||
new File(
|
new File(
|
||||||
|
|||||||
Reference in New Issue
Block a user