Class EphemeralAgentsServiceImpl
- java.lang.Object
-
- com.atlassian.bamboo.agent.ephemeral.EphemeralAgentsServiceImpl
-
- All Implemented Interfaces:
EphemeralAgentsService
public class EphemeralAgentsServiceImpl extends Object implements EphemeralAgentsService
-
-
Constructor Summary
Constructors Constructor Description EphemeralAgentsServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addOrUpdateCapability(@NotNull EphemeralAgentTemplate template, @NotNull Capability capability)
EphemeralAgentTemplate
copyEphemeralAgentTemplate(@NotNull EphemeralAgentTemplate ephemeralAgentTemplate)
Copies specified Ephemeral Agent Template and saves it within the persistence layer.void
deleteEphemeralAgentTemplate(@NotNull EphemeralAgentTemplate ephemeralAgentTemplate)
Deletes specified Ephemeral Agent Template from the persistence layer.EphemeralAgentsConfiguration
getEphemeralAgentsBaseConfiguration()
@NotNull Optional<EphemeralAgentTemplate>
getEphemeralAgentTemplate(long id)
Gets the Ephemeral Agent Template for the requested ID if the one exist.@NotNull List<EphemeralAgentTemplate>
getEphemeralAgentTemplates()
Gets all available Ephemeral Agent Templates.@NotNull List<EphemeralAgentTemplate>
getEphemeralAgentTemplates(@Nullable String filter, int start, int limit)
Gets list of Ephemeral Agent Templates filtered.boolean
isEphemeralAgentsEnabled()
void
removeCapability(@NotNull EphemeralAgentTemplate template, @NotNull String capabilityKey)
void
saveEphemeralAgentsBaseConfiguration(@NotNull EphemeralAgentsConfiguration ephemeralAgentsConfiguration)
Persist ephemeral agents configuration.void
saveEphemeralAgentTemplate(@NotNull EphemeralAgentTemplate ephemeralAgentTemplate)
Saves specified Ephemeral Agent Template within the persistence layer.TestConnectionResult
testConnection(EphemeralAgentsConfiguration configuration)
Validate ephemeral agents configuration and perform attempt to connect provider with provided settings.
-
-
-
Method Detail
-
getEphemeralAgentsBaseConfiguration
public EphemeralAgentsConfiguration getEphemeralAgentsBaseConfiguration()
- Specified by:
getEphemeralAgentsBaseConfiguration
in interfaceEphemeralAgentsService
- Returns:
- ephemeral agents configuration
-
saveEphemeralAgentsBaseConfiguration
public void saveEphemeralAgentsBaseConfiguration(@NotNull @NotNull EphemeralAgentsConfiguration ephemeralAgentsConfiguration) throws WebValidationException
Description copied from interface:EphemeralAgentsService
Persist ephemeral agents configuration.- Specified by:
saveEphemeralAgentsBaseConfiguration
in interfaceEphemeralAgentsService
- Throws:
WebValidationException
- when settings are not valid
-
isEphemeralAgentsEnabled
public boolean isEphemeralAgentsEnabled()
- Specified by:
isEphemeralAgentsEnabled
in interfaceEphemeralAgentsService
- Returns:
- true if ephemeral agents functionality is enabled
-
testConnection
public TestConnectionResult testConnection(EphemeralAgentsConfiguration configuration)
Description copied from interface:EphemeralAgentsService
Validate ephemeral agents configuration and perform attempt to connect provider with provided settings.- Specified by:
testConnection
in interfaceEphemeralAgentsService
- Returns:
- result of connection attempt
-
getEphemeralAgentTemplates
@NotNull public @NotNull List<EphemeralAgentTemplate> getEphemeralAgentTemplates()
Description copied from interface:EphemeralAgentsService
Gets all available Ephemeral Agent Templates.- Specified by:
getEphemeralAgentTemplates
in interfaceEphemeralAgentsService
- Returns:
- list of the configurations
-
getEphemeralAgentTemplates
@NotNull public @NotNull List<EphemeralAgentTemplate> getEphemeralAgentTemplates(@Nullable @Nullable String filter, int start, int limit)
Description copied from interface:EphemeralAgentsService
Gets list of Ephemeral Agent Templates filtered. It supports pagination.- Specified by:
getEphemeralAgentTemplates
in interfaceEphemeralAgentsService
- Returns:
- list of templates
-
getEphemeralAgentTemplate
@NotNull public @NotNull Optional<EphemeralAgentTemplate> getEphemeralAgentTemplate(long id)
Description copied from interface:EphemeralAgentsService
Gets the Ephemeral Agent Template for the requested ID if the one exist.- Specified by:
getEphemeralAgentTemplate
in interfaceEphemeralAgentsService
- Parameters:
id
- entity identifier- Returns:
- value if the one exists, empty otherwise
-
saveEphemeralAgentTemplate
public void saveEphemeralAgentTemplate(@NotNull @NotNull EphemeralAgentTemplate ephemeralAgentTemplate) throws TemplateValidationException, org.springframework.dao.DataIntegrityViolationException
Description copied from interface:EphemeralAgentsService
Saves specified Ephemeral Agent Template within the persistence layer.- Specified by:
saveEphemeralAgentTemplate
in interfaceEphemeralAgentsService
- Parameters:
ephemeralAgentTemplate
- entity to save- Throws:
TemplateValidationException
org.springframework.dao.DataIntegrityViolationException
-
deleteEphemeralAgentTemplate
public void deleteEphemeralAgentTemplate(@NotNull @NotNull EphemeralAgentTemplate ephemeralAgentTemplate)
Description copied from interface:EphemeralAgentsService
Deletes specified Ephemeral Agent Template from the persistence layer.- Specified by:
deleteEphemeralAgentTemplate
in interfaceEphemeralAgentsService
- Parameters:
ephemeralAgentTemplate
- entity to delete
-
copyEphemeralAgentTemplate
public EphemeralAgentTemplate copyEphemeralAgentTemplate(@NotNull @NotNull EphemeralAgentTemplate ephemeralAgentTemplate)
Description copied from interface:EphemeralAgentsService
Copies specified Ephemeral Agent Template and saves it within the persistence layer.- Specified by:
copyEphemeralAgentTemplate
in interfaceEphemeralAgentsService
- Parameters:
ephemeralAgentTemplate
- entity to copy- Returns:
- copy of the entity
-
addOrUpdateCapability
public void addOrUpdateCapability(@NotNull @NotNull EphemeralAgentTemplate template, @NotNull @NotNull Capability capability)
- Specified by:
addOrUpdateCapability
in interfaceEphemeralAgentsService
-
removeCapability
public void removeCapability(@NotNull @NotNull EphemeralAgentTemplate template, @NotNull @NotNull String capabilityKey)
- Specified by:
removeCapability
in interfaceEphemeralAgentsService
-
-