Poco::Data

class ArchiveStrategy

Library: Data
Package: Logging
Header: Poco/Data/ArchiveStrategy.h

Description

The ArchiveStrategy is used by SQLChannel to archive log rows.

Inheritance

Known Derived Classes: ArchiveByAgeStrategy

Member Summary

Member Functions: archive, getCopyStatement, getCountStatement, getDeleteStatement, getDestination, getSource, getThreshold, open, session, setCopyStatement, setCountStatement, setDeleteStatement, setDestination, setSource, setThreshold

Types Aliases

SessionPtr protected

using SessionPtr = Poco::SharedPtr < Session >;

StatementPtr protected

using StatementPtr = Poco::SharedPtr < Statement >;

Constructors

ArchiveStrategy

ArchiveStrategy(
    const std::string & connector,
    const std::string & connect,
    const std::string & source,
    const std::string & destination = DEFAULT_ARCHIVE_DESTINATION
);

Creates archive strategy.

Destructor

~ArchiveStrategy virtual

virtual ~ArchiveStrategy();

Destroys archive strategy.

Member Functions

archive virtual

virtual void archive() = 0;

Archives the rows.

getDestination inline

const std::string & getDestination() const;

Returns the name of the destination table for rows to be archived.

getSource inline

const std::string & getSource() const;

Returns the name of the source table containing rows to be archived.

getThreshold virtual

virtual const std::string & getThreshold() const = 0;

Returns the archive threshold.

open

void open();

Opens the session.

setDestination inline

void setDestination(
    const std::string & destination
);

Sets the name of the destination table.

setSource inline

void setSource(
    const std::string & source
);

Sets the name of the source table.

setThreshold virtual

virtual void setThreshold(
    const std::string & threshold
) = 0;

Sets the archive threshold.

getCopyStatement protected inline

Statement & getCopyStatement();

getCountStatement protected inline

Statement & getCountStatement();

getDeleteStatement protected inline

Statement & getDeleteStatement();

session protected inline

Session & session();

setCopyStatement protected inline

void setCopyStatement();

setCountStatement protected inline

void setCountStatement();

setDeleteStatement protected inline

void setDeleteStatement();

Variables

DEFAULT_ARCHIVE_DESTINATION static

static const std::string DEFAULT_ARCHIVE_DESTINATION;