no message
This commit is contained in:
9
.idea/workspace.xml
generated
9
.idea/workspace.xml
generated
@@ -7,14 +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/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$/.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/RepositoryServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Repository/RepositoryServer.java" 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/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/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/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" />
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public abstract class RepositoryServer<D extends Database> {
|
|||||||
}
|
}
|
||||||
//-DVMTestingChecker
|
//-DVMTestingChecker
|
||||||
public abstract int getPort();
|
public abstract int getPort();
|
||||||
protected abstract void Session() throws Exception;
|
protected abstract void SafeSession() throws Exception;
|
||||||
protected void startAdditionalThreads() {
|
protected void startAdditionalThreads() {
|
||||||
}
|
}
|
||||||
public void ActivateDB() {
|
public void ActivateDB() {
|
||||||
@@ -229,7 +229,7 @@ public abstract class RepositoryServer<D extends Database> {
|
|||||||
CloneObject();
|
CloneObject();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Session();
|
SafeSession();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|||||||
@@ -190,20 +190,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
//--
|
//--
|
||||||
} else throw new RepositoryRefuseException("Внутренняя ошибка. Не удалось распаковать проект");
|
} 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 {
|
void AppendBugReportField() throws Exception {
|
||||||
BugReportAdditionJson transport = (BugReportAdditionJson) request.object;
|
BugReportAdditionJson transport = (BugReportAdditionJson) request.object;
|
||||||
if (db.bugReports.containsKey(transport.id)) {
|
if (db.bugReports.containsKey(transport.id)) {
|
||||||
@@ -215,6 +201,71 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
response.object = actual;
|
response.object = actual;
|
||||||
} else throw new RepositoryRefuseException("Баг репорт с ключом " + transport.id + " не существует.");
|
} 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 {
|
void PublishComponent() throws Exception {
|
||||||
ComponentPublicationInfoJson info = (ComponentPublicationInfoJson) request.object;
|
ComponentPublicationInfoJson info = (ComponentPublicationInfoJson) request.object;
|
||||||
File componentHome = Utils_.getFile(Utils_.getHomePath(), "Components", info.componentType.toString());
|
File componentHome = Utils_.getFile(Utils_.getHomePath(), "Components", info.componentType.toString());
|
||||||
@@ -256,49 +307,19 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
bufferWriter_.close();
|
bufferWriter_.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void CheckSubscriberRole() throws Exception {
|
void GetComponentsVersionsInfo() throws Exception {
|
||||||
Account account = (Account) request.object;
|
Vector<String> types = (Vector<String>) request.object;
|
||||||
Subscriber subscriber = null;
|
Vector<ComponentVersionsInfoJson> res = new Vector<>();
|
||||||
if (db.subscribers.containsKey(account.email)) {
|
for (String sType : types) {
|
||||||
subscriber = db.subscribers.get(account.email);
|
ComponentType componentType = ComponentType.valueOf(sType);
|
||||||
} else {
|
File actualVersionFile = Paths.get(Utils_.getHomePath(), "Components", sType, "version.txt").toFile();
|
||||||
subscriber = new Subscriber();
|
File minimalVersionFile = Paths.get(Utils_.getHomePath(), "Components", sType, "minimal_version.txt").toFile();
|
||||||
subscriber.name = account.name;
|
ComponentVersionsInfoJson info = new ComponentVersionsInfoJson(componentType);
|
||||||
subscriber.address = account.email;
|
info.actual_version = Utils_.removeCharacters(Utils.ReadAllText(actualVersionFile), "\n", "\r");
|
||||||
subscriber.mailOn = 1;
|
info.minimal_version = Utils_.removeCharacters(Utils.ReadAllText(minimalVersionFile), "\n", "\r");
|
||||||
db.Insert(subscriber);
|
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;
|
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 {
|
void ReceiveComponent() throws Exception {
|
||||||
String[] packed1 = request.arg.split("\n");
|
String[] packed1 = request.arg.split("\n");
|
||||||
@@ -307,29 +328,9 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
Print("Получить компонент " + packed1[0]);
|
Print("Получить компонент " + packed1[0]);
|
||||||
response.object = Utils_.fileToBytes(componentFile1);
|
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
|
@Override
|
||||||
protected void Session() throws Exception {
|
protected void SafeSession() throws Exception {
|
||||||
switch (code) {
|
switch (code) {
|
||||||
// ПРОХОДЫ НЕЗАВИСИМЫЕ ОТ ВЕРСИИ
|
// ПРОХОДЫ НЕЗАВИСИМЫЕ ОТ ВЕРСИИ
|
||||||
case CheckSubscriberRole:
|
case CheckSubscriberRole:
|
||||||
@@ -353,7 +354,7 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
case GetComponentChangesLog:
|
case GetComponentChangesLog:
|
||||||
GetComponentChangesLog();
|
GetComponentChangesLog();
|
||||||
break;
|
break;
|
||||||
//------------------------------------------------------------------------>>>>
|
//------------------------------------------------------------------------>>>>
|
||||||
case ReceiveAllArchives:
|
case ReceiveAllArchives:
|
||||||
ReceiveAllArchives();
|
ReceiveAllArchives();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -762,7 +762,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
@Override
|
@Override
|
||||||
protected void Session() throws Exception {
|
protected void SafeSession() throws Exception {
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case PerformAutoSapforTesting:
|
case PerformAutoSapforTesting:
|
||||||
PerformAutoSapforTesting();
|
PerformAutoSapforTesting();
|
||||||
|
|||||||
Reference in New Issue
Block a user