|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSK.gnome.dwarf.GenericService
SK.gnome.dwarf.GenericServer
SK.gnome.dwarf.thread.ThreadServer
SK.gnome.dwarf.thread.MultiThreadServer
SK.gnome.dwarf.tcpip.TCPIPServer
SK.gnome.dwarf.mail.MailServer
Provides a generic mail server.
This is a base class for all mail servers. It extends the generic multithreaded TCP/IP server
and provides a container for MailHost
objects. Each server must contain at least one mail
host, which is regarded as default. It may also contain one or more additional virtual mail hosts
for each internet domain it will handle mail for.
The getMailHostByUser(String)
method may be used to obtain the correct MailHost
object for the particular user. A user is identified by its name with optional domain part after
the '@' character. Such user name with the domain part present may refer to a particular
virtual host rather than the default mail host. User names without the domain part are always
served by the default MailHost.
The getMailStore(String)
, getUserStore(String)
and getACLStore(String)
utility methods may be used to obtain the desired storage service for the particular user name by
the same process as above.
Field Summary | |
protected java.util.Map |
hosts
Mapping between host identification strings and MailHost objects. |
Fields inherited from class SK.gnome.dwarf.tcpip.TCPIPServer |
sslContext |
Fields inherited from class SK.gnome.dwarf.thread.MultiThreadServer |
counter |
Fields inherited from class SK.gnome.dwarf.thread.ThreadServer |
daemon, thread |
Fields inherited from class SK.gnome.dwarf.GenericService |
initParameters, parent |
Fields inherited from interface SK.gnome.dwarf.Service |
INITIALIZED, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_TRACE, LOG_WARN, LOG_XFER, SHUTDOWN, STARTED, STOPPED |
Constructor Summary | |
MailServer(java.lang.String name)
Creates a new MailServer. |
Method Summary | |
void |
addService(SK.gnome.dwarf.Service service)
|
ACLStore |
getACLStore(java.lang.String user)
Returns the ACL store for the given user. |
MailHost |
getMailHost(java.lang.String id)
Returns the MailHost object referenced by the given identification string. |
MailHost |
getMailHostByUser(java.lang.String user)
Returns a MailHost object for the given user. |
MailStore |
getMailStore(java.lang.String user)
Returns the mail store for the given user. |
UserStore |
getUserStore(java.lang.String user)
Returns the user store for the given user. |
void |
init(SK.gnome.dwarf.Server parent)
Initializes the service. |
Methods inherited from class SK.gnome.dwarf.tcpip.TCPIPServer |
createSSLServerSocket, createSSLServerSocket, createSSLSocket, enqueue, finish, getRequestReadTimeout, getTCPRequest, isBlocking, isSSLConfigured, loop, report, setKeyPwd, setKeyStorePwd, setKeyStoreURL, setRegistrationQueueSize, setRequestClass, setSSLProtocol, shutdown, start |
Methods inherited from class SK.gnome.dwarf.thread.MultiThreadServer |
dequeue, enableThread, getHandlerTimeout, setHandlerClass, setHandlerTimeout, setMaxHandlers, setMinHandlers, setQueueSize, setSingleRequest, wakeUpHandlers |
Methods inherited from class SK.gnome.dwarf.thread.ThreadServer |
finish, run, setDaemon, stop |
Methods inherited from class SK.gnome.dwarf.GenericServer |
addService, getAuthenticator, getLogger, getParameters, getService, getServices, getServices, removeService |
Methods inherited from class SK.gnome.dwarf.GenericService |
getAuthFacility, getFullName, getInitParameter, getInitParameterNames, getLogFacility, getName, getPrincipal, getShutdownTimeout, getState, log, log, login, logout, setAuthFacility, setInitParameters, setLogFacility, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface SK.gnome.dwarf.Service |
getFullName, getName, getState, log, log, login, logout |
Field Detail |
protected java.util.Map hosts
MailHost
objects. The identification
strings may be either hostnames, domain names or IP addresses. A single MailHost
instance
may be even mapped by more then one key if its getHostId() method returns a comma-separated
list of identification strings instead of a single value.
Constructor Detail |
public MailServer(java.lang.String name)
Method Detail |
public void addService(SK.gnome.dwarf.Service service) throws SK.gnome.dwarf.ServiceException
SK.gnome.dwarf.ServiceException
public void init(SK.gnome.dwarf.Server parent) throws SK.gnome.dwarf.ServiceException
It throws a ServiceException if no default MailHost
instance is found
or no mail store service is provided by it.
SK.gnome.dwarf.ServiceException
public MailHost getMailHost(java.lang.String id)
The host identification string can be either a hostname, domain name or an IP address.
If no MailHost
instance can be found for the given id, a null value is returned.
id
- the host identification string
public MailHost getMailHostByUser(java.lang.String user) throws MailException
If the user argument contains the '@' character with a domain part
after it, this method returns a MailHost
instance for the given domain, otherwise
it returns the default mail host instance. A MailException is thrown when no mail
host can be found in either case.
user
- the user identification
MailException
- if a mail host could not be found for the given userpublic MailStore getMailStore(java.lang.String user) throws MailException
It returns a MailStore object associated either with the MailHost
obtained from getMailHostByUser(String)
method, or with the default mail host.
user
- the user identiciation
MailException
public UserStore getUserStore(java.lang.String user) throws MailException
It returns a UserStore object associated either with the MailHost
obtained from getMailHostByUser(String)
method, or with the default mail host.
user
- the user identiciation
MailException
public ACLStore getACLStore(java.lang.String user) throws MailException
It returns an ACLStore object associated either with the MailHost
obtained from getMailHostByUser(String)
method, or with the default mail host.
user
- the user identiciation
MailException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |