View Javadoc

1   /*
2    * Copyright (2005-2009) Schibsted Søk AS
3    * This file is part of SESAT.
4    *
5    *   SESAT is free software: you can redistribute it and/or modify
6    *   it under the terms of the GNU Affero General Public License as published by
7    *   the Free Software Foundation, either version 3 of the License, or
8    *   (at your option) any later version.
9    *
10   *   SESAT is distributed in the hope that it will be useful,
11   *   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   *   GNU Affero General Public License for more details.
14   *
15   *   You should have received a copy of the GNU Affero General Public License
16   *   along with SESAT.  If not, see <http://www.gnu.org/licenses/>.
17   */
18  package no.sesat.search.user;
19  
20  import java.io.Serializable;
21  import java.util.Date;
22  import java.util.List;
23  import java.util.Map;
24  
25  
26  /**
27   * A user object representing the user entity.
28   *
29   * @author <a href="mailto:endre@sesam.no">Endre Midtgård Meckelborg</a>
30   * @author <a href="mailto:mick@semb.wever.org">Mck</a>
31   * @version <tt>$Id: User.java 21 2009-03-06 10:36:40Z ssmiweve $</tt>
32   */
33  public interface User extends Serializable {
34  
35      // See Javadoc in implementing class.
36  
37      Long getUserId();
38  
39      void setUserId(final Long userId);
40  
41      String getPasswordHash();
42  
43      void setPasswordHash(final String passwordHash);
44  
45      String getPasswordSalt();
46  
47      void setPasswordSalt(final String passwordSalt);
48  
49      boolean isValidPassword(final String password, final String salt);
50  
51      void setPassword(final String password);
52  
53      Date getLastLogin();
54  
55      void setLastLogin(final Date date);
56  
57      Date getCreated();
58  
59      void setCreated(final Date created);
60  
61      Date getLastUpdated();
62  
63      void setLastUpdated(final Date lastUpdated);
64  
65      List<UserProperty> getUserProperties();
66  
67      void setUserProperties(final List<UserProperty> userProperties);
68  
69      Map<String, String> getUserPropertiesMap();
70  
71      List<UserLogin> getUserLogins();
72  
73      List<UserCredential> getUserCredentials();
74  
75      void setUserLogins(final List<UserLogin> userLogins);
76  
77      List<UserCookie> getUserCookies();
78  
79      void setUserCookies(final List<UserCookie> userCookies);
80  
81      BasicUser getBasicUserInstance();
82  }