1   /*
2    *  AccessController.java
3    *
4    *  Copyright (c) 1998-2005, The University of Sheffield.
5    *
6    *  This file is part of GATE (see http://gate.ac.uk/), and is free
7    *  software, licenced under the GNU Library General Public License,
8    *  Version 2, June 1991 (in the distribution as file licence.html,
9    *  and also available at http://gate.ac.uk/gate/licence.html).
10   *
11   *  Marin Dimitrov, 19/Sep/2001
12   *
13   *  $Id: AccessController.java,v 1.16 2005/01/11 13:51:36 ian Exp $
14   */
15  
16  package gate.security;
17  
18  import java.util.List;
19  
20  import gate.persist.PersistenceException;
21  
22  
23  public interface AccessController {
24  
25    /** --- */
26    public Group findGroup(String name)
27      throws PersistenceException, SecurityException;
28  
29    /** --- */
30    public Group findGroup(Long id)
31      throws PersistenceException, SecurityException;
32  
33    /** --- */
34    public User findUser(String name)
35      throws PersistenceException, SecurityException;
36  
37    /** --- */
38    public User findUser(Long id)
39      throws PersistenceException, SecurityException;
40  
41    /** --- */
42    public Session findSession(Long id)
43      throws SecurityException;
44  
45    /** --- */
46    public Group createGroup(String name,Session s)
47      throws PersistenceException, SecurityException;
48  
49    /** --- */
50    public void deleteGroup(Long id, Session s)
51      throws PersistenceException, SecurityException;
52  
53    /** --- */
54    public void deleteGroup(Group grp, Session s)
55      throws PersistenceException, SecurityException;
56  
57    /** --- */
58    public User createUser(String name, String passwd,Session s)
59      throws PersistenceException, SecurityException;
60  
61    /** --- */
62    public void deleteUser(User usr, Session s)
63      throws PersistenceException, SecurityException;
64  
65    /** --- */
66    public void deleteUser(Long id, Session s)
67      throws PersistenceException, SecurityException;
68  
69    /** --- */
70    public Session login(String usr_name, String passwd, Long prefGroupID)
71      throws PersistenceException, SecurityException;
72  
73    /** --- */
74    public void logout(Session s)
75      throws SecurityException;
76  
77    /** --- */
78    public void setSessionTimeout(Session s, int timeoutMins)
79      throws SecurityException;
80  
81    /** --- */
82    public boolean isValidSession(Session s)
83      throws SecurityException;
84  
85  
86    /** --- */
87    public void open()
88      throws PersistenceException;
89  
90    /** --- */
91    public void close()
92      throws PersistenceException;
93  
94  
95    /** -- */
96    public List listUsers()
97      throws PersistenceException;
98  
99    /** -- */
100   public List listGroups()
101     throws PersistenceException;
102 
103   /** -- */
104   public boolean isValidSecurityInfo(SecurityInfo si);
105 
106 }
107