Record Class PushHttpHandler.AuthUser
java.lang.Object
java.lang.Record
com.iizix.server.push.engine.http.PushHttpHandler.AuthUser
- Record Components:
uid- The database user ID, orPushHttpHandler.NO_UIDfor a caller with none.userName- The user name.privileges- The union of the caller's groups' privileges, never null.
- Enclosing class:
PushHttpHandler
public static record PushHttpHandler.AuthUser(long uid, String userName, Set<PushPrivilege> privileges) extends Record
An authenticated caller.
- Author:
- Christopher Mindus
Constructor Summary
ConstructorsConstructorDescriptionAuthUser(long uid, String userName, Set<PushPrivilege> privileges) Canonical constructor: the privileges are copied and made unmodifiable, null is none.Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.booleanhas(PushPrivilege privilege) Tells whether the caller holds a privilege.final inthashCode()Returns a hash code value for this object.booleanTells whether the caller is a database user, the only kind with auid, and so the only kind that may make a device operation (section 5.0).Returns the value of theprivilegesrecord component.final StringtoString()Returns a string representation of this record class.longuid()Returns the value of theuidrecord component.userName()Returns the value of theuserNamerecord component.
Constructor Details
AuthUser
Canonical constructor: the privileges are copied and made unmodifiable, null is none.
Method Details
has
Tells whether the caller holds a privilege.- Parameters:
privilege- The privilege.- Returns:
- true if one of the caller's groups grants it.
isDatabaseUser
public boolean isDatabaseUser()Tells whether the caller is a database user, the only kind with auid, and so the only kind that may make a device operation (section 5.0).- Returns:
- true for a database user.
toString
hashCode
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes.uid
userName
privileges
Returns the value of theprivilegesrecord component.- Returns:
- the value of the
privilegesrecord component