Package com.atlassian.bamboo.webhook
Class DefaultWebhookTemplateService
- java.lang.Object
-
- com.atlassian.bamboo.webhook.DefaultWebhookTemplateService
-
- All Implemented Interfaces:
WebhookTemplateService
public class DefaultWebhookTemplateService extends Object implements WebhookTemplateService
-
-
Constructor Summary
Constructors Constructor Description DefaultWebhookTemplateService(WebhookTemplateDao webhookTemplateDao, BambooPermissionManager bambooPermissionManager, com.atlassian.event.api.EventPublisher eventPublisher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteById(long webhookId)Deletes Webhook Template with given idbooleanexists(String webhookName)Check if Webhook Template with given name existsOptional<WebhookTemplate>findById(long webhookId)Finds WebhookTemplate By idOptional<WebhookTemplate>findByUuid(UUID uuid)Finds WebhookTemplate By uuidOptional<String>findNameByUuid(UUID uuid)Finds Webhook Template name for given uuidOptional<UUID>findUuidByName(String name)Return uuid for Webhook Template with given nameUUIDgenerateUuid()List<WebhookTemplate>getGlobalWebhooks()return all Global webhook specified in Global AdministrationList<org.springframework.http.HttpMethod>getSupportedMethods()WebhookTemplatesave(WebhookTemplate webhookTemplate)Saves new webhook templatevoidupdate(WebhookTemplate webhookTemplate)Updates Webhook Template which already exists
-
-
-
Constructor Detail
-
DefaultWebhookTemplateService
@Autowired public DefaultWebhookTemplateService(WebhookTemplateDao webhookTemplateDao, BambooPermissionManager bambooPermissionManager, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Detail
-
save
public WebhookTemplate save(WebhookTemplate webhookTemplate)
Description copied from interface:WebhookTemplateServiceSaves new webhook template- Specified by:
savein interfaceWebhookTemplateService- Returns:
-
getGlobalWebhooks
public List<WebhookTemplate> getGlobalWebhooks()
Description copied from interface:WebhookTemplateServicereturn all Global webhook specified in Global Administration- Specified by:
getGlobalWebhooksin interfaceWebhookTemplateService- Returns:
-
findById
public Optional<WebhookTemplate> findById(long webhookId)
Description copied from interface:WebhookTemplateServiceFinds WebhookTemplate By id- Specified by:
findByIdin interfaceWebhookTemplateService- Returns:
-
update
public void update(WebhookTemplate webhookTemplate)
Description copied from interface:WebhookTemplateServiceUpdates Webhook Template which already exists- Specified by:
updatein interfaceWebhookTemplateService
-
deleteById
public void deleteById(long webhookId)
Description copied from interface:WebhookTemplateServiceDeletes Webhook Template with given id- Specified by:
deleteByIdin interfaceWebhookTemplateService
-
findNameByUuid
public Optional<String> findNameByUuid(UUID uuid)
Description copied from interface:WebhookTemplateServiceFinds Webhook Template name for given uuid- Specified by:
findNameByUuidin interfaceWebhookTemplateService- Returns:
- name
- See Also:
NameProvider.getName()
-
exists
public boolean exists(String webhookName)
Description copied from interface:WebhookTemplateServiceCheck if Webhook Template with given name exists- Specified by:
existsin interfaceWebhookTemplateService- Returns:
- true if exists, otherwise false
-
findUuidByName
public Optional<UUID> findUuidByName(String name)
Description copied from interface:WebhookTemplateServiceReturn uuid for Webhook Template with given name- Specified by:
findUuidByNamein interfaceWebhookTemplateService- Returns:
- Webhook Template id
- See Also:
BambooIdProvider.getId()
-
findByUuid
public Optional<WebhookTemplate> findByUuid(UUID uuid)
Description copied from interface:WebhookTemplateServiceFinds WebhookTemplate By uuid- Specified by:
findByUuidin interfaceWebhookTemplateService- Returns:
-
generateUuid
public UUID generateUuid()
- Specified by:
generateUuidin interfaceWebhookTemplateService- Returns:
- uuid for webhook
-
getSupportedMethods
public List<org.springframework.http.HttpMethod> getSupportedMethods()
- Specified by:
getSupportedMethodsin interfaceWebhookTemplateService
-
-