Classe UserLogger

(Actualitzat 30/04/2020, 16:14:57)

Extends:

Implements:

Package: org.psanz.user

Informació general

Autor: Pablo Sanz Martín

Clase que juntamente con User monta un sistema de usuarios, claves y
privilegios basados en archivos planos.
Es la clase responsable de crear y mantener los archivos, así como guardar
la información, y mantenerla, en el contexto de la aplicación.

Se empezó a utilizar en 'sevir' en enero del 2011

Revisada 29/04/2020 09:11:48
   addPassword
   addUsuario
   fetchPerfil
   getInstance
   getPerfiles
   getPswFile
   getRuta
   getUserDefControl
   getUsers
   getUsrPerfiles
   hasPrivilegio
   hasPrivilegios
   load
   load
   loadPasswords
   loadPerfiles
   loadPrivilegios
   loadUserDef
   loadUserDefined
   loadUsers
   modifyPassword
   modifyPassword
   removeUser
   removeUserFromClausFile
   removeUserFromUserFile
   saveClaves
   savePerfiles
   saveUserDef
   saveUserDef
   saveUserDefs
   saveUserPerfiles
   saveUsers
   saveUsers
   setPswFile
   setRuta
   setUsers
   splitIntoUsers
   updateInMemory
   UserLogger
        
org.psanz.user.UserLogger
Añade una usuario
@param String
@param String
@return 
@throws 
public static synchronized int addPassword(String usr, String pass) {}  
org.psanz.user.UserLogger
@param String
@return 
@throws 
private static synchronized int addUsuario(String usr) {}  
org.psanz.user.UserLogger
Devuelve el perfil asociado a un usuario
@param String
@return 
@throws 
public static String fetchPerfil(String usr)   {}  
org.psanz.user.UserLogger
@param String
@return 
@throws 
public static User getInstance(String usr)  {}  
org.psanz.user.UserLogger

@return 
@throws 
public static Map<String, String> getPerfiles() {}  
org.psanz.user.UserLogger

@return 
@throws 
public static String getPswFile() {}  
org.psanz.user.UserLogger

@return 
@throws 
public static String getRuta() {}  
org.psanz.user.UserLogger

@return 
@throws 
public static UserDefController getUserDefControl() {}  
org.psanz.user.UserLogger

@return 
@throws 
public static Map<String, String> getUsers() {}  
org.psanz.user.UserLogger

@return 
@throws 
public static Map<String, String> getUsrPerfiles() {}  
org.psanz.user.UserLogger
@param HttpSession
@param String
@return 
@throws NullPointerException
public static boolean hasPrivilegio(HttpSession session, String priv) throws NullPointerException {}  
org.psanz.user.UserLogger
Comprueba una colección de privilegios
@param HttpSession
@param String
@return 
@throws NullPointerException
public static boolean hasPrivilegios(HttpSession session, String str) throws NullPointerException {}  
org.psanz.user.UserLogger

@return 
@throws IOException
public static void load() throws IOException   {}  
org.psanz.user.UserLogger
@param Collection<String>
@return 
@throws IOException
public static void load(Collection<String> col) throws IOException   {}  
org.psanz.user.UserLogger
Carga el archivo de claves de una aplicación

@return 
@throws IOException
public static synchronized void loadPasswords() throws IOException {}  
org.psanz.user.UserLogger
Carga los perfiles si existen y si no los crea

@return 
@throws IOException
private static synchronized void loadPerfiles() throws IOException {}  
org.psanz.user.UserLogger
Carga la lista de privilegios

@return 
@throws IOException
public static synchronized void loadPrivilegios() throws IOException {}  
org.psanz.user.UserLogger
Salva un Mapa de mapas de los archivos
@param Collection<String>
@return 
@throws IOException
public static synchronized Map<String, Map<String, String>> loadUserDef(Collection<String> udFile) throws IOException {}  
org.psanz.user.UserLogger
Carga archivos de control de usuarios particulares a una aplicación
@param Collection<String>
@return 
@throws IOException
public static synchronized void loadUserDefined(Collection<String> udFile) throws IOException {}  
org.psanz.user.UserLogger
Carga el archivo de usuarios y privilegios o perfiles según el valor de USE_PROFILE

@return 
@throws IOException
public static synchronized void loadUsers() throws IOException {}  
org.psanz.user.UserLogger
Modifica la contraseña de un usuario. NECESITA LA ANTIGUA
@param String
@param String
@param String
@return 
@throws 
public static synchronized int modifyPassword(String usr, String oldKey, String newKey) {}  
org.psanz.user.UserLogger
Modifica la clave de un usuario. NO NECESITA LA ANTIGUA
@param String
@param String
@return 
@throws 
public static synchronized int modifyPassword(String usr, String newKey) {}  
org.psanz.user.UserLogger
Elimina un usuario de los Map users y claves y de los correspondientes
 archivos de texto.
@param String
@return 
@throws IOException
public static int removeUser(String usr) throws IOException {}  
org.psanz.user.UserLogger
Elimina un usuario del Map claves lo envía (claves) a resalvarse en el disco
@param String
@return 
@throws throws IOException
private static int removeUserFromClausFile(String usr)  throws IOException {}  
org.psanz.user.UserLogger
Elimina un usuario del Map users lo envía (users) a resalvarse en el disco
@param String
@return 
@throws throws IOException
private static int removeUserFromUserFile(String usr)  throws IOException {}  
org.psanz.user.UserLogger
Guarda el Map claves en disco

@return 
@throws IOException
private static synchronized void saveClaves() throws IOException {}  
org.psanz.user.UserLogger
Graba el mapa de perfiles:
 perfil:dret1;dret2;dret3...
 perfil:dret1;dret2;dret3...
 perfil:dret1;dret2;dret3...

@return 
@throws IOException
public static void savePerfiles() throws IOException {}  
org.psanz.user.UserLogger
Salva los UserDefs del Map users en el archivo correspondiente
@param String
@param User
@return 
@throws IOException
public static synchronized void saveUserDef(String file, User user) throws IOException {}  
org.psanz.user.UserLogger
@param String
@return 
@throws IOException
public static synchronized void saveUserDef(String file) throws IOException {}  
org.psanz.user.UserLogger

@return 
@throws IOException
public static synchronized void saveUserDefs() throws IOException {}  
org.psanz.user.UserLogger
Guarda el mapa entre usuarios y perfiles. Aunque en el formato en que existen
 los perfiles, el archivo físico de usuarios guarda la equivalencia usuario=perfil
 una vez se ha cargado, en la aplicación se guardan usr:rights, con lo que no de puede
 guardar usando saveUsers()

@return 
@throws IOException
public static void saveUserPerfiles() throws IOException {}  
org.psanz.user.UserLogger
Guarda los Users en el archivo correspondiente a partir de una Collection de Users
@param Collection<User>
@return 
@throws IOException
public static synchronized void saveUsers(Collection<User> col) throws IOException {}  
org.psanz.user.UserLogger

@return 
@throws IOException
public static synchronized void saveUsers() throws IOException {}  
org.psanz.user.UserLogger
@param String
@return 
@throws 
public static void setPswFile(String aPswFile) {}  
org.psanz.user.UserLogger
@param String
@return 
@throws 
public static void setRuta(String aRuta) {}  
org.psanz.user.UserLogger
@param ,Map<String
@return 
@throws 
public static void setUsers(Map<String, String> aUsers) {}  
org.psanz.user.UserLogger
Convierte una cadena con la forma: user1:dret1;dret2;dret3;user2:dret1;dret2;dret3...
 en una colección de User
@param String
@param String
@param String
@return 
@throws 
public static Collection<User> splitIntoUsers(String obj, String sepUsers, String sepRights) {}  
org.psanz.user.UserLogger
Actualiza la lista de usuarios en memoria a partir de una Collection
@param Collection<User>
@return 
@throws 
private static void updateInMemory(Collection<User> col) {}  
org.psanz.user.UserLogger

@return 
@throws 
private UserLogger()   {}