VMware Tanzu GemFire Native C++ Reference 10.3.0
apache::geode::client::ExpirationAttributes Class Reference

Immutable parameter object for accessing and setting the attributes associated with timeToLive and idleTimeout. More...

#include <ExpirationAttributes.hpp>

Public Member Functions

 ExpirationAttributes ()
 public methods More...
 
 ExpirationAttributes (const std::chrono::seconds &expirationTime, const ExpirationAction expirationAction=ExpirationAction::INVALIDATE)
 Constructs an ExpirationAttributes with the specified expiration time and expiration action. More...
 
ExpirationAction getAction () const
 Returns the action that should take place when this value or region expires. More...
 
const std::chrono::seconds & getTimeout () const
 Returns the duration before a region or value expires. More...
 

Detailed Description

Immutable parameter object for accessing and setting the attributes associated with timeToLive and idleTimeout.

If the expiration action is not specified, it defaults to ExpirationAction.INVALIDATE. If the timeout is not specified, it defaults to zero (which means to never time out).

See also
RegionAttributesFactory
RegionAttributes
AttributesMutator

Constructor & Destructor Documentation

◆ ExpirationAttributes() [1/2]

apache::geode::client::ExpirationAttributes::ExpirationAttributes ( )

public methods

constructors Constructs a default ExpirationAttributes, which indicates no expiration will take place.

◆ ExpirationAttributes() [2/2]

apache::geode::client::ExpirationAttributes::ExpirationAttributes ( const std::chrono::seconds &  expirationTime,
const ExpirationAction  expirationAction = ExpirationAction::INVALIDATE 
)
explicit

Constructs an ExpirationAttributes with the specified expiration time and expiration action.

Parameters
expirationTimeDuration live before it expires
expirationActionthe action to take when the value expires
Exceptions
IllegalArgumentExceptionif expirationTime is nonpositive

Member Function Documentation

◆ getAction()

ExpirationAction apache::geode::client::ExpirationAttributes::getAction ( ) const

Returns the action that should take place when this value or region expires.

Returns
the action to take when expiring

◆ getTimeout()

const std::chrono::seconds & apache::geode::client::ExpirationAttributes::getTimeout ( ) const

Returns the duration before a region or value expires.

Returns
the duration before a region or value expires or zero if it will never expire

Apache Geode C++ Cache API Documentation