com.atlassian.bamboo.deployments.environments.persistence
Interface EnvironmentDao

All Known Implementing Classes:
EnvironmentDaoImpl

public interface EnvironmentDao

Dao for interacting with Environments in DB.


Method Summary
 void delete(MutableEnvironment environment)
          Delete a specific Deployment Environment.
 java.util.List<MutableEnvironment> findAll()
           
 MutableEnvironment getEnvironment(DeploymentKey environmentKey)
          Gets specific Environment by key
 MutableEnvironment getEnvironment(long environmentId)
          Gets specific Environment by ID
 java.util.List<MutableEnvironment> getEnvironmentsForDeploymentProject(long deploymentProjectId)
          Retrieve all environments for a Deployment Project
 int getLastEnvironmentPosition(long deploymentProjectId)
           
 boolean isEnvironmentNameConflicting(MutableDeploymentProject deploymentProject, java.lang.String name)
          Check if there is currently an environment with the given name in the given deployment Project.
 void save(MutableEnvironment environment)
          Save a new or existing environment.
<E extends MutableEnvironment>
void
saveAll(java.util.Collection<E> environments)
          Save all items on the list;
 

Method Detail

getEnvironment

@Nullable
MutableEnvironment getEnvironment(long environmentId)
Gets specific Environment by ID

Parameters:
environmentId - ID of the environment your looking for.
Returns:
environment with given id or null if one with that ID could not be found.

getEnvironment

@Nullable
MutableEnvironment getEnvironment(@NotNull
                                           DeploymentKey environmentKey)
Gets specific Environment by key

Parameters:
environmentKey - ket of the environment to find
Returns:
Deployment Environment with given key or null if one with that key could not be found

save

void save(@NotNull
          MutableEnvironment environment)
Save a new or existing environment.

Parameters:
environment - to save.

saveAll

<E extends MutableEnvironment> void saveAll(@NotNull
                                            java.util.Collection<E> environments)
Save all items on the list;

Parameters:
environments -

getEnvironmentsForDeploymentProject

@NotNull
java.util.List<MutableEnvironment> getEnvironmentsForDeploymentProject(long deploymentProjectId)
Retrieve all environments for a Deployment Project

Parameters:
deploymentProjectId - of the Deployment Project
Returns:
List of all environments in a Deployment Project

delete

void delete(@NotNull
            MutableEnvironment environment)
Delete a specific Deployment Environment.

Parameters:
environment -

isEnvironmentNameConflicting

boolean isEnvironmentNameConflicting(@NotNull
                                     MutableDeploymentProject deploymentProject,
                                     @NotNull
                                     java.lang.String name)
Check if there is currently an environment with the given name in the given deployment Project.

Parameters:
deploymentProject - the project to check environments of
name - to check for conflict
Returns:
true if the name is already being used by an environment in the project, false if not.

findAll

java.util.List<MutableEnvironment> findAll()

getLastEnvironmentPosition

int getLastEnvironmentPosition(long deploymentProjectId)
Returns:
position of the last environment associated with a deployment project or -1 if none.


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.