com.atlassian.bamboo.buildqueue.dao
Interface AgentDao

All Superinterfaces:
BambooObjectDao, bucket.core.persistence.ObjectDao
All Known Implementing Classes:
AgentHibernateDao

public interface AgentDao
extends BambooObjectDao

Agent Definition Dao that can search on PipelineDefinitions as well as it sub classes.


Method Summary
 PipelineDefinition findAgentByName(java.lang.String name)
          Retrieve a pipelineDefinition by name.
 java.util.List<PipelineDefinition> findAllAgents()
          Retrieves all agents();
 java.util.Set<PipelineDefinition> findAllAgentsForAgentIds(java.util.Collection<java.lang.Long> agentIds)
          Return a list of agents by their ids
 java.util.List<PipelineDefinition> findAllAgentsWithNameLike(java.lang.String likeName)
          Retrun a list of agents whose name is like the provided string.
 java.util.List<ElasticAgentDefinition> findAllElasticAgents()
          Retrieves all elastic agents
 java.util.List<LocalAgentDefinition> findAllLocalAgents()
          Retrieves all local agents
 java.util.List<RemoteAgentDefinition> findAllRemoteAgents()
          Retrieves all remote agents
 PipelineDefinition getAgentById(long id)
          Retrieve the agentDefinition object.
 PipelineDefinition getLocalAgentById(long id)
          Retrieve the localAgentDefinition
 PipelineDefinition getRemoteAgentById(long id)
          Retrieve the remoteAgentDefinition
 PipelineDefinition saveAndReturn(PipelineDefinition pipelineDefinition)
          Saves the passed definition and returns a new copy of the updated pipeline definition
 
Methods inherited from interface com.atlassian.bamboo.persistence.BambooObjectDao
findById
 
Methods inherited from interface bucket.core.persistence.ObjectDao
findAll, findAllSorted, getPersistentClass, refresh, remove, replicate, save, saveRaw
 

Method Detail

saveAndReturn

@NotNull
PipelineDefinition saveAndReturn(@NotNull
                                         PipelineDefinition pipelineDefinition)
Saves the passed definition and returns a new copy of the updated pipeline definition

Parameters:
pipelineDefinition - to save
Returns:
the saved and updated (e.g with agentId) pipelineDefinition

getAgentById

PipelineDefinition getAgentById(long id)
Retrieve the agentDefinition object.

Parameters:
id - - the id for the agent to be retrieved
Returns:
agentDefinition associated with the agentId or null if it couldn't be found

getLocalAgentById

PipelineDefinition getLocalAgentById(long id)
Retrieve the localAgentDefinition

Parameters:
id - of the agent
Returns:
LocalAgentDefintion associated with the id if no agent found, returns null

getRemoteAgentById

PipelineDefinition getRemoteAgentById(long id)
Retrieve the remoteAgentDefinition

Parameters:
id - of the agent
Returns:
RemoteAgentDefintion associated with the id if no agent found, returns null

findAllRemoteAgents

java.util.List<RemoteAgentDefinition> findAllRemoteAgents()
Retrieves all remote agents

Returns:
List of all remote agents

findAllLocalAgents

java.util.List<LocalAgentDefinition> findAllLocalAgents()
Retrieves all local agents

Returns:
List of all local agents

findAllElasticAgents

java.util.List<ElasticAgentDefinition> findAllElasticAgents()
Retrieves all elastic agents

Returns:
List

findAllAgents

java.util.List<PipelineDefinition> findAllAgents()
Retrieves all agents();

Returns:
List of all agents

findAllAgentsWithNameLike

@NotNull
java.util.List<PipelineDefinition> findAllAgentsWithNameLike(@NotNull
                                                                     java.lang.String likeName)
Retrun a list of agents whose name is like the provided string. Uses hibernate's "like" so % to mark wild card.

Parameters:
likeName - the string to match
Returns:
List of Pipeline Definitions

findAllAgentsForAgentIds

java.util.Set<PipelineDefinition> findAllAgentsForAgentIds(@NotNull
                                                           java.util.Collection<java.lang.Long> agentIds)
Return a list of agents by their ids

Parameters:
buildResultsSummaries -
Returns:
List of PipelineDefinition

findAgentByName

@Nullable
PipelineDefinition findAgentByName(@NotNull
                                            java.lang.String name)
Retrieve a pipelineDefinition by name. Names should be unique.

Parameters:
name - of the agent to find
Returns:
the agent that has the given name.


Copyright © 2010 Atlassian. All Rights Reserved.