Package org.cdlib.mrt.zk
Class QueueItemHelper
- java.lang.Object
-
- org.cdlib.mrt.zk.QueueItemHelper
-
public class QueueItemHelper extends Object
The static methods in this class also provides a simplified interface for common ZooKeeper API calls.
-
-
Constructor Summary
Constructors Constructor Description QueueItemHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]asBytes(String s)static Stringcreate(org.apache.zookeeper.ZooKeeper client, String path, byte[] data)static StringcreateEphemeral(org.apache.zookeeper.ZooKeeper client, String path, byte[] data)static StringcreateId(org.apache.zookeeper.ZooKeeper client, String prefix)static voidcreateIfNeeded(org.apache.zookeeper.ZooKeeper client, String path)static voidcreateIfNeededForgiving(org.apache.zookeeper.ZooKeeper client, String path)static StringcreateSequential(org.apache.zookeeper.ZooKeeper client, String path, byte[] data)static voiddelete(org.apache.zookeeper.ZooKeeper client, String p)static voiddeleteAll(org.apache.zookeeper.ZooKeeper client, String p)static booleanexists(org.apache.zookeeper.ZooKeeper client, String p)static Stringnow()static StringpathToString(org.apache.zookeeper.ZooKeeper client, String path)static Stringserialize(Object data)static byte[]serializeAsBytes(Object data)static voidsetData(org.apache.zookeeper.ZooKeeper client, String path, byte[] data)
-
-
-
Field Detail
-
acl
public static final List<org.apache.zookeeper.data.ACL> acl
-
empty
public static final byte[] empty
-
-
Method Detail
-
exists
public static boolean exists(org.apache.zookeeper.ZooKeeper client, String p) throws org.apache.zookeeper.KeeperException, InterruptedException- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
pathToString
public static String pathToString(org.apache.zookeeper.ZooKeeper client, String path) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
asBytes
public static byte[] asBytes(String s)
-
serializeAsBytes
public static byte[] serializeAsBytes(Object data)
-
createId
public static String createId(org.apache.zookeeper.ZooKeeper client, String prefix) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
now
public static String now()
-
create
public static String create(org.apache.zookeeper.ZooKeeper client, String path, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
createSequential
public static String createSequential(org.apache.zookeeper.ZooKeeper client, String path, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
createEphemeral
public static String createEphemeral(org.apache.zookeeper.ZooKeeper client, String path, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
setData
public static void setData(org.apache.zookeeper.ZooKeeper client, String path, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
delete
public static void delete(org.apache.zookeeper.ZooKeeper client, String p) throws InterruptedException, org.apache.zookeeper.KeeperException- Throws:
InterruptedExceptionorg.apache.zookeeper.KeeperException
-
deleteAll
public static void deleteAll(org.apache.zookeeper.ZooKeeper client, String p) throws InterruptedException, org.apache.zookeeper.KeeperException- Throws:
InterruptedExceptionorg.apache.zookeeper.KeeperException
-
createIfNeeded
public static void createIfNeeded(org.apache.zookeeper.ZooKeeper client, String path) throws org.apache.zookeeper.KeeperException, InterruptedException- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
createIfNeededForgiving
public static void createIfNeededForgiving(org.apache.zookeeper.ZooKeeper client, String path) throws org.apache.zookeeper.KeeperException, InterruptedException- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
-