public class InternalUserSource extends AbstractUserSourceProfile
This user source stores users, groups, extended properties, and contact info inside the internal database. It is fully compliant with the user-source editing capabilities of Ignition.
Relevant persistent records:
cacheValidationTimeout, context, manager, profileId, profileName
PWD_EXPIRATION_BYPASS
Constructor and Description |
---|
InternalUserSource(GatewayContext context,
long profileId,
java.lang.String profileName,
long cacheTimeout) |
InternalUserSource(GatewayContext context,
long profileId,
java.lang.String profileName,
long cacheTimeout,
int pwdHistory,
int pwdMinLength,
int pwdComplexity,
int pwdMaxAge) |
Modifier and Type | Method and Description |
---|---|
void |
addRole(java.lang.String newName,
UICallback ui) |
void |
addUser(User user,
UICallback ui) |
void |
alterPassword(User user,
java.lang.String oldPassword,
java.lang.String newPassword) |
void |
alterUser(User user,
UICallback ui) |
AuthenticatedUser |
authenticate(AuthChallenge challenge)
Called to both verify authentication for a given username/password pair, and to find the security roles for that
user.
|
static long |
createDefaultUserSource(GatewayContext context)
Creates an internal user source called "default" with user "admin"/"password" and role "Administrator".
|
static long |
createFirstUser(GatewayContext context,
java.lang.String username,
java.lang.String password,
boolean preEncrypted)
Creates an internal user source called "default" with the supplied username and password and role
"Administrator".
|
protected java.lang.Long |
findUserInternalId(PersistenceSession session,
User user) |
protected java.util.List<ContactInfo> |
getContactInfoForUser(PersistenceSession session,
InternalUserRecord user) |
java.util.Set<UserSourceEditCapability> |
getEditFlags()
Which of the editing functions are supported?
|
java.util.Collection<java.lang.String> |
getRoles() |
protected java.util.List<java.lang.String> |
getRolesForUser(PersistenceSession session,
InternalUserRecord user) |
protected java.util.List<ScheduleAdjustment> |
getScheduleAdjustmentsForUser(PersistenceSession session,
InternalUserRecord user) |
java.util.Collection<User> |
getUsers()
Retrieve all users from this profile.
|
protected void |
loadExtendedUserProperties(PersistenceSession session,
InternalUserRecord userRec,
PropertySet user) |
protected void |
loadUserProperties(InternalUserRecord userRec,
User user) |
void |
removeRole(java.lang.String group,
UICallback ui) |
void |
removeUser(User user,
UICallback ui) |
void |
renameRole(java.lang.String oldName,
java.lang.String newName,
UICallback ui) |
java.lang.String |
toString() |
java.lang.String |
validatePassword(User user,
java.lang.String password)
Validate the given password.
|
getCacheValidationTimeout, getName, getProfileId, shutdown, startup
public InternalUserSource(GatewayContext context, long profileId, java.lang.String profileName, long cacheTimeout)
public InternalUserSource(GatewayContext context, long profileId, java.lang.String profileName, long cacheTimeout, int pwdHistory, int pwdMinLength, int pwdComplexity, int pwdMaxAge)
public static long createDefaultUserSource(GatewayContext context) throws java.lang.Exception
java.lang.Exception
public static long createFirstUser(GatewayContext context, java.lang.String username, java.lang.String password, boolean preEncrypted) throws java.lang.Exception
context
- The GatewayContext instanceusername
- The username, Must not be nullpassword
- The password either pre-encrypted or not. Must not be nulljava.lang.Exception
public AuthenticatedUser authenticate(AuthChallenge challenge) throws java.lang.Exception
UserSourceProfile
java.lang.Exception
public java.util.Collection<User> getUsers()
UserSourceProfile
protected void loadUserProperties(InternalUserRecord userRec, User user)
protected java.util.List<java.lang.String> getRolesForUser(PersistenceSession session, InternalUserRecord user)
protected java.util.List<ContactInfo> getContactInfoForUser(PersistenceSession session, InternalUserRecord user)
protected java.util.List<ScheduleAdjustment> getScheduleAdjustmentsForUser(PersistenceSession session, InternalUserRecord user)
protected void loadExtendedUserProperties(PersistenceSession session, InternalUserRecord userRec, PropertySet user)
public java.util.Collection<java.lang.String> getRoles() throws java.lang.Exception
java.lang.Exception
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Set<UserSourceEditCapability> getEditFlags()
UserSourceProfile
getEditFlags
in interface UserSourceProfile
getEditFlags
in class AbstractUserSourceProfile
public java.lang.String validatePassword(@Nonnull User user, java.lang.String password)
UserSourceProfile
public void addUser(User user, UICallback ui) throws java.lang.Exception
addUser
in interface UserSourceProfile
addUser
in class AbstractUserSourceProfile
java.lang.Exception
protected java.lang.Long findUserInternalId(PersistenceSession session, User user)
public void alterPassword(User user, java.lang.String oldPassword, java.lang.String newPassword) throws java.lang.Exception
alterPassword
in interface UserSourceProfile
alterPassword
in class AbstractUserSourceProfile
java.lang.Exception
public void alterUser(User user, UICallback ui) throws java.lang.Exception
alterUser
in interface UserSourceProfile
alterUser
in class AbstractUserSourceProfile
java.lang.Exception
public void removeUser(User user, UICallback ui) throws java.lang.Exception
removeUser
in interface UserSourceProfile
removeUser
in class AbstractUserSourceProfile
java.lang.Exception
public void addRole(java.lang.String newName, UICallback ui) throws java.lang.Exception
addRole
in interface UserSourceProfile
addRole
in class AbstractUserSourceProfile
java.lang.Exception
public void renameRole(java.lang.String oldName, java.lang.String newName, UICallback ui) throws java.lang.Exception
renameRole
in interface UserSourceProfile
renameRole
in class AbstractUserSourceProfile
java.lang.Exception
public void removeRole(java.lang.String group, UICallback ui) throws java.lang.Exception
removeRole
in interface UserSourceProfile
removeRole
in class AbstractUserSourceProfile
java.lang.Exception