no message

This commit is contained in:
2025-02-14 01:22:50 +03:00
parent 245ed7c5f0
commit 6d9bd4bc9b
4 changed files with 84 additions and 88 deletions

9
.idea/workspace.xml generated
View File

@@ -7,14 +7,9 @@
</component>
<component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/src/Common/Visual/Tables/RendererLongCell.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/ServerRequestUnit.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/ServerRequestUnit.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Test/UI/TestDialog.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Test/UI/TestDialog.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Test/UI/TestFields.form" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Test/UI/TestFields.form" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Test/UI/TestFields.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Test/UI/TestFields.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Test/UI/TestsForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Test/UI/TestsForm.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Repository/RepositoryServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Repository/RepositoryServer.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/ComponentsServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/ComponentsServer.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>
<option name="SHOW_DIALOG" value="false" />

View File

@@ -81,7 +81,7 @@ public abstract class RepositoryServer<D extends Database> {
}
//-DVMTestingChecker
public abstract int getPort();
protected abstract void Session() throws Exception;
protected abstract void SafeSession() throws Exception;
protected void startAdditionalThreads() {
}
public void ActivateDB() {
@@ -229,7 +229,7 @@ public abstract class RepositoryServer<D extends Database> {
CloneObject();
break;
default:
Session();
SafeSession();
break;
}
} catch (Exception ex) {

View File

@@ -190,20 +190,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
//--
} else throw new RepositoryRefuseException("Внутренняя ошибка. Не удалось распаковать проект");
}
void GetComponentsVersionsInfo() throws Exception {
Vector<String> types = (Vector<String>) request.object;
Vector<ComponentVersionsInfoJson> res = new Vector<>();
for (String sType : types) {
ComponentType componentType = ComponentType.valueOf(sType);
File actualVersionFile = Paths.get(Utils_.getHomePath(), "Components", sType, "version.txt").toFile();
File minimalVersionFile = Paths.get(Utils_.getHomePath(), "Components", sType, "minimal_version.txt").toFile();
ComponentVersionsInfoJson info = new ComponentVersionsInfoJson(componentType);
info.actual_version = Utils_.removeCharacters(Utils.ReadAllText(actualVersionFile), "\n", "\r");
info.minimal_version = Utils_.removeCharacters(Utils.ReadAllText(minimalVersionFile), "\n", "\r");
res.add(info);
}
response.object = res;
}
void AppendBugReportField() throws Exception {
BugReportAdditionJson transport = (BugReportAdditionJson) request.object;
if (db.bugReports.containsKey(transport.id)) {
@@ -215,6 +201,71 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
response.object = actual;
} else throw new RepositoryRefuseException("Баг репорт с ключом " + transport.id + " не существует.");
}
void ReceiveAllArchives() throws Exception {
ZipFolderPass zip = new ZipFolderPass();
File archives = new File(Utils_.getDateName("Bugs"));
if (zip.Do("Bugs", archives.getAbsolutePath())) {
response.object = Utils_.fileToBytes(archives);
} else throw new RepositoryRefuseException("Не удалось запаковать архивы");
}
void ReceiveBugReportsDatabase() throws Exception{
response.object = Utils_.fileToBytes(db.getFile());
}
void ReceiveBugReport() throws Exception {
File bugArchive = Utils_.getFile(Utils_.getHomePath(), "Bugs", request.arg);
response.object = Utils_.fileToBytes(bugArchive);
}
void UpdateBugReport() throws Exception {
BugReport oldBugReport = (BugReport) request.object;
if (db.bugReports.containsKey(oldBugReport.id)) {
BugReport bugReport = db.bugReports.get(oldBugReport.id);
bugReport.SynchronizeFields(oldBugReport);
bugReport.change_date = new Date().getTime();
db.Update(bugReport);
} else
throw new RepositoryRefuseException("Баг репорт с ключом " + oldBugReport.id + " не существует.");
}
//--
void CheckSubscriberRole() throws Exception {
Account account = (Account) request.object;
Subscriber subscriber = null;
if (db.subscribers.containsKey(account.email)) {
subscriber = db.subscribers.get(account.email);
} else {
subscriber = new Subscriber();
subscriber.name = account.name;
subscriber.address = account.email;
subscriber.mailOn = 1;
db.Insert(subscriber);
}
response.object = subscriber; //возвращаем информацию о подписчике.
}
void GetComponentsBackUps() throws Exception {
File backupsDirectory = Paths.get(Utils_.getHomePath(), "Components", request.arg, "Backups").toFile();
//--
if (backupsDirectory.exists()) {
File[] files = backupsDirectory.listFiles(File::isFile);
if (files != null) {
Vector<RemoteFile> res = new Vector<>();
for (File file : files)
res.add(new RemoteFile(file.getAbsolutePath(), false)); //тут всегда линух.
response.object = res;
} else throw new RepositoryRefuseException("Не удалось получить список предыдущих версий");
} else {
//баги еще не создавались. штатная ситуация.
response.object = new Vector<>();
}
}
void CheckURLRegistered() throws Exception {
String[] data = request.arg.split("\n");
String email = data[0];
String machineURL = data[1];
String login = data[2];
response.object = db.workspaces.findWorkspace(email, machineURL, login);
}
void GetComponentChangesLog() throws Exception {
response.object = Utils_.fileToBytes(Paths.get(Utils_.getHomePath(), "Components", request.arg, "changes.txt").toFile());
}
void PublishComponent() throws Exception {
ComponentPublicationInfoJson info = (ComponentPublicationInfoJson) request.object;
File componentHome = Utils_.getFile(Utils_.getHomePath(), "Components", info.componentType.toString());
@@ -256,49 +307,19 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
bufferWriter_.close();
}
}
void CheckSubscriberRole() throws Exception {
Account account = (Account) request.object;
Subscriber subscriber = null;
if (db.subscribers.containsKey(account.email)) {
subscriber = db.subscribers.get(account.email);
} else {
subscriber = new Subscriber();
subscriber.name = account.name;
subscriber.address = account.email;
subscriber.mailOn = 1;
db.Insert(subscriber);
void GetComponentsVersionsInfo() throws Exception {
Vector<String> types = (Vector<String>) request.object;
Vector<ComponentVersionsInfoJson> res = new Vector<>();
for (String sType : types) {
ComponentType componentType = ComponentType.valueOf(sType);
File actualVersionFile = Paths.get(Utils_.getHomePath(), "Components", sType, "version.txt").toFile();
File minimalVersionFile = Paths.get(Utils_.getHomePath(), "Components", sType, "minimal_version.txt").toFile();
ComponentVersionsInfoJson info = new ComponentVersionsInfoJson(componentType);
info.actual_version = Utils_.removeCharacters(Utils.ReadAllText(actualVersionFile), "\n", "\r");
info.minimal_version = Utils_.removeCharacters(Utils.ReadAllText(minimalVersionFile), "\n", "\r");
res.add(info);
}
response.object = subscriber; //возвращаем информацию о подписчике.
}
void ReceiveAllArchives() throws Exception {
ZipFolderPass zip = new ZipFolderPass();
File archives = new File(Utils_.getDateName("Bugs"));
if (zip.Do("Bugs", archives.getAbsolutePath())) {
response.object = Utils_.fileToBytes(archives);
} else throw new RepositoryRefuseException("Не удалось запаковать архивы");
}
void GetComponentsBackUps() throws Exception {
File backupsDirectory = Paths.get(Utils_.getHomePath(), "Components", request.arg, "Backups").toFile();
//--
if (backupsDirectory.exists()) {
File[] files = backupsDirectory.listFiles(File::isFile);
if (files != null) {
Vector<RemoteFile> res = new Vector<>();
for (File file : files)
res.add(new RemoteFile(file.getAbsolutePath(), false)); //тут всегда линух.
response.object = res;
} else throw new RepositoryRefuseException("Не удалось получить список предыдущих версий");
} else {
//баги еще не создавались. штатная ситуация.
response.object = new Vector<>();
}
}
void ReceiveBugReportsDatabase() throws Exception{
response.object = Utils_.fileToBytes(db.getFile());
}
void ReceiveBugReport() throws Exception {
File bugArchive = Utils_.getFile(Utils_.getHomePath(), "Bugs", request.arg);
response.object = Utils_.fileToBytes(bugArchive);
}
void ReceiveComponent() throws Exception {
String[] packed1 = request.arg.split("\n");
@@ -307,29 +328,9 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
Print("Получить компонент " + packed1[0]);
response.object = Utils_.fileToBytes(componentFile1);
}
void CheckURLRegistered() throws Exception {
String[] data = request.arg.split("\n");
String email = data[0];
String machineURL = data[1];
String login = data[2];
response.object = db.workspaces.findWorkspace(email, machineURL, login);
}
void GetComponentChangesLog() throws Exception {
response.object = Utils_.fileToBytes(Paths.get(Utils_.getHomePath(), "Components", request.arg, "changes.txt").toFile());
}
void UpdateBugReport() throws Exception {
BugReport oldBugReport = (BugReport) request.object;
if (db.bugReports.containsKey(oldBugReport.id)) {
BugReport bugReport = db.bugReports.get(oldBugReport.id);
bugReport.SynchronizeFields(oldBugReport);
bugReport.change_date = new Date().getTime();
db.Update(bugReport);
} else
throw new RepositoryRefuseException("Баг репорт с ключом " + oldBugReport.id + " не существует.");
}
//--
@Override
protected void Session() throws Exception {
protected void SafeSession() throws Exception {
switch (code) {
// ПРОХОДЫ НЕЗАВИСИМЫЕ ОТ ВЕРСИИ
case CheckSubscriberRole:

View File

@@ -762,7 +762,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
}
//--
@Override
protected void Session() throws Exception {
protected void SafeSession() throws Exception {
switch (code) {
case PerformAutoSapforTesting:
PerformAutoSapforTesting();