From 905a31da1fc84752176446792828a00724fe895d Mon Sep 17 00:00:00 2001 From: 02090095 Date: Wed, 5 Feb 2025 19:30:16 +0300 Subject: [PATCH 1/2] no message --- .idea/workspace.xml | 4 +-- properties | 2 +- src/_VisualDVM/Passes/All/Email.java | 16 +++++++++++- .../Repository/Component/Visualiser.java | 2 +- .../Repository/RepositoryServer.java | 25 +++---------------- 5 files changed, 22 insertions(+), 27 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d7ed6829..2030a481 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,9 +7,9 @@ + - - + diff --git a/properties b/properties index fff10d8d..81f2dc41 100644 --- a/properties +++ b/properties @@ -18,7 +18,7 @@ "collapseProjectTrees": false, "EditorFontSize": 17, "ComponentsWindowWidth": 929, - "ComponentsWindowHeight": 300, + "ComponentsWindowHeight": 250, "Kernels": 8, "LocalMakePathWindows": "C:\\MinGW\\msys\\1.0\\bin\\make.exe", "CheckTestingIntervalSeconds": 10, diff --git a/src/_VisualDVM/Passes/All/Email.java b/src/_VisualDVM/Passes/All/Email.java index 4121a246..48dd415e 100644 --- a/src/_VisualDVM/Passes/All/Email.java +++ b/src/_VisualDVM/Passes/All/Email.java @@ -2,11 +2,20 @@ package _VisualDVM.Passes.All; import _VisualDVM.Passes.Server.ComponentsServerPass; import _VisualDVM.Repository.EmailMessage; import _VisualDVM.Repository.Server.ServerCode; +import _VisualDVM.Repository.Server.ServerExchangeUnit_2021; import java.util.Vector; public class Email extends ComponentsServerPass { Vector recipients; @Override + protected boolean requestNeedsAnimation() { + return false; + } + @Override + protected boolean needsAnimation() { + return true; + } + @Override protected boolean canStart(Object... args) throws Exception { recipients = null; if (args.length<=1) { @@ -28,7 +37,12 @@ public class Email extends ComponentsServerPass { } @Override protected void body() throws Exception { - SendRequest(ServerCode.EmailBroadcast, String.join("\n",recipients), target); + int i = 0; + for (String address : recipients) { + ShowProgress(recipients.size(), i, true); + SendRequest(ServerCode.Email, address, target,0); + ++i; + } } } diff --git a/src/_VisualDVM/Repository/Component/Visualiser.java b/src/_VisualDVM/Repository/Component/Visualiser.java index eef4b4e6..ede57649 100644 --- a/src/_VisualDVM/Repository/Component/Visualiser.java +++ b/src/_VisualDVM/Repository/Component/Visualiser.java @@ -62,7 +62,7 @@ public class Visualiser extends Component { //http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html @Override public void GetVersionInfo() { - version = 1143; + version = 1144; String pattern = "MMM dd yyyy HH:mm:ss"; DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH); date_text = df.format(getClassBuildTime()); diff --git a/src/_VisualDVM/Repository/RepositoryServer.java b/src/_VisualDVM/Repository/RepositoryServer.java index 28263b33..1977c164 100644 --- a/src/_VisualDVM/Repository/RepositoryServer.java +++ b/src/_VisualDVM/Repository/RepositoryServer.java @@ -103,9 +103,9 @@ public abstract class RepositoryServer { props.put("mail.smtp.port", String.valueOf(Constants.SMTPPort)); props.put("mail.smtp.socketFactory.port", String.valueOf(Constants.MailSocketPort)); props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); - props.put("mail.smtp.connectiontimeout", String.valueOf(Global.properties.SocketTimeout)); - props.put("mail.smtp.timeout", String.valueOf(Global.properties.SocketTimeout)); - props.put("mail.smtp.writetimeout", String.valueOf(Global.properties.SocketTimeout)); + props.put("mail.smtp.connectiontimeout", String.valueOf(15000)); + props.put("mail.smtp.timeout", String.valueOf(15000)); + props.put("mail.smtp.writetimeout", String.valueOf(15000)); //------------------------------ LinkedHashMap innerFiles = new LinkedHashMap<>(); for (String aName : message_in.files.keySet()) { @@ -123,9 +123,6 @@ public abstract class RepositoryServer { Constants.MailPassword); } }); - boolean done = false; - int attempts = 5; - while (!done && (attempts > 0)) { try { MimeMessage message = new MimeMessage(session); message.setFrom(new InternetAddress(Constants.MailAddress)); @@ -144,15 +141,11 @@ public abstract class RepositoryServer { } message.setContent(multipart); Transport.send(message); - done = true; } catch (Exception ex) { System.out.println("Исключение во время отправки сообщения абоненту " + Utils_.Brackets(address_in)); ex.printStackTrace(); Utils_.sleep(1000); - } finally { - attempts--; } - } } catch (Exception ex) { System.out.println("Исключение во время выполнения рассылки."); ex.printStackTrace(); @@ -223,9 +216,6 @@ public abstract class RepositoryServer { Email((EmailMessage) request.object, request.arg); response = new ServerExchangeUnit_2021(ServerCode.OK); break; - case EmailBroadcast: - EmailBroadcast(); - break; // // case CheckObjectExistense: @@ -326,15 +316,6 @@ public abstract class RepositoryServer { } } } - private void EmailBroadcast() throws Exception { - String[] packed = request.arg.split("\n"); - for (String address : packed) { - if (!address.isEmpty()) { - Email((EmailMessage) request.object, address); - } - } - response = new ServerExchangeUnit_2021(ServerCode.OK); - } //-- protected Database getDefaultDatabase() { return db; From de9f5ce5c7b2c784480004fc1779a6761a3e7321 Mon Sep 17 00:00:00 2001 From: 02090095 Date: Wed, 5 Feb 2025 19:32:35 +0300 Subject: [PATCH 2/2] =?UTF-8?q?=D0=BF=D0=BE=D0=B4=D0=BD=D1=8F=D0=BB=20?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D1=81=D0=B8=D1=8E=20=D0=BF=D0=BB=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D1=89=D0=B8=D0=BA=D0=B0=20=D0=B2=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=B4=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/workspace.xml | 6 +----- src/_VisualDVM/Constants.java | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2030a481..96341548 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,11 +7,7 @@ - - - - - +