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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class ch.colabproject.colab.api.model.token.Token
SALT, TOKEN_SEQUENCE_NAME
-
-
Constructor Summary
Constructors Constructor Description ModelSharingToken()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
consume(TokenManager tokenManager)
token effect.Conditions.Condition
getCreateCondition()
Get the condition required to persist this entityString
getEmailBody(String link)
ExpirationPolicy
getExpirationPolicy()
Does it have to be destroyed after one consumption, or can it live indefinitely.InstanceMaker
getInstanceMaker()
Project
getProject()
If instance maker is set, return the associated projectString
getRecipient()
String
getRedirectTo()
URL to redirect the user to once the token has been consumed.String
getSender()
String
getSubject()
void
setInstanceMaker(InstanceMaker instanceMaker)
void
setRecipient(String recipient)
void
setSender(String sender)
String
toString()
-
Methods inherited from class ch.colabproject.colab.api.model.token.Token
checkHash, equals, getDeletionStatus, getExpirationDate, getHashedToken, getHashMethod, getId, getReadCondition, getTrackingData, getUpdateCondition, hashCode, isAuthenticationRequired, isOutdated, mergeToUpdate, setAuthenticationRequired, setDeletionStatus, setExpirationDate, setHashedToken, setHashMethod, setId, setTrackingData
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ch.colabproject.colab.api.model.ColabEntity
mergeToDuplicate
-
Methods inherited from interface ch.colabproject.colab.api.model.token.TokenWithURL
getId, setHashedToken, setHashMethod
-
Methods inherited from interface ch.colabproject.colab.generator.model.interfaces.WithJsonDiscriminator
getJsonDiscriminator
-
Methods inherited from interface ch.colabproject.colab.api.model.WithPermission
getDeleteCondition
-
Methods inherited from interface ch.colabproject.colab.api.model.WithTrackingData
initErasureTrackingData, resetErasureTrackingData, touch
-
-
-
-
Method Detail
-
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 classToken
- 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.
-
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 classToken
- Returns:
- the expiration policy
-
getSubject
public String getSubject()
- Specified by:
getSubject
in interfaceEmailableToken
- Returns:
- the message subject
-
getEmailBody
public String getEmailBody(String link)
- Specified by:
getEmailBody
in interfaceEmailableToken
- 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 interfaceWithPermission
- Returns:
- the condition
-
-