Class ModelSharingToken

java.lang.Object
ch.colabproject.colab.api.model.token.Token
ch.colabproject.colab.api.model.token.ModelSharingToken
All Implemented Interfaces:
ColabEntity, EmailableToken, TokenWithURL, WithDeletionStatus, WithPermission, WithTrackingData, ch.colabproject.colab.generator.model.interfaces.WithId, ch.colabproject.colab.generator.model.interfaces.WithJsonDiscriminator, Serializable

@Entity public class ModelSharingToken extends Token implements EmailableToken
A token to share a model to a user
Author:
sandra
See Also:
  • Constructor Details

    • ModelSharingToken

      public ModelSharingToken()
  • Method Details

    • getInstanceMaker

      public InstanceMaker getInstanceMaker()
      Returns:
      the pending instance maker
    • setInstanceMaker

      public void setInstanceMaker(InstanceMaker instanceMaker)
      Parameters:
      instanceMaker - the pending instance maker
    • getSender

      public String getSender()
      Returns:
      the sender name
    • setSender

      public void setSender(String sender)
      Parameters:
      sender - the sender name
    • getRecipient

      public String getRecipient()
      Returns:
      the email address to send the sharing to
    • setRecipient

      public void setRecipient(String recipient)
      Parameters:
      recipient - the email address to send the sharing to
    • getRedirectTo

      public String getRedirectTo()
      Description copied from class: Token
      URL to redirect the user to once the token has been consumed.
      Specified by:
      getRedirectTo in class Token
      Returns:
      redirect to URL
    • consume

      public boolean consume(TokenManager tokenManager)
      Description copied from class: Token
      token effect. As some token may require the requestManager, give it to them.
      Specified by:
      consume in class Token
      Parameters:
      tokenManager - token manager that handles all token-specific logic
      Returns:
      true if the token can be consumed
    • getExpirationPolicy

      public ExpirationPolicy getExpirationPolicy()
      Description copied from class: Token
      Does it have to be destroyed after one consumption, or can it live indefinitely.
      Specified by:
      getExpirationPolicy in class Token
      Returns:
      the expiration policy
    • getSubject

      public String getSubject()
      Specified by:
      getSubject in interface EmailableToken
      Returns:
      the message subject
    • getEmailBody

      public String getEmailBody(String link)
      Specified by:
      getEmailBody in interface EmailableToken
      Parameters:
      link - link to embed in the body
      Returns:
      email body html text
    • getProject

      public Project getProject()
      If instance maker is set, return the associated project
      Returns:
      the model project
    • 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
    • toString

      public String toString()
      Overrides:
      toString in class Object