Class ZooInspectorManagerImpl
java.lang.Object
org.apache.zookeeper.inspector.manager.ZooInspectorManagerImpl
- All Implemented Interfaces:
ZooInspectorManager,ZooInspectorNodeManager,ZooInspectorNodeTreeManager,ZooInspectorReadOnlyManager
A default implementation of
ZooInspectorManager for connecting to
zookeeper instances-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassA Watcher which will re-add itself every time an event is fired -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe key used for the authentication data in the connection properties filestatic final StringThe key used for the authentication scheme in the connection properties filestatic final StringThe key used for the connect string in the connection properties fileprotected booleanstatic final StringThe key used for the data encryption manager in the connection properties filestatic final StringThe key used for the session timeout in the connection properties file -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWatchers(Collection<String> selectedNodes, NodeListener nodeListener) booleanconnect(Properties connectionProps) booleancreateNode(String parent, String nodeName) booleandeleteNode(String nodePath) booleangetChildren(String nodePath) getNodeMeta(String nodePath) intgetNumChildren(String nodePath) loadNodeViewersFile(File selectedFile) voidremoveWatchers(Collection<String> selectedNodes) voidvoidsaveNodeViewersFile(File selectedFile, List<String> nodeViewersClassNames) booleanvoidsetDefaultNodeViewerConfiguration(List<String> nodeViewersClassNames) voidsetLastConnectionProps(Properties connectionProps)
-
Field Details
-
CONNECT_STRING
The key used for the connect string in the connection properties file- See Also:
-
SESSION_TIMEOUT
The key used for the session timeout in the connection properties file- See Also:
-
DATA_ENCRYPTION_MANAGER
The key used for the data encryption manager in the connection properties file- See Also:
-
AUTH_SCHEME_KEY
The key used for the authentication scheme in the connection properties file- See Also:
-
AUTH_DATA_KEY
The key used for the authentication data in the connection properties file- See Also:
-
connected
protected boolean connected
-
-
Constructor Details
-
ZooInspectorManagerImpl
- Throws:
IOException- - thrown if the default connection settings cannot be loaded
-
-
Method Details
-
connect
- Specified by:
connectin interfaceZooInspectorManager- Parameters:
connectionProps-- Returns:
- true if successfully connected
-
disconnect
public boolean disconnect()- Specified by:
disconnectin interfaceZooInspectorManager- Returns:
- true if successfully disconnected
-
getChildren
- Specified by:
getChildrenin interfaceZooInspectorReadOnlyManager- Parameters:
nodePath- - the path to the node whose children to retrieve- Returns:
- a
Listof the children of the node
-
getData
- Specified by:
getDatain interfaceZooInspectorReadOnlyManager- Parameters:
nodePath- - the path to the node whose data is to be retrieved- Returns:
- the data for the node
-
getACLs
-
getNodeMeta
- Specified by:
getNodeMetain interfaceZooInspectorReadOnlyManager- Parameters:
nodePath- - the path to the node whose metadata is to be retrieved- Returns:
- the metaData for the node
-
getNumChildren
- Specified by:
getNumChildrenin interfaceZooInspectorReadOnlyManager- Parameters:
nodePath- - the path to the node to parent node- Returns:
- the number of children of the node
-
createNode
- Specified by:
createNodein interfaceZooInspectorNodeTreeManager- Parameters:
parent- - the parent node path for the node to addnodeName- - the name of the new node- Returns:
- true if the node was successfully created
-
deleteNode
- Specified by:
deleteNodein interfaceZooInspectorNodeTreeManager- Parameters:
nodePath- - the path to the node to delete- Returns:
- true if the node was successfully deleted
-
setData
- Specified by:
setDatain interfaceZooInspectorNodeManager- Parameters:
nodePath- - the path to the node on which to set the datadata- - the data to set on the this node- Returns:
- true if the data for the node was successfully updated
-
getConnectionPropertiesTemplate
- Specified by:
getConnectionPropertiesTemplatein interfaceZooInspectorManager- Returns:
- a
Paircontaining the following:- a
Mapof property keys to list of possible values. If the list size is 1 the value is taken to be the default value for aJTextField. If the list size is greater than 1, the values are taken to be the possible options to show in aJComboBoxwith the first selected as default. - a
Mapof property keys to the label to show on the UI
- a
-
addWatchers
- Specified by:
addWatchersin interfaceZooInspectorManager- Parameters:
selectedNodes- - the nodes to add the watcher tonodeListener- - the node listener for this watcher
-
removeWatchers
- Specified by:
removeWatchersin interfaceZooInspectorManager- Parameters:
selectedNodes- - the nodes to remove the watchers from
-
loadNodeViewersFile
- Specified by:
loadNodeViewersFilein interfaceZooInspectorManager- Parameters:
selectedFile- - the file to load which contains the node viewers configuration- Returns:
- nodeViewers - the class names of the node viewers from the configuration
- Throws:
IOException- - if the configuration file cannot be loaded
-
saveDefaultConnectionFile
- Specified by:
saveDefaultConnectionFilein interfaceZooInspectorManager- Parameters:
props- - the properties to use as the default connection settings- Throws:
IOException- - if the default configuration file cannot be saved
-
saveNodeViewersFile
public void saveNodeViewersFile(File selectedFile, List<String> nodeViewersClassNames) throws IOException - Specified by:
saveNodeViewersFilein interfaceZooInspectorManager- Parameters:
selectedFile- - the file to save the configuration tonodeViewersClassNames- - the class names of the node viewers- Throws:
IOException- - if the configuration file cannot be saved
-
setDefaultNodeViewerConfiguration
public void setDefaultNodeViewerConfiguration(List<String> nodeViewersClassNames) throws IOException - Specified by:
setDefaultNodeViewerConfigurationin interfaceZooInspectorManager- Parameters:
nodeViewersClassNames- - the class names of the node viewers- Throws:
IOException- - if the default configuration file cannot be loaded
-
getDefaultNodeViewerConfiguration
- Specified by:
getDefaultNodeViewerConfigurationin interfaceZooInspectorManager- Returns:
- nodeViewers - the class names of the node viewers from the configuration
- Throws:
IOException- - if the default configuration file cannot be loaded
-
getLastConnectionProps
- Specified by:
getLastConnectionPropsin interfaceZooInspectorManager- Returns:
- last connection Properties - the connection properties last used to connect to the zookeeeper instance
-
setLastConnectionProps
- Specified by:
setLastConnectionPropsin interfaceZooInspectorManager- Parameters:
connectionProps- - the connection properties last used to connect to the zookeeeper instance
-