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... | |
WireTapServerId & | operator= (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... | |
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:
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.
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.
database | An input parameter. A string that describes the type of database that the Wiretap server exposes for example: IFFFS, Backburner). |
ip | An input parameter. A string that contains the IP address or name of the host machine on which the Wiretap server is running. |
port | An input parameter. The TCP port used for the server. Defaults to 0 if no value is set. |
WireTapServerId::WireTapServerId | ( | int | port, |
const char * | ip | ||
) |
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)
serverId | An input parameter. The ID of the server. A string in this format: <host name or IP address>:[<database or port>] |
For example, if a server named cardigan is running multiple Wiretap servers, the serverId parameter could be specified in these ways:
WireTapServerId::WireTapServerId | ( | ) |
Default constructor.
Constructs a new empty invalid WireTapServerId object.
WireTapServerId::WireTapServerId | ( | const WireTapServerId & | serverId) |
Copy constructor.
Constructs a new WireTapServerId object that duplicates the content of the original.
serverId | An input parameter. The WireTapServerId object that is to be copied. |
|
virtual |
Destructor.
const char* WireTapServerId::getDB | ( | ) | const |
Gets the name of the database that the Wiretap server exposes.
const char* WireTapServerId::getId | ( | ) | const |
Gets the string representation of the ID of the Wiretap server.
const char* WireTapServerId::getIPAddr | ( | ) | const |
Gets the IP address on which the Wiretap server is running.
int WireTapServerId::getPort | ( | ) | const |
Gets the TCP port number used for the type of database that the Wiretap server exposes.
const char* WireTapServerId::getStorageId | ( | ) | const |
Gets the persistent storage id of the Wiretap server.
bool WireTapServerId::isValid | ( | ) | const |
Test validity of the server ID.
WireTapServerId& WireTapServerId::operator= | ( | const WireTapServerId & | src) |
Assignment operator. Returns a reference to the source object.
src | An input parameter. The WireTapServerId object to which the reference should point. |
bool WireTapServerId::operator== | ( | const WireTapServerId & | other) | const |
void WireTapServerId::setDB | ( | const char * | db) |
Set the database of a server ID.
db | An input parameter. The database of the server. |
void WireTapServerId::setId | ( | const char * | serverId) |
Initializes the WireTapServerId object from a string that contains the ID of the server.
serverId | An input parameter. The ID of the server. A string in this format: <host name or IP address>:[<database or port>] |
void WireTapServerId::setIPAddr | ( | const char * | ip) |
Set the IP address of a server ID.
ip | An input parameter. The IP address of the server. |
void WireTapServerId::setPort | ( | int | port) |
Set the TCP port number of a server ID.
port | An input parameter. The TCP port number of the server. |
void WireTapServerId::setStorageId | ( | const char * | storageId) |
Initializes the WireTapServerId object from a string that contains the persistent storage ID of the server.
storageId | An input parameter. The storage ID of the server. |