Class ZooKeeperUtils
java.lang.Object
org.apache.camel.component.zookeeper.ZooKeeperUtils
ZooKeeperUtils contains static utility functions mostly for retrieving optional message properties from
Message headers.-
Method Summary
Modifier and TypeMethodDescriptionstatic List<org.apache.zookeeper.data.ACL> getAclListFromMessage(org.apache.camel.Message in) static org.apache.zookeeper.CreateModegetCreateMode(org.apache.camel.Message message, org.apache.zookeeper.CreateMode defaultMode) Pulls a createMode flag from the header keyed byZooKeeperMessage.ZOOKEEPER_CREATE_MODEin the given message and attempts to parse aCreateModefrom it.static org.apache.zookeeper.CreateModegetCreateModeFromString(String modeHeader, org.apache.zookeeper.CreateMode defaultMode) static StringgetNodeFromMessage(org.apache.camel.Message message, String defaultNode) Pulls the target node from the header keyed byZooKeeperMessage.ZOOKEEPER_NODE.static byte[]getPayloadFromExchange(org.apache.camel.Exchange exchange) static IntegergetVersionFromMessage(org.apache.camel.Message message) static org.apache.zookeeper.WatchedEventgetWatchedEvent(ZooKeeperOperation<?> zooKeeperOperation) static <T> TgetZookeeperProperty(org.apache.camel.Message m, String propertyName, T defaultValue, Class<? extends T> type) static booleanhasWatchedEvent(ZooKeeperOperation<?> zooKeeperOperation)
-
Method Details
-
getCreateMode
public static org.apache.zookeeper.CreateMode getCreateMode(org.apache.camel.Message message, org.apache.zookeeper.CreateMode defaultMode) Pulls a createMode flag from the header keyed byZooKeeperMessage.ZOOKEEPER_CREATE_MODEin the given message and attempts to parse aCreateModefrom it.- Parameters:
message- the message that may contain a ZOOKEEPER_CREATE_MODE header.- Returns:
- the parsed
CreateModeor null if the header was null or not a valid mode flag.
-
getCreateModeFromString
public static org.apache.zookeeper.CreateMode getCreateModeFromString(String modeHeader, org.apache.zookeeper.CreateMode defaultMode) -
getNodeFromMessage
Pulls the target node from the header keyed byZooKeeperMessage.ZOOKEEPER_NODE. This node is then typically used in place of the configured node extracted from the endpoint uri.- Parameters:
message- the message that may contain a ZOOKEEPER_NODE header.- Returns:
- the node property or null if the header was null
-
getVersionFromMessage
-
getPayloadFromExchange
public static byte[] getPayloadFromExchange(org.apache.camel.Exchange exchange) -
getAclListFromMessage
public static List<org.apache.zookeeper.data.ACL> getAclListFromMessage(org.apache.camel.Message in) -
getZookeeperProperty
-
getWatchedEvent
public static org.apache.zookeeper.WatchedEvent getWatchedEvent(ZooKeeperOperation<?> zooKeeperOperation) -
hasWatchedEvent
-