AccessController.java
001 /*
002  *  AccessController.java
003  *
004  *  Copyright (c) 1995-2010, The University of Sheffield. See the file
005  *  COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
006  *
007  *  This file is part of GATE (see http://gate.ac.uk/), and is free
008  *  software, licenced under the GNU Library General Public License,
009  *  Version 2, June 1991 (in the distribution as file licence.html,
010  *  and also available at http://gate.ac.uk/gate/licence.html).
011  *
012  *  Marin Dimitrov, 19/Sep/2001
013  *
014  *  $Id: AccessController.java 12006 2009-12-01 17:24:28Z thomas_heitz $
015  */
016 
017 package gate.security;
018 
019 import java.util.List;
020 
021 import gate.persist.PersistenceException;
022 
023 
024 public interface AccessController {
025 
026   /** --- */
027   public Group findGroup(String name)
028     throws PersistenceException, SecurityException;
029 
030   /** --- */
031   public Group findGroup(Long id)
032     throws PersistenceException, SecurityException;
033 
034   /** --- */
035   public User findUser(String name)
036     throws PersistenceException, SecurityException;
037 
038   /** --- */
039   public User findUser(Long id)
040     throws PersistenceException, SecurityException;
041 
042   /** --- */
043   public Session findSession(Long id)
044     throws SecurityException;
045 
046   /** --- */
047   public Group createGroup(String name,Session s)
048     throws PersistenceException, SecurityException;
049 
050   /** --- */
051   public void deleteGroup(Long id, Session s)
052     throws PersistenceException, SecurityException;
053 
054   /** --- */
055   public void deleteGroup(Group grp, Session s)
056     throws PersistenceException, SecurityException;
057 
058   /** --- */
059   public User createUser(String name, String passwd,Session s)
060     throws PersistenceException, SecurityException;
061 
062   /** --- */
063   public void deleteUser(User usr, Session s)
064     throws PersistenceException, SecurityException;
065 
066   /** --- */
067   public void deleteUser(Long id, Session s)
068     throws PersistenceException, SecurityException;
069 
070   /** --- */
071   public Session login(String usr_name, String passwd, Long prefGroupID)
072     throws PersistenceException, SecurityException;
073 
074   /** --- */
075   public void logout(Session s)
076     throws SecurityException;
077 
078   /** --- */
079   public void setSessionTimeout(Session s, int timeoutMins)
080     throws SecurityException;
081 
082   /** --- */
083   public boolean isValidSession(Session s)
084     throws SecurityException;
085 
086 
087   /** --- */
088   public void open()
089     throws PersistenceException;
090 
091   /** --- */
092   public void close()
093     throws PersistenceException;
094 
095 
096   /** -- */
097   public List listUsers()
098     throws PersistenceException;
099 
100   /** -- */
101   public List listGroups()
102     throws PersistenceException;
103 
104   /** -- */
105   public boolean isValidSecurityInfo(SecurityInfo si);
106 
107 }