OCILIB (C and C++ Driver for Oracle)  4.7.5
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
Loading...
Searching...
No Matches
ocilib::Event Class Reference

Subscription Event. More...

#include <types.hpp>

Inherits ocilib::core::HandleHolder< OCI_Event * >.

Public Types

enum  EventTypeValues {
  DatabaseStart = OCI_ENT_STARTUP , DatabaseShutdown = OCI_ENT_SHUTDOWN , DatabaseShutdownAny = OCI_ENT_SHUTDOWN_ANY , DatabaseDrop = OCI_ENT_DROP_DATABASE ,
  Unregister = OCI_ENT_DEREGISTER , ObjectChanged = OCI_ENT_OBJECT_CHANGED
}
 Event type enumerated values. More...
 
enum  ObjectEventValues {
  ObjectInserted = OCI_ONT_INSERT , ObjectUpdated = OCI_ONT_UPDATE , ObjectDeleted = OCI_ONT_DELETE , ObjectAltered = OCI_ONT_ALTER ,
  ObjectDropped = OCI_ONT_DROP , ObjectGeneric = OCI_ONT_GENERIC
}
 Object events enumerated values. More...
 
typedef core::Enum< EventTypeValuesEventType
 Event type.
 
typedef core::Enum< ObjectEventValuesObjectEvent
 Object events.
 

Public Member Functions

EventType GetType () const
 Return the type of event reported by a notification.
 
ObjectEvent GetObjectEvent () const
 Return the type of operation reported by a notification.
 
ostring GetDatabaseName () const
 Return the name of the database that generated the event.
 
ostring GetObjectName () const
 Return the name of the object that generated the event.
 
ostring GetRowID () const
 Return the rowid of the altered database object row.
 
Subscription GetSubscription () const
 Return the subscription that generated this event.
 

Detailed Description

Subscription Event.

This class wraps the OCILIB object handle OCI_Event and its related methods

Warning
Environment::Events flag must be passed to Environment::Initialize() to be able to use subscriptions

Definition at line 7201 of file types.hpp.

Member Typedef Documentation

◆ EventType

Event type.

Possible values are Event::EventTypeValues

Definition at line 7236 of file types.hpp.

◆ ObjectEvent

Object events.

Possible values are Event::ObjectEventValues

Definition at line 7266 of file types.hpp.

Member Enumeration Documentation

◆ EventTypeValues

Event type enumerated values.

Enumerator
DatabaseStart 

A database has been started up

DatabaseShutdown 

A database has been shut down

DatabaseShutdownAny 

A database has been shut down (RAC)

DatabaseDrop 

A database has been dropped

Unregister 

The notification is timed out

ObjectChanged 

A database object has been modified

Definition at line 7213 of file types.hpp.

◆ ObjectEventValues

Object events enumerated values.

Enumerator
ObjectInserted 

An insert has been performed

ObjectUpdated 

An update has been performed

ObjectDeleted 

A delete has been performed

ObjectAltered 

An alter has been performed

ObjectDropped 

A drop has been performed

ObjectGeneric 

Generic undefined action *

Definition at line 7243 of file types.hpp.

Member Function Documentation

◆ GetType()

Event::EventType ocilib::Event::GetType ( ) const
inline

Return the type of event reported by a notification.

Definition at line 33 of file Event.hpp.

References ocilib::core::Check(), and OCI_EventGetType().

◆ GetObjectEvent()

Event::ObjectEvent ocilib::Event::GetObjectEvent ( ) const
inline

Return the type of operation reported by a notification.

Note
This call is only valid when GetType() reports the event type Event::ObjectChanged

Definition at line 38 of file Event.hpp.

References ocilib::core::Check(), and OCI_EventGetOperation().

◆ GetDatabaseName()

ostring ocilib::Event::GetDatabaseName ( ) const
inline

Return the name of the database that generated the event.

Definition at line 43 of file Event.hpp.

References ocilib::core::Check(), ocilib::core::MakeString(), and OCI_EventGetDatabase().

◆ GetObjectName()

ostring ocilib::Event::GetObjectName ( ) const
inline

Return the name of the object that generated the event.

Note
Database object name follows the pattern "[schema_name].object_name"

Definition at line 48 of file Event.hpp.

References ocilib::core::Check(), ocilib::core::MakeString(), and OCI_EventGetObject().

◆ GetRowID()

ostring ocilib::Event::GetRowID ( ) const
inline

Return the rowid of the altered database object row.

Definition at line 53 of file Event.hpp.

References ocilib::core::Check(), ocilib::core::MakeString(), and OCI_EventGetRowid().

◆ GetSubscription()

Subscription ocilib::Event::GetSubscription ( ) const
inline

Return the subscription that generated this event.

Definition at line 58 of file Event.hpp.

References ocilib::core::Check(), and OCI_EventGetSubscription().