Class RestRule
java.lang.Object
com.helixframework.rules.rule.BaseRule
com.helixframework.rules.rule.rest.RestRule
- All Implemented Interfaces:
Rule
Rule that invokes a restful endpoint.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface com.helixframework.rules.rule.Rule
DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyInternal(RuleContext ctx) Applies the logic of the implementing rule and modifies the root object in the context.protected <T> TapplyInternal(RuleContext<?> ctx, Class<T> outputType) Applies the logic of the implementing rule and returns the result.static RestRule.BuilderBuilder for creating new instances ofRestRule.getType()Gets the type of rule.getUrl()Gets the url of the endpoint to call for the rule.toString()Methods inherited from class com.helixframework.rules.rule.BaseRule
apply, apply, apply, apply, getClassification, getDependencies, getDescription, getMaxRetries, getName, getTags, getTimeout
-
Method Details
-
builder
Builder for creating new instances ofRestRule.- Parameters:
name- rule nameurl- rule endpoint url- Returns:
- a
RestRule.Builder
-
applyInternal
Description copied from class:BaseRuleApplies the logic of the implementing rule and modifies the root object in the context.- Specified by:
applyInternalin classBaseRule- Parameters:
ctx- rule context
-
applyInternal
Description copied from class:BaseRuleApplies the logic of the implementing rule and returns the result.- Specified by:
applyInternalin classBaseRule- Type Parameters:
T- type of rule output- Parameters:
ctx- rule contextoutputType- type of rule output- Returns:
- rule result
-
getType
Description copied from interface:RuleGets the type of rule.- Returns:
- rule type
-
getUrl
Gets the url of the endpoint to call for the rule.- Returns:
- rule url
-
toString
-