Wiretap API  <small>Wiretap 2021</small>
WireTapServerId Class Reference

This class contains the information required to establish a unique identifier for a given instance of a Wiretap server on a host. It is possible for more than one server to be running on any given machine. More...

Public Member Functions

const char * getDB () const
 Gets the name of the database that the Wiretap server exposes. More...
 
const char * getId () const
 Gets the string representation of the ID of the Wiretap server. More...
 
const char * getIPAddr () const
 Gets the IP address on which the Wiretap server is running. More...
 
int getPort () const
 Gets the TCP port number used for the type of database that the Wiretap server exposes. More...
 
const char * getStorageId () const
 Gets the persistent storage id of the Wiretap server. More...
 
bool isValid () const
 Test validity of the server ID. More...
 
WireTapServerIdoperator= (const WireTapServerId &src)
 Assignment operator. Returns a reference to the source object. More...
 
bool operator== (const WireTapServerId &other) const
 
void setDB (const char *db)
 Set the database of a server ID. More...
 
void setId (const char *serverId)
 Initializes the WireTapServerId object from a string that contains the ID of the server. More...
 
void setIPAddr (const char *ip)
 Set the IP address of a server ID. More...
 
void setPort (int port)
 Set the TCP port number of a server ID. More...
 
void setStorageId (const char *storageId)
 Initializes the WireTapServerId object from a string that contains the persistent storage ID of the server. More...
 
 WireTapServerId (const char *database, const char *ip, int port=0)
 Constructs a WireServerId from a database type, an IP address or host name and, optionally, a port number. More...
 
 WireTapServerId (int port, const char *ip)
 
 WireTapServerId (const char *serverId)
 Constructs a WireTapServerId object from a string that contains the ID of the server. More...
 
 WireTapServerId ()
 Default constructor. More...
 
 WireTapServerId (const WireTapServerId &serverId)
 Copy constructor. More...
 
virtual ~WireTapServerId ()
 Destructor. More...
 

Detailed Description

This class contains the information required to establish a unique identifier for a given instance of a Wiretap server on a host. It is possible for more than one server to be running on any given machine.

In this context, "Wiretap server" means an instance of a particular Wiretap server running on a particular host. For example: an instance of the IFFFS Wiretap Server running on a host machine named "belgium".

A Wiretap server runs on a particular host machine and exposes a specific database on a designated TCP port. A WireTapServerId can be created in any of these ways:

  • unique and persistent storage identifier
  • host IP address and database identifier
  • host IP address and port number
  • host name and database identifier
  • host name and port number

A WireTapServerId is essential for Wiretap clients dealing with multiple Wiretap servers running on a single host or multiple hosts. To instantiate a WireTapServerHandle, Wiretap clients should use the constructor that takes a WireTapServerId as an input parameter.

See also
WireTapServerHandle, WireTapServerInfo.

Constructor & Destructor Documentation

◆ WireTapServerId() [1/5]

WireTapServerId::WireTapServerId ( const char *  database,
const char *  ip,
int  port = 0 
)

Constructs a WireServerId from a database type, an IP address or host name and, optionally, a port number.

Wiretap clients usually obtain a valid WireTapServerId object from the WireTapServerInfo obtained when querying the list of all servers via the WireTapServerList class.

Parameters
databaseAn input parameter. A string that describes the type of database that the Wiretap server exposes for example: IFFFS, Backburner).
ipAn input parameter. A string that contains the IP address or name of the host machine on which the Wiretap server is running.
portAn input parameter. The TCP port used for the server. Defaults to 0 if no value is set.

◆ WireTapServerId() [2/5]

WireTapServerId::WireTapServerId ( int  port,
const char *  ip 
)

◆ WireTapServerId() [3/5]

WireTapServerId::WireTapServerId ( const char *  serverId)

Constructs a WireTapServerId object from a string that contains the ID of the server.

The ID of a Wiretap server consists of two parts: the host (name or IP address) and the type of storage (database type or TCP port)

Parameters
serverIdAn input parameter. The ID of the server. A string in this format: <host name or IP address>:[<database or port>]
Note
<database or port> is optional. If not specified, a WireTapServerID will be instantiated for the first available Wiretap server on the host. Wiretap servers are ordered alphabetically using their database IDs.

For example, if a server named cardigan is running multiple Wiretap servers, the serverId parameter could be specified in these ways:

  • cardigan:7549
  • cardigan:IFFFS
  • cardigan

◆ WireTapServerId() [4/5]

WireTapServerId::WireTapServerId ( )

Default constructor.

Constructs a new empty invalid WireTapServerId object.

◆ WireTapServerId() [5/5]

WireTapServerId::WireTapServerId ( const WireTapServerId serverId)

Copy constructor.

Constructs a new WireTapServerId object that duplicates the content of the original.

Parameters
serverIdAn input parameter. The WireTapServerId object that is to be copied.

◆ ~WireTapServerId()

virtual WireTapServerId::~WireTapServerId ( )
virtual

Destructor.

Member Function Documentation

◆ getDB()

const char* WireTapServerId::getDB ( ) const

Gets the name of the database that the Wiretap server exposes.

Returns
A string that identifies the type of database that the Wiretap server exposes. For example: IFFFS, Backburner, and so on.
See also
WireTapServerInfo.getDatabase()

◆ getId()

const char* WireTapServerId::getId ( ) const

Gets the string representation of the ID of the Wiretap server.

Returns
The server ID of the Wiretap server. A string in this format: <host name or IP address>:<database or port>. For example: 111.11.111.11:IFFFS or cardigan:IFFFS.

◆ getIPAddr()

const char* WireTapServerId::getIPAddr ( ) const

Gets the IP address on which the Wiretap server is running.

Returns
A string that is the IP address of the host. An empty string is returned if no value has been set.

◆ getPort()

int WireTapServerId::getPort ( ) const

Gets the TCP port number used for the type of database that the Wiretap server exposes.

Returns
The port number.

◆ getStorageId()

const char* WireTapServerId::getStorageId ( ) const

Gets the persistent storage id of the Wiretap server.

Returns
A string that uniquely and persistently identifies, among all databases on the network, the database (or storage) instance that the Wiretap server exposes.
See also
WireTapServerInfo.getStorageId()

◆ isValid()

bool WireTapServerId::isValid ( ) const

Test validity of the server ID.

Returns
False for default construction. Note that a positive return value does not indicate that the WireTapServerId corresponds to a real accessible server; it only indicates that the id is properly formed and could correspond to a real server.

◆ operator=()

WireTapServerId& WireTapServerId::operator= ( const WireTapServerId src)

Assignment operator. Returns a reference to the source object.

Parameters
srcAn input parameter. The WireTapServerId object to which the reference should point.

◆ operator==()

bool WireTapServerId::operator== ( const WireTapServerId other) const
Returns
true if both server Id objects are identical

◆ setDB()

void WireTapServerId::setDB ( const char *  db)

Set the database of a server ID.

Parameters
dbAn input parameter. The database of the server.
See also
WireTapServerInfo.getDatabase()

◆ setId()

void WireTapServerId::setId ( const char *  serverId)

Initializes the WireTapServerId object from a string that contains the ID of the server.

Parameters
serverIdAn input parameter. The ID of the server. A string in this format: <host name or IP address>:[<database or port>]

◆ setIPAddr()

void WireTapServerId::setIPAddr ( const char *  ip)

Set the IP address of a server ID.

Parameters
ipAn input parameter. The IP address of the server.

◆ setPort()

void WireTapServerId::setPort ( int  port)

Set the TCP port number of a server ID.

Parameters
portAn input parameter. The TCP port number of the server.
See also
WireTapServerInfo.getNodePort()

◆ setStorageId()

void WireTapServerId::setStorageId ( const char *  storageId)

Initializes the WireTapServerId object from a string that contains the persistent storage ID of the server.

Parameters
storageIdAn input parameter. The storage ID of the server.

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