Class InternalUserResource.InternalUserBuilder
java.lang.Object
com.inductiveautomation.ignition.gateway.authentication.resources.InternalUserResource.InternalUserBuilder
- Enclosing class:
- InternalUserResource
Builder for the
InternalUserResource
class.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
copy
(User user, int maxHistory, InternalUserResource existingUser) Copy the fields from the given user.copy
(InternalUserResource user) Copy the fields from the given user.setContactInfos
(List<InternalContactInfoResource> contactInfos) setCreatedDate
(Date createdDate) setDescription
(String description) setExtraProps
(List<InternalUserExtraPropsResource> extraProps) setFirstName
(String firstName) setLanguage
(String language) setLastModifiedDate
(Date lastModifiedDate) setLastName
(String lastName) setPassword
(String password, boolean preHashed, int maxHistory, List<String> passwordHistory) Set the password for the user.setPassword
(String hashedPassword, Date passwordDate, List<String> passwordHistory) Set the password fields directly.setSchedule
(String schedule) setScheduleAdjustments
(List<InternalScheduleAdjustmentResource> scheduleAdjustments) setUsername
(String username)
-
Constructor Details
-
InternalUserBuilder
public InternalUserBuilder()
-
-
Method Details
-
build
-
setBadge
-
setContactInfos
public InternalUserResource.InternalUserBuilder setContactInfos(@Nullable List<InternalContactInfoResource> contactInfos) -
setDescription
-
setExtraProps
public InternalUserResource.InternalUserBuilder setExtraProps(@Nullable List<InternalUserExtraPropsResource> extraProps) -
setFirstName
-
setLanguage
-
setLastName
-
setPassword
public InternalUserResource.InternalUserBuilder setPassword(String password, boolean preHashed, int maxHistory, @Nullable List<String> passwordHistory) Set the password for the user. If the password is not pre-hashed, it will be hashed using SHA-256. The password history will be updated if necessary.- Parameters:
password
- The password to set.preHashed
- Is the password pre-hashed?maxHistory
- The maximum number of passwords to store in the history.passwordHistory
- The current password history.- Returns:
- This builder.
-
setPassword
public InternalUserResource.InternalUserBuilder setPassword(String hashedPassword, Date passwordDate, @Nullable List<String> passwordHistory) Set the password fields directly. This is useful when copying a user, and we don't want to rehash the password. The passwords will be stored as-is and no history checking will be made, so be careful with this method.- Parameters:
hashedPassword
- The pre-hashed password.passwordDate
- The date the password was hashed.passwordHistory
- The password history.- Returns:
- This builder.
- See Also:
-
setRoles
-
setSchedule
-
setScheduleAdjustments
public InternalUserResource.InternalUserBuilder setScheduleAdjustments(@Nullable List<InternalScheduleAdjustmentResource> scheduleAdjustments) -
setUsername
-
setUuid
-
setCreatedDate
-
setLastModifiedDate
-
copy
public InternalUserResource.InternalUserBuilder copy(User user, int maxHistory, @Nullable InternalUserResource existingUser) Copy the fields from the given user. Any calls to set methods will overwrite the copied values. The roles, schedule adjustments, extra properties, and contact infos are not copied because we do some special handling for those fields in the user source.- Parameters:
user
- The user to copy.maxHistory
- The maximum number of passwords to store in the history.existingUser
- The existing user, if it exists.- Returns:
- This builder.
-
copy
Copy the fields from the given user. Any calls to set methods will overwrite the copied values.- Parameters:
user
- The user to copy.- Returns:
- This builder.
-