Package com.floragunn.signals.watch
Class Watch
- java.lang.Object
-
- com.floragunn.signals.watch.common.WatchElement
-
- com.floragunn.signals.watch.Watch
-
- All Implemented Interfaces:
com.floragunn.searchsupport.jobs.config.JobConfig,org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentObject
public class Watch extends WatchElement implements com.floragunn.searchsupport.jobs.config.JobConfig, org.elasticsearch.common.xcontent.ToXContentObject
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWatch.HiddenAttributesstatic classWatch.JobConfigFactorystatic classWatch.Meta
-
Field Summary
Fields Modifier and Type Field Description protected com.floragunn.searchsupport.util.duration.DurationExpressionthrottlePeriodstatic org.elasticsearch.common.xcontent.ToXContent.ParamsWITHOUT_AUTH_TOKENstatic Map<String,String>WITHOUT_AUTH_TOKEN_PARAM_MAPstatic org.elasticsearch.common.xcontent.ToXContent.ParamsWITHOUT_META_AND_ACTIVE
-
Constructor Summary
Constructors Constructor Description Watch()Watch(org.quartz.JobKey jobKey, com.floragunn.searchsupport.jobs.config.schedule.Schedule schedule, List<Check> checks, SeverityMapping severityMapping, List<AlertAction> actions, List<ResolveAction> resolveActions)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.quartz.JobKeycreateJobKey(String id)List<AlertAction>getActions()StringgetAuthToken()List<Check>getChecks()StringgetDescription()StringgetId()StringgetIdAndHash()static Map<String,Object>getIndexMapping()Class<? extends org.quartz.Job>getJobClass()Map<String,Object>getJobDataMap()org.quartz.JobKeygetJobKey()Watch.MetagetMeta()List<ResolveAction>getNonGeneratedResolveActions()List<ResolveAction>getResolveActions()com.floragunn.searchsupport.jobs.config.schedule.SchedulegetSchedule()StringgetSecureAuthTokenAudience()SeverityMappinggetSeverityMapping()StringgetTenant()com.floragunn.searchsupport.util.duration.DurationExpressiongetThrottlePeriod()List<org.quartz.Trigger>getTriggers()Map<String,Object>getUi()longgetVersion()inthashCode()booleanisActive()booleanisDurable()booleanisLogRuntimeData()static Watchparse(WatchInitializationService ctx, String tenant, String id, com.fasterxml.jackson.databind.JsonNode jsonNode)static Watchparse(WatchInitializationService ctx, String tenant, String id, com.fasterxml.jackson.databind.JsonNode jsonNode, long version)static Watchparse(WatchInitializationService ctx, String tenant, String id, String json, long version)static WatchparseFromElasticDocument(WatchInitializationService ctx, String tenant, String id, String json, long version)StringsecureHash()voidsetActive(boolean active)voidsetDescription(String description)voidsetLogRuntimeData(boolean logRuntimeData)voidsetResolveActions(List<ResolveAction> resolveActions)voidsetSchedule(com.floragunn.searchsupport.jobs.config.schedule.Schedule schedule)voidsetSeverityMapping(SeverityMapping severityMapping)voidsetTenant(String tenant)voidsetThrottlePeriod(com.floragunn.searchsupport.util.duration.DurationExpression throttlePeriod)voidsetUi(Map<String,Object> ui)StringtoJson()StringtoJsonWithoutAuthToken()StringtoJsonWithoutMetaAndActive()StringtoString()org.elasticsearch.common.xcontent.XContentBuildertoXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)-
Methods inherited from class com.floragunn.signals.watch.common.WatchElement
getChildByNameAndType, getChildByNameAndType, getChildren, getName, render, render
-
-
-
-
Field Detail
-
WITHOUT_AUTH_TOKEN
public static final org.elasticsearch.common.xcontent.ToXContent.Params WITHOUT_AUTH_TOKEN
-
WITHOUT_META_AND_ACTIVE
public static final org.elasticsearch.common.xcontent.ToXContent.Params WITHOUT_META_AND_ACTIVE
-
throttlePeriod
protected com.floragunn.searchsupport.util.duration.DurationExpression throttlePeriod
-
-
Constructor Detail
-
Watch
public Watch()
-
Watch
public Watch(org.quartz.JobKey jobKey, com.floragunn.searchsupport.jobs.config.schedule.Schedule schedule, List<Check> checks, SeverityMapping severityMapping, List<AlertAction> actions, List<ResolveAction> resolveActions)
-
-
Method Detail
-
getId
public String getId()
-
getJobKey
public org.quartz.JobKey getJobKey()
- Specified by:
getJobKeyin interfacecom.floragunn.searchsupport.jobs.config.JobConfig
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfacecom.floragunn.searchsupport.jobs.config.JobConfig
-
getJobClass
public Class<? extends org.quartz.Job> getJobClass()
- Specified by:
getJobClassin interfacecom.floragunn.searchsupport.jobs.config.JobConfig
-
getJobDataMap
public Map<String,Object> getJobDataMap()
- Specified by:
getJobDataMapin interfacecom.floragunn.searchsupport.jobs.config.JobConfig
-
isDurable
public boolean isDurable()
- Specified by:
isDurablein interfacecom.floragunn.searchsupport.jobs.config.JobConfig
-
getTriggers
public List<org.quartz.Trigger> getTriggers()
- Specified by:
getTriggersin interfacecom.floragunn.searchsupport.jobs.config.JobConfig
-
getActions
public List<AlertAction> getActions()
-
getNonGeneratedResolveActions
public List<ResolveAction> getNonGeneratedResolveActions()
-
getVersion
public long getVersion()
- Specified by:
getVersionin interfacecom.floragunn.searchsupport.jobs.config.JobConfig
-
toJson
public String toJson()
-
toJsonWithoutAuthToken
public String toJsonWithoutAuthToken()
-
toJsonWithoutMetaAndActive
public String toJsonWithoutMetaAndActive()
-
hashCode
public int hashCode()
-
secureHash
public String secureHash()
-
getIdAndHash
public String getIdAndHash()
-
getSecureAuthTokenAudience
public String getSecureAuthTokenAudience()
- Specified by:
getSecureAuthTokenAudiencein interfacecom.floragunn.searchsupport.jobs.config.JobConfig
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Specified by:
toXContentin interfaceorg.elasticsearch.common.xcontent.ToXContent- Throws:
IOException
-
getThrottlePeriod
public com.floragunn.searchsupport.util.duration.DurationExpression getThrottlePeriod()
-
isActive
public boolean isActive()
-
setActive
public void setActive(boolean active)
-
isLogRuntimeData
public boolean isLogRuntimeData()
-
setLogRuntimeData
public void setLogRuntimeData(boolean logRuntimeData)
-
getTenant
public String getTenant()
-
setTenant
public void setTenant(String tenant)
-
getSeverityMapping
public SeverityMapping getSeverityMapping()
-
setSeverityMapping
public void setSeverityMapping(SeverityMapping severityMapping)
-
getResolveActions
public List<ResolveAction> getResolveActions()
-
setResolveActions
public void setResolveActions(List<ResolveAction> resolveActions)
-
getMeta
public Watch.Meta getMeta()
-
getAuthToken
public String getAuthToken()
- Specified by:
getAuthTokenin interfacecom.floragunn.searchsupport.jobs.config.JobConfig
-
getSchedule
public com.floragunn.searchsupport.jobs.config.schedule.Schedule getSchedule()
-
setSchedule
public void setSchedule(com.floragunn.searchsupport.jobs.config.schedule.Schedule schedule)
-
setDescription
public void setDescription(String description)
-
parse
public static Watch parse(WatchInitializationService ctx, String tenant, String id, String json, long version) throws com.floragunn.searchsupport.config.validation.ConfigValidationException
- Throws:
com.floragunn.searchsupport.config.validation.ConfigValidationException
-
parseFromElasticDocument
public static Watch parseFromElasticDocument(WatchInitializationService ctx, String tenant, String id, String json, long version) throws com.floragunn.searchsupport.config.validation.ConfigValidationException
- Throws:
com.floragunn.searchsupport.config.validation.ConfigValidationException
-
parse
public static Watch parse(WatchInitializationService ctx, String tenant, String id, com.fasterxml.jackson.databind.JsonNode jsonNode) throws com.floragunn.searchsupport.config.validation.ConfigValidationException
- Throws:
com.floragunn.searchsupport.config.validation.ConfigValidationException
-
parse
public static Watch parse(WatchInitializationService ctx, String tenant, String id, com.fasterxml.jackson.databind.JsonNode jsonNode, long version) throws com.floragunn.searchsupport.config.validation.ConfigValidationException
- Throws:
com.floragunn.searchsupport.config.validation.ConfigValidationException
-
createJobKey
public static org.quartz.JobKey createJobKey(String id)
-
setThrottlePeriod
public void setThrottlePeriod(com.floragunn.searchsupport.util.duration.DurationExpression throttlePeriod)
-
-