Class Account

java.lang.Object
ch.colabproject.colab.api.model.user.Account
All Implemented Interfaces:
ColabEntity, WithDeletionStatus, WithPermission, WithTrackingData, WithWebsocketChannels, WithId, WithJsonDiscriminator, Serializable
Direct Known Subclasses:
LocalAccount

@Entity public abstract class Account extends Object implements ColabEntity, WithWebsocketChannels
Accounts are used by users to authenticate.
Author:
maxence
See Also:
  • Constructor Details

    • Account

      public Account()
  • Method Details

    • getId

      public Long getId()
      Specified by:
      getId in interface WithId
      Returns:
      account id
    • setId

      public void setId(Long id)
      set id
      Parameters:
      id - id
    • getTrackingData

      public Tracking getTrackingData()
      Get the tracking data
      Specified by:
      getTrackingData in interface WithTrackingData
      Returns:
      tracking data
    • setTrackingData

      public void setTrackingData(Tracking trackingData)
      Set tracking data
      Specified by:
      setTrackingData in interface WithTrackingData
      Parameters:
      trackingData - new tracking data
    • getDeletionStatus

      public DeletionStatus getDeletionStatus()
      Description copied from interface: WithDeletionStatus
      Get the deletion status :

      Is it in a bin or ready to be definitely deleted.

      Null means active.

      Specified by:
      getDeletionStatus in interface WithDeletionStatus
      Returns:
      null or a deletion status
    • setDeletionStatus

      public void setDeletionStatus(DeletionStatus status)
      Description copied from interface: WithDeletionStatus
      Set the deletion status :

      Is it in a bin or ready to be definitely deleted.

      Null means active.

      Specified by:
      setDeletionStatus in interface WithDeletionStatus
      Parameters:
      status - null or a deletion status
    • getUser

      public User getUser()
      Returns:
      the user
    • setUser

      public void setUser(User user)
      Set account owner
      Parameters:
      user - user who owns this account
    • getUserId

      public Long getUserId()
      Return the id of the account owner
      Returns:
      id of the user
    • setUserId

      public void setUserId(Long id)
      set the id of the account owner. For serialization only
      Parameters:
      id - if of the user
    • getHttpSessions

      public List<HttpSession> getHttpSessions()
      Get the list of httpSession this account is using
      Returns:
      httpSession list
    • setHttpSessions

      public void setHttpSessions(List<HttpSession> httpSessions)
      Set the list of httpSession
      Parameters:
      httpSessions - new httpSessions
    • getChannelsBuilder

      public ChannelsBuilders.ChannelsBuilder getChannelsBuilder()
      Description copied from interface: WithWebsocketChannels
      Get the channels this entity shall be sent through.
      Specified by:
      getChannelsBuilder in interface WithWebsocketChannels
      Returns:
      list of channels
    • getReadCondition

      public Conditions.Condition getReadCondition()
      Description copied from interface: WithPermission
      Get the condition required to read this entity
      Specified by:
      getReadCondition in interface WithPermission
      Returns:
      the condition
    • getUpdateCondition

      public Conditions.Condition getUpdateCondition()
      Description copied from interface: WithPermission
      Get the condition required to update this entity
      Specified by:
      getUpdateCondition in interface WithPermission
      Returns:
      the condition
    • getCreateCondition

      public Conditions.Condition getCreateCondition()
      Description copied from interface: WithPermission
      Get the condition required to persist this entity
      Specified by:
      getCreateCondition in interface WithPermission
      Returns:
      the condition
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object