Package io.github.pimak.ntfy.spring
Class NtfyProperties
java.lang.Object
io.github.pimak.ntfy.spring.NtfyProperties
Binds all
ntfy.* application properties. Spring Boot's relaxed binding maps kebab-case
(e.g. ntfy.app-name), camelCase and underscore variants onto these fields, and binds the
Duration fields natively from strings like 5s, 3m, 500ms or a bare
number interpreted as milliseconds.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetIcon()Comma-separated allow-list of MDC keys whose values are rendered into alert bodies, onekey: valueline each, in the order given here.Language of notification bodies and diagnostics as a BCP 47 tag (e.g.intintgetTitle()getToken()getTopic()getUrl()ntfyPriorityheader for WARN alerts and the WARN digest.ntfyTagsheader for WARN alerts and the WARN digest.The topic WARN-level events are published to.booleanisAsync()booleanisCache()booleanbooleanbooleanbooleanbooleanvoidsetActions(String actions) voidsetAppName(String appName) voidsetAsync(boolean async) voidsetAsyncQueueCapacity(int asyncQueueCapacity) voidsetCache(boolean cache) voidsetClickUrl(String clickUrl) voidsetConnectTimeout(Duration connectTimeout) voidsetDigestPriority(String digestPriority) voidsetDigestTags(String digestTags) voidsetEnabled(boolean enabled) voidsetErrorPriority(String errorPriority) voidsetErrorTags(String errorTags) voidsetExcludedExceptionTypes(String excludedExceptionTypes) voidsetExcludedLoggers(String excludedLoggers) voidsetFirebase(boolean firebase) voidvoidsetIconsByLogger(String iconsByLogger) voidsetIncludeMdcKeys(String includeMdcKeys) voidvoidsetMaxAlertsPerWindow(int maxAlertsPerWindow) voidsetMaxStackFrames(int maxStackFrames) voidsetPassword(String password) voidsetRequestTimeout(Duration requestTimeout) voidsetRequireHttpsForCredentials(boolean requireHttpsForCredentials) voidsetStartupPing(String startupPing) Bound as aStringrather than theStartupPingModeenum on purpose: Spring's relaxed binder throws on an unconvertible enum value, which would turn one typo inapplication.ymlinto a failed context refresh.voidsetStartupPingFailFast(boolean startupPingFailFast) voidsetStartupPingNotifyFailures(boolean startupPingNotifyFailures) voidsetStartupPingWarn(String startupPingWarn) Bound as aStringfor the same reason assetStartupPing(String).voidsetSuppressionWindow(Duration suppressionWindow) voidvoidvoidvoidvoidsetUsername(String username) voidsetWarnPriority(String warnPriority) voidsetWarnTags(String warnTags) voidsetWarnTopic(String warnTopic)
-
Constructor Details
-
NtfyProperties
public NtfyProperties()
-
-
Method Details
-
getUrl
-
setUrl
-
getTopic
-
setTopic
-
getToken
-
setToken
-
getUsername
-
setUsername
-
getPassword
-
setPassword
-
getTitle
-
setTitle
-
getAppName
-
setAppName
-
getMaxStackFrames
public int getMaxStackFrames() -
setMaxStackFrames
public void setMaxStackFrames(int maxStackFrames) -
getConnectTimeout
-
setConnectTimeout
-
getRequestTimeout
-
setRequestTimeout
-
getMaxAlertsPerWindow
public int getMaxAlertsPerWindow() -
setMaxAlertsPerWindow
public void setMaxAlertsPerWindow(int maxAlertsPerWindow) -
getSuppressionWindow
-
setSuppressionWindow
-
getErrorPriority
-
setErrorPriority
-
getDigestPriority
-
setDigestPriority
-
getErrorTags
-
setErrorTags
-
getDigestTags
-
setDigestTags
-
getWarnTopic
The topic WARN-level events are published to. A non-blank value is the entire opt-in for WARN alerting: unset (the default), alerting stays ERROR-only. Set it to the same value asntfy.topicto alert on warnings through the main topic at a different priority. -
setWarnTopic
-
getWarnPriority
ntfyPriorityheader for WARN alerts and the WARN digest. -
setWarnPriority
-
getWarnTags
ntfyTagsheader for WARN alerts and the WARN digest. -
setWarnTags
-
getClickUrl
-
setClickUrl
-
getActions
-
setActions
-
getLocale
Language of notification bodies and diagnostics as a BCP 47 tag (e.g.fr,de-DE). Defaults to English; an unknown/unshipped locale silently uses English. -
setLocale
-
getExcludedLoggers
-
setExcludedLoggers
-
getExcludedExceptionTypes
-
setExcludedExceptionTypes
-
isCache
public boolean isCache() -
setCache
public void setCache(boolean cache) -
isFirebase
public boolean isFirebase() -
setFirebase
public void setFirebase(boolean firebase) -
getIcon
-
setIcon
-
getIconsByLogger
-
setIconsByLogger
-
getIncludeMdcKeys
Comma-separated allow-list of MDC keys whose values are rendered into alert bodies, onekey: valueline each, in the order given here. Empty by default, and there is deliberately no wildcard form: an MDC value reaches a notification only when an operator named its key, because a production MDC routinely holds tokens and user identifiers that must never leave the process. -
setIncludeMdcKeys
-
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean enabled) -
isAsync
public boolean isAsync() -
setAsync
public void setAsync(boolean async) -
getAsyncQueueCapacity
public int getAsyncQueueCapacity() -
setAsyncQueueCapacity
public void setAsyncQueueCapacity(int asyncQueueCapacity) -
isRequireHttpsForCredentials
public boolean isRequireHttpsForCredentials() -
setRequireHttpsForCredentials
public void setRequireHttpsForCredentials(boolean requireHttpsForCredentials) -
getStartupPing
-
setStartupPing
Bound as aStringrather than theStartupPingModeenum on purpose: Spring's relaxed binder throws on an unconvertible enum value, which would turn one typo inapplication.ymlinto a failed context refresh. The core parses it leniently and warns instead, matching every other surface. -
isStartupPingFailFast
public boolean isStartupPingFailFast() -
setStartupPingFailFast
public void setStartupPingFailFast(boolean startupPingFailFast) -
getStartupPingWarn
-
setStartupPingWarn
Bound as aStringfor the same reason assetStartupPing(String). -
isStartupPingNotifyFailures
public boolean isStartupPingNotifyFailures() -
setStartupPingNotifyFailures
public void setStartupPingNotifyFailures(boolean startupPingNotifyFailures)
-