Class UserToken

java.lang.Object
live.crowdcontrol.cc4j.websocket.UserToken
All Implemented Interfaces:
IUserRecord

public class UserToken extends Object implements IUserRecord
  • Field Details

  • Constructor Details

    • UserToken

      public UserToken(@NotNull @NotNull String type, @NotNull @NotNull String jti, @Pattern("^ccuid-[0-7][0-9a-hjkmnp-tv-z]{25}$") @NotNull @NotNull String ccUID, @NotNull @NotNull String originID, @NotNull @NotNull ProfileType profile, @NotNull @NotNull String name, @NotNull @NotNull List<@NotNull String> roles, @Nullable @Nullable UserTokenApplication app, long exp, @NotNull @NotNull String ver)
  • Method Details

    • getType

      @NotNull public @NotNull String getType()
    • getJti

      @NotNull public @NotNull String getJti()
    • getId

      @Pattern("^ccuid-[0-7][0-9a-hjkmnp-tv-z]{25}$") @NotNull public @NotNull String getId()
      Description copied from interface: IUserRecord
      Gets the user's Crowd Control User ID.
      Specified by:
      getId in interface IUserRecord
      Returns:
      ccUID
    • getName

      @NotNull public @NotNull String getName()
      Description copied from interface: IUserRecord
      Gets the user's display name.
      Specified by:
      getName in interface IUserRecord
      Returns:
      display name
    • getProfile

      @NotNull public @NotNull ProfileType getProfile()
      Description copied from interface: IUserRecord
      Gets the type of profile the user logged in with.
      Specified by:
      getProfile in interface IUserRecord
      Returns:
      profile type
    • getOriginId

      @NotNull public @NotNull String getOriginId()
      Description copied from interface: IUserRecord
      Gets the ID of the user on their home platform.
      Specified by:
      getOriginId in interface IUserRecord
      Returns:
      origin id
    • getRoles

      @NotNull public @NotNull List<@NotNull String> getRoles()
      Gets the user's roles. Some roles include admin, ambassador, partner.
      Returns:
      list of roles
    • getApp

      @Nullable public @Nullable UserTokenApplication getApp()
      Gets the details for the Application that initialized this token.
      Returns:
      app details or null
    • getExp

      public long getExp()
      Gets the Unix epoch seconds timestamp at which this token will expire.
      Returns:
      expiration time in unix epoch seconds
    • getVer

      @NotNull public @NotNull String getVer()