org.apache.camel.component.zookeeper
Class ZooKeeperUtils

java.lang.Object
  extended by org.apache.camel.component.zookeeper.ZooKeeperUtils

public final class ZooKeeperUtils
extends Object

ZooKeeperUtils contains static utility functions mostly for retrieving optional message properties from Message headers.


Method Summary
static List<org.apache.zookeeper.data.ACL> getAclListFromMessage(org.apache.camel.Message in)
           
static org.apache.zookeeper.CreateMode getCreateMode(org.apache.camel.Message message, org.apache.zookeeper.CreateMode defaultMode)
          Pulls a createMode flag from the header keyed by ZooKeeperMessage.ZOOKEEPER_CREATE_MODE in the given message and attempts to parse a CreateMode from it.
static org.apache.zookeeper.CreateMode getCreateModeFromString(String modeHeader, org.apache.zookeeper.CreateMode defaultMode)
           
static String getNodeFromMessage(org.apache.camel.Message message, String defaultNode)
          Pulls the target node from the header keyed by ZooKeeperMessage.ZOOKEEPER_NODE.
static byte[] getPayloadFromExchange(org.apache.camel.Exchange exchange)
           
static Integer getVersionFromMessage(org.apache.camel.Message message)
           
static org.apache.zookeeper.WatchedEvent getWatchedEvent(ZooKeeperOperation<?> zooKeeperOperation)
           
static
<T> T
getZookeeperProperty(org.apache.camel.Message m, String propertyName, T defaultValue, Class<? extends T> type)
           
static boolean hasWatchedEvent(ZooKeeperOperation<?> zooKeeperOperation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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 by ZooKeeperMessage.ZOOKEEPER_CREATE_MODE in the given message and attempts to parse a CreateMode from it.

Parameters:
message - the message that may contain a ZOOKEEPER_CREATE_MODE header.
Returns:
the parsed CreateMode or 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

public static String getNodeFromMessage(org.apache.camel.Message message,
                                        String defaultNode)
Pulls the target node from the header keyed by ZooKeeperMessage.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

public static Integer getVersionFromMessage(org.apache.camel.Message message)

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

public static <T> T getZookeeperProperty(org.apache.camel.Message m,
                                         String propertyName,
                                         T defaultValue,
                                         Class<? extends T> type)

getWatchedEvent

public static org.apache.zookeeper.WatchedEvent getWatchedEvent(ZooKeeperOperation<?> zooKeeperOperation)

hasWatchedEvent

public static boolean hasWatchedEvent(ZooKeeperOperation<?> zooKeeperOperation)


Apache CAMEL