Package dev.getelements.elements.sdk.dao
Interface ElementDeploymentDao
- All Known Implementing Classes:
MongoElementDeploymentDao
public interface ElementDeploymentDao
Provides access to
ElementDeployment instances in the database.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncreateElementDeployment(ElementDeployment elementDeployment) Creates a newElementDeployment.voiddeleteDeployment(String deploymentId) Deletes theElementDeploymentwith the supplied id.findElementDeployment(String deploymentId) Finds theElementDeploymentwith the supplied deployment ID.default ElementDeploymentgetElementDeployment(String deploymentId) Gets theElementDeploymentwith the supplied deployment ID.getElementDeployments(int offset, int count, String search) Gets all deployments with offset, count, and search query.Gets allElementDeploymentinstances with the specified state.updateElementDeployment(ElementDeployment elementDeployment) Updates anElementDeployment.
-
Field Details
-
ELEMENT_DEPLOYMENT_CREATED
- See Also:
-
ELEMENT_DEPLOYMENT_UPDATED
- See Also:
-
ELEMENT_DEPLOYMENT_DELETED
- See Also:
-
-
Method Details
-
createElementDeployment
Creates a newElementDeployment.- Parameters:
elementDeployment- theElementDeployment- Returns:
- the
ElementDeploymentas written to the database
-
getElementDeployments
Gets all deployments with offset, count, and search query.- Parameters:
offset- the offsetcount- the countsearch- the search- Returns:
- the
PaginationofElementDeploymentinstances
-
findElementDeployment
Finds theElementDeploymentwith the supplied deployment ID.- Parameters:
deploymentId- the deployment ID- Returns:
- an
Optional<ElementDeployment>
-
getElementDeployment
Gets theElementDeploymentwith the supplied deployment ID.- Parameters:
deploymentId- the deployment ID- Returns:
- the
ElementDeployment, never null - Throws:
ElementDeploymentNotFoundException- if not found
-
updateElementDeployment
Updates anElementDeployment. Note this must implicitly update theElementDeployment.version()value incrementing by one for every successful modification.- Parameters:
elementDeployment- the deployment- Returns:
- the updated deployment
-
deleteDeployment
Deletes theElementDeploymentwith the supplied id.- Parameters:
deploymentId- the deployment ID
-
getElementDeploymentsByState
Gets allElementDeploymentinstances with the specified state.- Parameters:
state- the state to filter by- Returns:
- list of deployments in that state
-