Class InstanceMakerManager
java.lang.Object
ch.colabproject.colab.api.controller.team.InstanceMakerManager
Logic to manage model sharing
- Author:
- mikkelvestergaard
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAndPersistInstanceMaker(Project model, User user) Create an instance maker for the model and the user and then persist it in databaseaddInstanceMaker(Project model, User user) Create an instance maker for the model and the userassertAndGetInstanceMaker(Long instanceMakerId) Retrieve the instanceMaker.voiddeleteInstanceMaker(Long instanceMakerId) Delete instanceMakerfindInstanceMakerByProjectAndUser(Project project, User user) Find the instance maker linked to the given project and the given user.getInstanceMakersForProject(Long projectId) Retrieve all instanceMakers for a projectgetUsersForProject(Long projectId) Retrieve all users of the instanceMakersshareModel(Long modelId, String email) Send a token by email to grant access to use the model.
-
Constructor Details
-
InstanceMakerManager
public InstanceMakerManager()
-
-
Method Details
-
assertAndGetInstanceMaker
Retrieve the instanceMaker. If not found, throw aHttpErrorMessage- Parameters:
instanceMakerId- the id of the instanceMaker- Returns:
- the instanceMaker found
- Throws:
ch.colabproject.colab.generator.model.exceptions.HttpErrorMessage- if the instanceMaker was not found
-
getInstanceMakersForProject
Retrieve all instanceMakers for a project- Parameters:
projectId- the id of the project- Returns:
- list of instanceMakers
-
getUsersForProject
Retrieve all users of the instanceMakers- Parameters:
projectId- the id of the project- Returns:
- list of users
-
addAndPersistInstanceMaker
Create an instance maker for the model and the user and then persist it in database- Parameters:
user- the usermodel- the model- Returns:
- the brand-new potential instance maker
-
addInstanceMaker
Create an instance maker for the model and the user- Parameters:
user- the usermodel- the model- Returns:
- the brand-new potential instance maker
-
findInstanceMakerByProjectAndUser
Find the instance maker linked to the given project and the given user.- Parameters:
project- the projectuser- the user- Returns:
- the matching instance makers
-
deleteInstanceMaker
Delete instanceMaker- Parameters:
instanceMakerId- id of instanceMaker to delete
-