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 void
deleteById(long webhookId)
Deletes Webhook Template with given idboolean
exists(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 nameUUID
generateUuid()
List<WebhookTemplate>
getGlobalWebhooks()
return all Global webhook specified in Global AdministrationList<org.springframework.http.HttpMethod>
getSupportedMethods()
WebhookTemplate
save(WebhookTemplate webhookTemplate)
Saves new webhook templatevoid
update(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:WebhookTemplateService
Saves new webhook template- Specified by:
save
in interfaceWebhookTemplateService
- Returns:
-
getGlobalWebhooks
public List<WebhookTemplate> getGlobalWebhooks()
Description copied from interface:WebhookTemplateService
return all Global webhook specified in Global Administration- Specified by:
getGlobalWebhooks
in interfaceWebhookTemplateService
- Returns:
-
findById
public Optional<WebhookTemplate> findById(long webhookId)
Description copied from interface:WebhookTemplateService
Finds WebhookTemplate By id- Specified by:
findById
in interfaceWebhookTemplateService
- Returns:
-
update
public void update(WebhookTemplate webhookTemplate)
Description copied from interface:WebhookTemplateService
Updates Webhook Template which already exists- Specified by:
update
in interfaceWebhookTemplateService
-
deleteById
public void deleteById(long webhookId)
Description copied from interface:WebhookTemplateService
Deletes Webhook Template with given id- Specified by:
deleteById
in interfaceWebhookTemplateService
-
findNameByUuid
public Optional<String> findNameByUuid(UUID uuid)
Description copied from interface:WebhookTemplateService
Finds Webhook Template name for given uuid- Specified by:
findNameByUuid
in interfaceWebhookTemplateService
- Returns:
- name
- See Also:
NameProvider.getName()
-
exists
public boolean exists(String webhookName)
Description copied from interface:WebhookTemplateService
Check if Webhook Template with given name exists- Specified by:
exists
in interfaceWebhookTemplateService
- Returns:
- true if exists, otherwise false
-
findUuidByName
public Optional<UUID> findUuidByName(String name)
Description copied from interface:WebhookTemplateService
Return uuid for Webhook Template with given name- Specified by:
findUuidByName
in interfaceWebhookTemplateService
- Returns:
- Webhook Template id
- See Also:
BambooIdProvider.getId()
-
findByUuid
public Optional<WebhookTemplate> findByUuid(UUID uuid)
Description copied from interface:WebhookTemplateService
Finds WebhookTemplate By uuid- Specified by:
findByUuid
in interfaceWebhookTemplateService
- Returns:
-
generateUuid
public UUID generateUuid()
- Specified by:
generateUuid
in interfaceWebhookTemplateService
- Returns:
- uuid for webhook
-
getSupportedMethods
public List<org.springframework.http.HttpMethod> getSupportedMethods()
- Specified by:
getSupportedMethods
in interfaceWebhookTemplateService
-
-