# 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

using SessionPtr = Poco::SharedPtr < Session >;

### StatementPtr

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 ~ArchiveStrategy();

Destroys archive strategy.

## Member Functions

### archive

virtual void archive() = 0;

Archives the rows.

### getDestination

const std::string & getDestination() const;

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

### getSource

const std::string & getSource() const;

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

### getThreshold

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

Returns the archive threshold.

### open

void open();

Opens the session.

### setDestination

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

Sets the name of the destination table.

### setSource

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

Sets the name of the source table.

### setThreshold

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

Sets the archive threshold.

### getCopyStatement

Statement & getCopyStatement();

### getCountStatement

Statement & getCountStatement();

### getDeleteStatement

Statement & getDeleteStatement();

### session

Session & session();

### setCopyStatement

void setCopyStatement();

### setCountStatement

void setCountStatement();

### setDeleteStatement

void setDeleteStatement();

## Variables

### DEFAULT_ARCHIVE_DESTINATION

static const std::string DEFAULT_ARCHIVE_DESTINATION;