Class RestAgentServiceImpl
java.lang.Object
com.atlassian.bamboo.plugins.rest.admin.agent.RestAgentServiceImpl
- All Implemented Interfaces:
RestAgentService
Service layer to manage agents
-
Constructor Summary
ConstructorsConstructorDescriptionRestAgentServiceImpl
(AgentManager agentManager, com.atlassian.sal.api.message.I18nResolver i18nResolver, RestPermissionCheck restPermissionCheck, EphemeralAgentsService ephemeralAgentsService) -
Method Summary
Modifier and TypeMethodDescription@NotNull RestAgent
getAgentById
(@NotNull javax.ws.rs.core.UriInfo uriInfo, long agentId) Retrieve an agent definition@NotNull RestPageModel<RestAgent>
getAgents
(@NotNull javax.ws.rs.core.UriInfo uriInfo) Retrieve all agents on the bamboo server@NotNull RestAgent
updateAgent
(@NotNull javax.ws.rs.core.UriInfo uriInfo, long agentId, @NotNull RestAgent restAgent) Update an agent
-
Constructor Details
-
RestAgentServiceImpl
@Autowired public RestAgentServiceImpl(AgentManager agentManager, com.atlassian.sal.api.message.I18nResolver i18nResolver, RestPermissionCheck restPermissionCheck, EphemeralAgentsService ephemeralAgentsService)
-
-
Method Details
-
getAgents
@NotNull public @NotNull RestPageModel<RestAgent> getAgents(@NotNull @NotNull javax.ws.rs.core.UriInfo uriInfo) Description copied from interface:RestAgentService
Retrieve all agents on the bamboo server- Specified by:
getAgents
in interfaceRestAgentService
- Parameters:
uriInfo
- Object that provides access to information of http request- Returns:
- Collection of agents
-
getAgentById
@NotNull public @NotNull RestAgent getAgentById(@NotNull @NotNull javax.ws.rs.core.UriInfo uriInfo, long agentId) throws NotFoundException Description copied from interface:RestAgentService
Retrieve an agent definition- Specified by:
getAgentById
in interfaceRestAgentService
- Parameters:
uriInfo
- Object that provides access to information of http requestagentId
- Id of agent- Returns:
- RestAgent object that contains the definition of the agent
- Throws:
NotFoundException
- if no agent exists with an id equal to agentId
-
updateAgent
@NotNull public @NotNull RestAgent updateAgent(@NotNull @NotNull javax.ws.rs.core.UriInfo uriInfo, long agentId, @NotNull @NotNull RestAgent restAgent) throws WebValidationException, NotFoundException Description copied from interface:RestAgentService
Update an agent- Specified by:
updateAgent
in interfaceRestAgentService
- Parameters:
uriInfo
- Object that provides access to information of http requestagentId
- Id of the agent to be updatedrestAgent
- The updated agent definition- Returns:
- The updated agent
- Throws:
WebValidationException
- If the agent definition is invalidNotFoundException
- if no agent exists with an id equal to agentId
-