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 classIJEMHTransportProvider.TransportContentType
-
Field Summary
Fields Modifier and Type Field Description static StringCONFIG_NAME_KEYKey that configurations store a display name/description for the configuration, for use in JEMH when displaying itstatic StringCONFIG_WEBHOOK
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TransportConfigWrappercreateConfig()voiddeleteConfig(int fConfigId)List<TransportConfigWrapper>getAllConfigs()TransportConfigWrappergetConfig(int configId)StringgetHelpURL()Gets the URL that users can navigate to in order to access documentation for the transportStringgetIssueEventSubject(long eventId)StringgetIssueEventTemplate(long eventId, IJEMHTransportProvider.TransportContentType type)StringgetStatus()Get the status of the addonTransportStatusgetTransportStatus(int transportConfigId)booleanisUsable()If something prevents this addon from being usedbooleanneedsHtmlTemplate()hints for JEMH to enable HTML template editingbooleanneedsSubjectTemplate()hints for JEMH to enable subject template editingbooleanneedsTextTemplate()hints for JEMH to enable TEXT template editingvoidsend(ITransportNotificationItem item)voidsendAdHocMessage(int transportConfigId, String subject, String content, List<String> recipients, Map<String,List<String>> params)AD-Hoc notificationsvoidsendTestMessage(int configId, String testMessage)send a test message using the given config and textvoidupdateConfig(TransportConfigWrapper config)voidvalidateConfig(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 TransportExceptionAD-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 TransportExceptionsend 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:
isUsablein interfaceIJEMHModuleProvider- Returns:
- true if this transport is usable
-
getStatus
String getStatus()
Description copied from interface:IJEMHModuleProviderGet the status of the addon- Specified by:
getStatusin 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
-
-