1 /*****************************************************************
2 * Licensed to the Apache Software Foundation (ASF) under one *
3 * or more contributor license agreements. See the NOTICE file *
4 * distributed with this work for additional information *
5 * regarding copyright ownership. The ASF licenses this file *
6 * to you under the Apache License, Version 2.0 (the *
7 * "License"); you may not use this file except in compliance *
8 * with the License. You may obtain a copy of the License at *
9 * *
10 * http://www.apache.org/licenses/LICENSE-2.0 *
11 * *
12 * Unless required by applicable law or agreed to in writing, *
13 * software distributed under the License is distributed on an *
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
15 * KIND, either express or implied. See the License for the *
16 * specific language governing permissions and limitations *
17 * under the License. *
18 ****************************************************************/
19
20 package org.apache.james.services;
21
22 import org.apache.mailet.MailAddress;
23
24 /***
25 * Interface for objects representing users of an email/ messaging system.
26 *
27 *
28 * @version $Revision: 494012 $
29 */
30
31 public interface JamesUser extends User {
32
33 /***
34 * Change password to pass. Return true if successful.
35 *
36 * @param pass the new password
37 * @return true if successful, false otherwise
38 */
39 boolean setPassword(String pass);
40
41 /***
42 * Indicate if mail for this user should be forwarded to some other mail
43 * server.
44 *
45 * @param forward whether email for this user should be forwarded
46 */
47 void setForwarding(boolean forward);
48
49 /***
50 * Return true if mail for this user should be forwarded
51 */
52 boolean getForwarding();
53
54 /***
55 * <p>Set destination for forwading mail</p>
56 * <p>TODO: Should we use a MailAddress?</p>
57 *
58 * @param address the forwarding address for this user
59 */
60 boolean setForwardingDestination(MailAddress address);
61
62 /***
63 * Return the destination to which email should be forwarded
64 */
65 MailAddress getForwardingDestination();
66
67 /***
68 * Indicate if mail received for this user should be delivered locally to
69 * a different address.
70 */
71 void setAliasing(boolean alias);
72
73 /***
74 * Return true if emails should be delivered locally to an alias.
75 */
76 boolean getAliasing();
77
78 /***
79 * Set local address to which email should be delivered.
80 *
81 * @return true if successful
82 */
83 boolean setAlias(String address);
84
85 /***
86 * Get local address to which mail should be delivered.
87 */
88 String getAlias();
89
90
91 }