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, profileNamePWD_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, startuppublic 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.Exceptionpublic 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.Exceptionpublic AuthenticatedUser authenticate(AuthChallenge challenge) throws java.lang.Exception
UserSourceProfilejava.lang.Exceptionpublic java.util.Collection<User> getUsers()
UserSourceProfileprotected 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.Exceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Set<UserSourceEditCapability> getEditFlags()
UserSourceProfilegetEditFlags in interface UserSourceProfilegetEditFlags in class AbstractUserSourceProfilepublic java.lang.String validatePassword(@Nonnull
User user,
java.lang.String password)
UserSourceProfilepublic void addUser(User user, UICallback ui) throws java.lang.Exception
addUser in interface UserSourceProfileaddUser in class AbstractUserSourceProfilejava.lang.Exceptionprotected 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 UserSourceProfilealterPassword in class AbstractUserSourceProfilejava.lang.Exceptionpublic void alterUser(User user, UICallback ui) throws java.lang.Exception
alterUser in interface UserSourceProfilealterUser in class AbstractUserSourceProfilejava.lang.Exceptionpublic void removeUser(User user, UICallback ui) throws java.lang.Exception
removeUser in interface UserSourceProfileremoveUser in class AbstractUserSourceProfilejava.lang.Exceptionpublic void addRole(java.lang.String newName,
UICallback ui)
throws java.lang.Exception
addRole in interface UserSourceProfileaddRole in class AbstractUserSourceProfilejava.lang.Exceptionpublic void renameRole(java.lang.String oldName,
java.lang.String newName,
UICallback ui)
throws java.lang.Exception
renameRole in interface UserSourceProfilerenameRole in class AbstractUserSourceProfilejava.lang.Exceptionpublic void removeRole(java.lang.String group,
UICallback ui)
throws java.lang.Exception
removeRole in interface UserSourceProfileremoveRole in class AbstractUserSourceProfilejava.lang.Exception