public class ZooInspectorManagerImpl extends Object implements ZooInspectorManager
ZooInspectorManager
for connecting to
zookeeper instancesModifier and Type | Class and Description |
---|---|
class |
ZooInspectorManagerImpl.NodeWatcher
A Watcher which will re-add itself every time an event is fired
|
Modifier and Type | Field and Description |
---|---|
static String |
AUTH_DATA_KEY
The key used for the authentication data in the connection properties file
|
static String |
AUTH_SCHEME_KEY
The key used for the authentication scheme in the connection properties file
|
static String |
CONNECT_STRING
The key used for the connect string in the connection properties file
|
protected boolean |
connected |
static String |
DATA_ENCRYPTION_MANAGER
The key used for the data encryption manager in the connection properties
file
|
static String |
SESSION_TIMEOUT
The key used for the session timeout in the connection properties file
|
Constructor and Description |
---|
ZooInspectorManagerImpl() |
public static final String CONNECT_STRING
public static final String SESSION_TIMEOUT
public static final String DATA_ENCRYPTION_MANAGER
public static final String AUTH_SCHEME_KEY
public static final String AUTH_DATA_KEY
protected boolean connected
public ZooInspectorManagerImpl() throws IOException
IOException
- - thrown if the default connection settings cannot be loadedpublic boolean connect(Properties connectionProps)
connect
in interface ZooInspectorManager
public boolean disconnect()
disconnect
in interface ZooInspectorManager
public List<String> getChildren(String nodePath)
getChildren
in interface ZooInspectorReadOnlyManager
nodePath
- - the path to the node to deleteList
of the children of the nodepublic String getData(String nodePath)
getData
in interface ZooInspectorReadOnlyManager
nodePath
- - the path to the node to deletepublic String getNodeChild(String nodePath, int childIndex)
getNodeChild
in interface ZooInspectorReadOnlyManager
nodePath
- - the path to the node to deletechildIndex
- - the index to the node in the list of node childrenpublic int getNodeIndex(String nodePath)
getNodeIndex
in interface ZooInspectorReadOnlyManager
nodePath
- - the path to the node to deletepublic List<Map<String,String>> getACLs(String nodePath)
getACLs
in interface ZooInspectorReadOnlyManager
nodePath
- - the path to the node to deletepublic Map<String,String> getNodeMeta(String nodePath)
getNodeMeta
in interface ZooInspectorReadOnlyManager
nodePath
- - the path to the node to deletepublic int getNumChildren(String nodePath)
getNumChildren
in interface ZooInspectorReadOnlyManager
nodePath
- - the path to the node to deletepublic boolean hasChildren(String nodePath)
hasChildren
in interface ZooInspectorReadOnlyManager
nodePath
- - the path to the node to deletepublic boolean isAllowsChildren(String nodePath)
isAllowsChildren
in interface ZooInspectorReadOnlyManager
nodePath
- - the path to the node to deletepublic Map<String,String> getSessionMeta()
getSessionMeta
in interface ZooInspectorReadOnlyManager
public boolean createNode(String parent, String nodeName)
createNode
in interface ZooInspectorNodeTreeManager
parent
- - the parent node path for the node to addnodeName
- - the name of the new nodepublic boolean deleteNode(String nodePath)
deleteNode
in interface ZooInspectorNodeTreeManager
nodePath
- - the path to the node to deletepublic boolean setData(String nodePath, String data)
setData
in interface ZooInspectorNodeManager
nodePath
- - the path to the node on which to set the datadata
- - the data to set on the this nodepublic Pair<Map<String,List<String>>,Map<String,String>> getConnectionPropertiesTemplate()
getConnectionPropertiesTemplate
in interface ZooInspectorManager
Pair
containing the following:
Map
of property keys to list of possible values. If
the list size is 1 the value is taken to be the default value for
a JTextField
. If the list size is greater than 1, the
values are taken to be the possible options to show in a
JComboBox
with the first selected as default.Map
of property keys to the label to show on the UI
public void addWatchers(Collection<String> selectedNodes, NodeListener nodeListener)
addWatchers
in interface ZooInspectorManager
selectedNodes
- - the nodes to add the watcher tonodeListener
- - the node listener for this watcherpublic void removeWatchers(Collection<String> selectedNodes)
removeWatchers
in interface ZooInspectorManager
selectedNodes
- - the nodes to remove the watchers frompublic List<String> loadNodeViewersFile(File selectedFile) throws IOException
loadNodeViewersFile
in interface ZooInspectorManager
selectedFile
- - the file to load which contains the node viewers
configurationIOException
- - if the configuration file cannot be loadedpublic void saveDefaultConnectionFile(Properties props) throws IOException
saveDefaultConnectionFile
in interface ZooInspectorManager
props
- - the properties to use as the default connection settingsIOException
- - if the default configuration file cannot be savedpublic void saveNodeViewersFile(File selectedFile, List<String> nodeViewersClassNames) throws IOException
saveNodeViewersFile
in interface ZooInspectorManager
selectedFile
- - the file to save the configuration tonodeViewersClassNames
- - the class names of the node viewersIOException
- - if the configuration file cannot be savedpublic void setDefaultNodeViewerConfiguration(List<String> nodeViewersClassNames) throws IOException
setDefaultNodeViewerConfiguration
in interface ZooInspectorManager
nodeViewersClassNames
- - the class names of the node viewersIOException
- - if the default configuration file cannot be loadedpublic List<String> getDefaultNodeViewerConfiguration() throws IOException
getDefaultNodeViewerConfiguration
in interface ZooInspectorManager
IOException
- - if the default configuration file cannot be loadedpublic Properties getLastConnectionProps()
getLastConnectionProps
in interface ZooInspectorManager
public void setLastConnectionProps(Properties connectionProps)
setLastConnectionProps
in interface ZooInspectorManager
connectionProps
- - the connection properties last used to connect to the
zookeeeper instanceCopyright © 2008–2021 The Apache Software Foundation. All rights reserved.