19 package org.turro.mail.provider;
21 import java.util.ArrayList;
22 import java.util.HashSet;
23 import java.util.List;
25 import org.turro.collections.KeyValueMap;
26 import org.turro.elephant.context.ElephantContext;
27 import org.turro.elephant.context.HeadlessApplication;
28 import org.turro.elephant.impl.context.ContextFactory;
29 import org.turro.mail.impl.MailMessagePool;
30 import org.turro.mail.impl.MailPool;
31 import org.turro.string.Strings;
40 Set<String> ids =
new HashSet<>();
42 List<String> names =
new ArrayList<>();
43 names.add(
"IMailMessagePool");
45 names.forEach((s) -> {
49 String
id = ((String) s).substring(((String) s).indexOf(
"_") + 1);
51 if(!ids.contains(
id)) {
54 provider.
setPort(attrs.get(Integer.class,
"port",
null));
55 provider.
setTls(attrs.get(Boolean.class,
"tls",
false));
56 provider.
setSsl(attrs.get(Boolean.class,
"ssl",
false));
57 provider.
setUser(attrs.get(String.class,
"user",
null));
58 provider.
setPassword(attrs.get(String.class,
"cryptpass",
null));
64 set.addProvider(provider);
72 String
id = ((String) s).substring(((String) s).indexOf(
"_") + 1);
73 if(!ids.contains(
id)) {
76 provider.
setPort(attrs.get(Integer.class,
"port",
null));
77 provider.
setTls(attrs.get(Boolean.class,
"tls",
false));
78 provider.
setSsl(attrs.get(Boolean.class,
"ssl",
false));
79 provider.
setUser(attrs.get(String.class,
"user",
null));
80 provider.
setPassword(attrs.get(String.class,
"cryptpass",
null));
86 set.addProvider(provider);
IImplementation getImplementation(String name)
static byte[] encrypt(byte[] value)
static HeadlessApplication getInstance()
KeyValueMap getAttributes()
static List getImplementationNamesByType(String type)
static MailProviderSet migrate()
void setHostname(String hostname)
void setFrom(MailRecipient from)
void setUser(String user)
void setPort(Integer port)
void setPassword(String password)
static final String GENERIC
static MailRecipient of(String value)