Interface IJEMHTransportProvider
-
- All Superinterfaces:
IJEMHModuleProvider
public interface IJEMHTransportProvider extends IJEMHModuleProvider
Interface for common transports
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
IJEMHTransportProvider.TransportContentType
-
Field Summary
Fields Modifier and Type Field Description static String
CONFIG_NAME_KEY
Key that configurations store a display name/description for the configuration, for use in JEMH when displaying itstatic String
CONFIG_WEBHOOK
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TransportConfigWrapper
createConfig()
void
deleteConfig(int fConfigId)
List<TransportConfigWrapper>
getAllConfigs()
TransportConfigWrapper
getConfig(int configId)
String
getHelpURL()
Gets the URL that users can navigate to in order to access documentation for the transportString
getIssueEventSubject(long eventId)
String
getIssueEventTemplate(long eventId, IJEMHTransportProvider.TransportContentType type)
String
getStatus()
Get the status of the addonTransportStatus
getTransportStatus(int transportConfigId)
boolean
isUsable()
If something prevents this addon from being usedboolean
needsHtmlTemplate()
hints for JEMH to enable HTML template editingboolean
needsSubjectTemplate()
hints for JEMH to enable subject template editingboolean
needsTextTemplate()
hints for JEMH to enable TEXT template editingvoid
send(ITransportNotificationItem item)
void
sendAdHocMessage(int transportConfigId, String subject, String content, List<String> recipients, Map<String,List<String>> params)
AD-Hoc notificationsvoid
sendTestMessage(int configId, String testMessage)
send a test message using the given config and textvoid
updateConfig(TransportConfigWrapper config)
void
validateConfig(TransportConfigWrapper config, Map<String,String> errors)
-
Methods inherited from interface com.javahollic.jira.emh.api.extension.IJEMHModuleProvider
getDescription, getKey, getName, getVendor, getVendorUrl
-
-
-
-
Field Detail
-
CONFIG_NAME_KEY
static final String CONFIG_NAME_KEY
Key that configurations store a display name/description for the configuration, for use in JEMH when displaying it- See Also:
- Constant Field Values
-
CONFIG_WEBHOOK
static final String CONFIG_WEBHOOK
- See Also:
- Constant Field Values
-
-
Method Detail
-
getConfig
TransportConfigWrapper getConfig(int configId)
-
getAllConfigs
List<TransportConfigWrapper> getAllConfigs()
-
validateConfig
void validateConfig(TransportConfigWrapper config, Map<String,String> errors)
-
createConfig
TransportConfigWrapper createConfig()
-
updateConfig
void updateConfig(TransportConfigWrapper config)
-
deleteConfig
void deleteConfig(int fConfigId)
-
sendAdHocMessage
void sendAdHocMessage(int transportConfigId, String subject, String content, List<String> recipients, Map<String,List<String>> params) throws TransportException
AD-Hoc notifications- Parameters:
transportConfigId
- the transport specific config to usesubject
- , can be null, transport will ignore if not relevant, eg XMPP postingcontent
- , the rendered content to userecipients
- , list of recipient identifiers, e.g. user/chat room ID's or mobile phone numbersparams
- , a map of keys to multiple values that may be used in the given transport. E.g., for SMTP, this could be a set of SMTP mail header prefixes- Throws:
TransportException
- if it breaks
-
getIssueEventTemplate
String getIssueEventTemplate(long eventId, IJEMHTransportProvider.TransportContentType type)
- Parameters:
eventId
- event idtype
- content type- Returns:
- template text for the given event and content type
-
getIssueEventSubject
String getIssueEventSubject(long eventId)
- Parameters:
eventId
- event id- Returns:
- the issue event subject
-
needsSubjectTemplate
boolean needsSubjectTemplate()
hints for JEMH to enable subject template editing- Returns:
- if subject template needed
-
needsTextTemplate
boolean needsTextTemplate()
hints for JEMH to enable TEXT template editing- Returns:
- if TEXT template needed
-
needsHtmlTemplate
boolean needsHtmlTemplate()
hints for JEMH to enable HTML template editing- Returns:
- if HTML template needed
-
sendTestMessage
void sendTestMessage(int configId, String testMessage) throws TransportException
send a test message using the given config and text- Parameters:
configId
- the config to usetestMessage
- the message to send- Throws:
TransportException
- if something breaks
-
isUsable
boolean isUsable()
If something prevents this addon from being used- Specified by:
isUsable
in interfaceIJEMHModuleProvider
- Returns:
- true if this transport is usable
-
getStatus
String getStatus()
Description copied from interface:IJEMHModuleProvider
Get the status of the addon- Specified by:
getStatus
in interfaceIJEMHModuleProvider
- Returns:
- text status of the addon
-
getTransportStatus
TransportStatus getTransportStatus(int transportConfigId)
- Parameters:
transportConfigId
- to test- Returns:
- status of the given transport
-
send
void send(ITransportNotificationItem item) throws TransportException
- Parameters:
item
- to send- Throws:
TransportException
- if it breaks
-
getHelpURL
String getHelpURL()
Gets the URL that users can navigate to in order to access documentation for the transport- Returns:
- the String representing the URL where the documentation is located
-
-