com.im.df.api 15.5.11.0

com.im.df.api.capabilities
Interface IJCUserDetailsService

All Superinterfaces:
DFCapability, SchemaServiceCapability, UserDetailsService

public interface IJCUserDetailsService
extends UserDetailsService, SchemaServiceCapability

The service for IJC user table administration.


Method Summary
 UserDetails addUser(String username, String password, boolean enabled, GrantedAuthority[] authorities, DFEnvironmentRW env)
          Add a new user to the system.
 void createTables(DFEnvironmentRW env)
          Creates the database tables, deleting any that might have been present.
 void deleteTables(DFEnvironmentRW env)
          Delete the database tables
 void deleteUser(String username, DFEnvironmentRW env)
          Delete this user Can be called only when tablesExist() is true
 List<UserDetails> getAllUsers()
          Get a list of all users in the system.
 Map<GrantedAuthority,String> getAuthorities()
          Get the valid authorities that are understood by the application.
 DFLockable getLockable()
          Get special lockable for this capability.
 UserDetails loadUserByUsername(String username)
          Redefined from UserDetalsSevice interface so that security and transaction can be annotated.
 boolean tablesExist()
          Do all the database tables exist.
 UserDetails updateAuthorities(String username, GrantedAuthority[] authorities, DFEnvironmentRW env)
          Replaces current authorities with the specified ones.
 UserDetails updateEnabled(String username, boolean enabled, DFEnvironmentRW env)
          Change the enabled status of this user Can be called only when tablesExist() is true
 UserDetails updatePassword(String username, String password, DFEnvironmentRW env)
          Update the password for this user Can be called only when tablesExist() is true
 

Method Detail

getLockable

DFLockable getLockable()
Get special lockable for this capability. It must be used when calling user management methods from this interface

Returns:
The lockable

getAuthorities

Map<GrantedAuthority,String> getAuthorities()
Get the valid authorities that are understood by the application. Additional authorities can be set by adding them to the IJC_AUTHORITIES table. The roles ROLE_ADMIN, ROLE_EDIT_DATA, ROLE_EDIT_SCHEMA and ROLE_USER must be present in this table.

Returns:
Map of authorities. Keys are the authorities, the values a human readable description of the authority.

tablesExist

@Secured(value="ROLE_ADMIN")
@Transactional(readOnly=true)
boolean tablesExist()
Do all the database tables exist. If not they can be created. If so they can be deleted. If for some reason some but not all the table are present the return value will be false.


createTables

@Secured(value="ROLE_ADMIN")
@Transactional
void createTables(DFEnvironmentRW env)
Creates the database tables, deleting any that might have been present.


deleteTables

@Secured(value="ROLE_ADMIN")
@Transactional
void deleteTables(DFEnvironmentRW env)
Delete the database tables


addUser

@Secured(value="ROLE_ADMIN")
@Transactional
UserDetails addUser(String username,
                                               String password,
                                               boolean enabled,
                                               GrantedAuthority[] authorities,
                                               DFEnvironmentRW env)
Add a new user to the system. The user must be granted at least one authority to be active. Can be called only when tablesExist() is true

Parameters:
username - The username to update
password - The password
enabled - True to enable, false to disable
authorities - This user's granted authorities

deleteUser

@Secured(value="ROLE_ADMIN")
@Transactional
void deleteUser(String username,
                                           DFEnvironmentRW env)
Delete this user Can be called only when tablesExist() is true

Parameters:
username - The username to update

updatePassword

@Secured(value="ROLE_ADMIN")
@Transactional
UserDetails updatePassword(String username,
                                                      String password,
                                                      DFEnvironmentRW env)
Update the password for this user Can be called only when tablesExist() is true

Parameters:
username - The username to update
password - The new password
env - The environment

updateEnabled

@Secured(value="ROLE_ADMIN")
@Transactional
UserDetails updateEnabled(String username,
                                                     boolean enabled,
                                                     DFEnvironmentRW env)
Change the enabled status of this user Can be called only when tablesExist() is true

Parameters:
username - The username to update
enabled - True to enable, false to disable

updateAuthorities

@Secured(value="ROLE_ADMIN")
@Transactional
UserDetails updateAuthorities(String username,
                                                         GrantedAuthority[] authorities,
                                                         DFEnvironmentRW env)
Replaces current authorities with the specified ones. Can be called only when tablesExist() is true

Parameters:
username - The username to update
authorities - The new authorities.

getAllUsers

@Secured(value="ROLE_ADMIN")
@Transactional(readOnly=true)
List<UserDetails> getAllUsers()
Get a list of all users in the system. Does not include password or Granted Authorities information. Retrieve the individual user if you want this information


loadUserByUsername

@Secured(value="ROLE_ADMIN")
@Transactional(readOnly=true)
UserDetails loadUserByUsername(String username)
                               throws UsernameNotFoundException,
                                      DataAccessException
Redefined from UserDetalsSevice interface so that security and transaction can be annotated.

Specified by:
loadUserByUsername in interface UserDetailsService
Throws:
UsernameNotFoundException
DataAccessException

com.im.df.api 15.5.11.0