hadoop-zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ph...@apache.org
Subject svn commit: r920604 [1/3] - in /hadoop/zookeeper/trunk: ./ src/contrib/zooinspector/ src/contrib/zooinspector/config/ src/contrib/zooinspector/icons/ src/contrib/zooinspector/lib/ src/contrib/zooinspector/licences/ src/contrib/zooinspector/src/ src/con...
Date Tue, 09 Mar 2010 01:06:17 GMT
Author: phunt
Date: Tue Mar  9 01:06:15 2010
New Revision: 920604

URL: http://svn.apache.org/viewvc?rev=920604&view=rev
Log:
ZOOKEEPER-678. Gui browser application to view and edit the contents of a zookeeper instance

Added:
    hadoop/zookeeper/trunk/src/contrib/zooinspector/
    hadoop/zookeeper/trunk/src/contrib/zooinspector/NOTICE.txt
    hadoop/zookeeper/trunk/src/contrib/zooinspector/README.txt
    hadoop/zookeeper/trunk/src/contrib/zooinspector/build.xml
    hadoop/zookeeper/trunk/src/contrib/zooinspector/config/
    hadoop/zookeeper/trunk/src/contrib/zooinspector/config/defaultConnectionSettings.cfg
    hadoop/zookeeper/trunk/src/contrib/zooinspector/config/defaultNodeVeiwers.cfg
    hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/
    hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/edtsrclkup_co.gif   (with props)
    hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/file_obj.gif   (with props)
    hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/fldr_obj.gif   (with props)
    hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/info_obj.gif   (with props)
    hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/jspdecl.gif   (with props)
    hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/launch_run.gif   (with props)
    hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/launch_stop.gif   (with props)
    hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/new_con.gif   (with props)
    hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/refresh.gif   (with props)
    hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/save_edit.gif   (with props)
    hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/search_next.gif   (with props)
    hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/search_prev.gif   (with props)
    hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/trash.gif   (with props)
    hadoop/zookeeper/trunk/src/contrib/zooinspector/ivy.xml
    hadoop/zookeeper/trunk/src/contrib/zooinspector/lib/
    hadoop/zookeeper/trunk/src/contrib/zooinspector/lib/jtoaster-1.0.4.jar   (with props)
    hadoop/zookeeper/trunk/src/contrib/zooinspector/lib/log4j.properties
    hadoop/zookeeper/trunk/src/contrib/zooinspector/licences/
    hadoop/zookeeper/trunk/src/contrib/zooinspector/licences/Apache Software Licence v2.0.txt
    hadoop/zookeeper/trunk/src/contrib/zooinspector/licences/epl-v10.html
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/ZooInspector.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/encryption/
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/encryption/BasicDataEncryptionManager.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/encryption/DataEncryptionManager.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/NodeViewersChangeListener.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorAboutDialog.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorConnectionPropertiesDialog.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorIconResources.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorNodeViewersDialog.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorNodeViewersPanel.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorPanel.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorTreeViewer.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/about.html
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/nodeviewer/
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/nodeviewer/NodeViewerACL.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/nodeviewer/NodeViewerData.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/nodeviewer/NodeViewerMetaData.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/nodeviewer/ZooInspectorNodeViewer.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/logger/
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/logger/LoggerFactory.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/manager/
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/manager/NodeListener.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/manager/Pair.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/manager/ZooInspectorManager.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/manager/ZooInspectorManagerImpl.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/manager/ZooInspectorNodeManager.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/manager/ZooInspectorNodeTreeManager.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/manager/ZooInspectorReadOnlyManager.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/retry/
    hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/retry/ZooKeeperRetry.java
    hadoop/zookeeper/trunk/src/contrib/zooinspector/zooInspector-dev.sh   (with props)
    hadoop/zookeeper/trunk/src/contrib/zooinspector/zooInspector.cmd
    hadoop/zookeeper/trunk/src/contrib/zooinspector/zooInspector.sh   (with props)
Modified:
    hadoop/zookeeper/trunk/CHANGES.txt

Modified: hadoop/zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=920604&r1=920603&r2=920604&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/CHANGES.txt (original)
+++ hadoop/zookeeper/trunk/CHANGES.txt Tue Mar  9 01:06:15 2010
@@ -270,24 +270,29 @@ IMPROVEMENTS:
 
   ZOOKEEPER-425. Add OSGi metadata to zookeeper.jar (david bosschaert via breed)
 
-  ZOOKEEPER-599. Changes to FLE and QuorumCnxManager to support Observers (fpj via breed)
+  ZOOKEEPER-599. Changes to FLE and QuorumCnxManager to support Observers
+  (fpj via breed)
 
   ZOOKEEPER-506. QuorumBase should use default leader election (fpj via breed)
 
   ZOOKEEPER-633. Fetch netty using ivy for bookkeeper (giri via fpj)
 
-  ZOOKEEPER-544. improve client testability - allow test client to access connected server location (phunt via breed)
+  ZOOKEEPER-544. improve client testability - allow test client to access
+  connected server location (phunt via breed)
 
-  ZOOKEEPER-426. Windows versions of zookeeper scripts (David Bosschaert via breed)
+  ZOOKEEPER-426. Windows versions of zookeeper scripts
+  (David Bosschaert via breed)
 
   ZOOKEEPER-638. upgrade ivy to 2.1.0 final from 2.1.0 release
   candidate (phunt via breed)
 
   ZOOKEEPER-648. Fix releaseaudit warning count to zero (phunt via henry)
 
-  ZOOKEEPER-626. ensure the c/java cli's print xid/sessionid/etc... in hex (pat via mahadev)
+  ZOOKEEPER-626. ensure the c/java cli's print xid/sessionid/etc... in hex
+  (pat via mahadev)
 
-  ZOOKEEPER-655. StringBuffer -> StringBuilder - conversion of references as necessary (Kay Kay via henry)
+  ZOOKEEPER-655. StringBuffer -> StringBuilder - conversion of references as
+  necessary (Kay Kay via henry)
 
   ZOOKEEPER-612. Make Zookeeper C client can be compiled by gcc of early
   version (qian via mahadev)
@@ -331,10 +336,14 @@ NEW FEATURES:
 
   ZOOKEEPER-368. Observers: core functionality (henry robinson via mahadev)
 
-  ZOOKEEPER-496. zookeeper-tree utility for export, import and incremental updates (anirban roy via breed)
+  ZOOKEEPER-496. zookeeper-tree utility for export, import and incremental
+  updates (anirban roy via breed)
 
   ZOOKEEPER-572. add ability for operator to examine state of watches
   currently registered with a server (phunt via mahadev)
+
+  ZOOKEEPER-678. Gui browser application to view and edit the contents of a
+  zookeeper instance (Colin Goodheart-Smithe via phunt)
   
 Release 3.2.0 - 2009-06-30
 

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/NOTICE.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/NOTICE.txt?rev=920604&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zooinspector/NOTICE.txt (added)
+++ hadoop/zookeeper/trunk/src/contrib/zooinspector/NOTICE.txt Tue Mar  9 01:06:15 2010
@@ -0,0 +1,3 @@
+This contrib module includes icons available under the Eclipse Public Licence Version 1.0
+. from the Eclipse Java Devlopment Platform. 
+The lib sub-directory includes a binary only jar library developed at http://sourceforge.net/projects/jtoaster/
\ No newline at end of file

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/README.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/README.txt?rev=920604&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zooinspector/README.txt (added)
+++ hadoop/zookeeper/trunk/src/contrib/zooinspector/README.txt Tue Mar  9 01:06:15 2010
@@ -0,0 +1,94 @@
+==========================================
+ZooInspector - Browser and Editor for ZooKeeper Instances
+Author: Colin Goodheart-Smithe
+Date: February 2010
+==========================================
+
+ZooInspector is a Java Swing based application for browsing and editing ZooKeeper instances.
+
+Contents
+--------
+	- Features
+	- Pre-requisites
+	- Build Instructions
+	- Using ZooInspector
+	- Creating and Using Plugins
+	
+Features
+--------
+	Below is a list of features in the current release of ZooInspector.
+	- Load connection settings from a zookeeper properties file
+	- Plugable DataEncryptionManagers to specify how data should be encrypted and decrypted in the Zookeeper instance
+	- Browseable tree view of the ZooKeeper instance
+	- View the data in a node
+	- View the ACL's currently applied to a node
+	- View the metadata for a node (Version, Number of Children, Last modified Tiem, etc.)
+	- Plugable NodeViewers interface
+	- Ability to save/load and set default Node Viewers
+	
+Pre-requisites
+--------------
+	- The main zookeeper build script must have been run before building this module
+	
+Build Instructions
+------------------
+	1. Open a command line.
+	2. cd into this directory
+	3. Run command: ant
+	4. ZooInspector will be built to ../../../build/contrib/ZooInspector
+	5. Copy zookeeper-3.x.x.jar into the lib sub-directory (if you are using zookeeper-3.3.0.jar it will have been
+       copied to this directory during the build
+	6. By default the zookeeper.cmd and zookeeper.sh files expect zookeeper-3.3.0.jar.  If you are using another version
+	   you will need to change these files to point to the zookeeper-3.x.x.jar you copied to the lib directory
+	7. To run ZooInspector run zooInspector.cmd (on Windows) or zooInspector.sh (on Linux).  If you are using 
+	   zookeeper-3.3.0.jar and do not require any classpath changes you can run the zookeeper-dev-ZooInspector.jar
+	   directly
+
+Using ZooInspector
+------------------
+	To start ZooInspector run zooInspector.cmd (on Windows) or zooInspector.sh (on Linux).  If you are using 
+	zookeeper-3.3.0.jar and do not require any classpath changes you can run the zookeeper-dev-ZooInspector.jar
+	directly.
+	
+	Click the play button on the toolbar to bring up the connection dialog.  From here you can enter connection 
+	information for your zookeeper instance.  You can also load the connection properties from a file.  This file can 
+	have the format as a normal zookeeper properties file (i.e. hosts and timeout key-value pairs) and van optional have
+	an encryptionManager key-value pair to specify the DataEncryptionManager to use for this connection 
+	(DataEncryptionManagers are explained in further detail in the 'Creating and Using Plugins' section below).  You can
+	also set the entered information as the defaults so that when you first start ZooInspector these settings are 
+	automatically loaded into this dialog.  Pressing the OK button with connect to your ZooKeeper instance and show the
+	current node tree on the left of the main panel.
+	
+	Clicking a node in the node tree will load the data for that node into the node viewers.  Three node viewers are 
+	currently distributed with ZooInspector:
+		1. Node Data - This enables you to see the data current stored on that node.  This data can be modified and 
+		   saved.  The data is decrypted and encrypted using the DataEncryptionManager specified on the connection 
+		   dialog.
+		2. Node Metadata - This enables you to see the metadata associiated with this node.  This is Essentially the data
+		   obtained from the Stat object for this node.
+		3. Node ACLs - This allows you to see the ACLs currently applied to this node.  Currently there is no ability
+		   to change the ACLs on a node, but it is a feature I would like to add.
+	Other custom Node Viewers can be added, this is explained in the 'Creating and Using Plugins' section below.
+	
+
+Creating and Using Plugins
+--------------------------
+	There are two types of plugin which can be used with ZooInspector:
+		1. DataEncryptionManager - This specifies how data should be encrypted and decrypted when working with a 
+		   zookeeper instance.
+		2. ZooInspectorNodeViewer - This is a GUI panel which provides a view of visualisation on a node.
+	More information on these interfaces can be found in the javadocs for this module.
+	
+	To use a plugin in ZooInspector, build the plugin to a jar and copy the jar to the lib sub-directory.  Edit the 
+	zooInspector.cmd and/or zooInspector.sh files to include your new jar on the classpath and run ZooInspector.
+	
+	For DataEncryptionManagers, click the play button to open the connection dialog and enter the full class name of 
+	your DataEncryptionManager in the 'Data Encryption Manager' field.  You can make this Data Encryption Manager the 
+	default by clicking 'Set As Default'.  Click the 'OK' button to instantiate and use your plugin.
+	
+	For ZooInspectorNodeViewers, Click the 'Change Node Viewers' button on the toolbar (looks like a tree with a pencil)
+	and enter the full classname for your Node Viewer in the field left of the 'Add' button, then click the 'Add' 
+	button.  The Node Viewer will be instantiated and should appear in the list.  You can change the order of the Node 
+	viewers by clicking the up and dpwn buttons and delete a Node Viewer by clicking the delete button.  You can save 
+	to configuration to a file or set it as the default if necessary. Then click the 'OK' button and your Node Viewer 
+	should appear in the tabs on the right of the main panel.
\ No newline at end of file

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/build.xml
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/build.xml?rev=920604&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zooinspector/build.xml (added)
+++ hadoop/zookeeper/trunk/src/contrib/zooinspector/build.xml Tue Mar  9 01:06:15 2010
@@ -0,0 +1,152 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+<project name="ZooInspector" default="jar">
+	<import file="../build-contrib.xml" />
+
+
+	<target name="setjarname">
+		<property name="jarname" value="${build.dir}/zookeeper-${version}-${name}.jar" />
+	</target>
+
+	<target name="init" depends="checkMainCompiled, zookeeperbuildcontrib.init">
+		<mkdir dir="${build.dir}/licences" />
+		<copy todir="${build.dir}/licences">
+			<fileset dir="${basedir}/licences" />
+		</copy>
+		<mkdir dir="${build.dir}/icons" />
+		<copy todir="${build.dir}/icons">
+			<fileset dir="${basedir}/icons" />
+		</copy>
+		<mkdir dir="${build.dir}/config" />
+		<copy todir="${build.dir}/config">
+			<fileset dir="${basedir}/config" />
+		</copy>
+		<copy todir="${build.dir}/lib">
+			<fileset file="${basedir}/lib/jtoaster-1.0.4.jar" />
+			<fileset file="${basedir}/lib/log4j.properties" />
+		</copy>
+		<copy todir="${build.dir}/lib">
+			<fileset file="../../../build/zookeeper-3.3.0.jar" />
+		</copy>
+		<copy todir="${build.dir}">
+			<fileset dir="${basedir}" includes="*.*" excludes="build.xml,ivy.xml" />
+		</copy>
+	</target>
+
+	<!-- Override jar target to specify main class -->
+	<target name="jar" depends="setjarname, compile">
+		<echo message="contrib: ${name}" />
+
+		<jar jarfile="${jarname}">
+			<manifest>
+				<attribute name="Main-Class" value="org.apache.zookeeper.inspector.ZooInspector" />
+				<attribute name="Class-Path" value="lib/log4j-1.2.15.jar lib/TableLayout-20050920.jar lib/zookeeper-3.3.0.jar lib/jToaster-1.0.4.jar lib" />
+				<attribute name="Built-By" value="${user.name}" />
+				<attribute name="Built-At" value="${build.time}" />
+				<attribute name="Built-On" value="${host.name}" />
+				<attribute name="Implementation-Title" value="org.apache.zookeeper" />
+				<attribute name="Implementation-Version" value="${revision}" />
+				<attribute name="Implementation-Vendor" value="The Apache Software Foundation" />
+			</manifest>
+			<fileset file="${zk.root}/LICENSE.txt" />
+			<fileset dir="${build.classes}" />
+			<fileset dir="${basedir}/src/java" excludes="**/*.jar, **/*.java"/>
+		</jar>
+	</target>
+
+	<target name="compile" depends="ivy-retrieve,zookeeperbuildcontrib.compile" />
+
+	<target name="test" depends="checkMainTestCompiled,compile-test,test-init,test-category,junit.run" />
+
+	<target name="compile-test" depends="ivy-retrieve-test,compile">
+		<property name="target.jdk" value="${ant.java.version}" />
+		<property name="src.test.local" location="${basedir}/test" />
+		<mkdir dir="${build.test}" />
+		<javac srcdir="${src.test.local}" destdir="${build.test}" target="${target.jdk}" debug="on">
+			<classpath refid="classpath" />
+			<classpath>
+				<pathelement location="${zk.root}/build/test/classes" />
+			</classpath>
+		</javac>
+	</target>
+
+	<target name="test-init" depends="jar,compile-test">
+		<delete dir="${test.log.dir}" />
+		<delete dir="${test.tmp.dir}" />
+		<delete dir="${test.data.dir}" />
+		<mkdir dir="${test.log.dir}" />
+		<mkdir dir="${test.tmp.dir}" />
+		<mkdir dir="${test.data.dir}" />
+	</target>
+
+	<target name="test-category">
+		<property name="test.category" value="" />
+	</target>
+
+	<target name="junit.run">
+		<echo message="${test.src.dir}" />
+		<junit showoutput="${test.output}" printsummary="${test.junit.printsummary}" haltonfailure="${test.junit.haltonfailure}" fork="yes" forkmode="${test.junit.fork.mode}" maxmemory="${test.junit.maxmem}" dir="${basedir}" timeout="${test.timeout}" errorProperty="tests.failed" failureProperty="tests.failed">
+			<sysproperty key="build.test.dir" value="${test.tmp.dir}" />
+			<sysproperty key="test.data.dir" value="${test.data.dir}" />
+			<sysproperty key="log4j.configuration" value="file:${basedir}/conf/log4j.properties" />
+			<classpath refid="classpath" />
+			<classpath>
+				<pathelement path="${build.test}" />
+				<pathelement location="${zk.root}/build/test/classes" />
+			</classpath>
+			<formatter type="${test.junit.output.format}" />
+			<batchtest todir="${test.log.dir}" unless="testcase">
+				<fileset dir="${test.src.dir}" includes="**/*${test.category}Test.java" />
+			</batchtest>
+			<batchtest todir="${test.log.dir}" if="testcase">
+				<fileset dir="${test.src.dir}" includes="**/${testcase}.java" />
+			</batchtest>
+		</junit>
+		<fail if="tests.failed">Tests failed!</fail>
+	</target>
+
+	<target name="package" depends="jar, zookeeperbuildcontrib.package" unless="skip.contrib">
+
+		<copy file="${basedir}/build.xml" todir="${dist.dir}/contrib/${name}" />
+
+		<mkdir dir="${dist.dir}/contrib/${name}/src" />
+		<copy todir="${dist.dir}/contrib/${name}/src">
+			<fileset dir="${basedir}/src" />
+		</copy>
+		<mkdir dir="${dist.dir}/contrib/${name}/licences" />
+		<copy todir="${dist.dir}/contrib/${name}/licences">
+			<fileset dir="${basedir}/licences" />
+		</copy>
+		<mkdir dir="${dist.dir}/contrib/${name}/icons" />
+		<copy todir="${dist.dir}/contrib/${name}/icons">
+			<fileset dir="${basedir}/icons" />
+		</copy>
+		<mkdir dir="${dist.dir}/contrib/${name}/config" />
+		<copy todir="${dist.dir}/contrib/${name}/config">
+			<fileset dir="${basedir}/config" />
+		</copy>
+		<copy todir="${dist.dir}/contrib/${name}/lib">
+			<fileset file="${basedir}/lib/jtoaster-1.0.4.jar" />
+		</copy>
+		<copy todir="${dist.dir}/contrib/${name}/lib">
+			<fileset file="../../../build/zookeeper-3.3.0.jar" />
+		</copy>
+	</target>
+
+</project>
+

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/config/defaultConnectionSettings.cfg
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/config/defaultConnectionSettings.cfg?rev=920604&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zooinspector/config/defaultConnectionSettings.cfg (added)
+++ hadoop/zookeeper/trunk/src/contrib/zooinspector/config/defaultConnectionSettings.cfg Tue Mar  9 01:06:15 2010
@@ -0,0 +1,5 @@
+#Default connection for ZooInspector
+#Sun Feb 28 14:46:55 GMT 2010
+hosts=localhost\:2181
+encryptionManager=org.apache.zookeeper.inspector.encryption.BasicDataEncryptionManager
+timeout=5000

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/config/defaultNodeVeiwers.cfg
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/config/defaultNodeVeiwers.cfg?rev=920604&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zooinspector/config/defaultNodeVeiwers.cfg (added)
+++ hadoop/zookeeper/trunk/src/contrib/zooinspector/config/defaultNodeVeiwers.cfg Tue Mar  9 01:06:15 2010
@@ -0,0 +1,3 @@
+org.apache.zookeeper.inspector.gui.nodeviewer.NodeViewerData
+org.apache.zookeeper.inspector.gui.nodeviewer.NodeViewerMetaData
+org.apache.zookeeper.inspector.gui.nodeviewer.NodeViewerACL

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/edtsrclkup_co.gif
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/edtsrclkup_co.gif?rev=920604&view=auto
==============================================================================
Binary file - no diff available.

Propchange: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/edtsrclkup_co.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/file_obj.gif
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/file_obj.gif?rev=920604&view=auto
==============================================================================
Binary file - no diff available.

Propchange: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/file_obj.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/fldr_obj.gif
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/fldr_obj.gif?rev=920604&view=auto
==============================================================================
Binary file - no diff available.

Propchange: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/fldr_obj.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/info_obj.gif
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/info_obj.gif?rev=920604&view=auto
==============================================================================
Binary file - no diff available.

Propchange: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/info_obj.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/jspdecl.gif
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/jspdecl.gif?rev=920604&view=auto
==============================================================================
Binary file - no diff available.

Propchange: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/jspdecl.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/launch_run.gif
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/launch_run.gif?rev=920604&view=auto
==============================================================================
Binary file - no diff available.

Propchange: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/launch_run.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/launch_stop.gif
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/launch_stop.gif?rev=920604&view=auto
==============================================================================
Binary file - no diff available.

Propchange: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/launch_stop.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/new_con.gif
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/new_con.gif?rev=920604&view=auto
==============================================================================
Binary file - no diff available.

Propchange: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/new_con.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/refresh.gif
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/refresh.gif?rev=920604&view=auto
==============================================================================
Binary file - no diff available.

Propchange: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/refresh.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/save_edit.gif
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/save_edit.gif?rev=920604&view=auto
==============================================================================
Binary file - no diff available.

Propchange: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/save_edit.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/search_next.gif
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/search_next.gif?rev=920604&view=auto
==============================================================================
Binary file - no diff available.

Propchange: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/search_next.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/search_prev.gif
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/search_prev.gif?rev=920604&view=auto
==============================================================================
Binary file - no diff available.

Propchange: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/search_prev.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/trash.gif
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/trash.gif?rev=920604&view=auto
==============================================================================
Binary file - no diff available.

Propchange: hadoop/zookeeper/trunk/src/contrib/zooinspector/icons/trash.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/ivy.xml
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/ivy.xml?rev=920604&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zooinspector/ivy.xml (added)
+++ hadoop/zookeeper/trunk/src/contrib/zooinspector/ivy.xml Tue Mar  9 01:06:15 2010
@@ -0,0 +1,45 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+<ivy-module version="2.0"
+            xmlns:e="http://ant.apache.org/ivy/extra">
+
+  <info organisation="org.apache.zookeeper"
+        module="${name}" revision="${version}">
+    <license name="Apache 2.0"/>
+    <ivyauthor name="Apache Hadoop" url="http://hadoop.apache.org"/>
+    <description>ZooInspector</description>
+  </info>
+
+  <configurations defaultconfmapping="default">
+    <conf name="default"/>
+    <conf name="test"/>
+    <conf name="releaseaudit" visibility="private" description="Artifacts required for releaseaudit target"/>
+  </configurations>
+
+  <dependencies>
+    <dependency org="log4j" name="log4j" rev="1.2.15" transitive="false"/>
+    <dependency org="junit" name="junit" rev="4.7" conf="test->default"/>
+        <dependency org="org.apache.rat" name="apache-rat-tasks" 
+                rev="0.6" conf="releaseaudit->default"/>
+    <dependency org="commons-lang" name="commons-lang" 
+                rev="2.4" conf="releaseaudit->default"/>
+    <dependency org="commons-collections" name="commons-collections" 
+                rev="3.1" conf="releaseaudit->default"/>
+  </dependencies>
+
+</ivy-module>
\ No newline at end of file

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/lib/jtoaster-1.0.4.jar
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/lib/jtoaster-1.0.4.jar?rev=920604&view=auto
==============================================================================
Binary file - no diff available.

Propchange: hadoop/zookeeper/trunk/src/contrib/zooinspector/lib/jtoaster-1.0.4.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/lib/log4j.properties
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/lib/log4j.properties?rev=920604&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zooinspector/lib/log4j.properties (added)
+++ hadoop/zookeeper/trunk/src/contrib/zooinspector/lib/log4j.properties Tue Mar  9 01:06:15 2010
@@ -0,0 +1,9 @@
+# ***** Set root logger level to INFO and it appender to stdout.
+log4j.rootLogger=info, stdout
+
+# ***** stdout is set to be a ConsoleAppender.
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+# ***** stdout uses PatternLayout.
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+# ***** Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
\ No newline at end of file

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/licences/Apache Software Licence v2.0.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/licences/Apache%20Software%20Licence%20v2.0.txt?rev=920604&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zooinspector/licences/Apache Software Licence v2.0.txt (added)
+++ hadoop/zookeeper/trunk/src/contrib/zooinspector/licences/Apache Software Licence v2.0.txt Tue Mar  9 01:06:15 2010
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/licences/epl-v10.html
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/licences/epl-v10.html?rev=920604&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zooinspector/licences/epl-v10.html (added)
+++ hadoop/zookeeper/trunk/src/contrib/zooinspector/licences/epl-v10.html Tue Mar  9 01:06:15 2010
@@ -0,0 +1,261 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Public License - Version 1.0</title>
+<style type="text/css">
+  body {
+    size: 8.5in 11.0in;
+    margin: 0.25in 0.5in 0.25in 0.5in;
+    tab-interval: 0.5in;
+    }
+  p {  	
+    margin-left: auto;
+    margin-top:  0.5em;
+    margin-bottom: 0.5em;
+    }
+  p.list {
+  	margin-left: 0.5in;
+    margin-top:  0.05em;
+    margin-bottom: 0.05em;
+    }
+  </style>
+
+</head>
+
+<body lang="EN-US">
+
+<h2>Eclipse Public License - v 1.0</h2>
+
+<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE, REPRODUCTION OR
+DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS
+AGREEMENT.</p>
+
+<p><b>1. DEFINITIONS</b></p>
+
+<p>&quot;Contribution&quot; means:</p>
+
+<p class="list">a) in the case of the initial Contributor, the initial
+code and documentation distributed under this Agreement, and</p>
+<p class="list">b) in the case of each subsequent Contributor:</p>
+<p class="list">i) changes to the Program, and</p>
+<p class="list">ii) additions to the Program;</p>
+<p class="list">where such changes and/or additions to the Program
+originate from and are distributed by that particular Contributor. A
+Contribution 'originates' from a Contributor if it was added to the
+Program by such Contributor itself or anyone acting on such
+Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii)
+are not derivative works of the Program.</p>
+
+<p>&quot;Contributor&quot; means any person or entity that distributes
+the Program.</p>
+
+<p>&quot;Licensed Patents&quot; mean patent claims licensable by a
+Contributor which are necessarily infringed by the use or sale of its
+Contribution alone or when combined with the Program.</p>
+
+<p>&quot;Program&quot; means the Contributions distributed in accordance
+with this Agreement.</p>
+
+<p>&quot;Recipient&quot; means anyone who receives the Program under
+this Agreement, including all Contributors.</p>
+
+<p><b>2. GRANT OF RIGHTS</b></p>
+
+<p class="list">a) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free copyright license to reproduce, prepare derivative works
+of, publicly display, publicly perform, distribute and sublicense the
+Contribution of such Contributor, if any, and such derivative works, in
+source code and object code form.</p>
+
+<p class="list">b) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free patent license under Licensed Patents to make, use, sell,
+offer to sell, import and otherwise transfer the Contribution of such
+Contributor, if any, in source code and object code form. This patent
+license shall apply to the combination of the Contribution and the
+Program if, at the time the Contribution is added by the Contributor,
+such addition of the Contribution causes such combination to be covered
+by the Licensed Patents. The patent license shall not apply to any other
+combinations which include the Contribution. No hardware per se is
+licensed hereunder.</p>
+
+<p class="list">c) Recipient understands that although each Contributor
+grants the licenses to its Contributions set forth herein, no assurances
+are provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other entity. Each
+Contributor disclaims any liability to Recipient for claims brought by
+any other entity based on infringement of intellectual property rights
+or otherwise. As a condition to exercising the rights and licenses
+granted hereunder, each Recipient hereby assumes sole responsibility to
+secure any other intellectual property rights needed, if any. For
+example, if a third party patent license is required to allow Recipient
+to distribute the Program, it is Recipient's responsibility to acquire
+that license before distributing the Program.</p>
+
+<p class="list">d) Each Contributor represents that to its knowledge it
+has sufficient copyright rights in its Contribution, if any, to grant
+the copyright license set forth in this Agreement.</p>
+
+<p><b>3. REQUIREMENTS</b></p>
+
+<p>A Contributor may choose to distribute the Program in object code
+form under its own license agreement, provided that:</p>
+
+<p class="list">a) it complies with the terms and conditions of this
+Agreement; and</p>
+
+<p class="list">b) its license agreement:</p>
+
+<p class="list">i) effectively disclaims on behalf of all Contributors
+all warranties and conditions, express and implied, including warranties
+or conditions of title and non-infringement, and implied warranties or
+conditions of merchantability and fitness for a particular purpose;</p>
+
+<p class="list">ii) effectively excludes on behalf of all Contributors
+all liability for damages, including direct, indirect, special,
+incidental and consequential damages, such as lost profits;</p>
+
+<p class="list">iii) states that any provisions which differ from this
+Agreement are offered by that Contributor alone and not by any other
+party; and</p>
+
+<p class="list">iv) states that source code for the Program is available
+from such Contributor, and informs licensees how to obtain it in a
+reasonable manner on or through a medium customarily used for software
+exchange.</p>
+
+<p>When the Program is made available in source code form:</p>
+
+<p class="list">a) it must be made available under this Agreement; and</p>
+
+<p class="list">b) a copy of this Agreement must be included with each
+copy of the Program.</p>
+
+<p>Contributors may not remove or alter any copyright notices contained
+within the Program.</p>
+
+<p>Each Contributor must identify itself as the originator of its
+Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution.</p>
+
+<p><b>4. COMMERCIAL DISTRIBUTION</b></p>
+
+<p>Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and the
+like. While this license is intended to facilitate the commercial use of
+the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create
+potential liability for other Contributors. Therefore, if a Contributor
+includes the Program in a commercial product offering, such Contributor
+(&quot;Commercial Contributor&quot;) hereby agrees to defend and
+indemnify every other Contributor (&quot;Indemnified Contributor&quot;)
+against any losses, damages and costs (collectively &quot;Losses&quot;)
+arising from claims, lawsuits and other legal actions brought by a third
+party against the Indemnified Contributor to the extent caused by the
+acts or omissions of such Commercial Contributor in connection with its
+distribution of the Program in a commercial product offering. The
+obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In
+order to qualify, an Indemnified Contributor must: a) promptly notify
+the Commercial Contributor in writing of such claim, and b) allow the
+Commercial Contributor to control, and cooperate with the Commercial
+Contributor in, the defense and any related settlement negotiations. The
+Indemnified Contributor may participate in any such claim at its own
+expense.</p>
+
+<p>For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone. Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those
+performance claims and warranties, and if a court requires any other
+Contributor to pay any damages as a result, the Commercial Contributor
+must pay those damages.</p>
+
+<p><b>5. NO WARRANTY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS
+OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
+ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement , including but not limited to
+the risks and costs of program errors, compliance with applicable laws,
+damage to or loss of data, programs or equipment, and unavailability or
+interruption of operations.</p>
+
+<p><b>6. DISCLAIMER OF LIABILITY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
+DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p>
+
+<p><b>7. GENERAL</b></p>
+
+<p>If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further action
+by the parties hereto, such provision shall be reformed to the minimum
+extent necessary to make such provision valid and enforceable.</p>
+
+<p>If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the
+Program itself (excluding combinations of the Program with other
+software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the
+date such litigation is filed.</p>
+
+<p>All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of time
+after becoming aware of such noncompliance. If all Recipient's rights
+under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive.</p>
+
+<p>Everyone is permitted to copy and distribute copies of this
+Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The
+Agreement Steward reserves the right to publish new versions (including
+revisions) of this Agreement from time to time. No one other than the
+Agreement Steward has the right to modify this Agreement. The Eclipse
+Foundation is the initial Agreement Steward. The Eclipse Foundation may
+assign the responsibility to serve as the Agreement Steward to a
+suitable separate entity. Each new version of the Agreement will be
+given a distinguishing version number. The Program (including
+Contributions) may always be distributed subject to the version of the
+Agreement under which it was received. In addition, after a new version
+of the Agreement is published, Contributor may elect to distribute the
+Program (including its Contributions) under the new version. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
+rights or licenses to the intellectual property of any Contributor under
+this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under this
+Agreement are reserved.</p>
+
+<p>This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No party
+to this Agreement will bring a legal action under this Agreement more
+than one year after the cause of action arose. Each party waives its
+rights to a jury trial in any resulting litigation.</p>
+
+</body>
+
+</html>

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/ZooInspector.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/ZooInspector.java?rev=920604&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/ZooInspector.java (added)
+++ hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/ZooInspector.java Tue Mar  9 01:06:15 2010
@@ -0,0 +1,66 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.zookeeper.inspector;
+
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import javax.swing.JFrame;
+import javax.swing.JOptionPane;
+import javax.swing.UIManager;
+
+import org.apache.zookeeper.inspector.gui.ZooInspectorPanel;
+import org.apache.zookeeper.inspector.logger.LoggerFactory;
+import org.apache.zookeeper.inspector.manager.ZooInspectorManagerImpl;
+
+/**
+ * 
+ */
+public class ZooInspector {
+    /**
+     * @param args
+     *            - not used. The value of these parameters will have no effect
+     *            on the application
+     */
+    public static void main(String[] args) {
+        try {
+            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+            JFrame frame = new JFrame("ZooInspector");
+            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+            final ZooInspectorPanel zooInspectorPanel = new ZooInspectorPanel(
+                    new ZooInspectorManagerImpl());
+            frame.addWindowListener(new WindowAdapter() {
+                @Override
+                public void windowClosed(WindowEvent e) {
+                    super.windowClosed(e);
+                    zooInspectorPanel.disconnect(true);
+                }
+            });
+
+            frame.setContentPane(zooInspectorPanel);
+            frame.setSize(1024, 768);
+            frame.setVisible(true);
+        } catch (Exception e) {
+            LoggerFactory.getLogger().error(
+                    "Error occurred loading ZooInspector", e);
+            JOptionPane.showMessageDialog(null,
+                    "ZooInspector failed to start: " + e.getMessage(), "Error",
+                    JOptionPane.ERROR_MESSAGE);
+        }
+    }
+}

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/encryption/BasicDataEncryptionManager.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/encryption/BasicDataEncryptionManager.java?rev=920604&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/encryption/BasicDataEncryptionManager.java (added)
+++ hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/encryption/BasicDataEncryptionManager.java Tue Mar  9 01:06:15 2010
@@ -0,0 +1,50 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.zookeeper.inspector.encryption;
+
+/**
+ *
+ */
+public class BasicDataEncryptionManager implements DataEncryptionManager {
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.zookeeper.inspector.encryption.DataEncryptionManager#decryptData
+     * (byte[])
+     */
+    public String decryptData(byte[] encrypted) throws Exception {
+        return new String(encrypted);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.zookeeper.inspector.encryption.DataEncryptionManager#encryptData
+     * (java.lang.String)
+     */
+    public byte[] encryptData(String data) throws Exception {
+        if (data == null) {
+            return new byte[0];
+        }
+        return data.getBytes();
+    }
+
+}

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/encryption/DataEncryptionManager.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/encryption/DataEncryptionManager.java?rev=920604&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/encryption/DataEncryptionManager.java (added)
+++ hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/encryption/DataEncryptionManager.java Tue Mar  9 01:06:15 2010
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.zookeeper.inspector.encryption;
+
+/**
+ * A class which describes how data should be encrypted and decrypted
+ */
+public interface DataEncryptionManager {
+    /**
+     * @param data
+     *            - the data to be encrypted
+     * @return the encrypted data
+     * @throws Exception
+     */
+    public byte[] encryptData(String data) throws Exception;
+
+    /**
+     * @param encrypted
+     *            - the data to be decrypted
+     * @return the decrypted data
+     * @throws Exception
+     */
+    public String decryptData(byte[] encrypted) throws Exception;
+}

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/NodeViewersChangeListener.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/NodeViewersChangeListener.java?rev=920604&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/NodeViewersChangeListener.java (added)
+++ hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/NodeViewersChangeListener.java Tue Mar  9 01:06:15 2010
@@ -0,0 +1,37 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.zookeeper.inspector.gui;
+
+import java.util.List;
+
+import org.apache.zookeeper.inspector.gui.nodeviewer.ZooInspectorNodeViewer;
+
+/**
+ * A Listener for changes to the configuration of which node viewers are shown
+ */
+public interface NodeViewersChangeListener {
+    /**
+     * Called when the node viewers configuration is changed (i.e node viewers
+     * are added, removed or the order of the node viewers is changed)
+     * 
+     * @param newViewers
+     *            - a {@link List} of {@link ZooInspectorNodeViewer}s which are
+     *            to be shown
+     */
+    public void nodeViewersChanged(List<ZooInspectorNodeViewer> newViewers);
+}

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorAboutDialog.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorAboutDialog.java?rev=920604&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorAboutDialog.java (added)
+++ hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorAboutDialog.java Tue Mar  9 01:06:15 2010
@@ -0,0 +1,80 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.zookeeper.inspector.gui;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Frame;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.IOException;
+
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+
+import org.apache.zookeeper.inspector.logger.LoggerFactory;
+
+/**
+ * The About Dialog for the application
+ */
+public class ZooInspectorAboutDialog extends JDialog {
+    /**
+     * @param frame
+     *            - the Frame from which the dialog is displayed
+     */
+    public ZooInspectorAboutDialog(Frame frame) {
+        super(frame);
+        this.setLayout(new BorderLayout());
+        this.setIconImage(ZooInspectorIconResources.getInformationIcon()
+                .getImage());
+        this.setTitle("About ZooInspector");
+        this.setModal(true);
+        this.setAlwaysOnTop(true);
+        this.setResizable(false);
+        JPanel panel = new JPanel();
+        panel.setLayout(new BorderLayout());
+        JEditorPane aboutPane = new JEditorPane();
+        aboutPane.setEditable(false);
+        aboutPane.setOpaque(false);
+        java.net.URL aboutURL = ZooInspectorAboutDialog.class
+                .getResource("about.html");
+        try {
+            aboutPane.setPage(aboutURL);
+        } catch (IOException e) {
+            LoggerFactory.getLogger().error(
+                    "Error loading about.html, file may be corrupt", e);
+        }
+        panel.add(aboutPane, BorderLayout.CENTER);
+        panel.setPreferredSize(new Dimension(600, 200));
+        JPanel buttonsPanel = new JPanel();
+        buttonsPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 10, 10));
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                ZooInspectorAboutDialog.this.dispose();
+            }
+        });
+        buttonsPanel.add(okButton);
+        this.add(panel, BorderLayout.CENTER);
+        this.add(buttonsPanel, BorderLayout.SOUTH);
+        this.pack();
+    }
+}

Added: hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorConnectionPropertiesDialog.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorConnectionPropertiesDialog.java?rev=920604&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorConnectionPropertiesDialog.java (added)
+++ hadoop/zookeeper/trunk/src/contrib/zooinspector/src/java/org/apache/zookeeper/inspector/gui/ZooInspectorConnectionPropertiesDialog.java Tue Mar  9 01:06:15 2010
@@ -0,0 +1,321 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.zookeeper.inspector.gui;
+
+import java.awt.BorderLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Map.Entry;
+
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+import javax.swing.JDialog;
+import javax.swing.JFileChooser;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import org.apache.zookeeper.inspector.logger.LoggerFactory;
+import org.apache.zookeeper.inspector.manager.Pair;
+
+/**
+ * The connection properties dialog. This is used to determine the settings for
+ * connecting to a zookeeper instance
+ */
+public class ZooInspectorConnectionPropertiesDialog extends JDialog {
+
+    private final HashMap<String, JComponent> components;
+
+    /**
+     * @param lastConnectionProps
+     *            - the last connection properties used. if this is the first
+     *            conneciton since starting the applications this will be the
+     *            default settings
+     * @param connectionPropertiesTemplateAndLabels
+     *            - the connection properties and labels to show in this dialog
+     * @param zooInspectorPanel
+     *            - the {@link ZooInspectorPanel} linked to this dialog
+     */
+    public ZooInspectorConnectionPropertiesDialog(
+            Properties lastConnectionProps,
+            Pair<Map<String, List<String>>, Map<String, String>> connectionPropertiesTemplateAndLabels,
+            final ZooInspectorPanel zooInspectorPanel) {
+        final Map<String, List<String>> connectionPropertiesTemplate = connectionPropertiesTemplateAndLabels
+                .getKey();
+        final Map<String, String> connectionPropertiesLabels = connectionPropertiesTemplateAndLabels
+                .getValue();
+        this.setLayout(new BorderLayout());
+        this.setTitle("Connection Settings");
+        this.setModal(true);
+        this.setAlwaysOnTop(true);
+        this.setResizable(false);
+        final JPanel options = new JPanel();
+        final JFileChooser fileChooser = new JFileChooser();
+        options.setLayout(new GridBagLayout());
+        int i = 0;
+        components = new HashMap<String, JComponent>();
+        for (Entry<String, List<String>> entry : connectionPropertiesTemplate
+                .entrySet()) {
+            int rowPos = 2 * i + 1;
+            JLabel label = new JLabel(connectionPropertiesLabels.get(entry
+                    .getKey()));
+            GridBagConstraints c1 = new GridBagConstraints();
+            c1.gridx = 0;
+            c1.gridy = rowPos;
+            c1.gridwidth = 1;
+            c1.gridheight = 1;
+            c1.weightx = 0;
+            c1.weighty = 0;
+            c1.anchor = GridBagConstraints.WEST;
+            c1.fill = GridBagConstraints.HORIZONTAL;
+            c1.insets = new Insets(5, 5, 5, 5);
+            c1.ipadx = 0;
+            c1.ipady = 0;
+            options.add(label, c1);
+            if (entry.getValue().size() == 0) {
+                JTextField text = new JTextField();
+                GridBagConstraints c2 = new GridBagConstraints();
+                c2.gridx = 2;
+                c2.gridy = rowPos;
+                c2.gridwidth = 1;
+                c2.gridheight = 1;
+                c2.weightx = 0;
+                c2.weighty = 0;
+                c2.anchor = GridBagConstraints.WEST;
+                c2.fill = GridBagConstraints.HORIZONTAL;
+                c2.insets = new Insets(5, 5, 5, 5);
+                c2.ipadx = 0;
+                c2.ipady = 0;
+                options.add(text, c2);
+                components.put(entry.getKey(), text);
+            } else if (entry.getValue().size() == 1) {
+                JTextField text = new JTextField(entry.getValue().get(0));
+                GridBagConstraints c2 = new GridBagConstraints();
+                c2.gridx = 2;
+                c2.gridy = rowPos;
+                c2.gridwidth = 1;
+                c2.gridheight = 1;
+                c2.weightx = 0;
+                c2.weighty = 0;
+                c2.anchor = GridBagConstraints.WEST;
+                c2.fill = GridBagConstraints.HORIZONTAL;
+                c2.insets = new Insets(5, 5, 5, 5);
+                c2.ipadx = 0;
+                c2.ipady = 0;
+                options.add(text, c2);
+                components.put(entry.getKey(), text);
+            } else {
+                List<String> list = entry.getValue();
+                JComboBox combo = new JComboBox(list.toArray(new String[list
+                        .size()]));
+                combo.setSelectedItem(list.get(0));
+                GridBagConstraints c2 = new GridBagConstraints();
+                c2.gridx = 2;
+                c2.gridy = rowPos;
+                c2.gridwidth = 1;
+                c2.gridheight = 1;
+                c2.weightx = 0;
+                c2.weighty = 0;
+                c2.anchor = GridBagConstraints.WEST;
+                c2.fill = GridBagConstraints.HORIZONTAL;
+                c2.insets = new Insets(5, 5, 5, 5);
+                c2.ipadx = 0;
+                c2.ipady = 0;
+                options.add(combo, c2);
+                components.put(entry.getKey(), combo);
+            }
+            i++;
+        }
+        loadConnectionProps(lastConnectionProps);
+        JPanel buttonsPanel = new JPanel();
+        buttonsPanel.setLayout(new GridBagLayout());
+        JButton loadPropsFileButton = new JButton("Load from file");
+        loadPropsFileButton.addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent e) {
+                int result = fileChooser
+                        .showOpenDialog(ZooInspectorConnectionPropertiesDialog.this);
+                if (result == JFileChooser.APPROVE_OPTION) {
+                    File propsFilePath = fileChooser.getSelectedFile();
+                    Properties props = new Properties();
+                    try {
+                        FileReader reader = new FileReader(propsFilePath);
+                        try {
+                            props.load(reader);
+                            loadConnectionProps(props);
+                        } finally {
+                            reader.close();
+                        }
+                    } catch (IOException ex) {
+                        LoggerFactory
+                                .getLogger()
+                                .error(
+                                        "An Error occurred loading connection properties from file",
+                                        ex);
+                        JOptionPane
+                                .showMessageDialog(
+                                        ZooInspectorConnectionPropertiesDialog.this,
+                                        "An Error occurred loading connection properties from file",
+                                        "Error", JOptionPane.ERROR_MESSAGE);
+                    }
+                    options.revalidate();
+                    options.repaint();
+                }
+
+            }
+        });
+        GridBagConstraints c3 = new GridBagConstraints();
+        c3.gridx = 0;
+        c3.gridy = 0;
+        c3.gridwidth = 1;
+        c3.gridheight = 1;
+        c3.weightx = 0;
+        c3.weighty = 1;
+        c3.anchor = GridBagConstraints.SOUTHWEST;
+        c3.fill = GridBagConstraints.NONE;
+        c3.insets = new Insets(5, 5, 5, 5);
+        c3.ipadx = 0;
+        c3.ipady = 0;
+        buttonsPanel.add(loadPropsFileButton, c3);
+        JButton saveDefaultPropsFileButton = new JButton("Set As Default");
+        saveDefaultPropsFileButton.addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent e) {
+
+                Properties connectionProps = getConnectionProps();
+                try {
+                    zooInspectorPanel
+                            .setdefaultConnectionProps(connectionProps);
+                } catch (IOException ex) {
+                    LoggerFactory
+                            .getLogger()
+                            .error(
+                                    "An Error occurred saving the default connection properties file",
+                                    ex);
+                    JOptionPane
+                            .showMessageDialog(
+                                    ZooInspectorConnectionPropertiesDialog.this,
+                                    "An Error occurred saving the default connection properties file",
+                                    "Error", JOptionPane.ERROR_MESSAGE);
+                }
+            }
+        });
+        GridBagConstraints c6 = new GridBagConstraints();
+        c6.gridx = 1;
+        c6.gridy = 0;
+        c6.gridwidth = 1;
+        c6.gridheight = 1;
+        c6.weightx = 1;
+        c6.weighty = 1;
+        c6.anchor = GridBagConstraints.SOUTHWEST;
+        c6.fill = GridBagConstraints.NONE;
+        c6.insets = new Insets(5, 5, 5, 5);
+        c6.ipadx = 0;
+        c6.ipady = 0;
+        buttonsPanel.add(saveDefaultPropsFileButton, c6);
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent e) {
+                ZooInspectorConnectionPropertiesDialog.this.dispose();
+                Properties connectionProps = getConnectionProps();
+                zooInspectorPanel.connect(connectionProps);
+            }
+        });
+        GridBagConstraints c4 = new GridBagConstraints();
+        c4.gridx = 2;
+        c4.gridy = 0;
+        c4.gridwidth = 1;
+        c4.gridheight = 1;
+        c4.weightx = 0;
+        c4.weighty = 1;
+        c4.anchor = GridBagConstraints.SOUTH;
+        c4.fill = GridBagConstraints.HORIZONTAL;
+        c4.insets = new Insets(5, 5, 5, 5);
+        c4.ipadx = 0;
+        c4.ipady = 0;
+        buttonsPanel.add(okButton, c4);
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent e) {
+                ZooInspectorConnectionPropertiesDialog.this.dispose();
+            }
+        });
+        GridBagConstraints c5 = new GridBagConstraints();
+        c5.gridx = 3;
+        c5.gridy = 0;
+        c5.gridwidth = 1;
+        c5.gridheight = 1;
+        c5.weightx = 0;
+        c5.weighty = 1;
+        c5.anchor = GridBagConstraints.SOUTH;
+        c5.fill = GridBagConstraints.HORIZONTAL;
+        c5.insets = new Insets(5, 5, 5, 5);
+        c5.ipadx = 0;
+        c5.ipady = 0;
+        buttonsPanel.add(cancelButton, c5);
+        this.add(options, BorderLayout.CENTER);
+        this.add(buttonsPanel, BorderLayout.SOUTH);
+        this.pack();
+    }
+
+    private void loadConnectionProps(Properties props) {
+        if (props != null) {
+            for (Object key : props.keySet()) {
+                String propsKey = (String) key;
+                if (components.containsKey(propsKey)) {
+                    JComponent component = components.get(propsKey);
+                    String value = props.getProperty(propsKey);
+                    if (component instanceof JTextField) {
+                        ((JTextField) component).setText(value);
+                    } else if (component instanceof JComboBox) {
+                        ((JComboBox) component).setSelectedItem(value);
+                    }
+                }
+            }
+        }
+    }
+
+    private Properties getConnectionProps() {
+        Properties connectionProps = new Properties();
+        for (Entry<String, JComponent> entry : components.entrySet()) {
+            String value = null;
+            JComponent component = entry.getValue();
+            if (component instanceof JTextField) {
+                value = ((JTextField) component).getText();
+            } else if (component instanceof JComboBox) {
+                value = ((JComboBox) component).getSelectedItem().toString();
+            }
+            connectionProps.put(entry.getKey(), value);
+        }
+        return connectionProps;
+    }
+}



Mime
View raw message