Class GreenhouseService
- java.lang.Object
-
- com.inhousegreenhouse.ch.backend.service.GreenhouseService
-
public class GreenhouseService extends java.lang.Object
Service for Greenhouse.
-
-
Constructor Summary
Constructors Constructor Description GreenhouseService(GreenhouseRepository repository)
Constructor for GreenhouseService.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addGreenhouse(java.lang.String name, java.lang.String description, java.lang.String userToken)
Add a new greenhouse to the repository.Greenhouse
getGreenhouse()
Get a greenhouse from the repository.
-
-
-
Constructor Detail
-
GreenhouseService
public GreenhouseService(GreenhouseRepository repository)
Constructor for GreenhouseService.- Parameters:
repository
- The GreenhouseRepository to use.
-
-
Method Detail
-
addGreenhouse
public boolean addGreenhouse(java.lang.String name, java.lang.String description, java.lang.String userToken)
Add a new greenhouse to the repository.- Parameters:
name
- The name of the greenhouse.description
- The description of the greenhouse.userToken
- The user token of the user.- Returns:
- The UUID of the greenhouse.
-
getGreenhouse
public Greenhouse getGreenhouse() throws GreenhouseNotInitializedException
Get a greenhouse from the repository.- Returns:
- The greenhouse.
- Throws:
GreenhouseNotInitializedException
- If the greenhouse is not initialized.
-
-