public class StackDAO extends Object
StackDAO
class is used to manage the persistence and retrieval of
StackEntity
instances.Constructor and Description |
---|
StackDAO() |
Modifier and Type | Method and Description |
---|---|
void |
create(StackEntity stack)
Persists a new stack instance.
|
void |
createOrUpdate(StackEntity stack)
Creates or updates the specified entity.
|
StackEntity |
find(StackId stackId)
Gets the stack that matches the specified stack ID by name and version.
|
StackEntity |
find(String stackName,
String stackVersion)
Gets the stack that matches the specified name and version.
|
List<StackEntity> |
findAll()
Gets all of the defined stacks.
|
StackEntity |
findById(long stackId)
Gets a stack with the specified ID.
|
StackEntity |
findByMpack(Long mpackId)
Gets the stack that matches the specified mpackid.
|
StackEntity |
merge(StackEntity stack)
Merge the speicified stack with the existing stack in the database.
|
void |
refresh(StackEntity stack)
Refresh the state of the stack instance from the database.
|
void |
remove(StackEntity stack)
Removes the specified stack and all related clusters, services and
components.
|
void |
removeByMpack(Long mpackId)
Removes the specified stack based on mpackid.
|
public StackEntity findById(long stackId)
stackId
- the ID of the stack to retrieve.null
if none exists.public List<StackEntity> findAll()
null
).public StackEntity find(String stackName, String stackVersion)
null
if none.public StackEntity find(StackId stackId)
stackId
- the stack ID to find (not null
).null
if none.public void create(StackEntity stack) throws org.apache.ambari.server.AmbariException
stack
- the stack to persist (not null
).org.apache.ambari.server.AmbariException
public void refresh(StackEntity stack)
stack
- the stack to refresh (not null
).public StackEntity merge(StackEntity stack)
stack
- the stack to merge (not null
).null
).public void createOrUpdate(StackEntity stack) throws org.apache.ambari.server.AmbariException
StackEntity.getStackId()
in order to determine whether the entity
should be created or merged.stack
- the stack to create or update (not null
).org.apache.ambari.server.AmbariException
public void remove(StackEntity stack)
stack
- the stack to remove.public void removeByMpack(Long mpackId)
mpackId
- public StackEntity findByMpack(Long mpackId)
null
if none.Copyright © 2022 Apache Software Foundation. All rights reserved.