|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SK.gnome.dwarf.GenericService SK.gnome.dwarf.GenericServer SK.gnome.dwarf.mail.MailHost
Provides a generic mail host.
MailHost may represent a single host name or a subdomain. It provides some necessary features as mail, user data and ACL storage, as well as user authentication, shared by all recipients belonging to the same internet domain.
There are two types of mail hosts - default and virtual. Default mail host is required for each mail server instance. It is always the very first MailHost service added to the server. In addition, one or more virtual hosts may be added to the server to represent other internet domains for which the server will be able to handle mail locally.
Each mail host must have assigned its host identification via setHostId(String)
method. It may be either a full host name, a domain name or an IP address, or even a mixed
list of these values.
The mapVirtualUser(String)
method may be used to map the virtual user name to
a name by which the given user is known to the local authentication facility as well as the
storage services. It may be overriden to implement a custom mapping mechanism, like a
relocation table, for example.
Field Summary | |
protected ACLStore |
aclStore
The ACL store associated with this host. |
protected java.lang.String |
hostId
The host identification. |
protected MailStore |
mailStore
The mail store associated with this host. |
protected boolean |
stripDomain
Determines the mode of mapping a virtual user to local one. |
protected UserStore |
userStore
The user store associated with this host. |
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 | |
MailHost(java.lang.String name)
Creates a new MailHost. |
Method Summary | |
void |
addService(SK.gnome.dwarf.Service service)
Adds the given service to the server. |
ACLStore |
getACLStore()
Returns the ACL store associated with this host. |
java.lang.String |
getHostId()
Returns the host identification. |
MailStore |
getMailStore()
Returns the mail store associated with this host. |
UserStore |
getUserStore()
Returns the user store associated with this host. |
void |
init(SK.gnome.dwarf.Server parent)
Initializes the service. |
java.lang.String |
mapVirtualUser(java.lang.String user)
Maps the virtual user name to a local user name. |
void |
setHostId(java.lang.String hostname)
Sets the host identification. |
void |
setStripDomain(boolean enable)
Sets the mode of mapping a virtual user to local one. |
static java.lang.String |
stripDomain(java.lang.String user)
Strips the user name of the domain part. |
Methods inherited from class SK.gnome.dwarf.GenericServer |
addService, getAuthenticator, getLogger, getParameters, getService, getServices, getServices, removeService, report, shutdown, start, stop |
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.lang.String hostId
It may be either a hostname, an IP address or a domain name. If a comma-separated list of values is specified, the host will be identified by all of the given strings. An example list of host identification strings may be "host.domain.com, domain.com, 192.168.0.1".
getHostId()
protected boolean stripDomain
Determines the mode in which the mapVirtualUser(String)
method will operate.
Default value: true
protected MailStore mailStore
getMailStore()
protected UserStore userStore
getUserStore()
protected ACLStore aclStore
getACLStore()
Constructor Detail |
public MailHost(java.lang.String name)
Method Detail |
public void setHostId(java.lang.String hostname)
It may be either a hostname, an IP address or a domain name. If a comma-separated list of values is specified, the host will be identified by all of the given strings. An example list of host identification string may be "host.domain.com, domain.com, 192.168.0.1".
hostname
- host identification stringhostId
public void setStripDomain(boolean enable)
Determines the mode in which the mapVirtualUser(String)
method will operate.
enable
- true to enable stripping the virtual user name of its domain part,
false otherwisestripDomain
public java.lang.String getHostId()
If the host is identified by more than one string, the whole comma-separated list of identification strings will be returned.
hostId
public MailStore getMailStore()
mailStore
public UserStore getUserStore()
userStore
public ACLStore getACLStore()
aclStore
public void addService(SK.gnome.dwarf.Service service) throws SK.gnome.dwarf.ServiceException
It initializes also the mailStore
, userStore
and aclStore
member variables to the actual service instances being added to the server.
SK.gnome.dwarf.ServiceException
public void init(SK.gnome.dwarf.Server parent) throws SK.gnome.dwarf.ServiceException
If the parent server is not an instance of the MailServer
class,
the IllegalServiceClassException
is thrown.
SK.gnome.dwarf.ServiceException
public java.lang.String mapVirtualUser(java.lang.String user) throws MailException
This method maps the virtual user name to a name by which it is known to the local
authentication facility as well as the storage services. It returns the user
argument stripped of an eventual domain part, if the stripDomain
field is set
to true. Otherwise, it returns the argument value unchanged.
You may override this method to provide a custom mapping mechanism, like a relocation table, for example.
user
- the user identification
MailException
- if an error occuredpublic static java.lang.String stripDomain(java.lang.String user)
user
- the string
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |