Share

Traversing and Modifying a Node Hierarchy

A Wiretap server uses a hierarchy of nodes to represent the directory structure of an underlying database. These workflows are related to navigating the node hierarchy and to modifying it in generic ways (create, copy, modify, delete).



Node Handles

The WireTapNodeHandle class represents a node in a Wiretap server hierarchy.

The fact that a Wiretap client can manipulate objects on a Wiretap server resembles Microsoft’s Component Object Model (COM). Unlike COM objects, Wiretap node handles are not automatically updated when there is a change in the object they point to on the server. If the Wiretap client requires the latest state of an object on the server, it must update the information explicitly by calling the appropriate accessor method on the node handle.



Node IDs

Each node has a node ID. These methods give access to the node IDs of a Wiretap server:

  • WireTapNodeHandle.getNodeId() – Returns a WireTapNodeId object.
  • WireTapNodeId.id() – Returns a string containing the persistent ID of a node.


Responsibility of Wiretap Servers with Respect to IDs

In addition to node IDs, other Wiretap entities have IDs: servers, storage devices, and frames. Wiretap servers are responsible for ensuring the persistence and uniqueness of:

ID Type Description
Server ID Network-based server identification
Storage ID Persistent and network-independent server identification
Host UUID Persistent, network-independent and server-independent

Wiretap servers do not guarantee the uniqueness and persistence of frame IDs.

You should not persist connection information based on the server ID: this ID can change over time, such as when the network uses DHCP. Instead, use the server ID for the first connection and get either Storage ID or Host UUID, and then use either for the following connections.

The Host UUID can be used to identify and link two servers running on the same host.

See Discovering Wiretap Servers for details.



Viewing the Node Hierarchy of a Wiretap Server

See Understanding the IFFFS Wiretap Server Node Hierarchy for the structure and description of the IFFFFS Wiretap server hierarchy.

C++ Python Description
listChildren.C listChildren.py Example of listing children under a node.
Tool Description
wiretap_get_root_node Fetch the root node of a server. Use this as the starting point for browsing.
wiretap_get_children Fetch the children of a given node.
wiretap_get_parent_node Fetch the parent node ID of a given node.
wiretap_get_display_name Print the display name of a node from its node ID.
wiretap_print_tree Print multiple levels of the hierarchy under a node.
wiretap_can_create_node Query if a node type can be created under a parent node.


Creating Nodes

The WireTapNodeHandle class includes a number of methods for creating nodes and clip nodes. Use WireTapNodeHandle.createNode to create all types of nodes (except clip nodes).

See the following pages for more specifics examples:

C++ Python Decsription
createClip.C createClip.py Example on how to create a clip node.
createProject.C createProject.py Example on how to create a project node.
duplicateNode.C duplicateNode.py Example on how to create node based on another node attributes.
Tool Description
wiretap_create_node Create any type of node.
wiretap_create_clip_node Create a clip node.
wiretap_duplicate_node Create a node by copying the attributes of another node.


Getting and Setting Node Metadata

Most nodes support metadata streams. Streams availability and content will be specific to node type.

To get and set the metadata for a node, you call the getMetaData and setMetaData methods on the WireTapNodeHandle object. Metadata is a stream that can be in any format (for example, XML).

See the following page for more specific examples:

C++ Python Decsription
createClip.C createClip.py Example on how to create a clip node.
createProject.C createProject.py Example on how to create a project node.
copyProject.C createProject.py Example on how to create a project node by copying attributes from another.
Tool Description
wiretap_get_metadata Retrieve a metadata stream from a node.
wiretap_set_metadata Set a metadata stream on a node.
wiretap_is_metadata_available Query if a metadata stream ID is usable with a given node ID.
wiretap_get_available_metadata Retrieve the list of available metadata stream IDs usable with a given node ID.
wiretap_get_node_type Retrieve the type of a given node.
wiretap_is_clip Validate if a given node is a clip node or not.
wiretap_rename_node Change the display name of a node.


Deleting Nodes

To delete a node, you call the destroyNode method on the WireTapNodeHandle object.

Depending on the type of node, there may be some conditions on deleting a node. For more information, see:

C++ Python Decsription
destroyNodeHierarchy.C N/A Example on how to destroy a node and its children.
Tool Description
wiretap_destroy_node Destroy a node.

Was this information helpful?