2024-10-14 12:14:01 +03:00
|
|
|
package _VisualDVM.Passes.All;
|
2024-10-14 15:19:13 +03:00
|
|
|
import _VisualDVM.Passes.Server.ComponentsRepositoryPass;
|
2024-10-09 22:21:57 +03:00
|
|
|
import _VisualDVM.Repository.EmailMessage;
|
|
|
|
|
import _VisualDVM.Repository.Server.ServerCode;
|
|
|
|
|
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
|
2024-11-28 16:52:17 +03:00
|
|
|
|
|
|
|
|
import java.util.Vector;
|
2023-09-17 22:13:42 +03:00
|
|
|
public class Email extends ComponentsRepositoryPass<EmailMessage> {
|
2024-11-28 16:52:17 +03:00
|
|
|
Vector<String> recipients;
|
2023-09-17 22:13:42 +03:00
|
|
|
@Override
|
|
|
|
|
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
|
|
|
|
|
protected int getTimeout() {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected void ServerAction() throws Exception {
|
2024-11-28 16:52:17 +03:00
|
|
|
int i = 0;
|
|
|
|
|
for (String address : recipients) {
|
|
|
|
|
ShowProgress(recipients.size(), i, true);
|
|
|
|
|
Command(new ServerExchangeUnit_2021(ServerCode.Email, address, target));
|
|
|
|
|
++i;
|
|
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
|
|
|
|
}
|
2024-11-28 16:52:17 +03:00
|
|
|
|