Wiretap API  <small>Wiretap 2021.2</small>
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WireTapServerList Class Reference

This class prepares a list of the Wiretap servers that can be accessed by the Wiretap client. More...

Public Types

typedef WireTapServerInfo ServerInfo
 This type definition is available for backward compatibility with Wiretap 2007 and earlier versions. More...
 

Public Member Functions

const char * getGatewayIpAddr () const
 Gets the IP address of the gateway server from which the multicast reply have been receive from. More...
 
int getGatewayPort () const
 Gets the port of the gateway server from which the multicast reply have been receive from. More...
 
bool getNode (int index, WireTapServerInfo &node)
 Gets the WireTapServerInfo object at the specified index. More...
 
bool getNumNodes (int &numberOfNodes)
 Gets the number of Wiretap servers available to the Wiretap client. More...
 
const char * lastError () const
 Gets the error string for the last operation that failed. More...
 
WireTapServerListoperator= (const WireTapServerList &)
 
bool refresh ()
 Actively trigger a refresh of available servers on the network. More...
 
bool resolve (const WireTapServerId &serverId, WireTapServerInfo &serverInfo)
 Resolves server ID to its corresponding server information. More...
 
WIRETAP_DEPRECATED bool resolveStorageId (const char *storageId, WireTapServerId &serverId)
 Resolves the storage ID of a storage device to determine which Wiretap server it is currently connected to. More...
 
 WireTapServerList (const char *database=0, const char *gatewayIpAddr=0, int gatewayPort=0)
 The constructor prepares a list of the servers on the subnet to which the Wiretap client is connected. More...
 
 WireTapServerList (const WireTapServerList &)
 
 ~WireTapServerList ()
 Destructor. More...
 

Detailed Description

This class prepares a list of the Wiretap servers that can be accessed by the Wiretap client.

This class sends out a multicast request on the local subnet. Wiretap clients can use this class to populate a browser with a list of the Wiretap servers available on a host or network.

The list can be filtered to include the servers associated with a particular database which, in effect, means a particular type of Wiretap server (IFFFS, Backburner, and so on). The class can also prepare a list of Wiretap servers that are accessible via a particular gateway.

Note
This class is not thread safe.

Member Typedef Documentation

This type definition is available for backward compatibility with Wiretap 2007 and earlier versions.

Constructor & Destructor Documentation

WireTapServerList::WireTapServerList ( const char *  database = 0,
const char *  gatewayIpAddr = 0,
int  gatewayPort = 0 
)

The constructor prepares a list of the servers on the subnet to which the Wiretap client is connected.

The constructor sends out a multicast request that reaches a single server from which all other servers are, in turn, located. By default, all servers that respond to the multicast message are added to the list. Two optional parameters can be set to customize the list.

Parameters
databaseAn input parameter. This optional parameter can be set to the database identifier for a particular Wiretap server. Since database IDs are product-specific and unique across vendors, setting this parameter makes it possible to filter for a particular type of Wiretap server. Examples of these database IDs include "IFFFS", "Backburner". If this parameter is not set, all servers on the subnet will be added to the list.
gatewayIpAddrAn input parameter. This optional parameter can be set to the IP address of the gateway computer to which the multicast message should be sent. If this parameter is not set, the servers on the subnet where the Wiretap client is running will be listed.
gatewayPortAn input parameter. This optional parameter can be set to the port of the gateway server to which the multicast message should be sent. If this parameter is not set, the servers on the subnet where the Wiretap client is running will be listed.
WireTapServerList::~WireTapServerList ( )

Destructor.

WireTapServerList::WireTapServerList ( const WireTapServerList )

Member Function Documentation

const char* WireTapServerList::getGatewayIpAddr ( ) const

Gets the IP address of the gateway server from which the multicast reply have been receive from.

int WireTapServerList::getGatewayPort ( ) const

Gets the port of the gateway server from which the multicast reply have been receive from.

bool WireTapServerList::getNode ( int  index,
WireTapServerInfo node 
)

Gets the WireTapServerInfo object at the specified index.

Wiretap clients can use this method when iterating through the Wiretap servers in the list. The getNumNodes method obtains the number of server available on the network.

The WireTapServerInfo object that is obtained by this method contains all the information that a Wiretap client might want to display about a Wiretap server. It also gives access to the WireTapServerId for the server which can used to obtain a WireTapServerHandle for the server. To access data on a particular server, Wiretap clients must obtain a WireTapServerHandle for that server.

See Also
WireTapServerInfo, WireTapServerId, WireTapServerHandle
Parameters
indexAn input parameter. The index of the Wiretap server in the list of available servers.
nodeAn output parameter. The WireTapServerId object that can be used to obtain a WireTapServerHandle for the server.
Returns
true if it was possible to get a WireTapServerId object for specified index, false if it was not possible to get a WireTapServerId object. On failure, WireTapServerList::lastError() can be called to get the error string.
bool WireTapServerList::getNumNodes ( int &  numberOfNodes)

Gets the number of Wiretap servers available to the Wiretap client.

This method determines the number of servers available on the network that was specified when the WireTapServerList was created. If the server list was not filtered in any way, the default network is the one accessible through the Wiretap client's local host. Wiretap clients can iterate through the available servers and use the getNode method to access each server.

Parameters
numberOfNodesAn output parameter. The number of Wiretap servers that are available on the network.
Returns
true if it was possible to get the number of servers available; false if it was not possible to get the number. On failure, WireTapServerList::lastError() can be called to get the actual error string.
const char* WireTapServerList::lastError ( ) const

Gets the error string for the last operation that failed.

Wiretap clients can obtain this error message for any member function that returns a boolean. The strings can be localized if required. See the Wiretap Developer's Guide.

Returns
The error string for the last operation (called on the current server list) that failed.
WireTapServerList& WireTapServerList::operator= ( const WireTapServerList )
bool WireTapServerList::refresh ( )

Actively trigger a refresh of available servers on the network.

Servers activity on the network is monitored to avoid the need to call this method. However, some network or OS condition might prevent network multicast message to be sent or received causing the list to be incorrect.

Calling this method will brodcast a request to find new server on the network.

Returns
true if operation was successful. On failure, WireTapServerList::lastError() can be called to get the error string.
bool WireTapServerList::resolve ( const WireTapServerId serverId,
WireTapServerInfo serverInfo 
)

Resolves server ID to its corresponding server information.

This method retrieves a WireTapServerInfo object based on a WireTapServerId object containing partial information that defines a persistent identifier for the Wiretap server (an instance of a particular Wiretap server running on a particular host machine). Wiretap clients can use this WireTapServerId object to instantiate a WireTapServerHandle which gives access to the data on the storage device.

See Also
WireTapServerID, WireTapServerInfo, WireTapServerHandle.
Parameters
serverIdAn input parameter. The WireTapServerId object for the Wiretap server ID to resolve.
serverInfoAn output parameter. The WireTapServerInfo object for the targeted Wiretap server ID.
Returns
true if server ID was resolved successfully; false if the provided information was unsufficient or if the Wiretap server described by the server id is no longer active and broadcasting its presence. On failure, WireTapServerList::lastError() can be called to get the error string.
WIRETAP_DEPRECATED bool WireTapServerList::resolveStorageId ( const char *  storageId,
WireTapServerId serverId 
)

Resolves the storage ID of a storage device to determine which Wiretap server it is currently connected to.

This method obtains a WireTapServerId object containing the information that defines a persistent identifier for the Wiretap server (an instance of a particular Wiretap server running on a particular host machine). Wiretap clients can use this WireTapServerId object to instantiate a WireTapServerHandle which gives access to the data on the storage device.

See Also
WireTapServerID, WireTapServerInfo, WireTapServerHandle.
Parameters
storageIdAn input parameter. The storage ID of a storage device.
serverIdAn output parameter. The WireTapServerId object for the Wiretap server to which the storage device is connected.
Returns
true if storageId was resolved successfully; false if the the storage device is not connected to an active Wiretap server. On failure, WireTapServerList::lastError() can be called to get the error string.
Deprecated:
Since Wiretap 2013.1. The preferred function is resolve( const WireTapServerId & serverId )

The documentation for this class was generated from the following file: