User.java
01 /*
02  *  User.java
03  *
04  *  Copyright (c) 1995-2010, The University of Sheffield. See the file
05  *  COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
06  *
07  *  This file is part of GATE (see http://gate.ac.uk/), and is free
08  *  software, licenced under the GNU Library General Public License,
09  *  Version 2, June 1991 (in the distribution as file licence.html,
10  *  and also available at http://gate.ac.uk/gate/licence.html).
11  *
12  *  Marin Dimitrov, 19/Sep/2001
13  *
14  *  $Id: User.java 12006 2009-12-01 17:24:28Z thomas_heitz $
15  */
16 
17 package gate.security;
18 
19 import java.util.List;
20 
21 import gate.persist.PersistenceException;
22 
23 
24 public interface User {
25 
26   /** subtype for ObjectModificationEvent of type OBJECT_MODIFIED
27    *  @see gate.event.ObjectModificationEvent
28    *  the event is sent when the name of the user is changed
29    *  */
30   public static final int OBJECT_CHANGE_NAME        = 1001;
31 
32 
33   /** returns the ID of the user
34    *  user IDs are uniques in the same
35    *  data store
36    *  */
37   public Long getID();
38 
39   /** returns the name of the user
40    *  user names are unique in the
41    *  same data store */
42   public String getName();
43 
44   /** returns a list with the groups that the
45    *  user is member of  */
46   public List getGroups();
47 
48   /** changes user name
49    *  Only members of the ADMIN group have sufficient privileges.
50    *  fires ObjectModificationEvent  */
51   public void setName(String newName, Session s)
52     throws PersistenceException,SecurityException;
53 
54   /** changes user password
55    *  Only members of the ADMIN group and the user himself
56    *  have sufficient privileges */
57   public void setPassword(String newPass, Session s)
58     throws PersistenceException,SecurityException;
59 }