public class UpgradeDAO extends Object
Constructor and Description |
---|
UpgradeDAO() |
Modifier and Type | Method and Description |
---|---|
void |
create(UpgradeEntity entity)
Creates the upgrade entity in the database
|
List<UpgradeEntity> |
findAll()
Get all items.
|
UpgradeEntity |
findLastUpgradeForCluster(long clusterId,
Direction direction) |
UpgradeEntity |
findLastUpgradeOrDowngradeForCluster(long clusterId) |
UpgradeEntity |
findRevertable(long clusterId)
Gets the only revertable upgrade if one exists.
|
UpgradeEntity |
findRevertableUsingJPQL(long clusterId)
Gets the only revertable upgrade if one exists.
|
UpgradeEntity |
findUpgrade(long upgradeId)
Finds a specific upgrade
|
UpgradeEntity |
findUpgradeByRequestId(Long requestId) |
UpgradeGroupEntity |
findUpgradeGroup(Long groupId) |
UpgradeItemEntity |
findUpgradeItemByRequestAndStage(Long requestId,
Long stageId) |
List<UpgradeEntity> |
findUpgrades(long clusterId) |
UpgradeEntity |
merge(UpgradeEntity upgradeEntity) |
void |
removeAll(long clusterId)
Removes all upgrades associated with the cluster.
|
public List<UpgradeEntity> findAll()
public List<UpgradeEntity> findUpgrades(long clusterId)
clusterId
- the cluster idpublic UpgradeEntity findUpgrade(long upgradeId)
upgradeId
- the idnull
if not foundpublic UpgradeEntity findUpgradeByRequestId(Long requestId)
public void create(UpgradeEntity entity)
entity
- the entitypublic void removeAll(long clusterId)
clusterId
- the cluster idpublic UpgradeGroupEntity findUpgradeGroup(Long groupId)
groupId
- the group idnull
if not foundpublic UpgradeItemEntity findUpgradeItemByRequestAndStage(Long requestId, Long stageId)
requestId
- the request idstageId
- the stage idnull
if not foundpublic UpgradeEntity findLastUpgradeForCluster(long clusterId, Direction direction)
clusterId
- the cluster iddirection
- the direction (not null
).null
if not foundpublic UpgradeEntity findLastUpgradeOrDowngradeForCluster(long clusterId)
clusterId
- the cluster idnull
if not foundpublic UpgradeEntity findRevertable(long clusterId)
RepositoryType#PATCH
or RepositoryType#MAINT
upgrade which doesn't have a downgrade already is revertable.clusterId
- the cluster idnull
if not foundpublic UpgradeEntity findRevertableUsingJPQL(long clusterId)
RepositoryType#PATCH
or RepositoryType#MAINT
upgrade which doesn't have a downgrade already is revertable.
This method tries to use some fancy SQL to do the work instead of relying on columns to be set correctly.
clusterId
- the cluster idnull
if not foundpublic UpgradeEntity merge(UpgradeEntity upgradeEntity)
Copyright © 2022 Apache Software Foundation. All rights reserved.