рефакторинг. прописал стандартную проверку существования объекта в бд сервера
This commit is contained in:
12
.idea/workspace.xml
generated
12
.idea/workspace.xml
generated
@@ -7,21 +7,9 @@
|
|||||||
</component>
|
</component>
|
||||||
<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 afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMConfigurationGroup/DVMConfigurationGroup.java" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMConfigurationGroup/DVMConfigurationGroupsDBTable.java" afterDir="false" />
|
|
||||||
<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/ComponentsServer/ComponentsServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/ComponentsServer.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/ComponentsServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/ComponentsServer.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DeleteUserAccount.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DeleteUserAccount.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/EditUserAccount.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/EditUserAccount.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishUserAccount.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishUserAccount.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/Server/DeleteServerObject.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/Server/DeleteServerObject.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/Server/EditServerObject.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/Server/EditServerObject.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/Server/PublishServerObject.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/Server/PublishServerObject.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/Server/ServerObjectPass.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/Server/ServerObjectPass.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/RepositoryServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/RepositoryServer.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/RepositoryServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/RepositoryServer.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/ServerCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/ServerCode.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Test/Test.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Test/Test.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" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import _VisualDVM.ComponentsServer.BugReport.Json.BugReportAdditionJson;
|
|||||||
import _VisualDVM.ComponentsServer.Component.ComponentType;
|
import _VisualDVM.ComponentsServer.Component.ComponentType;
|
||||||
import _VisualDVM.ComponentsServer.Component.Json.ComponentPublicationInfoJson;
|
import _VisualDVM.ComponentsServer.Component.Json.ComponentPublicationInfoJson;
|
||||||
import _VisualDVM.ComponentsServer.Component.Json.ComponentVersionsInfoJson;
|
import _VisualDVM.ComponentsServer.Component.Json.ComponentVersionsInfoJson;
|
||||||
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspace;
|
|
||||||
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||||
import _VisualDVM.Constants;
|
import _VisualDVM.Constants;
|
||||||
@@ -25,7 +24,6 @@ import org.apache.commons.io.FileUtils;
|
|||||||
import java.io.BufferedWriter;
|
import java.io.BufferedWriter;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
import java.io.Serializable;
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -133,14 +131,13 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
}
|
}
|
||||||
void AppendBugReportField() throws Exception {
|
void AppendBugReportField() throws Exception {
|
||||||
BugReportAdditionJson transport = (BugReportAdditionJson) request.object;
|
BugReportAdditionJson transport = (BugReportAdditionJson) request.object;
|
||||||
if (db.bugReports.containsKey(transport.id)) {
|
checkExistense(transport.id, BugReport.class);
|
||||||
BugReport actual = db.bugReports.get(transport.id);
|
BugReport actual = db.bugReports.get(transport.id);
|
||||||
Field field = BugReport.class.getField(transport.fieldName);
|
Field field = BugReport.class.getField(transport.fieldName);
|
||||||
field.set(actual, field.get(actual) + "\n" + transport.textAddition);
|
field.set(actual, field.get(actual) + "\n" + transport.textAddition);
|
||||||
actual.change_date = new Date().getTime();
|
actual.change_date = new Date().getTime();
|
||||||
db.Update(actual);
|
db.Update(actual);
|
||||||
response.object = actual;
|
response.object = actual;
|
||||||
} else throw new RepositoryRefuseException("Баг репорт с ключом " + transport.id + " не существует.");
|
|
||||||
}
|
}
|
||||||
void ReceiveAllArchives() throws Exception {
|
void ReceiveAllArchives() throws Exception {
|
||||||
ZipFolderPass zip = new ZipFolderPass();
|
ZipFolderPass zip = new ZipFolderPass();
|
||||||
@@ -159,13 +156,11 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
}
|
}
|
||||||
void UpdateBugReport() throws Exception {
|
void UpdateBugReport() throws Exception {
|
||||||
BugReport oldBugReport = (BugReport) request.object;
|
BugReport oldBugReport = (BugReport) request.object;
|
||||||
if (db.bugReports.containsKey(oldBugReport.id)) {
|
checkExistense(oldBugReport.id, BugReport.class);
|
||||||
BugReport bugReport = db.bugReports.get(oldBugReport.id);
|
BugReport bugReport = db.bugReports.get(oldBugReport.id);
|
||||||
bugReport.SynchronizeFields(oldBugReport);
|
bugReport.SynchronizeFields(oldBugReport);
|
||||||
bugReport.change_date = new Date().getTime();
|
bugReport.change_date = new Date().getTime();
|
||||||
db.Update(bugReport);
|
db.Update(bugReport);
|
||||||
} else
|
|
||||||
throw new RepositoryRefuseException("Баг репорт с ключом " + oldBugReport.id + " не существует.");
|
|
||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
void GetComponentsBackUps() throws Exception {
|
void GetComponentsBackUps() throws Exception {
|
||||||
|
|||||||
@@ -377,6 +377,17 @@ public abstract class RepositoryServer<D extends Database> {
|
|||||||
public Database getDb() {
|
public Database getDb() {
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
|
public void checkExistense(Database database, Object pk, Class d_class) throws Exception {
|
||||||
|
if (!database.getTable(d_class).containsKey(pk))
|
||||||
|
throw new RepositoryRefuseException(
|
||||||
|
database.getTable(d_class).getSingleDescription()+
|
||||||
|
" с ключом "+
|
||||||
|
Utils_.Brackets(pk.toString())+
|
||||||
|
" не существует");
|
||||||
|
}
|
||||||
|
public void checkExistense(Object pk, Class d_class) throws Exception {
|
||||||
|
checkExistense(db, pk, d_class);
|
||||||
|
}
|
||||||
//-------------
|
//-------------
|
||||||
void publishObject_(Database database, DBObject dbObject) throws Exception {
|
void publishObject_(Database database, DBObject dbObject) throws Exception {
|
||||||
beforePublishAction(dbObject);
|
beforePublishAction(dbObject);
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
public void StartAction() throws Exception {
|
public void StartAction() throws Exception {
|
||||||
try {
|
try {
|
||||||
//--
|
//--
|
||||||
// db.Patch();
|
// db.Patch();
|
||||||
//--
|
//--
|
||||||
machines_db = new MachinesDatabase();
|
machines_db = new MachinesDatabase();
|
||||||
machines_db.Activate();
|
machines_db.Activate();
|
||||||
@@ -143,15 +143,12 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
@Override
|
@Override
|
||||||
protected void afterCloneAction(riDBObject src, riDBObject dst) throws Exception {
|
protected void afterCloneAction(riDBObject src, riDBObject dst) throws Exception {
|
||||||
if (src instanceof SapforSettings) {
|
if (src instanceof SapforSettings) {
|
||||||
Vector<PassCode> codes = new Vector<>();
|
SapforSettings sapforSettings = (SapforSettings) src;
|
||||||
for (SapforSettingsCommand command : db.sapforSettingsCommands.Data.values())
|
for (SapforSettingsCommand src_command : db.getVectorByFK(sapforSettings, SapforSettingsCommand.class)) {
|
||||||
if (command.sapforsettings_id == src.id) codes.add(command.passCode);
|
SapforSettingsCommand dst_command = new SapforSettingsCommand();
|
||||||
//--
|
dst_command.sapforsettings_id = dst.id;
|
||||||
for (PassCode code : codes) {
|
dst_command.passCode = src_command.passCode;
|
||||||
SapforSettingsCommand command = new SapforSettingsCommand();
|
db.Insert(dst_command);
|
||||||
command.sapforsettings_id = dst.id;
|
|
||||||
command.passCode = code;
|
|
||||||
db.Insert(command);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -291,9 +288,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
}
|
}
|
||||||
void PerformAutoSapforTesting() throws Exception {
|
void PerformAutoSapforTesting() throws Exception {
|
||||||
int sapforId = Integer.parseInt(request.arg);
|
int sapforId = Integer.parseInt(request.arg);
|
||||||
if (!db.serverSapfors.containsKey(sapforId)) {
|
checkExistense(sapforId, ServerSapfor.class);
|
||||||
throw new RepositoryRefuseException("Версия SAPFOR " + sapforId + " не существует.");
|
|
||||||
}
|
|
||||||
ServerSapfor sapfor = db.serverSapfors.get(sapforId);
|
ServerSapfor sapfor = db.serverSapfors.get(sapforId);
|
||||||
TextLog Log = new TextLog();
|
TextLog Log = new TextLog();
|
||||||
SapforPackage autoPackage = tryAutoSapforTesting(sapfor, Log);
|
SapforPackage autoPackage = tryAutoSapforTesting(sapfor, Log);
|
||||||
@@ -310,16 +305,14 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
}
|
}
|
||||||
void DownloadTest() throws Exception {
|
void DownloadTest() throws Exception {
|
||||||
int test_id = Integer.parseInt(request.arg);
|
int test_id = Integer.parseInt(request.arg);
|
||||||
if (db.tests.containsKey(test_id)) {
|
checkExistense(test_id, Test.class);
|
||||||
Test test = db.tests.get(test_id);
|
Test test = db.tests.get(test_id);
|
||||||
File archive = new File(Global.TempDirectory, Utils_.getDateName(String.valueOf(test.id)));
|
File archive = new File(Global.TempDirectory, Utils_.getDateName(String.valueOf(test.id)));
|
||||||
ZipFolderPass zipFolderPass = new ZipFolderPass();
|
ZipFolderPass zipFolderPass = new ZipFolderPass();
|
||||||
if (!zipFolderPass.Do(test.getServerPath().getAbsolutePath(), archive.getAbsolutePath()))
|
if (!zipFolderPass.Do(test.getServerPath().getAbsolutePath(), archive.getAbsolutePath()))
|
||||||
throw new RepositoryRefuseException("Не удалось заархивировать тест");
|
throw new RepositoryRefuseException("Не удалось заархивировать тест");
|
||||||
response = new ServerExchangeUnit_2021(ServerCode.OK, "", Utils_.fileToBytes(archive));
|
response = new ServerExchangeUnit_2021(ServerCode.OK, "", Utils_.fileToBytes(archive));
|
||||||
FileUtils.forceDelete(archive);
|
FileUtils.forceDelete(archive);
|
||||||
} else
|
|
||||||
throw new RepositoryRefuseException("Теста с именем " + request.arg + " не существует");
|
|
||||||
}
|
}
|
||||||
void ReceiveTestsDatabase() throws Exception {
|
void ReceiveTestsDatabase() throws Exception {
|
||||||
response.object = Utils_.fileToBytes(db.getFile());
|
response.object = Utils_.fileToBytes(db.getFile());
|
||||||
@@ -449,8 +442,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
Vector<Integer> ids = (Vector<Integer>) request.object;
|
Vector<Integer> ids = (Vector<Integer>) request.object;
|
||||||
Vector<Pair<Integer, Pair<byte[], byte[]>>> res = new Vector<>();
|
Vector<Pair<Integer, Pair<byte[], byte[]>>> res = new Vector<>();
|
||||||
for (int dvmPackage_id : ids) {
|
for (int dvmPackage_id : ids) {
|
||||||
if (!db.dvmPackages.containsKey(dvmPackage_id))
|
checkExistense(dvmPackage_id, DVMPackage.class);
|
||||||
throw new RepositoryRefuseException("Не найдено пакета тестирования DVM с ключом " + dvmPackage_id);
|
|
||||||
DVMPackage dvmPackage = db.dvmPackages.get(dvmPackage_id);
|
DVMPackage dvmPackage = db.dvmPackages.get(dvmPackage_id);
|
||||||
File workspace = dvmPackage.getLocalWorkspace();
|
File workspace = dvmPackage.getLocalWorkspace();
|
||||||
File results_zip = new File(workspace, "results.zip");
|
File results_zip = new File(workspace, "results.zip");
|
||||||
@@ -461,8 +453,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
}
|
}
|
||||||
void DownloadSapforPackage() throws Exception {
|
void DownloadSapforPackage() throws Exception {
|
||||||
int sapforPackage_id = (int) request.object;
|
int sapforPackage_id = (int) request.object;
|
||||||
if (!db.sapforPackages.containsKey(sapforPackage_id))
|
checkExistense(sapforPackage_id, SapforPackage.class);
|
||||||
throw new RepositoryRefuseException("Не найдено пакета тестирования SAPFOR с ключом " + sapforPackage_id);
|
|
||||||
SapforPackage sapforPackage = db.sapforPackages.get(sapforPackage_id);
|
SapforPackage sapforPackage = db.sapforPackages.get(sapforPackage_id);
|
||||||
File workspace = sapforPackage.getLocalWorkspace();
|
File workspace = sapforPackage.getLocalWorkspace();
|
||||||
File results_zip = Utils.getTempFileName("results");
|
File results_zip = Utils.getTempFileName("results");
|
||||||
@@ -544,25 +535,6 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void GetSapforActualVersion() throws Exception {
|
|
||||||
File versionFile = new File(Global.TempDirectory, "version.h");
|
|
||||||
if (versionFile.exists())
|
|
||||||
FileUtils.forceDelete(versionFile);
|
|
||||||
//1. Получить версию из репозитория.
|
|
||||||
Utils.startScript(Global.TempDirectory,
|
|
||||||
Global.TempDirectory,
|
|
||||||
"get_version",
|
|
||||||
"wget --user dvmhuser --password dvmh2013 -P " +
|
|
||||||
Utils_.DQuotes(Global.TempDirectory.getAbsolutePath()) +
|
|
||||||
" http://svn.dvm-system.org/svn/dvmhrepo/sapfor/experts/Sapfor_2017/_src/Utils/version.h"
|
|
||||||
).waitFor();
|
|
||||||
if (!versionFile.exists())
|
|
||||||
throw new RepositoryRefuseException("Не удалось загрузить текущую версию SAPFOR из репозитория!");
|
|
||||||
int current_version = Sapfor.readVersionFromCode(versionFile);
|
|
||||||
int max_installed_version = db.getInstalledSapforMaxVersion();
|
|
||||||
if (max_installed_version == current_version)
|
|
||||||
throw new RepositoryRefuseException("Версия " + max_installed_version + " уже установлена");
|
|
||||||
}
|
|
||||||
//---
|
//---
|
||||||
int getSapforActualVersion() throws Exception {
|
int getSapforActualVersion() throws Exception {
|
||||||
File versionFile = new File(Global.TempDirectory, "version.h");
|
File versionFile = new File(Global.TempDirectory, "version.h");
|
||||||
@@ -651,10 +623,8 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
String[] packed = request.arg.split("\n");
|
String[] packed = request.arg.split("\n");
|
||||||
int groupId = Integer.parseInt(packed[0]);
|
int groupId = Integer.parseInt(packed[0]);
|
||||||
int packageId = Integer.parseInt(packed[1]);
|
int packageId = Integer.parseInt(packed[1]);
|
||||||
if (!db.sapforPackages.containsKey(packageId))
|
checkExistense(packageId, SapforPackage.class);
|
||||||
throw new RepositoryRefuseException("Пакета с ключом " + packageId + " не существует!");
|
checkExistense(groupId, Group.class);
|
||||||
if (!db.groups.containsKey(groupId))
|
|
||||||
throw new RepositoryRefuseException("Группы с ключом " + groupId + " не существует!");
|
|
||||||
//--
|
//--
|
||||||
SapforPackage sapforPackage = db.sapforPackages.get(packageId);
|
SapforPackage sapforPackage = db.sapforPackages.get(packageId);
|
||||||
Group group = db.groups.get(groupId);
|
Group group = db.groups.get(groupId);
|
||||||
@@ -692,7 +662,6 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
}
|
}
|
||||||
//создание тестов.
|
//создание тестов.
|
||||||
ServerSapfor serverSapfor = db.serverSapfors.getLastDoneVersion();
|
ServerSapfor serverSapfor = db.serverSapfors.getLastDoneVersion();
|
||||||
Vector<Test> tests = new Vector<>();
|
|
||||||
for (String name : versions.keySet()) {
|
for (String name : versions.keySet()) {
|
||||||
File src = versions.get(name);
|
File src = versions.get(name);
|
||||||
File[] files = src.listFiles(pathname -> !pathname.isDirectory());
|
File[] files = src.listFiles(pathname -> !pathname.isDirectory());
|
||||||
@@ -725,7 +694,6 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
FileUtils.forceDelete(testProject);
|
FileUtils.forceDelete(testProject);
|
||||||
FileUtils.copyDirectory(src, testProject);
|
FileUtils.copyDirectory(src, testProject);
|
||||||
//---
|
//---
|
||||||
tests.add(test);
|
|
||||||
db.DetectTestMinMaxDim(serverSapfor, group, test);
|
db.DetectTestMinMaxDim(serverSapfor, group, test);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -734,9 +702,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
Pair<DVMPackage, byte[]> p = (Pair<DVMPackage, byte[]>) request.object;
|
Pair<DVMPackage, byte[]> p = (Pair<DVMPackage, byte[]>) request.object;
|
||||||
DVMPackage src = p.getKey();
|
DVMPackage src = p.getKey();
|
||||||
byte[] packed_file = p.getValue();
|
byte[] packed_file = p.getValue();
|
||||||
//todo написать стандартное исключение на несуществование объекта с ключом
|
checkExistense(src.id, DVMPackage.class);
|
||||||
if (!db.dvmPackages.containsKey(src.id))
|
|
||||||
throw new RepositoryRefuseException("не существует пакета с ключом " + src.id);
|
|
||||||
DVMPackage dst = db.dvmPackages.get(src.id);
|
DVMPackage dst = db.dvmPackages.get(src.id);
|
||||||
dst.SynchronizeFields(src);
|
dst.SynchronizeFields(src);
|
||||||
db.Update(dst);
|
db.Update(dst);
|
||||||
@@ -745,8 +711,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
void DetectTestsMinMaxDim() throws Exception {
|
void DetectTestsMinMaxDim() throws Exception {
|
||||||
Vector<Object> keys = (Vector<Object>) request.object;
|
Vector<Object> keys = (Vector<Object>) request.object;
|
||||||
for (Object key : keys) {
|
for (Object key : keys) {
|
||||||
if (!db.tests.containsKey(key))
|
checkExistense(key, Test.class);
|
||||||
throw new RepositoryRefuseException("не существует пакета с ключом " + key);
|
|
||||||
}
|
}
|
||||||
ServerSapfor serverSapfor = db.serverSapfors.getLastDoneVersion();
|
ServerSapfor serverSapfor = db.serverSapfors.getLastDoneVersion();
|
||||||
for (Object key : keys) {
|
for (Object key : keys) {
|
||||||
@@ -757,8 +722,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
}
|
}
|
||||||
void GetDVMPackageCredentials() throws Exception {
|
void GetDVMPackageCredentials() throws Exception {
|
||||||
int package_id = (int) request.object;
|
int package_id = (int) request.object;
|
||||||
if (!db.dvmPackages.containsKey(package_id))
|
checkExistense(package_id,DVMPackage.class);
|
||||||
throw new RepositoryRefuseException("Не найден пакет с ключом " + Utils_.Brackets(package_id));
|
|
||||||
DVMPackageCredentials res = machines_db.dvmPackagesCredentials.getForPackageId(package_id);
|
DVMPackageCredentials res = machines_db.dvmPackagesCredentials.getForPackageId(package_id);
|
||||||
if (res == null)
|
if (res == null)
|
||||||
throw new RepositoryRefuseException("Не найдено учетных данных для пакета " + Utils_.Brackets(package_id));
|
throw new RepositoryRefuseException("Не найдено учетных данных для пакета " + Utils_.Brackets(package_id));
|
||||||
|
|||||||
Reference in New Issue
Block a user