Class Actor
java.lang.Object
de.gustavblass.fsu.fmi.roombooking.model.actor.Actor
- All Implemented Interfaces:
Identified, Serializable, Comparable<Actor>, org.springframework.security.core.CredentialsContainer, org.springframework.security.core.userdetails.UserDetails
- Direct Known Subclasses:
LdapActor, LocalActor
@Entity
public abstract class Actor
extends Object
implements Identified, Comparable<Actor>, org.springframework.security.core.userdetails.UserDetails, org.springframework.security.core.CredentialsContainer
A user of the
Room-booking system. Can be an end-user, a faculty's administration employee or an IT administrator.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate @NonNull StringThe e-mail address of the user.private booleanWhether the user has activated their account after self-registration.private @NonNull LongIdentifies this Actor uniquely.private booleanWhether the faculty's administration has chosen to make the account temporarily unusable.private ActorMetadataAdditional information on the account of thisActor.private @NonNull StringThe user's clear name, as stated on their university ID card or their government ID.private @NonNull ActorRoleClassification of this Actor.private @NonNull StringHuman-friendly identifier. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintDetermines whether this Actor or a given one has the higher-priorityrole.@NonNull Collection<? extends org.springframework.security.core.GrantedAuthority> @NonNull Optional<ActorMetadata> abstract @Nullable Stringabstract @NonNull String@NonNull Stringbooleanbooleanpassword()A null-safe alternative togetPassword().voidSets themetadatato null.voidsetMetadata(@NonNull ActorMetadata metadata) Updates themetadata.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.security.core.CredentialsContainer
eraseCredentialsMethods inherited from interface Identified
getIdMethods inherited from interface org.springframework.security.core.userdetails.UserDetails
isAccountNonExpired, isCredentialsNonExpired
-
Field Details
-
id
Identifies this Actor uniquely. -
role
Classification of this Actor. Every role implies certain privileges/authorities. -
userName
Human-friendly identifier. Used as a log-in credential. -
name
The user's clear name, as stated on their university ID card or their government ID. -
eMailAddress
The e-mail address of the user. Can be used for e-mail notifications. -
enabled
private boolean enabledWhether the user has activated their account after self-registration. -
locked
private boolean lockedWhether the faculty's administration has chosen to make the account temporarily unusable. -
metadata
Additional information on the account of thisActor.
-
-
Constructor Details
-
Actor
public Actor()
-
-
Method Details
-
getTypeCode
-
password
A null-safe alternative togetPassword().- Returns:
- The password, if present.
-
getPassword
- Specified by:
getPasswordin interfaceorg.springframework.security.core.userdetails.UserDetails
-
compareTo
Determines whether this Actor or a given one has the higher-priority
role.- Negative: This Actor has a more privileged
ActorRolethan the given Actor. - Zero: Both Actors have the same role.
- Positive: This Actor has a less privileged role than the given Actor.
- Specified by:
compareToin interfaceComparable<Actor>- Returns:
- Result of the actors' role comparison.
- Negative: This Actor has a more privileged
-
getAuthorities
@Contract(pure=true) @NonNull public @NonNull Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()- Specified by:
getAuthoritiesin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
- The
GrantedAuthorityimplied by the currentActorRole.
-
getUsername
-
isEnabled
@Contract(pure=true) public boolean isEnabled()- Specified by:
isEnabledin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
- The
enabledflag.
-
isAccountNonLocked
@Contract(pure=true) public boolean isAccountNonLocked()- Specified by:
isAccountNonLockedin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
Opposite of
.invalid reference
#isLocked()
-
getMetadata
- Returns:
- The
metadata, if present.
-
setMetadata
Updates themetadata.- Parameters:
metadata- The new value for the metadata field.
-
resetMetadata
public void resetMetadata()Sets themetadatato null.
-