http://git-wip-us.apache.org/repos/asf/zookeeper/blob/01b6b5e4/doc/r3.2.2/api/org/apache/zookeeper/ZooKeeper.html ---------------------------------------------------------------------- diff --git a/doc/r3.2.2/api/org/apache/zookeeper/ZooKeeper.html b/doc/r3.2.2/api/org/apache/zookeeper/ZooKeeper.html new file mode 100644 index 0000000..2428477 --- /dev/null +++ b/doc/r3.2.2/api/org/apache/zookeeper/ZooKeeper.html @@ -0,0 +1,1361 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.6.0_16) on Tue Dec 08 13:52:03 PST 2009 --> +<TITLE> +ZooKeeper (ZooKeeper 3.2.2 API) +</TITLE> + +<META NAME="date" CONTENT="2009-12-08"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="ZooKeeper (ZooKeeper 3.2.2 API)"; + } +} +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> +<HR> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ZooKeeper.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../../org/apache/zookeeper/ZooDefs.Perms.html" title="interface in org.apache.zookeeper"><B>PREV CLASS</B></A> + <A HREF="../../../org/apache/zookeeper/ZooKeeper.States.html" title="enum in org.apache.zookeeper"><B>NEXT CLASS</B></A></FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../../index.html?org/apache/zookeeper/ZooKeeper.html" target="_top"><B>FRAMES</B></A> + <A HREF="ZooKeeper.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<!-- ======== START OF CLASS DATA ======== --> +<H2> +<FONT SIZE="-1"> +org.apache.zookeeper</FONT> +<BR> +Class ZooKeeper</H2> +<PRE> +<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> + <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>org.apache.zookeeper.ZooKeeper</B> +</PRE> +<HR> +<DL> +<DT><PRE>public class <B>ZooKeeper</B><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL> +</PRE> + +<P> +This is the main class of ZooKeeper client library. To use a ZooKeeper + service, an application must first instantiate an object of ZooKeeper class. + All the iterations will be done by calling the methods of ZooKeeper class. + The methods of this class are thread-safe unless otherwise noted. + <p> + Once a connection to a server is established, a session ID is assigned to the + client. The client will send heart beats to the server periodically to keep + the session valid. + <p> + The application can call ZooKeeper APIs through a client as long as the + session ID of the client remains valid. + <p> + If for some reason, the client fails to send heart beats to the server for a + prolonged period of time (exceeding the sessionTimeout value, for instance), + the server will expire the session, and the session ID will become invalid. + The client object will no longer be usable. To make ZooKeeper API calls, the + application must create a new client object. + <p> + If the ZooKeeper server the client currently connects to fails or otherwise + does not respond, the client will automatically try to connect to another + server before its session ID expires. If successful, the application can + continue to use the client. + <p> + Some successful ZooKeeper API calls can leave watches on the "data nodes" in + the ZooKeeper server. Other successful ZooKeeper API calls can trigger those + watches. Once a watch is triggered, an event will be delivered to the client + which left the watch at the first place. Each watch can be triggered only + once. Thus, up to one event will be delivered to a client for every watch it + leaves. + <p> + A client needs an object of a class implementing Watcher interface for + processing the events delivered to the client. + + When a client drops current connection and re-connects to a server, all the + existing watches are considered as being triggered but the undelivered events + are lost. To emulate this, the client will generate a special event to tell + the event handler a connection has been dropped. This special event has type + EventNone and state sKeeperStateDisconnected. +<P> + +<P> +<HR> + +<P> +<!-- ======== NESTED CLASS SUMMARY ======== --> + +<A NAME="nested_class_summary"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> +<B>Nested Class Summary</B></FONT></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE>static class</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.States.html" title="enum in org.apache.zookeeper">ZooKeeper.States</A></B></CODE> + +<BR> + </TD> +</TR> +</TABLE> + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> + +<A NAME="constructor_summary"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> +<B>Constructor Summary</B></FONT></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#ZooKeeper(java.lang.String, int, org.apache.zookeeper.Watcher)">ZooKeeper</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> connectString, + int sessionTimeout, + <A HREF="../../../org/apache/zookeeper/Watcher.html" title="interface in org.apache.zookeeper">Watcher</A> watcher)</CODE> + +<BR> + To create a ZooKeeper client object, the application needs to pass a + connection string containing a comma separated list of host:port pairs, + each corresponding to a ZooKeeper server.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#ZooKeeper(java.lang.String, int, org.apache.zookeeper.Watcher, long, byte[])">ZooKeeper</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> connectString, + int sessionTimeout, + <A HREF="../../../org/apache/zookeeper/Watcher.html" title="interface in org.apache.zookeeper">Watcher</A> watcher, + long sessionId, + byte[] sessionPasswd)</CODE> + +<BR> + To create a ZooKeeper client object, the application needs to pass a + connection string containing a comma separated list of host:port pairs, + each corresponding to a ZooKeeper server.</TD> +</TR> +</TABLE> + +<!-- ========== METHOD SUMMARY =========== --> + +<A NAME="method_summary"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> +<B>Method Summary</B></FONT></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#addAuthInfo(java.lang.String, byte[])">addAuthInfo</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> scheme, + byte[] auth)</CODE> + +<BR> + Add the specified scheme:auth information to this connection.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#close()">close</A></B>()</CODE> + +<BR> + Close this client object.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#create(java.lang.String, byte[], java.util.List, org.apache.zookeeper.CreateMode)">create</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + byte[] data, + <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../org/apache/zookeeper/data/ACL.html" title="class in org.apache.zookeeper.data">ACL</A>> acl, + <A HREF="../../../org/apache/zookeeper/CreateMode.html" title="enum in org.apache.zookeeper">CreateMode</A> createMode)</CODE> + +<BR> + Create a node with the given path.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#create(java.lang.String, byte[], java.util.List, org.apache.zookeeper.CreateMode, org.apache.zookeeper.AsyncCallback.StringCallback, java.lang.Object)">create</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + byte[] data, + <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../org/apache/zookeeper/data/ACL.html" title="class in org.apache.zookeeper.data">ACL</A>> acl, + <A HREF="../../../org/apache/zookeeper/CreateMode.html" title="enum in org.apache.zookeeper">CreateMode</A> createMode, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.StringCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.StringCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</CODE> + +<BR> + The Asynchronous version of create.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#delete(java.lang.String, int)">delete</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + int version)</CODE> + +<BR> + Delete the node with the given path.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#delete(java.lang.String, int, org.apache.zookeeper.AsyncCallback.VoidCallback, java.lang.Object)">delete</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + int version, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.VoidCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.VoidCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</CODE> + +<BR> + The Asynchronous version of delete.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> <A HREF="../../../org/apache/zookeeper/data/Stat.html" title="class in org.apache.zookeeper.data">Stat</A></CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#exists(java.lang.String, boolean)">exists</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + boolean watch)</CODE> + +<BR> + Return the stat of the node of the given path.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#exists(java.lang.String, boolean, org.apache.zookeeper.AsyncCallback.StatCallback, java.lang.Object)">exists</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + boolean watch, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.StatCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.StatCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</CODE> + +<BR> + The Asynchronous version of exists.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> <A HREF="../../../org/apache/zookeeper/data/Stat.html" title="class in org.apache.zookeeper.data">Stat</A></CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#exists(java.lang.String, org.apache.zookeeper.Watcher)">exists</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="../../../org/apache/zookeeper/Watcher.html" title="interface in org.apache.zookeeper">Watcher</A> watcher)</CODE> + +<BR> + Return the stat of the node of the given path.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#exists(java.lang.String, org.apache.zookeeper.Watcher, org.apache.zookeeper.AsyncCallback.StatCallback, java.lang.Object)">exists</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="../../../org/apache/zookeeper/Watcher.html" title="interface in org.apache.zookeeper">Watcher</A> watcher, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.StatCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.StatCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</CODE> + +<BR> + The Asynchronous version of exists.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../org/apache/zookeeper/data/ACL.html" title="class in org.apache.zookeeper.data">ACL</A>></CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#getACL(java.lang.String, org.apache.zookeeper.data.Stat)">getACL</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="../../../org/apache/zookeeper/data/Stat.html" title="class in org.apache.zookeeper.data">Stat</A> stat)</CODE> + +<BR> + Return the ACL and stat of the node of the given path.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#getACL(java.lang.String, org.apache.zookeeper.data.Stat, org.apache.zookeeper.AsyncCallback.ACLCallback, java.lang.Object)">getACL</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="../../../org/apache/zookeeper/data/Stat.html" title="class in org.apache.zookeeper.data">Stat</A> stat, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.ACLCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.ACLCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</CODE> + +<BR> + The Asynchronous version of getACL.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>></CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#getChildren(java.lang.String, boolean)">getChildren</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + boolean watch)</CODE> + +<BR> + Return the list of the children of the node of the given path.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#getChildren(java.lang.String, boolean, org.apache.zookeeper.AsyncCallback.ChildrenCallback, java.lang.Object)">getChildren</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + boolean watch, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.ChildrenCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.ChildrenCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</CODE> + +<BR> + The Asynchronous version of getChildren.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>></CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#getChildren(java.lang.String, org.apache.zookeeper.Watcher)">getChildren</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="../../../org/apache/zookeeper/Watcher.html" title="interface in org.apache.zookeeper">Watcher</A> watcher)</CODE> + +<BR> + Return the list of the children of the node of the given path.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#getChildren(java.lang.String, org.apache.zookeeper.Watcher, org.apache.zookeeper.AsyncCallback.ChildrenCallback, java.lang.Object)">getChildren</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="../../../org/apache/zookeeper/Watcher.html" title="interface in org.apache.zookeeper">Watcher</A> watcher, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.ChildrenCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.ChildrenCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</CODE> + +<BR> + The Asynchronous version of getChildren.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#getData(java.lang.String, boolean, org.apache.zookeeper.AsyncCallback.DataCallback, java.lang.Object)">getData</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + boolean watch, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.DataCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.DataCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</CODE> + +<BR> + The Asynchronous version of getData.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> byte[]</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#getData(java.lang.String, boolean, org.apache.zookeeper.data.Stat)">getData</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + boolean watch, + <A HREF="../../../org/apache/zookeeper/data/Stat.html" title="class in org.apache.zookeeper.data">Stat</A> stat)</CODE> + +<BR> + Return the data and the stat of the node of the given path.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#getData(java.lang.String, org.apache.zookeeper.Watcher, org.apache.zookeeper.AsyncCallback.DataCallback, java.lang.Object)">getData</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="../../../org/apache/zookeeper/Watcher.html" title="interface in org.apache.zookeeper">Watcher</A> watcher, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.DataCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.DataCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</CODE> + +<BR> + The Asynchronous version of getData.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> byte[]</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#getData(java.lang.String, org.apache.zookeeper.Watcher, org.apache.zookeeper.data.Stat)">getData</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="../../../org/apache/zookeeper/Watcher.html" title="interface in org.apache.zookeeper">Watcher</A> watcher, + <A HREF="../../../org/apache/zookeeper/data/Stat.html" title="class in org.apache.zookeeper.data">Stat</A> stat)</CODE> + +<BR> + Return the data and the stat of the node of the given path.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> long</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#getSessionId()">getSessionId</A></B>()</CODE> + +<BR> + The session id for this ZooKeeper client instance.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> byte[]</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#getSessionPasswd()">getSessionPasswd</A></B>()</CODE> + +<BR> + The session password for this ZooKeeper client instance.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> <A HREF="../../../org/apache/zookeeper/ZooKeeper.States.html" title="enum in org.apache.zookeeper">ZooKeeper.States</A></CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#getState()">getState</A></B>()</CODE> + +<BR> + </TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#register(org.apache.zookeeper.Watcher)">register</A></B>(<A HREF="../../../org/apache/zookeeper/Watcher.html" title="interface in org.apache.zookeeper">Watcher</A> watcher)</CODE> + +<BR> + Specify the default watcher for the connection (overrides the one + specified during construction).</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> <A HREF="../../../org/apache/zookeeper/data/Stat.html" title="class in org.apache.zookeeper.data">Stat</A></CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#setACL(java.lang.String, java.util.List, int)">setACL</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../org/apache/zookeeper/data/ACL.html" title="class in org.apache.zookeeper.data">ACL</A>> acl, + int version)</CODE> + +<BR> + Set the ACL for the node of the given path if such a node exists and the + given version matches the version of the node.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#setACL(java.lang.String, java.util.List, int, org.apache.zookeeper.AsyncCallback.StatCallback, java.lang.Object)">setACL</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../org/apache/zookeeper/data/ACL.html" title="class in org.apache.zookeeper.data">ACL</A>> acl, + int version, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.StatCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.StatCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</CODE> + +<BR> + The Asynchronous version of setACL.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> <A HREF="../../../org/apache/zookeeper/data/Stat.html" title="class in org.apache.zookeeper.data">Stat</A></CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#setData(java.lang.String, byte[], int)">setData</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + byte[] data, + int version)</CODE> + +<BR> + Set the data for the node of the given path if such a node exists and the + given version matches the version of the node (if the given version is + -1, it matches any node's versions).</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#setData(java.lang.String, byte[], int, org.apache.zookeeper.AsyncCallback.StatCallback, java.lang.Object)">setData</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + byte[] data, + int version, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.StatCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.StatCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</CODE> + +<BR> + The Asynchronous version of setData.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#sync(java.lang.String, org.apache.zookeeper.AsyncCallback.VoidCallback, java.lang.Object)">sync</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.VoidCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.VoidCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</CODE> + +<BR> + Asynchronous sync.</TD> +</TR> +</TABLE> + <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> +<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.h tml?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> +</TR> +</TABLE> + +<P> + +<!-- ========= CONSTRUCTOR DETAIL ======== --> + +<A NAME="constructor_detail"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> +<B>Constructor Detail</B></FONT></TH> +</TR> +</TABLE> + +<A NAME="ZooKeeper(java.lang.String, int, org.apache.zookeeper.Watcher)"><!-- --></A><H3> +ZooKeeper</H3> +<PRE> +public <B>ZooKeeper</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> connectString, + int sessionTimeout, + <A HREF="../../../org/apache/zookeeper/Watcher.html" title="interface in org.apache.zookeeper">Watcher</A> watcher) + throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE> +<DL> +<DD>To create a ZooKeeper client object, the application needs to pass a + connection string containing a comma separated list of host:port pairs, + each corresponding to a ZooKeeper server. + <p> + Session establishment is asynchronous. This constructor will initiate + connection to the server and return immediately - potentially (usually) + before the session is fully established. The watcher argument specifies + the watcher that will be notified of any changes in state. This + notification can come at any point before or after the constructor call + has returned. + <p> + The instantiated ZooKeeper client object will pick an arbitrary server + from the connectString and attempt to connect to it. If establishment of + the connection fails, another server in the connect string will be tried + (the order is non-deterministic, as we random shuffle the list), until a + connection is established. The client will continue attempts until the + session is explicitly closed. + <p> + Added in 3.2.0: An optional "chroot" suffix may also be appended to the + connection string. This will run the client commands while interpreting + all paths relative to this root (similar to the unix chroot command). +<P> +<DL> +<DT><B>Parameters:</B><DD><CODE>connectString</CODE> - comma separated host:port pairs, each corresponding to a zk + server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002" If + the optional chroot suffix is used the example would look + like: "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002/app/a" + where the client would be rooted at "/app/a" and all paths + would be relative to this root - ie getting/setting/etc... + "/foo/bar" would result in operations being run on + "/app/a/foo/bar" (from the server perspective).<DD><CODE>sessionTimeout</CODE> - session timeout in milliseconds<DD><CODE>watcher</CODE> - a watcher object which will be notified of state changes, may + also be notified for node events +<DT><B>Throws:</B> +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE> - in cases of network failure +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if an invalid chroot path is specified</DL> +</DL> +<HR> + +<A NAME="ZooKeeper(java.lang.String, int, org.apache.zookeeper.Watcher, long, byte[])"><!-- --></A><H3> +ZooKeeper</H3> +<PRE> +public <B>ZooKeeper</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> connectString, + int sessionTimeout, + <A HREF="../../../org/apache/zookeeper/Watcher.html" title="interface in org.apache.zookeeper">Watcher</A> watcher, + long sessionId, + byte[] sessionPasswd) + throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE> +<DL> +<DD>To create a ZooKeeper client object, the application needs to pass a + connection string containing a comma separated list of host:port pairs, + each corresponding to a ZooKeeper server. + <p> + Session establishment is asynchronous. This constructor will initiate + connection to the server and return immediately - potentially (usually) + before the session is fully established. The watcher argument specifies + the watcher that will be notified of any changes in state. This + notification can come at any point before or after the constructor call + has returned. + <p> + The instantiated ZooKeeper client object will pick an arbitrary server + from the connectString and attempt to connect to it. If establishment of + the connection fails, another server in the connect string will be tried + (the order is non-deterministic, as we random shuffle the list), until a + connection is established. The client will continue attempts until the + session is explicitly closed (or the session is expired by the server). + <p> + Added in 3.2.0: An optional "chroot" suffix may also be appended to the + connection string. This will run the client commands while interpreting + all paths relative to this root (similar to the unix chroot command). + <p> + Use <A HREF="../../../org/apache/zookeeper/ZooKeeper.html#getSessionId()"><CODE>getSessionId()</CODE></A> and <A HREF="../../../org/apache/zookeeper/ZooKeeper.html#getSessionPasswd()"><CODE>getSessionPasswd()</CODE></A> on an established + client connection, these values must be passed as sessionId and + sessionPasswd respectively if reconnecting. Otherwise, if not + reconnecting, use the other constructor which does not require these + parameters. +<P> +<DL> +<DT><B>Parameters:</B><DD><CODE>connectString</CODE> - comma separated host:port pairs, each corresponding to a zk + server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002" + If the optional chroot suffix is used the example would look + like: "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002/app/a" + where the client would be rooted at "/app/a" and all paths + would be relative to this root - ie getting/setting/etc... + "/foo/bar" would result in operations being run on + "/app/a/foo/bar" (from the server perspective).<DD><CODE>sessionTimeout</CODE> - session timeout in milliseconds<DD><CODE>watcher</CODE> - a watcher object which will be notified of state changes, may + also be notified for node events<DD><CODE>sessionId</CODE> - specific session id to use if reconnecting<DD><CODE>sessionPasswd</CODE> - password for this session +<DT><B>Throws:</B> +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE> - in cases of network failure +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if an invalid chroot path is specified</DL> +</DL> + +<!-- ============ METHOD DETAIL ========== --> + +<A NAME="method_detail"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> +<B>Method Detail</B></FONT></TH> +</TR> +</TABLE> + +<A NAME="getSessionId()"><!-- --></A><H3> +getSessionId</H3> +<PRE> +public long <B>getSessionId</B>()</PRE> +<DL> +<DD>The session id for this ZooKeeper client instance. The value returned is + not valid until the client connects to a server and may change after a + re-connect. + + This method is NOT thread safe +<P> +<DD><DL> + +<DT><B>Returns:</B><DD>current session id</DL> +</DD> +</DL> +<HR> + +<A NAME="getSessionPasswd()"><!-- --></A><H3> +getSessionPasswd</H3> +<PRE> +public byte[] <B>getSessionPasswd</B>()</PRE> +<DL> +<DD>The session password for this ZooKeeper client instance. The value + returned is not valid until the client connects to a server and may + change after a re-connect. + + This method is NOT thread safe +<P> +<DD><DL> + +<DT><B>Returns:</B><DD>current session password</DL> +</DD> +</DL> +<HR> + +<A NAME="addAuthInfo(java.lang.String, byte[])"><!-- --></A><H3> +addAuthInfo</H3> +<PRE> +public void <B>addAuthInfo</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> scheme, + byte[] auth)</PRE> +<DL> +<DD>Add the specified scheme:auth information to this connection. + + This method is NOT thread safe +<P> +<DD><DL> +<DT><B>Parameters:</B><DD><CODE>scheme</CODE> - <DD><CODE>auth</CODE> - </DL> +</DD> +</DL> +<HR> + +<A NAME="register(org.apache.zookeeper.Watcher)"><!-- --></A><H3> +register</H3> +<PRE> +public void <B>register</B>(<A HREF="../../../org/apache/zookeeper/Watcher.html" title="interface in org.apache.zookeeper">Watcher</A> watcher)</PRE> +<DL> +<DD>Specify the default watcher for the connection (overrides the one + specified during construction). +<P> +<DD><DL> +<DT><B>Parameters:</B><DD><CODE>watcher</CODE> - </DL> +</DD> +</DL> +<HR> + +<A NAME="close()"><!-- --></A><H3> +close</H3> +<PRE> +public void <B>close</B>() + throws <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></PRE> +<DL> +<DD>Close this client object. Once the client is closed, its session becomes + invalid. All the ephemeral nodes in the ZooKeeper server associated with + the session will be removed. The watches left on those nodes (and on + their parents) will be triggered. +<P> +<DD><DL> + +<DT><B>Throws:</B> +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></CODE></DL> +</DD> +</DL> +<HR> + +<A NAME="create(java.lang.String, byte[], java.util.List, org.apache.zookeeper.CreateMode)"><!-- --></A><H3> +create</H3> +<PRE> +public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>create</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + byte[] data, + <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../org/apache/zookeeper/data/ACL.html" title="class in org.apache.zookeeper.data">ACL</A>> acl, + <A HREF="../../../org/apache/zookeeper/CreateMode.html" title="enum in org.apache.zookeeper">CreateMode</A> createMode) + throws <A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A>, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></PRE> +<DL> +<DD>Create a node with the given path. The node data will be the given data, + and node acl will be the given acl. + <p> + The flags argument specifies whether the created node will be ephemeral + or not. + <p> + An ephemeral node will be removed by the ZooKeeper automatically when the + session associated with the creation of the node expires. + <p> + The flags argument can also specify to create a sequential node. The + actual path name of a sequential node will be the given path plus a + suffix "_i" where i is the current sequential number of the node. Once + such a node is created, the sequential number will be incremented by one. + <p> + If a node with the same actual path already exists in the ZooKeeper, a + KeeperException with error code KeeperException.NodeExists will be + thrown. Note that since a different actual path is used for each + invocation of creating sequential node with the same path argument, the + call will never throw "file exists" KeeperException. + <p> + If the parent node does not exist in the ZooKeeper, a KeeperException + with error code KeeperException.NoNode will be thrown. + <p> + An ephemeral node cannot have children. If the parent node of the given + path is ephemeral, a KeeperException with error code + KeeperException.NoChildrenForEphemerals will be thrown. + <p> + This operation, if successful, will trigger all the watches left on the + node of the given path by exists and getData API calls, and the watches + left on the parent node by getChildren API calls. + <p> + If a node is created successfully, the ZooKeeper server will trigger the + watches on the path left by exists calls, and the watches on the parent + of the node by getChildren calls. + <p> + The maximum allowable size of the data array is 1 MB (1,048,576 bytes). + Arrays larger than this will cause a KeeperExecption to be thrown. +<P> +<DD><DL> +<DT><B>Parameters:</B><DD><CODE>path</CODE> - the path for the node<DD><CODE>data</CODE> - the initial data for the node<DD><CODE>acl</CODE> - the acl for the node<DD><CODE>createMode</CODE> - specifying whether the node to be created is ephemeral + and/or sequential +<DT><B>Returns:</B><DD>the actual path of the created node +<DT><B>Throws:</B> +<DD><CODE><A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A></CODE> - if the server returns a non-zero error code +<DD><CODE><A HREF="../../../org/apache/zookeeper/KeeperException.InvalidACLException.html" title="class in org.apache.zookeeper">KeeperException.InvalidACLException</A></CODE> - if the ACL is invalid +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></CODE> - if the transaction is interrupted +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if an invalid path is specified</DL> +</DD> +</DL> +<HR> + +<A NAME="create(java.lang.String, byte[], java.util.List, org.apache.zookeeper.CreateMode, org.apache.zookeeper.AsyncCallback.StringCallback, java.lang.Object)"><!-- --></A><H3> +create</H3> +<PRE> +public void <B>create</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + byte[] data, + <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../org/apache/zookeeper/data/ACL.html" title="class in org.apache.zookeeper.data">ACL</A>> acl, + <A HREF="../../../org/apache/zookeeper/CreateMode.html" title="enum in org.apache.zookeeper">CreateMode</A> createMode, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.StringCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.StringCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</PRE> +<DL> +<DD>The Asynchronous version of create. The request doesn't actually until + the asynchronous callback is called. +<P> +<DD><DL> +<DT><B>See Also:</B><DD><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#create(java.lang.String, byte[], java.util.List, org.apache.zookeeper.CreateMode)"><CODE>create(String, byte[], List, CreateMode)</CODE></A></DL> +</DD> +</DL> +<HR> + +<A NAME="delete(java.lang.String, int)"><!-- --></A><H3> +delete</H3> +<PRE> +public void <B>delete</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + int version) + throws <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A>, + <A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A></PRE> +<DL> +<DD>Delete the node with the given path. The call will succeed if such a node + exists, and the given version matches the node's version (if the given + version is -1, it matches any node's versions). + <p> + A KeeperException with error code KeeperException.NoNode will be thrown + if the nodes does not exist. + <p> + A KeeperException with error code KeeperException.BadVersion will be + thrown if the given version does not match the node's version. + <p> + A KeeperException with error code KeeperException.NotEmpty will be thrown + if the node has children. + <p> + This operation, if successful, will trigger all the watches on the node + of the given path left by exists API calls, and the watches on the parent + node left by getChildren API calls. +<P> +<DD><DL> +<DT><B>Parameters:</B><DD><CODE>path</CODE> - the path of the node to be deleted.<DD><CODE>version</CODE> - the expected node version. +<DT><B>Throws:</B> +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></CODE> - IF the server transaction is interrupted +<DD><CODE><A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A></CODE> - If the server signals an error with a non-zero + return code. +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if an invalid path is specified</DL> +</DD> +</DL> +<HR> + +<A NAME="delete(java.lang.String, int, org.apache.zookeeper.AsyncCallback.VoidCallback, java.lang.Object)"><!-- --></A><H3> +delete</H3> +<PRE> +public void <B>delete</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + int version, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.VoidCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.VoidCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</PRE> +<DL> +<DD>The Asynchronous version of delete. The request doesn't actually until + the asynchronous callback is called. +<P> +<DD><DL> +<DT><B>See Also:</B><DD><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#delete(java.lang.String, int)"><CODE>delete(String, int)</CODE></A></DL> +</DD> +</DL> +<HR> + +<A NAME="exists(java.lang.String, org.apache.zookeeper.Watcher)"><!-- --></A><H3> +exists</H3> +<PRE> +public <A HREF="../../../org/apache/zookeeper/data/Stat.html" title="class in org.apache.zookeeper.data">Stat</A> <B>exists</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="../../../org/apache/zookeeper/Watcher.html" title="interface in org.apache.zookeeper">Watcher</A> watcher) + throws <A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A>, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></PRE> +<DL> +<DD>Return the stat of the node of the given path. Return null if no such a + node exists. + <p> + If the watch is non-null and the call is successful (no exception is thrown), + a watch will be left on the node with the given path. The watch will be + triggered by a successful operation that creates/delete the node or sets + the data on the node. +<P> +<DD><DL> +<DT><B>Parameters:</B><DD><CODE>path</CODE> - the node path<DD><CODE>watcher</CODE> - explicit watcher +<DT><B>Returns:</B><DD>the stat of the node of the given path; return null if no such a + node exists. +<DT><B>Throws:</B> +<DD><CODE><A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A></CODE> - If the server signals an error +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></CODE> - If the server transaction is interrupted. +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if an invalid path is specified</DL> +</DD> +</DL> +<HR> + +<A NAME="exists(java.lang.String, boolean)"><!-- --></A><H3> +exists</H3> +<PRE> +public <A HREF="../../../org/apache/zookeeper/data/Stat.html" title="class in org.apache.zookeeper.data">Stat</A> <B>exists</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + boolean watch) + throws <A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A>, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></PRE> +<DL> +<DD>Return the stat of the node of the given path. Return null if no such a + node exists. + <p> + If the watch is true and the call is successful (no exception is thrown), + a watch will be left on the node with the given path. The watch will be + triggered by a successful operation that creates/delete the node or sets + the data on the node. +<P> +<DD><DL> +<DT><B>Parameters:</B><DD><CODE>path</CODE> - the node path<DD><CODE>watch</CODE> - whether need to watch this node +<DT><B>Returns:</B><DD>the stat of the node of the given path; return null if no such a + node exists. +<DT><B>Throws:</B> +<DD><CODE><A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A></CODE> - If the server signals an error +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></CODE> - If the server transaction is interrupted.</DL> +</DD> +</DL> +<HR> + +<A NAME="exists(java.lang.String, org.apache.zookeeper.Watcher, org.apache.zookeeper.AsyncCallback.StatCallback, java.lang.Object)"><!-- --></A><H3> +exists</H3> +<PRE> +public void <B>exists</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="../../../org/apache/zookeeper/Watcher.html" title="interface in org.apache.zookeeper">Watcher</A> watcher, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.StatCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.StatCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</PRE> +<DL> +<DD>The Asynchronous version of exists. The request doesn't actually until + the asynchronous callback is called. +<P> +<DD><DL> +<DT><B>See Also:</B><DD><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#exists(java.lang.String, boolean)"><CODE>exists(String, boolean)</CODE></A></DL> +</DD> +</DL> +<HR> + +<A NAME="exists(java.lang.String, boolean, org.apache.zookeeper.AsyncCallback.StatCallback, java.lang.Object)"><!-- --></A><H3> +exists</H3> +<PRE> +public void <B>exists</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + boolean watch, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.StatCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.StatCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</PRE> +<DL> +<DD>The Asynchronous version of exists. The request doesn't actually until + the asynchronous callback is called. +<P> +<DD><DL> +<DT><B>See Also:</B><DD><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#exists(java.lang.String, boolean)"><CODE>exists(String, boolean)</CODE></A></DL> +</DD> +</DL> +<HR> + +<A NAME="getData(java.lang.String, org.apache.zookeeper.Watcher, org.apache.zookeeper.data.Stat)"><!-- --></A><H3> +getData</H3> +<PRE> +public byte[] <B>getData</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="../../../org/apache/zookeeper/Watcher.html" title="interface in org.apache.zookeeper">Watcher</A> watcher, + <A HREF="../../../org/apache/zookeeper/data/Stat.html" title="class in org.apache.zookeeper.data">Stat</A> stat) + throws <A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A>, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></PRE> +<DL> +<DD>Return the data and the stat of the node of the given path. + <p> + If the watch is non-null and the call is successful (no exception is + thrown), a watch will be left on the node with the given path. The watch + will be triggered by a successful operation that sets data on the node, or + deletes the node. + <p> + A KeeperException with error code KeeperException.NoNode will be thrown + if no node with the given path exists. +<P> +<DD><DL> +<DT><B>Parameters:</B><DD><CODE>path</CODE> - the given path<DD><CODE>watcher</CODE> - explicit watcher<DD><CODE>stat</CODE> - the stat of the node +<DT><B>Returns:</B><DD>the data of the node +<DT><B>Throws:</B> +<DD><CODE><A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A></CODE> - If the server signals an error with a non-zero error code +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></CODE> - If the server transaction is interrupted. +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if an invalid path is specified</DL> +</DD> +</DL> +<HR> + +<A NAME="getData(java.lang.String, boolean, org.apache.zookeeper.data.Stat)"><!-- --></A><H3> +getData</H3> +<PRE> +public byte[] <B>getData</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + boolean watch, + <A HREF="../../../org/apache/zookeeper/data/Stat.html" title="class in org.apache.zookeeper.data">Stat</A> stat) + throws <A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A>, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></PRE> +<DL> +<DD>Return the data and the stat of the node of the given path. + <p> + If the watch is true and the call is successful (no exception is + thrown), a watch will be left on the node with the given path. The watch + will be triggered by a successful operation that sets data on the node, or + deletes the node. + <p> + A KeeperException with error code KeeperException.NoNode will be thrown + if no node with the given path exists. +<P> +<DD><DL> +<DT><B>Parameters:</B><DD><CODE>path</CODE> - the given path<DD><CODE>watch</CODE> - whether need to watch this node<DD><CODE>stat</CODE> - the stat of the node +<DT><B>Returns:</B><DD>the data of the node +<DT><B>Throws:</B> +<DD><CODE><A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A></CODE> - If the server signals an error with a non-zero error code +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></CODE> - If the server transaction is interrupted.</DL> +</DD> +</DL> +<HR> + +<A NAME="getData(java.lang.String, org.apache.zookeeper.Watcher, org.apache.zookeeper.AsyncCallback.DataCallback, java.lang.Object)"><!-- --></A><H3> +getData</H3> +<PRE> +public void <B>getData</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="../../../org/apache/zookeeper/Watcher.html" title="interface in org.apache.zookeeper">Watcher</A> watcher, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.DataCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.DataCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</PRE> +<DL> +<DD>The Asynchronous version of getData. The request doesn't actually until + the asynchronous callback is called. +<P> +<DD><DL> +<DT><B>See Also:</B><DD><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#getData(java.lang.String, org.apache.zookeeper.Watcher, org.apache.zookeeper.data.Stat)"><CODE>getData(String, Watcher, Stat)</CODE></A></DL> +</DD> +</DL> +<HR> + +<A NAME="getData(java.lang.String, boolean, org.apache.zookeeper.AsyncCallback.DataCallback, java.lang.Object)"><!-- --></A><H3> +getData</H3> +<PRE> +public void <B>getData</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + boolean watch, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.DataCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.DataCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</PRE> +<DL> +<DD>The Asynchronous version of getData. The request doesn't actually until + the asynchronous callback is called. +<P> +<DD><DL> +<DT><B>See Also:</B><DD><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#getData(java.lang.String, boolean, org.apache.zookeeper.data.Stat)"><CODE>getData(String, boolean, Stat)</CODE></A></DL> +</DD> +</DL> +<HR> + +<A NAME="setData(java.lang.String, byte[], int)"><!-- --></A><H3> +setData</H3> +<PRE> +public <A HREF="../../../org/apache/zookeeper/data/Stat.html" title="class in org.apache.zookeeper.data">Stat</A> <B>setData</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + byte[] data, + int version) + throws <A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A>, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></PRE> +<DL> +<DD>Set the data for the node of the given path if such a node exists and the + given version matches the version of the node (if the given version is + -1, it matches any node's versions). Return the stat of the node. + <p> + This operation, if successful, will trigger all the watches on the node + of the given path left by getData calls. + <p> + A KeeperException with error code KeeperException.NoNode will be thrown + if no node with the given path exists. + <p> + A KeeperException with error code KeeperException.BadVersion will be + thrown if the given version does not match the node's version. + <p> + The maximum allowable size of the data array is 1 MB (1,048,576 bytes). + Arrays larger than this will cause a KeeperExecption to be thrown. +<P> +<DD><DL> +<DT><B>Parameters:</B><DD><CODE>path</CODE> - the path of the node<DD><CODE>data</CODE> - the data to set<DD><CODE>version</CODE> - the expected matching version +<DT><B>Returns:</B><DD>the state of the node +<DT><B>Throws:</B> +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></CODE> - If the server transaction is interrupted. +<DD><CODE><A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A></CODE> - If the server signals an error with a non-zero error code. +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if an invalid path is specified</DL> +</DD> +</DL> +<HR> + +<A NAME="setData(java.lang.String, byte[], int, org.apache.zookeeper.AsyncCallback.StatCallback, java.lang.Object)"><!-- --></A><H3> +setData</H3> +<PRE> +public void <B>setData</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + byte[] data, + int version, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.StatCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.StatCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</PRE> +<DL> +<DD>The Asynchronous version of setData. The request doesn't actually until + the asynchronous callback is called. +<P> +<DD><DL> +<DT><B>See Also:</B><DD><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#setData(java.lang.String, byte[], int)"><CODE>setData(String, byte[], int)</CODE></A></DL> +</DD> +</DL> +<HR> + +<A NAME="getACL(java.lang.String, org.apache.zookeeper.data.Stat)"><!-- --></A><H3> +getACL</H3> +<PRE> +public <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../org/apache/zookeeper/data/ACL.html" title="class in org.apache.zookeeper.data">ACL</A>> <B>getACL</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="../../../org/apache/zookeeper/data/Stat.html" title="class in org.apache.zookeeper.data">Stat</A> stat) + throws <A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A>, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></PRE> +<DL> +<DD>Return the ACL and stat of the node of the given path. + <p> + A KeeperException with error code KeeperException.NoNode will be thrown + if no node with the given path exists. +<P> +<DD><DL> +<DT><B>Parameters:</B><DD><CODE>path</CODE> - the given path for the node<DD><CODE>stat</CODE> - the stat of the node will be copied to this parameter. +<DT><B>Returns:</B><DD>the ACL array of the given node. +<DT><B>Throws:</B> +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></CODE> - If the server transaction is interrupted. +<DD><CODE><A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A></CODE> - If the server signals an error with a non-zero error code. +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if an invalid path is specified</DL> +</DD> +</DL> +<HR> + +<A NAME="getACL(java.lang.String, org.apache.zookeeper.data.Stat, org.apache.zookeeper.AsyncCallback.ACLCallback, java.lang.Object)"><!-- --></A><H3> +getACL</H3> +<PRE> +public void <B>getACL</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="../../../org/apache/zookeeper/data/Stat.html" title="class in org.apache.zookeeper.data">Stat</A> stat, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.ACLCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.ACLCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</PRE> +<DL> +<DD>The Asynchronous version of getACL. The request doesn't actually until + the asynchronous callback is called. +<P> +<DD><DL> +<DT><B>See Also:</B><DD><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#getACL(java.lang.String, org.apache.zookeeper.data.Stat)"><CODE>getACL(String, Stat)</CODE></A></DL> +</DD> +</DL> +<HR> + +<A NAME="setACL(java.lang.String, java.util.List, int)"><!-- --></A><H3> +setACL</H3> +<PRE> +public <A HREF="../../../org/apache/zookeeper/data/Stat.html" title="class in org.apache.zookeeper.data">Stat</A> <B>setACL</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../org/apache/zookeeper/data/ACL.html" title="class in org.apache.zookeeper.data">ACL</A>> acl, + int version) + throws <A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A>, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></PRE> +<DL> +<DD>Set the ACL for the node of the given path if such a node exists and the + given version matches the version of the node. Return the stat of the + node. + <p> + A KeeperException with error code KeeperException.NoNode will be thrown + if no node with the given path exists. + <p> + A KeeperException with error code KeeperException.BadVersion will be + thrown if the given version does not match the node's version. +<P> +<DD><DL> +<DT><B>Parameters:</B><DD><CODE>path</CODE> - <DD><CODE>acl</CODE> - <DD><CODE>version</CODE> - +<DT><B>Returns:</B><DD>the stat of the node. +<DT><B>Throws:</B> +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></CODE> - If the server transaction is interrupted. +<DD><CODE><A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A></CODE> - If the server signals an error with a non-zero error code. +<DD><CODE><A HREF="../../../org/apache/zookeeper/KeeperException.InvalidACLException.html" title="class in org.apache.zookeeper">KeeperException.InvalidACLException</A></CODE> - If the acl is invalide. +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if an invalid path is specified</DL> +</DD> +</DL> +<HR> + +<A NAME="setACL(java.lang.String, java.util.List, int, org.apache.zookeeper.AsyncCallback.StatCallback, java.lang.Object)"><!-- --></A><H3> +setACL</H3> +<PRE> +public void <B>setACL</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../org/apache/zookeeper/data/ACL.html" title="class in org.apache.zookeeper.data">ACL</A>> acl, + int version, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.StatCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.StatCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</PRE> +<DL> +<DD>The Asynchronous version of setACL. The request doesn't actually until + the asynchronous callback is called. +<P> +<DD><DL> +<DT><B>See Also:</B><DD><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#setACL(java.lang.String, java.util.List, int)"><CODE>setACL(String, List, int)</CODE></A></DL> +</DD> +</DL> +<HR> + +<A NAME="getChildren(java.lang.String, org.apache.zookeeper.Watcher)"><!-- --></A><H3> +getChildren</H3> +<PRE> +public <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>> <B>getChildren</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="../../../org/apache/zookeeper/Watcher.html" title="interface in org.apache.zookeeper">Watcher</A> watcher) + throws <A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A>, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></PRE> +<DL> +<DD>Return the list of the children of the node of the given path. + <p> + If the watch is non-null and the call is successful (no exception is thrown), + a watch will be left on the node with the given path. The watch willbe + triggered by a successful operation that deletes the node of the given + path or creates/delete a child under the node. + <p> + The list of children returned is not sorted and no guarantee is provided + as to its natural or lexical order. + <p> + A KeeperException with error code KeeperException.NoNode will be thrown + if no node with the given path exists. +<P> +<DD><DL> +<DT><B>Parameters:</B><DD><CODE>path</CODE> - <DD><CODE>watcher</CODE> - explicit watcher +<DT><B>Returns:</B><DD>an unordered array of children of the node with the given path +<DT><B>Throws:</B> +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></CODE> - If the server transaction is interrupted. +<DD><CODE><A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A></CODE> - If the server signals an error with a non-zero error code. +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if an invalid path is specified</DL> +</DD> +</DL> +<HR> + +<A NAME="getChildren(java.lang.String, boolean)"><!-- --></A><H3> +getChildren</H3> +<PRE> +public <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>> <B>getChildren</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + boolean watch) + throws <A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A>, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></PRE> +<DL> +<DD>Return the list of the children of the node of the given path. + <p> + If the watch is true and the call is successful (no exception is thrown), + a watch will be left on the node with the given path. The watch willbe + triggered by a successful operation that deletes the node of the given + path or creates/delete a child under the node. + <p> + The list of children returned is not sorted and no guarantee is provided + as to its natural or lexical order. + <p> + A KeeperException with error code KeeperException.NoNode will be thrown + if no node with the given path exists. +<P> +<DD><DL> +<DT><B>Parameters:</B><DD><CODE>path</CODE> - <DD><CODE>watch</CODE> - +<DT><B>Returns:</B><DD>an unordered array of children of the node with the given path +<DT><B>Throws:</B> +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></CODE> - If the server transaction is interrupted. +<DD><CODE><A HREF="../../../org/apache/zookeeper/KeeperException.html" title="class in org.apache.zookeeper">KeeperException</A></CODE> - If the server signals an error with a non-zero error code.</DL> +</DD> +</DL> +<HR> + +<A NAME="getChildren(java.lang.String, org.apache.zookeeper.Watcher, org.apache.zookeeper.AsyncCallback.ChildrenCallback, java.lang.Object)"><!-- --></A><H3> +getChildren</H3> +<PRE> +public void <B>getChildren</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="../../../org/apache/zookeeper/Watcher.html" title="interface in org.apache.zookeeper">Watcher</A> watcher, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.ChildrenCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.ChildrenCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</PRE> +<DL> +<DD>The Asynchronous version of getChildren. The request doesn't actually + until the asynchronous callback is called. +<P> +<DD><DL> +<DT><B>See Also:</B><DD><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#getChildren(java.lang.String, org.apache.zookeeper.Watcher)"><CODE>getChildren(String, Watcher)</CODE></A></DL> +</DD> +</DL> +<HR> + +<A NAME="getChildren(java.lang.String, boolean, org.apache.zookeeper.AsyncCallback.ChildrenCallback, java.lang.Object)"><!-- --></A><H3> +getChildren</H3> +<PRE> +public void <B>getChildren</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + boolean watch, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.ChildrenCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.ChildrenCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</PRE> +<DL> +<DD>The Asynchronous version of getChildren. The request doesn't actually + until the asynchronous callback is called. +<P> +<DD><DL> +<DT><B>See Also:</B><DD><A HREF="../../../org/apache/zookeeper/ZooKeeper.html#getChildren(java.lang.String, boolean)"><CODE>getChildren(String, boolean)</CODE></A></DL> +</DD> +</DL> +<HR> + +<A NAME="sync(java.lang.String, org.apache.zookeeper.AsyncCallback.VoidCallback, java.lang.Object)"><!-- --></A><H3> +sync</H3> +<PRE> +public void <B>sync</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path, + <A HREF="../../../org/apache/zookeeper/AsyncCallback.VoidCallback.html" title="interface in org.apache.zookeeper">AsyncCallback.VoidCallback</A> cb, + <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> ctx)</PRE> +<DL> +<DD>Asynchronous sync. Flushes channel between process and leader. +<P> +<DD><DL> +<DT><B>Parameters:</B><DD><CODE>path</CODE> - <DD><CODE>cb</CODE> - a handler for the callback<DD><CODE>ctx</CODE> - context to be provided to the callback +<DT><B>Throws:</B> +<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if an invalid path is specified</DL> +</DD> +</DL> +<HR> + +<A NAME="getState()"><!-- --></A><H3> +getState</H3> +<PRE> +public <A HREF="../../../org/apache/zookeeper/ZooKeeper.States.html" title="enum in org.apache.zookeeper">ZooKeeper.States</A> <B>getState</B>()</PRE> +<DL> +<DD><DL> +</DL> +</DD> +</DL> +<!-- ========= END OF CLASS DATA ========= --> +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ZooKeeper.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLA
<TRUNCATED>