|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.cinecolombia.component.Security.ejb.SecurityDAO
This class has JDBC calls required by Security EJB for implementing its services
Field Summary | |
private java.lang.String |
companyId
current company |
private javax.sql.DataSource |
datasource
datasource corresponding to the database |
private java.sql.Connection |
dbConnection
connection with the database |
private Debug |
debug
The ubiquitous debugging object. |
private java.lang.Long |
userId
current user |
Constructor Summary | |
SecurityDAO(java.lang.String companyId,
java.lang.Long userId)
|
Method Summary | |
private int |
auxGetNullInt(java.sql.ResultSet rs,
int index)
metodo auxiliar que obtiene un valor int de un Resultset, posiblemente null, |
private long |
auxGetNullLong(java.sql.ResultSet rs,
int index)
metodo auxiliar que obtiene un valor long de un Resultset, posiblemente null, |
private java.util.ArrayList |
auxLoadUserModulosConPermisos(java.sql.ResultSet rs)
Auxiliary method of LoadUserModulosConPermisos |
private void |
auxSetNullDate(java.sql.PreparedStatement ps,
java.sql.Date value,
int index)
metodo auxiliar que asigna un valor, posiblemente null, a un parametro Date de un PreparedStatement |
private void |
auxSetNullInt(java.sql.PreparedStatement ps,
int value,
int index)
metodo auxiliar que asigna un valor, posiblemente null, a un parametro int de un PreparedStatement |
private void |
auxSetNullLong(java.sql.PreparedStatement ps,
long value,
int index)
metodo auxiliar que asigna un valor, posiblemente null, a un parametro long de un PreparedStatement |
private void |
auxSetNullString(java.sql.PreparedStatement ps,
java.lang.String value,
int index)
metodo auxiliar que asigna un valor, posiblemente null, a un parametro String de un PreparedStatement |
java.util.ArrayList |
getUserProfile(java.lang.String userName,
java.lang.String companyNumber)
Loads user profile: global data and security user actions from DatabaseNames.COMPANIA, USUARIO, COMPANIA, USUARIO_CASOUSO_ACCION |
java.util.Hashtable |
getUsersRoles()
Loads users and associated roles of the system from DatabaseNames.USUARIO_ROL view |
void |
inactivateUser(long idUsuario)
set user to inactive state in DatabaseNames.USUARIO |
ParametrosGlobalesModel |
loadCompany()
Get global parameters of current company from DatabaseNames.COMPANIA table |
Profile |
loadProfile(long idProfile)
Get complete data of a profile from DatabaseNames.PERFIL,DatabaseNames.MODULO, DatabaseNames.CASO_USO, DatabaseNames.ACCION, DatabaseNames.ACCION_PERFIL |
java.util.ArrayList |
loadSystemProfiles()
Get list of system profiles ordered by nombre_perfil from DatabaseNames.PERFIL |
User |
loadUser(long idUsuario)
Get data of selected user from DatabaseNames.USUARIO |
java.util.ArrayList |
loadUserModulosConPermisos(long idUsuario)
Get list of system modules and the permissions of user from DatabaseNames.PERMISO_PERFIL and DatabaseNames.PERMISO_ESPECIAL views, DatabaseNames.MODULO, DatabaseNames.CASO_USO and DatabaseNames.ACCION tables |
java.util.ArrayList |
loadUserProfiles(long idUsuario)
Get list of user profiles (for a specific user) ordered by nombre_perfil from DatabaseNames.PERFIL, REL_PERFIL_USUARIO |
java.util.ArrayList |
loadUsers()
Get list of active users (except the SUPERUSER) ordered by codigoUsuario from DatabaseNames.USUARIO |
void |
removeProfile(long idProfile)
Remove complete data of a profile |
void |
revokePermisosUsuario(long idUsuario,
long[] codigosRevocados)
Revoke every especial permissions of user in DatabaseNames.ACCION_USUARIO table |
void |
setState(java.lang.String companyId,
java.lang.Long userId)
Set value of attributes |
void |
storePermisosUsuario(long idUsuario,
AccionPermisoEspecial accionesPermisoEspecial)
Save new especial permissions of user in DatabaseNames.ACCION_USUARIO table |
void |
storeProfile(long idProfile,
java.lang.String profileName,
long[] allowedActions)
Set complete data of a profile into DatabaseNames.PERFIL and DatabaseNames.ACCION_PERFIL |
void |
storeUser(User user,
long[] userProfilesCodes)
Store user in DatabaseNames.USUARIO, REL_PERFIL_USUARIO |
void |
updateCompany(ParametrosGlobalesValue value)
Set global parameters of current company into from DatabaseNames.COMPANIA table |
void |
updatePassword(java.lang.String newPassword)
Update the password of the user from DatabaseNames.USUARIO table |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.lang.String companyId
private java.lang.Long userId
private java.sql.Connection dbConnection
private javax.sql.DataSource datasource
private Debug debug
Constructor Detail |
public SecurityDAO(java.lang.String companyId, java.lang.Long userId) throws DAOException
companyId
- current companyuserId
- current user
DAOException
- Description of the ExceptionMethod Detail |
public java.util.ArrayList getUserProfile(java.lang.String userName, java.lang.String companyNumber) throws DAOException
userName
- Description of the ParametercompanyNumber
- Description of the Parameter
DAOException
public java.util.Hashtable getUsersRoles() throws DAOException
DAOException
public void setState(java.lang.String companyId, java.lang.Long userId)
companyId
- userId
- public java.util.ArrayList loadUsers() throws DAOException
DAOException
public java.util.ArrayList loadSystemProfiles() throws DAOException
DAOException
public User loadUser(long idUsuario) throws DAOException
idUsuario
- Description of the Parameter
DAOException
public java.util.ArrayList loadUserProfiles(long idUsuario) throws DAOException
idUsuario
- Description of the Parameter
DAOException
public void storeUser(User user, long[] userProfilesCodes) throws DAOException
user
- data of the useruserProfilesCodes
- profiles of the user
DAOException
public void inactivateUser(long idUsuario) throws DAOException
idUsuario
- identifier of the user
DAOException
public void updatePassword(java.lang.String newPassword) throws DAOException
newPassword
- new password of the user
DAOException
public Profile loadProfile(long idProfile) throws DAOException
idProfile
- code of Profile
DAOException
public void storeProfile(long idProfile, java.lang.String profileName, long[] allowedActions) throws DAOException
idProfile
- Code of ProfileprofileName
- Name of PerfilallowedActions
- List of actions allowed
DAOException
public void removeProfile(long idProfile) throws DAOException
idProfile
- Code of Profile
DAOException
public ParametrosGlobalesModel loadCompany() throws DAOException
DAOException
public void updateCompany(ParametrosGlobalesValue value) throws DAOException
value
- ParametrosGlobalesValue Object.
DAOException
public java.util.ArrayList loadUserModulosConPermisos(long idUsuario) throws DAOException
idUsuario
- Code of user
DAOException
public void revokePermisosUsuario(long idUsuario, long[] codigosRevocados) throws DAOException
idUsuario
- User codecodigosRevocados
- List of revoked especial permissions
DAOException
public void storePermisosUsuario(long idUsuario, AccionPermisoEspecial accionesPermisoEspecial) throws DAOException
idUsuario
- User codeaccionesPermisoEspecial
- Set of new especial permissions
DAOException
private java.util.ArrayList auxLoadUserModulosConPermisos(java.sql.ResultSet rs) throws java.lang.Exception
rs
- ResultSet
java.lang.Exception
private void auxSetNullString(java.sql.PreparedStatement ps, java.lang.String value, int index) throws java.lang.Exception
ps
- el PreparedStatementvalue
- el String posiblemente nullindex
- indice del parametro a asignar.
java.lang.Exception
private void auxSetNullDate(java.sql.PreparedStatement ps, java.sql.Date value, int index) throws java.lang.Exception
ps
- el PreparedStatementvalue
- el Date posiblemente nullindex
- indice del parametro a asignar.
java.lang.Exception
private void auxSetNullLong(java.sql.PreparedStatement ps, long value, int index) throws java.lang.Exception
ps
- el PreparedStatementvalue
- si es UNDEF, se asignara null a ps, si no el valueindex
- indice del parametro a asignar.
java.lang.Exception
private void auxSetNullInt(java.sql.PreparedStatement ps, int value, int index) throws java.lang.Exception
ps
- el PreparedStatementvalue
- si es UNDEF, se asignara null a ps, si no el valueindex
- indice del parametro a asignar.
java.lang.Exception
private long auxGetNullLong(java.sql.ResultSet rs, int index) throws java.lang.Exception
rs
- el Resultsetindex
- indice del parametro a obtener.
java.lang.Exception
private int auxGetNullInt(java.sql.ResultSet rs, int index) throws java.lang.Exception
rs
- el Resultsetindex
- indice del parametro a obtener.
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |