продолжение рефакторинга рассылки и исправление анимации
v++
This commit is contained in:
@@ -3,13 +3,29 @@ import _VisualDVM.Passes.Server.ComponentsRepositoryPass;
|
||||
import _VisualDVM.Repository.EmailMessage;
|
||||
import _VisualDVM.Repository.Server.ServerCode;
|
||||
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
|
||||
|
||||
import java.util.Vector;
|
||||
public class Email extends ComponentsRepositoryPass<EmailMessage> {
|
||||
protected String address;
|
||||
Vector<String> recipients;
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
recipients = null;
|
||||
if (args.length<=1) {
|
||||
return false;
|
||||
}
|
||||
target = (EmailMessage) args[0];
|
||||
address = (String) args[1];
|
||||
return true;
|
||||
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;
|
||||
}
|
||||
@Override
|
||||
protected int getTimeout() {
|
||||
@@ -17,6 +33,12 @@ public class Email extends ComponentsRepositoryPass<EmailMessage> {
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.Email, address, target));
|
||||
int i = 0;
|
||||
for (String address : recipients) {
|
||||
ShowProgress(recipients.size(), i, true);
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.Email, address, target));
|
||||
++i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user