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 booleanconsume(TokenManager tokenManager)token effect.Conditions.ConditiongetCreateCondition()Get the condition required to persist this entityStringgetEmailBody(String link)ExpirationPolicygetExpirationPolicy()Does it have to be destroyed after one consumption, or can it live indefinitely.InstanceMakergetInstanceMaker()ProjectgetProject()If instance maker is set, return the associated projectStringgetRecipient()StringgetRedirectTo()URL to redirect the user to once the token has been consumed.StringgetSender()StringgetSubject()voidsetInstanceMaker(InstanceMaker instanceMaker)voidsetRecipient(String recipient)voidsetSender(String sender)StringtoString()-
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:TokenURL to redirect the user to once the token has been consumed.- Specified by:
getRedirectToin classToken- Returns:
- redirect to URL
-
consume
public boolean consume(TokenManager tokenManager)
Description copied from class:Tokentoken effect. As some token may require the requestManager, give it to them.
-
getExpirationPolicy
public ExpirationPolicy getExpirationPolicy()
Description copied from class:TokenDoes it have to be destroyed after one consumption, or can it live indefinitely.- Specified by:
getExpirationPolicyin classToken- Returns:
- the expiration policy
-
getSubject
public String getSubject()
- Specified by:
getSubjectin interfaceEmailableToken- Returns:
- the message subject
-
getEmailBody
public String getEmailBody(String link)
- Specified by:
getEmailBodyin 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:WithPermissionGet the condition required to persist this entity- Specified by:
getCreateConditionin interfaceWithPermission- Returns:
- the condition
-
-