| java.lang.Object com.ivata.groupware.business.mail.server.JavaMailServer com.ivata.groupware.business.mail.server.ScriptMailServer
ScriptMailServer | public class ScriptMailServer extends JavaMailServer implements MailServer(Code) | | This implementation of the mail server uses scripts
to perform each of the actions.
The scripts must have the same name as each of the
methods and use the same parameters. The location of the
scripts within the system is set using the system setting
'pathScriptMailServer'.
For each script, a return value of 0 is taken
as success. Any other value results in a
GroupwareException GroupwareException being thrown, with
the contents of the standard error stream as its message.
since: 2002-07-20 author: Colin MacLeod author: colin.macleod@ivata.com version: $Revision: 1.6 $ |
Method Summary | |
public void | addUser(SecuritySession securitySession, String userName, String fileAs) Add a new user to the system. | final public Collection | getList(SecuritySession securitySession, String name) Gets the contents of mailing list with the name provided.
This method calls the script called getList .
Parameters: name - the name of the list to be retrieved. | final public String | getSystemUserName(SecuritySession securitySession, String userName) | public List | getUserAliases(SecuritySession securitySession, String userName) Gets all of the email aliases for the user provided.
This method calls the script getUserAliases .
Parameters: userName - the user for whom to get the email aliases. | final public String | getUserForwarding(SecuritySession securitySession, String userName) Get the email addresss this user's mail is forwarded to.
This method calls the script getUserForwarding .
Parameters: userName - the user for whom to activate/deactive emailforwarding. | final public String | getUserNameFromSystemUserName(SecuritySession securitySession, String systemUserName) | final public String | getVacationMessage(SecuritySession securitySession, String userName) Gets the current vacation method for the user provided. | public boolean | isUser(SecuritySession securitySession, String userNameParam) | public void | removeList(SecuritySession securitySession, String name) | public void | removeUser(SecuritySession securitySession, String userName) Remove a user from the email system. | final public void | setList(SecuritySession securitySession, String name, Collection users) | final public void | setPassword(SecuritySession securitySession, String userName, String password) Set a user's password in the system. | final public void | setUserAliases(SecuritySession securitySession, String userName, Collection aliases) | final public void | setUserForwarding(SecuritySession securitySession, String userName, String address) Set an email addresss to forward this user's mail to. | final public void | setVacationMessage(SecuritySession securitySession, String userName, String messageParam) Sets the vacation method for the user provided. |
scriptPath | String scriptPath(Code) | | Stores the sole instance of this class.
|
addUser | public void addUser(SecuritySession securitySession, String userName, String fileAs) throws SystemException(Code) | | Add a new user to the system.
This method calls the addUser script.
Parameters: userName - it's userName in System Parameters: fileAs - it's file as of user throws: GroupwareException - containing the content of the standarderror stream, if the script returns non-zero. |
getList | final public Collection getList(SecuritySession securitySession, String name) throws SystemException(Code) | | Gets the contents of mailing list with the name provided.
This method calls the script called getList .
Parameters: name - the name of the list to be retrieved. a Collection containingUserLocal instances of each of the users in the list. throws: GroupwareException - containing the content of the standarderror stream, if the script returns non-zero. |
getSystemUserName | final public String getSystemUserName(SecuritySession securitySession, String userName)(Code) | | This method add prefix to username.
Parameters: userName - prefix_userName |
getUserAliases | public List getUserAliases(SecuritySession securitySession, String userName) throws SystemException(Code) | | Gets all of the email aliases for the user provided.
This method calls the script getUserAliases .
Parameters: userName - the user for whom to get the email aliases. a Collection containingString values for each of the aliases. throws: GroupwareException - containing the content of the standarderror stream, if the script returns non-zero. |
getUserForwarding | final public String getUserForwarding(SecuritySession securitySession, String userName) throws SystemException(Code) | | Get the email addresss this user's mail is forwarded to.
This method calls the script getUserForwarding .
Parameters: userName - the user for whom to activate/deactive emailforwarding. email address all email for this user is forwarded to, ornull if there is no forwarding for this user. throws: GroupwareException - containing the content of the standarderror stream, if the script returns non-zero. |
getUserNameFromSystemUserName | final public String getUserNameFromSystemUserName(SecuritySession securitySession, String systemUserName)(Code) | | This method is converting SystemUserName to userName, it's oposite method to getSystemUserName.
Parameters: systemUserName - |
getVacationMessage | final public String getVacationMessage(SecuritySession securitySession, String userName) throws SystemException(Code) | | Gets the current vacation method for the user provided.
This method calls the script
getVacationMessage .
Parameters: userName - the user for whom to set the vacation message. the current vacation message for this user, ornull ifthe user does not have a vacation message. throws: GroupwareException - containing the content of the standarderror stream, if the script returns non-zero. |
removeList | public void removeList(SecuritySession securitySession, String name) throws SystemException(Code) | | Removes an existing mailing list from the system.
The removeList script is called with
name as its only parameter.
Parameters: name - the name of the list to remove. throws: GroupwareException - containing the content of the standarderror stream, if the script returns non-zero. |
removeUser | public void removeUser(SecuritySession securitySession, String userName) throws SystemException(Code) | | Remove a user from the email system. Note: this user is
not removed
from the address book, only the email server. Comments by this user
will still appear in the system, though the user will no longer
have an email account.
This is good for employees who have left the company. We still
want to see their contributions, but they no longer have access to
the system themselves.
This method calls the removeUser script.
Parameters: userName - the user to remove from the email system. throws: GroupwareException - containing the content of the standarderror stream, if the script returns non-zero. |
setList | final public void setList(SecuritySession securitySession, String name, Collection users) throws SystemException(Code) | | Adds or amends a mailing list with the name and users
provided.
This method calls the setList script with the name
as the first parameter and the user names of each of the users as
following parameters.
Parameters: name - the name of the list to be added. Parameters: users - Collection containingUserLocal instances of each of the users in the list.Note that if you are changing an existing list, this array shouldcontain all of the users, not just the new ones. throws: GroupwareException - containing the content of the standarderror stream, if the script returns non-zero. |
setPassword | final public void setPassword(SecuritySession securitySession, String userName, String password) throws SystemException(Code) | | Set a user's password in the system. This method calls the
setPassword script with userName and
password as parameters.
Parameters: userName - the user for whom to set the password. Parameters: password - new value of the password. throws: GroupwareException - containing the content of the standarderror stream, if the script returns non-zero. |
setUserAliases | final public void setUserAliases(SecuritySession securitySession, String userName, Collection aliases) throws SystemException(Code) | | Gets all of the email aliases for the user provided.
This method calls the script setUserAliases .
Parameters: userName - the user for whom to get the email aliases. Parameters: aliases - a Collection containingString values for each of the aliases. throws: GroupwareException - containing the content of the standarderror stream, if the script returns non-zero. |
setUserForwarding | final public void setUserForwarding(SecuritySession securitySession, String userName, String address) throws SystemException(Code) | | Set an email addresss to forward this user's mail to. If
address is set to null then any previous
email
forwarding is removed.
Parameters: userName - the user for whom to activate/deactive emailforwarding. Parameters: address - email address to forward all email for this user to.If thisaddress is set to null then any previous forwarding isremoved. throws: GroupwareException - containing the content of the standarderrorstream, if the script returns non-zero. |
setVacationMessage | final public void setVacationMessage(SecuritySession securitySession, String userName, String messageParam) throws SystemException(Code) | | Sets the vacation method for the user provided. This message
will be sent
to all mails received at this address until it has been cleared, by
calling
this method again with a null value for the
message
parameter.
This method calls the setVacationMessage script
with user name and message as parameters.
If the message parameter is null , then
the
script is called with just the
user name parameter.
Parameters: userName - the user for whom to set the vacation message. Parameters: messageParam - the new vacation message for this user. Set tonull to remove any existing vacation message. throws: GroupwareException - containing the content of the standarderror stream, if the script returns non-zero. |
|
|