Class Validator
-
- All Implemented Interfaces:
-
io.github.cfraser.graphguard.Server.Plugin
public final class Validator implements Server.Plugin
Validator is a Server.Plugin that validates the Bolt.Run.query and Bolt.Run.parameters in a Bolt.Run message. If the data in the Bolt.Message is invalid, according to the rule, then a Bolt.Failure and Bolt.Ignored is returned upon the next Bolt.Pull.
-
-
Method Summary
Modifier and Type Method Description Bolt.Messageintercept(Bolt.Session session, Bolt.Message message)Intercept, and optionally transform, the message. Unitobserve(Server.Event event)Observe the event. -
-
Constructor Detail
-
Validator
Validator(Rule rule, Long cacheSize)
- Parameters:
rule- the Rule to validatecacheSize- the maximum entries in the cache of validated queries
-
Validator
Validator(Rule rule)
- Parameters:
rule- the Rule to validate
-
-
Method Detail
-
intercept
Bolt.Message intercept(Bolt.Session session, Bolt.Message message)
Intercept, and optionally transform, the message.
If the returned Bolt.Message is a Bolt.Request then it's sent to the graph server, otherwise the Bolt.Response is sent to the proxy client.
- Parameters:
session- the Bolt.Sessionmessage- the intercepted Bolt message- Returns:
the Bolt.Message to send
-
observe
Unit observe(Server.Event event)
Observe the event.
- Parameters:
event- the Server.Event that occurred
-
-
-
-