Public Member Functions | Private Member Functions | Private Attributes | List of all members
Aws::CloudWatchLogs::LogPublisher Class Reference

#include <log_publisher.h>

Inheritance diagram for Aws::CloudWatchLogs::LogPublisher:
Inheritance graph
[legend]

Public Member Functions

LogPublisherRunState getRunState ()
 
 LogPublisher (const std::string &log_group, const std::string &log_stream, const Aws::Client::ClientConfiguration &client_config)
 Creates a LogPublisher object that uses the provided client and SDK configuration Constructs a LogPublisher object that will use the provided CloudWatchClient and SDKOptions when it publishes logs. More...
 
 LogPublisher (const std::string &log_group, const std::string &log_stream, std::shared_ptr< Aws::CloudWatchLogs::Utils::CloudWatchLogsFacade > cw_client)
 Creates a LogPublisher object that uses the provided client and SDK configuration Constructs a LogPublisher object that will use the provided CloudWatchClient and SDKOptions when it publishes logs. More...
 
 LogPublisher (const LogPublisher &other)=delete
 
LogPublisheroperator= (const LogPublisher &other)=delete
 
bool shutdown () override
 
bool start () override
 
 ~LogPublisher () override
 Tears down the LogPublisher object. More...
 
- Public Member Functions inherited from Publisher< LogCollection >
virtual void addPublisherStateListener (const std::function< void(const PublisherState &)> &listener)
 
Aws::DataFlow::UploadStatus attemptPublish (LogCollection &data) override
 
bool canPublish ()
 
std::chrono::milliseconds getLastPublishDuration ()
 
int getPublishAttempts ()
 
PublisherState getPublisherState ()
 
int getPublishSuccesses ()
 
float getPublishSuccessPercentage ()
 
 Publisher ()
 
bool shutdown () override
 
 ~Publisher () override=default
 
- Public Member Functions inherited from Aws::DataFlow::IPublisher< T >
virtual UploadStatus attemptPublish (T &batch_data)=0
 
- Public Member Functions inherited from Service
ServiceState getState ()
 
virtual std::string getStatusString ()
 
 Service ()
 
virtual ~Service ()=default
 

Private Member Functions

bool checkIfConnected (Aws::CloudWatchLogs::ROSCloudWatchLogsErrors error)
 
bool configure ()
 
bool CreateGroup ()
 
bool CreateStream ()
 
bool InitToken (Aws::String &next_token)
 
Aws::DataFlow::UploadStatus publishData (std::list< Aws::CloudWatchLogs::Model::InputLogEvent > &data) override
 
void resetInitToken ()
 
Aws::CloudWatchLogs::ROSCloudWatchLogsErrors SendLogs (Aws::String &next_token, std::list< Aws::CloudWatchLogs::Model::InputLogEvent > &data)
 

Private Attributes

Aws::SDKOptions aws_sdk_options_
 
Aws::Client::ClientConfiguration client_config_
 
std::shared_ptr< Aws::CloudWatchLogs::Utils::CloudWatchLogsFacadecloudwatch_facade_
 
std::string log_group_
 
std::string log_stream_
 
std::recursive_mutex mtx_
 
Aws::String next_token
 
Aws::SDKOptions options_
 
ObservableObject< LogPublisherRunStaterun_state_
 

Additional Inherited Members

- Protected Member Functions inherited from Publisher< LogCollection >
virtual Aws::DataFlow::UploadStatus publishData (LogCollection &data)=0
 
- Protected Member Functions inherited from Service
void setState (ServiceState new_state)
 

Detailed Description

Wrapping class around the CloudWatch Logs API.

Definition at line 54 of file log_publisher.h.

Constructor & Destructor Documentation

Aws::CloudWatchLogs::LogPublisher::LogPublisher ( const std::string &  log_group,
const std::string &  log_stream,
const Aws::Client::ClientConfiguration &  client_config 
)

Creates a LogPublisher object that uses the provided client and SDK configuration Constructs a LogPublisher object that will use the provided CloudWatchClient and SDKOptions when it publishes logs.

Parameters
client_configThe ClientConfiguration that this publisher will use to create the Client.

Definition at line 41 of file log_publisher.cpp.

Aws::CloudWatchLogs::LogPublisher::LogPublisher ( const std::string &  log_group,
const std::string &  log_stream,
std::shared_ptr< Aws::CloudWatchLogs::Utils::CloudWatchLogsFacade cw_client 
)

Creates a LogPublisher object that uses the provided client and SDK configuration Constructs a LogPublisher object that will use the provided CloudWatchClient and SDKOptions when it publishes logs.

Parameters
cw_clientThe CloudWatchClient that this publisher will use when pushing logs to CloudWatch.

Definition at line 54 of file log_publisher.cpp.

Aws::CloudWatchLogs::LogPublisher::LogPublisher ( const LogPublisher other)
delete
Aws::CloudWatchLogs::LogPublisher::~LogPublisher ( )
overridedefault

Tears down the LogPublisher object.

Member Function Documentation

bool Aws::CloudWatchLogs::LogPublisher::checkIfConnected ( Aws::CloudWatchLogs::ROSCloudWatchLogsErrors  error)
private

Check if the input status is related to a network failure.

Parameters
error
Returns
true if connected to the internet, false otherwise

Definition at line 67 of file log_publisher.cpp.

bool Aws::CloudWatchLogs::LogPublisher::configure ( )
private

Definition at line 237 of file log_publisher.cpp.

bool Aws::CloudWatchLogs::LogPublisher::CreateGroup ( )
private

Checks to see if a log group already exists and tries to create it if not.

Definition at line 77 of file log_publisher.cpp.

bool Aws::CloudWatchLogs::LogPublisher::CreateStream ( )
private

Checks to see if a log stream already exists and tries to create it if not.

Definition at line 124 of file log_publisher.cpp.

LogPublisherRunState Aws::CloudWatchLogs::LogPublisher::getRunState ( )

Definition at line 233 of file log_publisher.cpp.

bool Aws::CloudWatchLogs::LogPublisher::InitToken ( Aws::String &  next_token)
private

Fetches the token to use for writing logs to a stream.

Definition at line 162 of file log_publisher.cpp.

LogPublisher& Aws::CloudWatchLogs::LogPublisher::operator= ( const LogPublisher other)
delete
Aws::DataFlow::UploadStatus Aws::CloudWatchLogs::LogPublisher::publishData ( std::list< Aws::CloudWatchLogs::Model::InputLogEvent > &  data)
overrideprivate

Definition at line 272 of file log_publisher.cpp.

void Aws::CloudWatchLogs::LogPublisher::resetInitToken ( )
private

Reset the current init token to UNINITIALIZED_TOKEN

Definition at line 229 of file log_publisher.cpp.

Aws::CloudWatchLogs::ROSCloudWatchLogsErrors Aws::CloudWatchLogs::LogPublisher::SendLogs ( Aws::String &  next_token,
std::list< Aws::CloudWatchLogs::Model::InputLogEvent > &  data 
)
private

Definition at line 184 of file log_publisher.cpp.

bool Aws::CloudWatchLogs::LogPublisher::shutdown ( )
overridevirtual

Reimplemented from Service.

Definition at line 318 of file log_publisher.cpp.

bool Aws::CloudWatchLogs::LogPublisher::start ( )
overridevirtual

Create the cloudwatch facade

Returns

Reimplemented from Service.

Definition at line 309 of file log_publisher.cpp.

Member Data Documentation

Aws::SDKOptions Aws::CloudWatchLogs::LogPublisher::aws_sdk_options_
private

Definition at line 125 of file log_publisher.h.

Aws::Client::ClientConfiguration Aws::CloudWatchLogs::LogPublisher::client_config_
private

Definition at line 129 of file log_publisher.h.

std::shared_ptr<Aws::CloudWatchLogs::Utils::CloudWatchLogsFacade> Aws::CloudWatchLogs::LogPublisher::cloudwatch_facade_
private

Definition at line 124 of file log_publisher.h.

std::string Aws::CloudWatchLogs::LogPublisher::log_group_
private

Definition at line 126 of file log_publisher.h.

std::string Aws::CloudWatchLogs::LogPublisher::log_stream_
private

Definition at line 127 of file log_publisher.h.

std::recursive_mutex Aws::CloudWatchLogs::LogPublisher::mtx_
mutableprivate

Definition at line 133 of file log_publisher.h.

Aws::String Aws::CloudWatchLogs::LogPublisher::next_token
private

Definition at line 132 of file log_publisher.h.

Aws::SDKOptions Aws::CloudWatchLogs::LogPublisher::options_
private

Definition at line 128 of file log_publisher.h.

ObservableObject<LogPublisherRunState> Aws::CloudWatchLogs::LogPublisher::run_state_
private

Definition at line 131 of file log_publisher.h.


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


cloudwatch_logs_common
Author(s): AWS RoboMaker
autogenerated on Fri May 7 2021 02:18:24