2024-10-14 12:14:01 +03:00
|
|
|
package _VisualDVM.Passes.All;
|
2025-02-04 19:28:38 +03:00
|
|
|
import _VisualDVM.Passes.Server.ComponentsServerPass;
|
2024-10-09 22:21:57 +03:00
|
|
|
import _VisualDVM.Repository.EmailMessage;
|
|
|
|
|
import _VisualDVM.Repository.Server.ServerCode;
|
2024-11-28 16:52:17 +03:00
|
|
|
|
|
|
|
|
import java.util.Vector;
|
2025-02-04 19:28:38 +03:00
|
|
|
public class Email extends ComponentsServerPass<EmailMessage> {
|
2024-11-28 16:52:17 +03:00
|
|
|
Vector<String> recipients;
|
2023-09-17 22:13:42 +03:00
|
|
|
@Override
|
2025-02-05 19:30:16 +03:00
|
|
|
protected boolean requestNeedsAnimation() {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected boolean needsAnimation() {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
2023-09-17 22:13:42 +03:00
|
|
|
protected boolean canStart(Object... args) throws Exception {
|
2024-11-28 16:52:17 +03:00
|
|
|
recipients = null;
|
|
|
|
|
if (args.length<=1) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
target = (EmailMessage) args[0];
|
2024-11-28 16:52:17 +03:00
|
|
|
if (args[1]instanceof Vector) {
|
|
|
|
|
recipients = (Vector<String>) args[1];
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else if (args[1] instanceof String){
|
|
|
|
|
recipients= new Vector<>();
|
|
|
|
|
for (int i=1; i< args.length; ++i){
|
|
|
|
|
recipients.add((String) args[i]);
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
|
|
|
|
@Override
|
2025-02-04 19:28:38 +03:00
|
|
|
protected void body() throws Exception {
|
2025-02-05 19:30:16 +03:00
|
|
|
int i = 0;
|
|
|
|
|
for (String address : recipients) {
|
|
|
|
|
ShowProgress(recipients.size(), i, true);
|
2025-02-15 23:30:48 +03:00
|
|
|
SendRequest(ServerCode.Email, address, target);
|
2025-02-05 19:30:16 +03:00
|
|
|
++i;
|
|
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
|
|
|
|
}
|
2024-11-28 16:52:17 +03:00
|
|
|
|