Streaming C++ API
sb::StreamBaseAdminClient Class Reference

The StreamBase Admin Client API. More...

#include <StreamBaseAdminClient.hpp>

Public Member Functions

 StreamBaseAdminClient (const StreamBaseURI &uri)
 Creates a StreamBase client and establishes a connection to a remote server. More...
 
 StreamBaseAdminClient (const std::vector< StreamBaseURI > &uris=StreamBaseURI::vectorFromEnvironment())
 Creates a StreamBase client and establishes a connection to a remote server. More...
 
 StreamBaseAdminClient (const std::vector< StreamBaseURI > &uris, sb::ClientSettings &settings)
 Creates a StreamBase client and establishes a connection to a remote server. More...
 
virtual ~StreamBaseAdminClient ()
 Destroys a session. More...
 
std::string shutdown ()
 Shuts down the application/sbd. More...
 
std::string shutdown (const std::string &name)
 Shuts down a container or a Java Operator. More...
 
void shutdownOperators (std::vector< std::string > &operatorNames)
 Shuts down Java operators in an application. More...
 
void suspendOperators (std::vector< std::string > &operatorNames)
 Suspends Java operators in an application. More...
 
void restartOperators (std::vector< std::string > &operatorNames)
 Restarts one or more Operators in an application. More...
 
void suspend (const std::string &name)
 Suspends a container or a Java Operator. More...
 
void restartContainer (const std::string &name)
 Restarts a container. More...
 
void resume (const std::string &name)
 Resumes a container or a Java Operator. More...
 
void resumeOperators (std::vector< std::string > &operatorNames)
 Resumes Java operators in an application. More...
 
void getOperatorProperties (const std::string &operatorName, std::vector< std::string > &result)
 For the given Operator, return its set of properties and their values. More...
 
std::string getOperatorProperty (const std::string &operatorName, const std::string &propertyName)
 Return the value of the given property on the given Operator. More...
 
void setOperatorProperty (const std::string &operatorName, const std::string &propertyName, const std::string &value)
 On the given Operator, set the given property to the given value. More...
 
void modifyApplication (const std::string &application)
 Adds an application to the default container. More...
 
std::vector< std::string > addContainer (const std::string &containerName, const std::string &applicationText, const std::vector< std::string > &options)
 Add an application to the given container. More...
 
std::vector< std::string > addDeploy (const std::string &applicationText, const std::vector< std::string > &options=std::vector< std::string >())
 Add a deploy file to the server. More...
 
std::vector< std::string > removeContainer (const std::string &containerName, const std::vector< std::string > &options=std::vector< std::string >())
 Remove a container. More...
 
std::vector< std::string > modifyContainer (const std::string &containerName, const std::vector< std::string > &options)
 Modify the given container. More...
 
void listConnections (std::vector< std::string > &result, const std::vector< std::string > &option=std::vector< std::string >())
 Lists all Connections to the StreamBaseServer. More...
 
void killConnection (const std::string &connectionId, std::vector< std::string > &status)
 Kill the connection with the given connectionId. More...
 
void killAllConnections (std::vector< std::string > &status)
 Kill all connected clients. More...
 
std::vector< std::string > manageJdbcConnections (const std::vector< std::string > &options)
 Manage JDBC connections. More...
 
LeadershipStatus getLeadershipStatus ()
 Get the leadership status of the server. More...
 
void setLeadershipStatus (LeadershipStatus leadershipStatus)
 Set the leadership status of the server. More...
 
void drain (const std::string &containerName)
 Drains the application: waits until there are no more tuples at all in the application and then shuts the application. More...
 
sb::ClientSettingsgetSettings ()
 Get the settings for the client. More...
 

Detailed Description

The StreamBase Admin Client API.

Connects to a StreamBase node over the network, via XML/RPC

Constructor & Destructor Documentation

◆ StreamBaseAdminClient() [1/3]

sb::StreamBaseAdminClient::StreamBaseAdminClient ( const StreamBaseURI uri)

Creates a StreamBase client and establishes a connection to a remote server.

◆ StreamBaseAdminClient() [2/3]

sb::StreamBaseAdminClient::StreamBaseAdminClient ( const std::vector< StreamBaseURI > &  uris = StreamBaseURI::vectorFromEnvironment())

Creates a StreamBase client and establishes a connection to a remote server.

Note: The StreamBaseAdminClient only supports 1 URI in the list.

◆ StreamBaseAdminClient() [3/3]

sb::StreamBaseAdminClient::StreamBaseAdminClient ( const std::vector< StreamBaseURI > &  uris,
sb::ClientSettings settings 
)

Creates a StreamBase client and establishes a connection to a remote server.

Note: The StreamBaseAdminClient only supports 1 URI in the list.

◆ ~StreamBaseAdminClient()

virtual sb::StreamBaseAdminClient::~StreamBaseAdminClient ( )
virtual

Destroys a session.

Member Function Documentation

◆ addContainer()

std::vector< std::string > sb::StreamBaseAdminClient::addContainer ( const std::string &  containerName,
const std::string &  applicationText,
const std::vector< std::string > &  options 
)

Add an application to the given container.

Parameters
containerNamethe name of the container to add this to
applicationTextbinary content from a .sbar file, xml from an EventFlow application, or StreamSQL text. The character set is assumed UTF-8.
optionsa list of options for the added container. Run "sbadmin addContainer --help" for a complete list.
Returns
results if any

◆ addDeploy()

std::vector< std::string > sb::StreamBaseAdminClient::addDeploy ( const std::string &  applicationText,
const std::vector< std::string > &  options = std::vector< std::string >() 
)

Add a deploy file to the server.

Parameters
deployTextbinary content from a .sbar file, or xml from an .sbdeploy file. The character set is assumed UTF-8.
optionsa list of options. Currently only supports –verbose as an argument
Returns
results if any

◆ drain()

void sb::StreamBaseAdminClient::drain ( const std::string &  containerName)

Drains the application: waits until there are no more tuples at all in the application and then shuts the application.

Blocks until this is complete.
has no effect if the server is not running

◆ getLeadershipStatus()

LeadershipStatus sb::StreamBaseAdminClient::getLeadershipStatus ( )

Get the leadership status of the server.

Exceptions
StreamBaseException

◆ getOperatorProperties()

void sb::StreamBaseAdminClient::getOperatorProperties ( const std::string &  operatorName,
std::vector< std::string > &  result 
)

For the given Operator, return its set of properties and their values.

◆ getOperatorProperty()

std::string sb::StreamBaseAdminClient::getOperatorProperty ( const std::string &  operatorName,
const std::string &  propertyName 
)

Return the value of the given property on the given Operator.

◆ getSettings()

sb::ClientSettings & sb::StreamBaseAdminClient::getSettings ( )
inline

Get the settings for the client.

◆ killAllConnections()

void sb::StreamBaseAdminClient::killAllConnections ( std::vector< std::string > &  status)

Kill all connected clients.

◆ killConnection()

void sb::StreamBaseAdminClient::killConnection ( const std::string &  connectionId,
std::vector< std::string > &  status 
)

Kill the connection with the given connectionId.

◆ listConnections()

void sb::StreamBaseAdminClient::listConnections ( std::vector< std::string > &  result,
const std::vector< std::string > &  option = std::vector< std::string >() 
)

Lists all Connections to the StreamBaseServer.

Parameters
resultthe result
option

◆ manageJdbcConnections()

std::vector< std::string > sb::StreamBaseAdminClient::manageJdbcConnections ( const std::vector< std::string > &  options)

Manage JDBC connections.

◆ modifyApplication()

void sb::StreamBaseAdminClient::modifyApplication ( const std::string &  application)

Adds an application to the default container.

Parameters
applicationa string containing the text of an application EventFlow, StreamSQL or binary of a sbar file
Deprecated:

◆ modifyContainer()

std::vector< std::string > sb::StreamBaseAdminClient::modifyContainer ( const std::string &  containerName,
const std::vector< std::string > &  options 
)

Modify the given container.

Parameters
containerNamecontainerName the container name to modify
optionsa list of options to modify a container. Run "sbadmin modifyContainer --help" for a complete list.
Returns
results if any

◆ removeContainer()

std::vector< std::string > sb::StreamBaseAdminClient::removeContainer ( const std::string &  containerName,
const std::vector< std::string > &  options = std::vector< std::string >() 
)

Remove a container.

Parameters
containerNamethe name of the container to add this to
optionsa list of options. Currently only supports –verbose as an argument
Returns
results if any

◆ restartContainer()

void sb::StreamBaseAdminClient::restartContainer ( const std::string &  name)

Restarts a container.

◆ restartOperators()

void sb::StreamBaseAdminClient::restartOperators ( std::vector< std::string > &  operatorNames)

Restarts one or more Operators in an application.

◆ resume()

void sb::StreamBaseAdminClient::resume ( const std::string &  name)

Resumes a container or a Java Operator.

◆ resumeOperators()

void sb::StreamBaseAdminClient::resumeOperators ( std::vector< std::string > &  operatorNames)

Resumes Java operators in an application.

◆ setLeadershipStatus()

void sb::StreamBaseAdminClient::setLeadershipStatus ( LeadershipStatus  leadershipStatus)

Set the leadership status of the server.

Parameters
leadershipStatus
Exceptions
StreamBaseException

◆ setOperatorProperty()

void sb::StreamBaseAdminClient::setOperatorProperty ( const std::string &  operatorName,
const std::string &  propertyName,
const std::string &  value 
)

On the given Operator, set the given property to the given value.

◆ shutdown() [1/2]

std::string sb::StreamBaseAdminClient::shutdown ( )

Shuts down the application/sbd.

◆ shutdown() [2/2]

std::string sb::StreamBaseAdminClient::shutdown ( const std::string &  name)

Shuts down a container or a Java Operator.

◆ shutdownOperators()

void sb::StreamBaseAdminClient::shutdownOperators ( std::vector< std::string > &  operatorNames)

Shuts down Java operators in an application.

◆ suspend()

void sb::StreamBaseAdminClient::suspend ( const std::string &  name)

Suspends a container or a Java Operator.

◆ suspendOperators()

void sb::StreamBaseAdminClient::suspendOperators ( std::vector< std::string > &  operatorNames)

Suspends Java operators in an application.


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